small code cleanups for voxy support

This commit is contained in:
Xonk
2025-12-18 13:55:16 -05:00
parent b3210a4dd5
commit 5ebf76829f
3 changed files with 6 additions and 10 deletions
+4 -3
View File
@@ -7,8 +7,6 @@
",
"version": 1,
"excludeLodsFromVanillaDepth": true,
"uniforms": [],
"samplers": {},
"opaqueDrawBuffers": [1,8,15],
"translucentDrawBuffers": [2,7],
"blending": {
@@ -47,7 +45,10 @@
"isEyeInWater",
"near",
"far",
"taaJitter"
"taaJitter",
"LOD_NEARPLANE",
"LOD_FARPLANE",
"LOD_RENDERDISTANCE"
]
#if TAA_MODE > 0
,"taaOffset": "{
+2 -2
View File
@@ -49,10 +49,10 @@ layout(location = 2) out vec4 MISC_DATA;
void voxy_emitFragment(VoxyFragmentParameters parameters) {
vec3 normal = vec3( uint((parameters.face >> 1) == 2), uint((parameters.face >> 1) == 0), uint((parameters.face >> 1) == 1) ) * (float(int(parameters.face) & 1) * 2.0 - 1.0);
normal.z = clamp(normal.z-1.0,-1,1)*0.5+0.5;
normal.z = clamp(normal.z-1.0,-1.0,1.0)*0.5+0.5;
normal = normalize(normal);
vec3 Albedo = clamp( parameters.sampledColour.rgb * parameters.tinting.rgb, 0.0, 1.0);
vec3 Albedo = parameters.sampledColour.rgb * parameters.tinting.rgb;
#ifdef WhiteWorld
Albedo.rgb = vec3(1.0);
-5
View File
@@ -44,11 +44,6 @@ vec3 WsunVec = normalize((float(sunElevation > 1e-5)*2.0 - 1.0) * normalize(mat3
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
#define PI 3.141592653589793
uniform float LOD_NEARPLANE;
uniform float LOD_FARPLANE;
uniform int LOD_RENDERDISTANCE;
float DH_ld(float dist) {
return (2.0 * LOD_NEARPLANE) / (LOD_FARPLANE + LOD_NEARPLANE - dist * (LOD_FARPLANE - LOD_NEARPLANE));
}