Fog does not render behind DH's glass
Self explanatory. Happens in the latest nightly build. I know transparency and stuff is complicated, hopefully there is an easy fix.
19 Replies
When nobody writes anything I suppose it's because the bug report is an actual bug with no fix
usually thats the case yea. ill try to replicate when im home, but the chance is very high that ill be seeing the same thing
Forgot I don't have time today
np, chances are that James is already silently working on a fix and will post "Just pushed a fix." at any time as he usually does
I really appreciate James' dedication to DH even when it is only his hobby he is always actively contributing to DH's development
can confirm, also happens with me
@James Seibel (GMT-6) is this something that can be easily solved?
water has the same issue btw
Currently fog only renders once at the very end of the pipeline. So missing fog behind glass is expected behavior.
I could try running the fog twice (once after opaque and once after transparent rendering), although that might cause issues with double applying fog to opaque areas and would cause a performance drop.
Personally I don’t think this problem is worth fixing since most of the time DH isn’t rendering large glass areas, but if other people think it’s a problem I can take a closer look.
yea its not that major indeed
There's no problem, I understand it's not a priority rn.
I was just wondering, if the fog is at the very end of the pipeline, could it be rendered just before the transparency pass instead? or would it break something?
If you did it that way then oceans wouldn’t have fog, since water is rendered during the transparent pass.
Right..
No problem then its not a major bug
This is what happens when you disable glDepthMask() for the transparency pass
And this is what happens when you get it working somehow
But then the ocean has no fog
I give up man, I don know how to code, I was doing my best
nICe 😄
Listen!
No fog no problem.... right?
Just remove it
xD
lol don’t take it personally. Depth sorting and the like are famously difficult problems to get right 😅
I mean the way I got this one working is by creating a copy of the depth texture right before the transparency pass. Then the fogshader would use the copy of the depth texture which would make it bypass glass. Side effects: oceans' surface don't have fog
Here i messed up with the depth texture and the fog shader just gave up
Fog would be fixed for all transparent surfaces now. However, to fix the ocean issue, maybe there could be a way to make only water write on the fog's copy of the depth texture. But I have no clue how to implement that. I was not kidding when I said I do not know how to code. I literally just installed IntelliJ and looked for some tutorials. I have some basic Java knowledge but that's it.
I think there's nothing to do actually, because there is no way to distinguish transparent vbos made from water to those made from other transparent blocks like glass. Therefore, its either all transparent surfaces have fog passthrough, or none. I'll consider this bug unfixable or at least unfixable without adding unnecessary complexity to the code.
There is some data about the block type stored in the vertex
As least when shaders are active
DH water gets its own render shader with shaders
Ther must be a way to do it in vanilla DH
That's good news, but I've got no clue how to access that data