Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

gersener waves

Shader "Custom/Waves" {
	Properties {
		_Color ("Color", Color) = (1,1,1,1)
		_MainTex ("Albedo (RGB)", 2D) = "white" {}
		_Glossiness ("Smoothness", Range(0,1)) = 0.5
		_Metallic ("Metallic", Range(0,1)) = 0.0
        _Amplitude ("Amplitude", Float) = 1
	}
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200

		CGPROGRAM
		#pragma surface surf Standard fullforwardshadows
		#pragma target 3.0

		sampler2D _MainTex;

		struct Input {
			float2 uv_MainTex;
		};
        
        half _Glossiness;
		half _Metallic;
		fixed4 _Color;
		float _Amplitude;

		void vert(inout appdata_full vertexData) {
			float3 p = vertexData.vertex.xyz;

			p.y = _Amplitude * sin(p.x);

			vertexData.vertex.xyz = p;
		}

		void vert(inout appdata_full vertexData) {}

		void surf (Input IN, inout SurfaceOutputStandard o) {
			fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
			o.Albedo = c.rgb;
			o.Metallic = _Metallic;
			o.Smoothness = _Glossiness;
			o.Alpha = c.a;
		}
		ENDCG
	}
	FallBack "Diffuse"
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: permutation and combination program in c# 
Csharp :: unity rotatetowards 
Csharp :: List picking records from database 
Csharp :: Razor while loop 
Csharp :: c# class where T : enum C# 7.03 
Csharp :: Implementing Banner Ads Unity 
Csharp :: bubble sort recursive c# 
Csharp :: ms transform 
Csharp :: c# sha512 salt 
Csharp :: how to convert command line argument to int in C# 
Csharp :: number to string ef example c# 
Csharp :: bootstrap daterangepicker change language to french 
Csharp :: soundplayer c# take uri 
Csharp :: c# crud observablecollection -mvvm 
Csharp :: input string was not in a correct format convert to double 
Csharp :: how to center a window in monogame 
Csharp :: How to read key from web config in JavaScript 
Csharp :: change color unity back and forth 
Csharp :: c# fastest way to find item in list 
Csharp :: qcombobox delegate text filter 
Csharp :: ASP.NET Core set update clear cache from IMemoryCache (set by Set method of CacheExtensions class) 
Csharp :: downloading a large file asp boilerplate (abp) 
Csharp :: create star rating using loop in c# 
Csharp :: how to trigger event when a com device is connected in c# 
Csharp :: ? in c# 
Csharp :: unity recttransform set anchor 
Csharp :: how to call method in different project in c# visual studio 
Csharp :: unity screentoworldpoint 
Csharp :: randon C# 
Csharp :: c# winforms input 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =