Transparent LOD Blocks rendering in front of everything else with Vertex Shader

I apologize if I'm doing something wrong here and all help is appreciated Basically I just created this simple vertex shader, I don't think it's a problem on the shader's end because it only does this with distant horizons transparent LOD blocks, it works properly if I turn off transparency entirely in distant horzon settings, but if there is a way for me to fix this with the shader I would happily do it.
Solution:
You will need to add a fragment shader, and from there, you perform a depth discard. If you need more info on how to do so, head over to the shaderLABS Discord server for more info.
Jump to solution
4 Replies
Miki_P98
Miki_P982mo ago
It is normal IDK if it is Iris or DH fault You need to add manual depth check and discard water if it is not in the front
Solution
hardester
hardester2mo ago
You will need to add a fragment shader, and from there, you perform a depth discard. If you need more info on how to do so, head over to the shaderLABS Discord server for more info.
Chandler
Chandler2mo ago
will look into these solutions later and mark it resolved if it works
Chandler
Chandler2mo ago
#version 120 compatibility float linearizeDepth(const in float d, const in float zNear, const in float zFar) { float z_n = 2.0 * d - 1.0; return 2.0 * zNear * zFar / (zFar + zNear - z_n * (zFar - zNear)); } uniform sampler2D depthtex0; uniform float dhNearPlane; uniform float dhFarPlane; varying vec4 color; uniform float near; uniform float far; uniform float farPlane; void main() { float depth = texelFetch(depthtex0, ivec2(gl_FragCoord.xy), 0).r; float depthL = linearizeDepth(depth, near, farPlane); float depthDhL = linearizeDepth(gl_FragCoord.z, dhNearPlane, dhFarPlane);
if (depthL < depthDhL && depth < 1.0) {discard; return;} gl_FragData[0] = color; } for future reference this is dh_water.fsh and basically all it's doing is the depth check and nothing more so just adding this stuff to other versions of dh_water should fix it
Want results from more Discord servers?
Add your server