Added dots instancing support;

Fixed the problem that shader can compile when using emission color map;
This commit is contained in:
2025-09-01 01:15:57 +09:00
parent e35650f052
commit bcba75a7d6
6 changed files with 18 additions and 8 deletions

View File

@@ -118,7 +118,8 @@ DirectLighting UtsShadeSurface(PositionInputs posInput, UtsBSDFData bsdfData, Pr
if (Max3(lightColor.r, lightColor.g, lightColor.b) > 0.0)
{
SHADOW_TYPE sharpShadow = smoothstep(0.0, 1.0, shadow);
// SHADOW_TYPE sharpShadow = smoothstep(0.0, 1.0, shadow);
SHADOW_TYPE sharpShadow = shadow;
#if _RECEIVE_HAIR_SHADOW_ON && ENABLE_UTS_HAIR_SHAOW
sharpShadow *= GetHairShadow(posInput, L, bsdfData.normalWS);
#endif

View File

@@ -33,6 +33,9 @@ TEXTURE2D(_SSSLutMap);
TEXTURE2D(_HairBlendingMap);
SAMPLER(sampler_HairBlendingMap);
TEXTURE2D(_EmissiveColorMap);
SAMPLER(sampler_EmissiveColorMap);
// Stocking
TEXTURE2D(_StockingSparkingMap);
SAMPLER(sampler_StockingSparkingMap);

View File

@@ -68,6 +68,8 @@ float _EnergyConservingSpecularColor;
float3 _EmissiveColor;
half _AlbedoAffectEmissive;
half _EmissiveExposureWeight;
float4 _EmissiveColorMap_ST;
half _TexWorldScaleEmissive;
float _ObjectSpaceUVMappingEmissive;

View File

@@ -84,7 +84,7 @@ void Frag(PackedVaryingsToPS packedInput,
discard;
#endif
float4 objPos = mul(unity_ObjectToWorld, float4(0, 0, 0, 1));
float4 objPos = mul(UNITY_MATRIX_M, float4(0, 0, 0, 1));
float4 uv0 = input.texCoord0;
float4 outlineColor = _OutlineColor;
#if _OUTLINECOLORMAP
@@ -128,4 +128,4 @@ void Frag(PackedVaryingsToPS packedInput,
#ifdef UNITY_VIRTUAL_TEXTURING
outVTFeedback = builtinData.vtPackedFeedback;
#endif
}
}

View File

@@ -1,9 +1,9 @@
float4 objPos = mul(unity_ObjectToWorld, float4(0, 0, 0, 1));
float4 objPos = mul(UNITY_MATRIX_M, float4(0, 0, 0, 1));
float4 _Outline_Sampler_var = SAMPLE_TEXTURE2D_LOD(_OutlineWidthMap, sampler_OutlineWidthMap, TRANSFORM_TEX(inputMesh.uv0, _BaseColorMap), 0.0);
//v.2.0.4.3 baked Normal Texture for Outline
float3 normalDir = UnityObjectToWorldNormal(inputMesh.normalOS);
float3 tangentDir = normalize(mul(unity_ObjectToWorld, float4(inputMesh.tangentOS.xyz, 0.0)).xyz);
float3 tangentDir = normalize(mul(UNITY_MATRIX_M, float4(inputMesh.tangentOS.xyz, 0.0)).xyz);
float3 bitangentDir = normalize(cross(normalDir, tangentDir) * inputMesh.tangentOS.w);
float3x3 tangentTransform = float3x3(tangentDir, bitangentDir, normalDir);
//end