Fix shader bug

This commit is contained in:
2025-05-08 16:55:29 +09:00
parent 9d24cdc6d0
commit de5de28d8f
2 changed files with 11 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 87205e074e30ad64181478668a074bdc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -165,6 +165,7 @@ Shader "Cainos/Pixel Art Platformer - Village House/Sprite Shadow Mask - 2D Lit"
UNITY_SETUP_INSTANCE_ID( IN );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
float3 positionWS = IN.positionWS.xyz;
float3 positionCS = IN.clipPos.xyz / IN.clipPos.w;
float2 uv_MainTex = IN.texCoord0.xy * _MainTex_ST.xy + _MainTex_ST.zw;
@@ -183,7 +184,7 @@ Shader "Cainos/Pixel Art Platformer - Village House/Sprite Shadow Mask - 2D Lit"
InitializeSurfaceData(Color.rgb, Color.a, Mask, surfaceData);
InputData2D inputData;
InitializeInputData(IN.texCoord0.xy, half2(IN.screenPosition.xy / IN.screenPosition.w), inputData);
SETUP_DEBUG_DATA_2D(inputData, positionWS);
SETUP_DEBUG_DATA_2D(inputData, positionWS, positionCS);
return CombinedShapeLightShared(surfaceData, inputData);
}
@@ -434,6 +435,7 @@ Shader "Cainos/Pixel Art Platformer - Village House/Sprite Shadow Mask - 2D Lit"
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
float3 positionWS = IN.positionWS.xyz;
float3 positionCS = IN.clipPos.xyz / IN.clipPos.w;
float2 uv_MainTex = IN.texCoord0.xy * _MainTex_ST.xy + _MainTex_ST.zw;
@@ -446,7 +448,7 @@ Shader "Cainos/Pixel Art Platformer - Village House/Sprite Shadow Mask - 2D Lit"
InitializeInputData(positionWS.xy, half2(IN.texCoord0.xy), inputData);
half4 debugColor = 0;
SETUP_DEBUG_DATA_2D(inputData, positionWS);
SETUP_DEBUG_DATA_2D(inputData, positionWS, positionCS);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{