bradleyq / shader-toolkit

MC 1.17 vanilla shader examples
Creative Commons Zero v1.0 Universal
144 stars 17 forks source link

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

Open BalintCsala opened 3 years ago

BalintCsala commented 3 years ago

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 commented 3 years ago

Also breaks on entity names due to text_see_through

BalintCsala commented 3 years ago

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

bradleyq commented 3 years ago

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.