From 1ff9b65fa940066be763862c9d170696c9a41ad7 Mon Sep 17 00:00:00 2001 From: TCL987 Date: Thu, 9 Aug 2018 19:44:09 -0700 Subject: [PATCH 1/3] Made the Occlusion Strength property actually do something. --- .../StandardLightingModelDithered.cginc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc b/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc index 647e75d..9ced128 100644 --- a/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc +++ b/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc @@ -135,7 +135,7 @@ void surf(Input i , inout SurfaceOutputDitheredStandard o) // Ambient Occlusion float2 uv_OcclusionMap = i.uv_texcoord * _OcclusionMap_ST.xy + _OcclusionMap_ST.zw; float4 occlusion = tex2D(_OcclusionMap, uv_OcclusionMap); - o.Occlusion = occlusion; + o.Occlusion = occlusion * _OcclusionStrength; // Compute Dithering o.Dithering = (ditherNoiseFuncHigh(i.uv_texcoord.xy) - 0.5) * 2 * _NoiseScale; From 4781ea60986c47c2dfa7443cb792190f7a7b9947 Mon Sep 17 00:00:00 2001 From: TCL987 Date: Thu, 9 Aug 2018 19:46:50 -0700 Subject: [PATCH 2/3] Made the Occlusion Strength property properly scale the occlusion map. --- .../StandardLightingModelDithered.cginc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc b/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc index 9ced128..b6c34be 100644 --- a/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc +++ b/StandardLighting PBR Dithered/StandardLightingModelDithered.cginc @@ -135,7 +135,7 @@ void surf(Input i , inout SurfaceOutputDitheredStandard o) // Ambient Occlusion float2 uv_OcclusionMap = i.uv_texcoord * _OcclusionMap_ST.xy + _OcclusionMap_ST.zw; float4 occlusion = tex2D(_OcclusionMap, uv_OcclusionMap); - o.Occlusion = occlusion * _OcclusionStrength; + o.Occlusion = lerp(1.0, occlusion, _OcclusionStrength); // Compute Dithering o.Dithering = (ditherNoiseFuncHigh(i.uv_texcoord.xy) - 0.5) * 2 * _NoiseScale; From 04bd26f66c2fca6397dbe62acda0965f2efecbc0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Sat, 11 Aug 2018 15:35:23 -0400 Subject: [PATCH 3/3] Changed the default value of dithering 0.01 too stronk --- StandardLighting PBR Dithered/StandardLighting.shader | 4 ++-- StandardLighting PBR Dithered/StandardLightingFade-1.shader | 4 ++-- StandardLighting PBR Dithered/StandardLightingFade.shader | 4 ++-- .../StandardLightingTransparent-1.shader | 4 ++-- .../StandardLightingTransparent.shader | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/StandardLighting PBR Dithered/StandardLighting.shader b/StandardLighting PBR Dithered/StandardLighting.shader index a4829f0..e845b1c 100644 --- a/StandardLighting PBR Dithered/StandardLighting.shader +++ b/StandardLighting PBR Dithered/StandardLighting.shader @@ -23,7 +23,7 @@ Shader "Xiexe/StandardLightingDithered" [HDR]_EmissionColor("Emission Color", Color) = (0,0,0,1) // Dithering - _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.01 + _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.001 // Specular Lightmap Occlusion _SpecularLightmapOcclusion("Specular Lightmap Occlusion Scale", Range(0,1)) = 1 @@ -68,4 +68,4 @@ Shader "Xiexe/StandardLightingDithered" ENDCG } Fallback "Diffuse" -} \ No newline at end of file +} diff --git a/StandardLighting PBR Dithered/StandardLightingFade-1.shader b/StandardLighting PBR Dithered/StandardLightingFade-1.shader index 8fd34fb..f42cc5d 100644 --- a/StandardLighting PBR Dithered/StandardLightingFade-1.shader +++ b/StandardLighting PBR Dithered/StandardLightingFade-1.shader @@ -23,7 +23,7 @@ Shader "Xiexe/StandardLightingDitheredFade-1" [HDR]_EmissionColor("Emission Color", Color) = (0,0,0,1) // Dithering - _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.01 + _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.001 // Specular Lightmap Occlusion _SpecularLightmapOcclusion("Specular Lightmap Occlusion Scale", Range(0,1)) = 1 @@ -143,4 +143,4 @@ Shader "Xiexe/StandardLightingDitheredFade-1" } } Fallback "Diffuse" -} \ No newline at end of file +} diff --git a/StandardLighting PBR Dithered/StandardLightingFade.shader b/StandardLighting PBR Dithered/StandardLightingFade.shader index d65f71e..7d43425 100644 --- a/StandardLighting PBR Dithered/StandardLightingFade.shader +++ b/StandardLighting PBR Dithered/StandardLightingFade.shader @@ -23,7 +23,7 @@ Shader "Xiexe/StandardLightingDitheredFade" [HDR]_EmissionColor("Emission Color", Color) = (0,0,0,1) // Dithering - _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.01 + _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.001 // Specular Lightmap Occlusion _SpecularLightmapOcclusion("Specular Lightmap Occlusion Scale", Range(0,1)) = 1 @@ -143,4 +143,4 @@ Shader "Xiexe/StandardLightingDitheredFade" } } Fallback "Diffuse" -} \ No newline at end of file +} diff --git a/StandardLighting PBR Dithered/StandardLightingTransparent-1.shader b/StandardLighting PBR Dithered/StandardLightingTransparent-1.shader index 8825e93..7e6368c 100644 --- a/StandardLighting PBR Dithered/StandardLightingTransparent-1.shader +++ b/StandardLighting PBR Dithered/StandardLightingTransparent-1.shader @@ -23,7 +23,7 @@ Shader "Xiexe/StandardLightingDitheredTransparent-1" [HDR]_EmissionColor("Emission Color", Color) = (0,0,0,1) // Dithering - _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.01 + _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.001 // Specular Lightmap Occlusion _SpecularLightmapOcclusion("Specular Lightmap Occlusion Scale", Range(0,1)) = 1 @@ -143,4 +143,4 @@ Shader "Xiexe/StandardLightingDitheredTransparent-1" } } Fallback "Diffuse" -} \ No newline at end of file +} diff --git a/StandardLighting PBR Dithered/StandardLightingTransparent.shader b/StandardLighting PBR Dithered/StandardLightingTransparent.shader index 30f52ad..9619c41 100644 --- a/StandardLighting PBR Dithered/StandardLightingTransparent.shader +++ b/StandardLighting PBR Dithered/StandardLightingTransparent.shader @@ -23,7 +23,7 @@ Shader "Xiexe/StandardLightingDitheredTransparent" [HDR]_EmissionColor("Emission Color", Color) = (0,0,0,1) // Dithering - _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.01 + _NoiseScale("Dithering Scale", Range(0,0.2)) = 0.001 // Specular Lightmap Occlusion _SpecularLightmapOcclusion("Specular Lightmap Occlusion Scale", Range(0,1)) = 1 @@ -143,4 +143,4 @@ Shader "Xiexe/StandardLightingDitheredTransparent" } } Fallback "Diffuse" -} \ No newline at end of file +}