summaryrefslogtreecommitdiffstats
path: root/globals.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-02-16 16:32:00 -0800
committeryum <yum.food.vr@gmail.com>2026-02-16 16:36:24 -0800
commit864c2ba12dc864d9cb55cb797ba8919bee5b5913 (patch)
treeaa6cd98a71e4ef05d23f762127d3759a4a3e3e21 /globals.cginc
parent6504b2c4631bab477838548167b88c1052eac263 (diff)
Add instancing distance culling, scale deformation
* GPU instance distance culling now takes a min/max range * Fold recovers ops from material, allowing state to persist across editor restarts * Add scale node to vertex deformation framework * Remove fold presets - dumb LLM idea, unused * Drop more "undeform" code; unused, was for ray marching, which does not work well * Fix reflection energy compensation; was using cloth math, which makes things too bright
Diffstat (limited to 'globals.cginc')
-rwxr-xr-xglobals.cginc11
1 files changed, 10 insertions, 1 deletions
diff --git a/globals.cginc b/globals.cginc
index 9bc4330..d3a4b8e 100755
--- a/globals.cginc
+++ b/globals.cginc
@@ -167,7 +167,8 @@ float _Ray_Marching_Hexagon_Height;
#endif // _RAY_MARCHING_HEXAGON
#if defined(_INSTANCE_DISTANCE_CULLING)
-float _Instance_Distance_Culling_Distance;
+float _Instance_Distance_Culling_Min_Distance;
+float _Instance_Distance_Culling_Max_Distance;
#endif // _INSTANCE_DISTANCE_CULLING
#if defined(_INSTANCE_TEXTURE_OFFSET)
@@ -180,6 +181,14 @@ float3 _Instance_Texture_Offset_Base_Scale;
float4 _Instance_Texture_Offset_Base_Rotation;
#endif // _INSTANCE_TEXTURE_OFFSET
+// Instancing buffer must be declared at global scope for D3D11 compatibility
+#if defined(_INSTANCE_TEXTURE_OFFSET) && defined(UNITY_INSTANCING_ENABLED)
+UNITY_INSTANCING_BUFFER_START(InstanceProps)
+ UNITY_DEFINE_INSTANCED_PROP(float, _Instance_ID)
+#define _Instance_ID_arr InstanceProps
+UNITY_INSTANCING_BUFFER_END(InstanceProps)
+#endif // _INSTANCE_TEXTURE_OFFSET && UNITY_INSTANCING_ENABLED
+
#if defined(_PARALLAX_HEIGHTMAP)
texture2D _Parallax_Heightmap;
float4 _Parallax_Heightmap_ST;