From 475444f90495456f2914044d99b06f954f7547a4 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 28 Jul 2021 17:36:33 +0200 Subject: [PATCH] We can share one point sampler for both diffuse and emissive textures, so reduced it down to one --- Assets/Shaders/QuakeForwardPass.hlsl | 4 ++-- Assets/Shaders/QuakeInput.hlsl | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Assets/Shaders/QuakeForwardPass.hlsl b/Assets/Shaders/QuakeForwardPass.hlsl index 76c1465..724fdf9 100644 --- a/Assets/Shaders/QuakeForwardPass.hlsl +++ b/Assets/Shaders/QuakeForwardPass.hlsl @@ -111,7 +111,7 @@ half4 LitPassFragmentSimple(Varyings input) : SV_Target float2 uv = input.uv.xy; half4 diffuseAlpha = SampleAlbedoAlpha(uv, #if _POINT_SAMPLING - TEXTURE2D_ARGS(_BaseMap, point_repeat_sampler_BaseMap) + TEXTURE2D_ARGS(_BaseMap, point_repeat_sampler) #else TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap) #endif @@ -139,7 +139,7 @@ half4 LitPassFragmentSimple(Varyings input) : SV_Target #ifdef _EMISSION finalColor += SampleEmission(uv, _EmissionColor.rgb, #if _POINT_SAMPLING - TEXTURE2D_ARGS(_EmissionMap, point_repeat_sampler_EmissionMap) + TEXTURE2D_ARGS(_EmissionMap, point_repeat_sampler) #else TEXTURE2D_ARGS(_EmissionMap, sampler_EmissionMap) #endif diff --git a/Assets/Shaders/QuakeInput.hlsl b/Assets/Shaders/QuakeInput.hlsl index bec3fce..f3658ba 100644 --- a/Assets/Shaders/QuakeInput.hlsl +++ b/Assets/Shaders/QuakeInput.hlsl @@ -27,8 +27,7 @@ CBUFFER_END #define _Surface UNITY_ACCESS_DOTS_INSTANCED_PROP_FROM_MACRO(float , Metadata__Surface) #endif - SAMPLER(point_repeat_sampler_BaseMap); - SAMPLER(point_repeat_sampler_EmissionMap); + SAMPLER(point_repeat_sampler); TEXTURE2D(_LightMap); SAMPLER(sampler_LightMap); inline void InitializeSimpleLitSurfaceData(float2 uv, out SurfaceData outSurfaceData)