Created
February 5, 2019 14:42
-
-
Save ninpl/f99c5c1957a9a7b6467108a5a1b5dcb5 to your computer and use it in GitHub Desktop.
Revisions
-
ninpl created this gist
Feb 5, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ Shader "Moon Antonio/SoftLambert" { Properties { _MainTex("Albedo (RGB)", 2D) = "white" {} } SubShader { Tags { "RenderType" = "Opaque" } LOD 200 CGPROGRAM // En lugar de standart, use un modelo de iluminacion custom #pragma surface surf SimpleLambert #pragma target 3.0 sampler2D _MainTex; struct Input { float2 uv_MainTex; }; void surf(Input IN, inout SurfaceOutput o) { o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb; } half4 LightingSimpleLambert(SurfaceOutput s, half3 lightDir, half atten) { half NdotL = dot(s.Normal, lightDir); half4 c; // _LightColor0 variable que contiene el color de la luz que se calcula. c.rgb = s.Albedo * _LightColor0.rgb * (NdotL * atten * 1); c.a = s.Alpha; return c; } ENDCG } FallBack "Diffuse" }