diff options
| author | yum <yum.food.vr@gmail.com> | 2025-04-11 19:17:06 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-04-11 19:17:06 -0700 |
| commit | a522e7738d75e84cc1ee1491a098421622ef1918 (patch) | |
| tree | c08951cdd65f3eccadc17d57d97ea24d7b0b750f /2ner.cginc | |
| parent | 77ae276b2b6e47d0de8bf0d9c4bbafd4212135b1 (diff) | |
add rough ability to nudge tessellation heightmap direction
Diffstat (limited to '2ner.cginc')
| -rw-r--r-- | 2ner.cginc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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;
|
