diff options
| author | yum <yum.food.vr@gmail.com> | 2024-11-04 16:28:58 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-11-04 16:32:29 -0800 |
| commit | 88e674850f6eae56ea8cac2d735efad4518f0a14 (patch) | |
| tree | 20d20a0455b02088d7add36b90500c909fc64f70 /pbr.cginc | |
| parent | 12e8a5cbd170ddf35c189dea193b2e9ca9245c81 (diff) | |
Add fog normals
Uses iquilez's directional derivative model and a simplified lighting
model. Lighting is evaluated at each sample.
Diffstat (limited to 'pbr.cginc')
| -rw-r--r-- | pbr.cginc | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -105,6 +105,18 @@ float3 BoxProjection ( return direction; } +float4 getIndirectDiffuse(v2f i, float4 vertexLightColor) { + float4 diffuse = vertexLightColor; +#if defined(FORWARD_BASE_PASS) +#if defined(LIGHTMAP_ON) + diffuse.xyz = DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv2)); +#else + diffuse.xyz += max(0, BetterSH9(float4(0, 0, 0, 1))); +#endif +#endif + return diffuse; +} + float4 getIndirectDiffuse(v2f i, float4 vertexLightColor, float3 normal) { float4 diffuse = vertexLightColor; #if defined(FORWARD_BASE_PASS) |
