How to draw text on the plain surface? #727
-
Hello, In order to simplify localization I wanted to remove text from textures and draw it above surface using vsg::Text. I tried to draw some text on the plain surface but the result of my attempt was not good. I though it is enough to draw a quad and above it, with minimal offset to avoid z fighting, draw a text. But it didn't work. I modified vsgtext example to show what I encountered. Green quad and text are on the same distance from black quad. And green quad is rendered as expected independently of the view. But text goes behind black quad and can be visible fully only at specific angles. Maybe this is expected behavior and just another approach should be used in such cases. How to properly draw text on the plain surface? Attach modified vsgtext example
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
When I removed these lines from text vertex shader my problem was fixed but probably this broke something else I don't use.
|
Beta Was this translation helpful? Give feedback.
-
@Mikalai I have now had a chance to run the modified vsgtext and have changed the sign of the depth offset as the shader offset was written before the VSG's default depth buffer order was changed to reverse depth, but these shaders were missed. I have checked the changes on the shaders into vsgExamples master: VSG commit: adf1e2e With this modified examples works fine. |
Beta Was this translation helpful? Give feedback.
@Mikalai I have now had a chance to run the modified vsgtext and have changed the sign of the depth offset as the shader offset was written before the VSG's default depth buffer order was changed to reverse depth, but these shaders were missed.
I have checked the changes on the shaders into vsgExamples master:
VSG commit: adf1e2e
vsgExamples commit: vsg-dev/vsgExamples@f54e2fc
With this modified examples works fine.