GUI late render pass #621
-
Hi Robert, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi Denis, If you want to render text ontop of 3d elements in the scene and have them track the objects what I would do is put the text into the scene graph the underneath the transform that moves the object and set it's layout to billboard so it remains axis aligned and is able to scale nicely. The text position you'd set in the local coordinate frame of that subgraph. Now the trick to making sure it renders would be to set the text depth value to 1.0 so that it always draws on top, to do this you'll need to override the Text graphics pipeline set by assigning a custom ShaderSet to the vsg::Text element. The vsgtext example has a code path that illustrates how to customize the ShaderSet to disable the depth test, this doesn't do exactly what I'm thinking of but gets you along some of the way. In a project that uses VSG I've been using this approach to render text at infinity by assigning my own vertex shader assigned a modification of the standard one passed back from vsg::createTextShaderSet(..) which is another approach you could take. I would suggest trying this approach over trying to have a separate subgraph for overlays as it would avoid the complexity of trying to keep the positions and other scene graph state that affects both the 3d model and the text in sync. |
Beta Was this translation helpful? Give feedback.
Hi Denis,
If you want to render text ontop of 3d elements in the scene and have them track the objects what I would do is put the text into the scene graph the underneath the transform that moves the object and set it's layout to billboard so it remains axis aligned and is able to scale nicely. The text position you'd set in the local coordinate frame of that subgraph.
Now the trick to making sure it renders would be to set the text depth value to 1.0 so that it always draws on top, to do this you'll need to override the Text graphics pipeline set by assigning a custom ShaderSet to the vsg::Text element. The vsgtext example has a code path that illustrates how to customize the ShaderSet t…