Text rendering on top of items it is behind #1367
-
Hi there! I am currently working on a project where I am using mesh items and text items, in which the shaders I am using are from the method vsg::createPhongShaderSet() and vsg::createTextShaderSet. When I am using a vsg::Perspective projection matrix the layering of the items is normal and items are rendered where they are supposed to be in the scene. However, when I change to vsg::Orthographic projection matrix, some of the text is rendering on top of other text and mesh that it should be behind in the scene. The mesh is still rendered in the order which it should be which is making me a bit confused. I believe that may be something to do with the depth buffer.
This is the depth stencil state which I am applying to the graphics pipeline of both the text and the mesh. I have also tried clearing the buffer using this.
which would reset the depth buffer to 1.0 and only render items closer to the camera (from my limited understanding of the depth buffer). Any help with my current issue would be much appreciated, Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The VSG by default use reverse depth convention for better depth precision, so the projection matrices and graphics pipelines are set up for this. Perhaps you are mixing different conventions. |
Beta Was this translation helpful? Give feedback.
The VSG by default use reverse depth convention for better depth precision, so the projection matrices and graphics pipelines are set up for this. Perhaps you are mixing different conventions.