shader-toolkit icon indicating copy to clipboard operation
shader-toolkit copied to clipboard

Sign text is not discarded if it's in the control pixels in sun-position

Open BalintCsala opened this issue 3 years ago • 3 comments

I was able to fix this by adding the shaders in the attached zip. Not sure how robust this is tho, as I know vertexDistance likes to change based on resolution. I think you could leave that part out, as none of the important texts ever reach the bottom of the screen, but who knows.

fix.zip

BalintCsala avatar Aug 09 '21 20:08 BalintCsala

Also breaks on entity names due to text_see_through

BalintCsala avatar Aug 09 '21 20:08 BalintCsala

Also problems when entities are beyond the fog distance, since you do a lot of if (vertexDistance < FogEnd) discardControlGLPos

Not sure why the check is there

BalintCsala avatar Aug 16 '21 22:08 BalintCsala

yes there is a very clean solution, set gl_fragdepth to -1 (or 0, i forgot) for your control pixel. Then you don't need discards in all the other shaders unless they bypass depth check (which afaik only sky shader does). I do this now in my newer shaders but haven't update the ones here yet. Thanks for reminding me.

bradleyq avatar Sep 21 '21 17:09 bradleyq