fix(shader/metal): correct noise coords and frame input in fragmentShader

- Replace undefined `screenSpace.xy * noise_scale` with `in.position.xy * frameUniforms.noiseScale`
- Replace undefined `noise_frame` with `float(frameUniforms.frameCount)`
- This resolves build failures (undeclared identifiers, nil vertexFunction) when driving over sand

Fixes: shader compilation errors and Metal pipeline validation assertion
This commit is contained in:
nervous-inhuman
2025-07-26 03:33:16 +02:00
committed by Lywx
parent 79f437ab30
commit a48909b7ea
+3 -3
View File
@@ -273,8 +273,8 @@ fragment float4 fragmentShader(ProjectedVertex in [[stage_in]], constant FrameUn
@end
@if(o_alpha && o_noise)
float2 coords = screenSpace.xy * noise_scale;
texel.w *= round(saturate(random(float3(floor(coords), noise_frame)) + texel.w - 0.5));
float2 coords = in.position.xy * frameUniforms.noiseScale;
texel.w *= round(saturate(random(float3(floor(coords), float(frameUniforms.frameCount))) + texel.w - 0.5));
@end
@if(o_alpha)
@@ -288,4 +288,4 @@ fragment float4 fragmentShader(ProjectedVertex in [[stage_in]], constant FrameUn
@else
return float4(texel, 1.0);
@end
}
}