From 864c2ba12dc864d9cb55cb797ba8919bee5b5913 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 16 Feb 2026 16:32:00 -0800 Subject: 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 --- globals.cginc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'globals.cginc') 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; -- cgit v1.2.3