From c1709ef4a57ab10e83afd9dfbed7e162e88c06d9 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 24 Feb 2026 00:35:46 -0800 Subject: Delete grass (unused) --- Scripts/GrassGridBlit.shader | 77 -------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100755 Scripts/GrassGridBlit.shader (limited to 'Scripts/GrassGridBlit.shader') diff --git a/Scripts/GrassGridBlit.shader b/Scripts/GrassGridBlit.shader deleted file mode 100755 index f4dc872..0000000 --- a/Scripts/GrassGridBlit.shader +++ /dev/null @@ -1,77 +0,0 @@ -Shader "yum_food/GrassGridBlit" -{ - Properties - { - } - SubShader - { - Tags { "RenderType"="Opaque" } - LOD 100 - - Pass - { - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - - struct appdata - { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - }; - - struct v2f - { - float2 uv : TEXCOORD0; - float4 vertex : SV_POSITION; - }; - - // Grid parameters - float3 _PlayerGridPos; // Player's grid cell position (x, y, z) - int3 _GridCount; // Number of instances along each axis - int3 _GridHalf; // Half dimensions for centering around player - int2 _TexDimensions; // Texture width and height - - v2f vert (appdata v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.uv = v.uv; - return o; - } - - float4 frag (v2f i) : SV_Target - { - // Convert UV to pixel coordinates - int2 pixelCoord = int2(i.uv.x * _TexDimensions.x, i.uv.y * _TexDimensions.y); - - // Convert pixel coordinate to instance index - int instanceID = pixelCoord.x + pixelCoord.y * _TexDimensions.x; - - // Calculate total valid instances - int totalInstances = _GridCount.x * _GridCount.y * _GridCount.z; - - // If this pixel is beyond valid instances, output invalid marker - if (instanceID >= totalInstances) { - return float4(0, 0, 0, -1); // Alpha = -1 marks invalid - } - - // Convert instance index to local grid coordinates (0 to GridCount-1) - int localX = instanceID % _GridCount.x; - int localY = (instanceID / _GridCount.x) % _GridCount.y; - int localZ = instanceID / (_GridCount.x * _GridCount.y); - - // Convert to world grid coordinates centered around player - int worldX = _PlayerGridPos.x - _GridHalf.x + localX; - int worldY = _PlayerGridPos.y - _GridHalf.y + localY; - int worldZ = _PlayerGridPos.z - _GridHalf.z + localZ; - - // Store world grid coordinates in RGB channels, alpha = 0 marks valid - return float4(worldX, worldY, worldZ, 0); - } - ENDCG - } - } -} -- cgit v1.2.3