Je n'arrive pas à avoir d'ombres sur mes shaders persos. Je ne trouve pas l'info, je rame bien. J'ai trouvé le mot clé fullforwardshadows mais il ne suffit pas de le rajouter pour avoir des ombres. Bref, je pêche et je me dis qu'à trop vouloir simplifier, j'ai tout cassé... Faut-il que je passe en Standard? Faut-il obligatoirement un Vertex shader? Où récupère-je les ombres? Quelle est la différence entre un pigeon? Tant de questions...
Le shader en question:
Code : Tout sélectionner
Shader "_MyCustoms/Water/Bump Script Offset" {
Properties {
_Color ("Main Color", Color) = (1, 1, 1, 1)
_ReflectColor ("Reflection Color", Color) = (1, 1, 1, 1)
_MainTex ("Base Texture (RGB)", 2D) = "white" {}
_BumpMap ("Normal Map", 2D) = "bump" {}
_Cube ("Reflection Cubemap", Cube) = "" {}
}
SubShader {
Tags {"Queue" = "Geometry" "IgnoreProjector" = "True" "RenderType" = "Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert fullforwardshadows
#pragma target 3.0
sampler2D _MainTex;
sampler2D _BumpMap;
samplerCUBE _Cube;
fixed4 _Color;
fixed4 _ReflectColor;
struct Input {
half2 uv_MainTex;
half2 uv_BumpMap;
half2 uv_Cube;
half3 worldRefl;
half3 viewDir;
INTERNAL_DATA
};
void surf(Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
fixed4 c = tex * _Color;
o.Albedo = c.rgb;
float3 normal1 = UnpackNormal (tex2D (_BumpMap, 1.171 * IN.uv_BumpMap)).xyz;
float3 normal2 = UnpackNormal (tex2D (_BumpMap, IN.uv_Cube)).xyz;
o.Normal = normalize (normal1 + normal2);
fixed rim = 0.92 - (dot (IN.viewDir, o.Normal) * 0.8);
o.Emission = texCUBE (_Cube, WorldReflectionVector (IN, o.Normal)).rgb * _ReflectColor.rgb * rim;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Diffuse"
}
Merci.