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

@@ -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