From 36dbdde9a08c66c5be2e8b8b6c822968a73041b6 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 26 Mar 2025 00:40:45 -0700 Subject: Fix how outlines work with shatterwave & tessellation heightmap --- tessellation.cginc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tessellation.cginc') diff --git a/tessellation.cginc b/tessellation.cginc index 8ba2595..faadd72 100644 --- a/tessellation.cginc +++ b/tessellation.cginc @@ -62,14 +62,24 @@ v2f domain( o.uv01 = DOMAIN_INTERP(uv01); #if defined(_TESSELLATION) && defined(_SHATTER_WAVE) +#if defined(OUTLINE_PASS) + shatterWaveVert(o.objPos.xyz, -o.normal, o.tangent); +#else shatterWaveVert(o.objPos.xyz, o.normal, o.tangent); #endif +#endif #if defined(_TESSELLATION_HEIGHTMAP) float height = _Tessellation_Heightmap.SampleLevel(linear_repeat_s, o.uv01.xy * _Tessellation_Heightmap_ST.xy + _Tessellation_Heightmap_ST.zw, 0).r * - _Tessellation_Heightmap_Scale + _Tessellation_Heightmap_Offset; + _Tessellation_Heightmap_Scale + + _Tessellation_Heightmap_Offset - + _Tessellation_Heightmap_Scale * 0.5; +#if defined(OUTLINE_PASS) + o.objPos.xyz += -o.normal * height; +#else o.objPos.xyz += o.normal * height; +#endif #endif o.pos = UnityObjectToClipPos(o.objPos); -- cgit v1.2.3