修复技能输入并更新战斗资源

This commit is contained in:
ud18010
2026-07-30 20:10:38 +08:00
parent d3c4bba5b2
commit 576aa6c14e
9077 changed files with 1322721 additions and 2648 deletions
@@ -0,0 +1,49 @@
#ifndef CUSTOMSHADOWMAP_BASE_INCLUDE
#define CUSTOMSHADOWMAP_BASE_INCLUDE
float4 tex2Dproj(sampler2D s, in float3 t) { return tex2D(s, t.xy / t.z); }
TEXTURE2D(_SGameShadowMap); SAMPLER(sampler_SGameShadowMap);
half _SGameShadowBias; half _SGameShadowStrength;
float4x4 _ShadowMatrix;
inline float4 GetCustomShadowCoords(float3 worldPos)
{
return mul(_ShadowMatrix, float4(worldPos, 1));
}
inline float GetCustomShadowAtten(float4 shadowCoords)
{
#if defined(SHADER_API_MOBILE)
float lightDepth = SAMPLE_TEXTURE2D(_SGameShadowMap, sampler_SGameShadowMap, shadowCoords.xy / shadowCoords.w).r;
#else
float lightDepth = 1 - SAMPLE_TEXTURE2D(_SGameShadowMap, sampler_SGameShadowMap, shadowCoords.xy / shadowCoords.w).r;
#endif
float atten = lerp(1, 0.35, step(lightDepth, (shadowCoords.z - _SGameShadowBias)));
// float atten = (shadowCoords.z - _SGameShadowBias) < lightDepth ? 1 : 0.5;
// atten = lerp(1, atten, _SGameShadowStrength);
// atten = pow(atten, 2);
atten = lerp(atten, 1, step(0.99 , shadowCoords.x));
atten = lerp(atten, 1, step(0.99 , shadowCoords.y));
return atten;
}
#if defined(_PROJECTOR_ON)
float4x4 _ProjectorVP;
TEXTURE2D(_ProjectorTex); SAMPLER(sampler_ProjectorTex);
inline float4 GetProjectorUV(float4 vertex, float4x4 o2wMat)
{
float4x4 propMVP = mul(_ProjectorVP, o2wMat);
float4 projProjPos = mul(propMVP, vertex);
projProjPos = ComputeScreenPos(projProjPos);
return projProjPos;
}
inline float3 GetProjectorColor(float3 oriCol, float4 projUV)
{
return oriCol + SAMPLE_TEXTURE2D(_ProjectorTex, sampler_ProjectorTex, projUV).rgb;
}
#endif
#endif