Translucent texture rendered above fog
First seen in https://github.com/Unvanquished/Unvanquished/issues/799
See the ice stalactites on the gauntry (in background):
This might be some incorrectly set shader sort since we do depth->opaque->fog->translucent. Or maybe we just need another pass before fog and after opaque, since stalactites probably are translucent.
I decided to check if it's still true...
On the bright side, it's no longer rendered above fog.
Confirming the original bug is still there.
This might be some incorrectly set shader sort since we do depth->opaque->fog->translucent. Or maybe we just need another pass before fog and after opaque, since stalactites probably are translucent.
So the stalactites are, in fact, translucent.
The implicitMask is indeed not working, because the alpha threshold is being set to 1.5, i. e. the default value.
Looks like the shader gets sorted as opaque and I'm not seeing it being used when stepping through the RB_RenderDrawSurfaces() code for translucents, but I see it being rendered after the global fog in a frame debugger...
They also don't write to depth, even though they should.
Oh wait, I was looking at the wrong shader lol.
So this is the shader in question:
surfaceparm alphashadow
cull none
{
map textures/snow/alpha_ice2s.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen vertex
}
It might be that alphashadow is supposed to turn alpha testing on here, but it doesn't.
I've watched some wolf ET videos and it seems the icicles there are also rendered above fog, the only difference is ours are rendered darker for some reason (on the original screenshot the ones closer to the view are rendered as they should, unlike the ones on the gantry, now both are like the ones on the gantry).
The shader is set to do rgbgen vertex, and these are the vertex colours used by those surfaces:
With default overbright settings:
With
r_overbrightDefaultClamp on:
So this has something to do with overbright.
The first screenshot has the original vertex colours, so they're being rendered correctly based on that.
Closing since the original issue is a map/shader bug, not an engine one.
The bug we were looking for was that he global fog was rendered twice, that is fixed with:
- https://github.com/DaemonEngine/Daemon/pull/1740
While the stalactites were always rendered above the fog (which is wrong), this did not looked bad unless we rendered the fog twice, and then the fog being too-much opaque, it became obviously visible that the stalactites were rendered above it.
Before:
After:
Before:
After:
Before:
After:
