summaryrefslogtreecommitdiffstats
path: root/2ner.cginc
diff options
context:
space:
mode:
Diffstat (limited to '2ner.cginc')
-rw-r--r--2ner.cginc10
1 files changed, 7 insertions, 3 deletions
diff --git a/2ner.cginc b/2ner.cginc
index 065015f..3b420e9 100644
--- a/2ner.cginc
+++ b/2ner.cginc
@@ -13,6 +13,7 @@
#include "interpolators.cginc"
#include "letter_grid.cginc"
#include "matcaps.cginc"
+#include "math.cginc"
#include "poi.cginc"
#include "shatter_wave.cginc"
#include "ssfd.cginc"
@@ -174,11 +175,11 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
i.tangent = UnityObjectToWorldNormal(i.tangent);
i.binormal = UnityObjectToWorldNormal(i.binormal);
-#if defined(_SHATTER_WAVE)
- shatterWaveFrag(i.normal, i.objPos);
+#if defined(_SHATTER_WAVE) || defined(_TESSELLATION_HEIGHTMAP)
+ calcNormalInScreenSpace(i.normal, i.objPos);
#endif
-#if defined(_SHATTER_WAVE) || defined(_VERTEX_DOMAIN_WARPING)
+#if defined(_SHATTER_WAVE) || defined(_VERTEX_DOMAIN_WARPING) || defined(_TESSELLATION_HEIGHTMAP)
{
[branch]
if (
@@ -189,6 +190,9 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace
#if defined(_VERTEX_DOMAIN_WARPING)
|| _Vertex_Domain_Warping_Octaves > 0.1
#endif
+#if defined(_TESSELLATION_HEIGHTMAP)
+ || _Tessellation_Heightmap_Scale > 1E-4
+#endif
) {
float4 clip_pos = UnityObjectToClipPos(i.objPos);
depth = clip_pos.z / clip_pos.w;