Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Codeblue/GolfFabric" {
- Properties {
- _Color ("Color", Color) = (1,1,1,1)
- _NormalTex ("Noise Normal", 2D) = "bump" {}
- _NoiseScale("Noise Scale", Range(0,2)) = 0.0
- _NormalStrength("Normal Strength", Range(0,4)) = 0.0
- }
- SubShader {
- Tags { "RenderType"="Opaque" }
- LOD 200
- CGPROGRAM
- // Physically based Standard lighting model, and enable shadows on all light types
- #pragma surface surf Standard fullforwardshadows
- // Use shader model 3.0 target, to get nicer looking lighting
- #pragma target 3.0
- struct Input {
- float3 worldPos;
- };
- float _NoiseScale;
- float _NormalStrength;
- float4 _Color;
- sampler2D _NoiseTex;
- sampler2D _NormalTex;
- void surf (Input IN, inout SurfaceOutputStandard o) {
- //Convert world space to texture space, based on scale
- float2 texturePos;
- texturePos.x = IN.worldPos.x * _NoiseScale;
- texturePos.y = IN.worldPos.z * _NoiseScale;
- fixed4 noiseColor = tex2D (_NoiseTex, texturePos);
- o.Albedo = _Color.rgb;
- float3 _normal = UnpackNormal(tex2D(_NormalTex, texturePos));
- _normal.z = _normal.z * (4 - _NormalStrength);
- o.Normal = normalize(_normal);
- }
- ENDCG
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement