feat: implements support for specifying depth order of drawing commands#33
feat: implements support for specifying depth order of drawing commands#33simsaens wants to merge 2 commits intojdryg:masterfrom
Conversation
|
Thanks for the PR and sorry for the delayed reply. Unfortunately I cannot merge this PR atm because I feel this should be a feature implemented in a different way.
In other words, I'd implement it similar to how the scissor rect is currently handled. May I ask how depth order can help with the "text on top of UI widget" case? Is your whole UI a single layer (background + text)? If it has multiple layers (e.g. overlapping windows), do you plan to increase the depth order for every UI layer? My approach to this would be a bit different (and a bit more complicated). IMO the API should be something like: AFAIR, I tried implementing something like that in the layers branch but I never finished it. Unfortunately I don't remember the details. Having said all that, I don't currently use this version of the library in my own projects. I use a stripped down version based on c99 branch. AFAIK @bkaradzic plans on integrating vg-renderer into bgfx at some point so it might be better if you tried porting your changes to his branch once it's ready. |
We use vg-renderer extensively in our project and have found the need to specify a depth order (which gets passed through to
bgfx::submitasdepth). This is used to, for example, render text on top of UI components or just layer different shapes in a specified orderingThis PR attempts to add a public API to vg-renderer to specify the depth ordering state of the renderer. I'm unsure about some things:
depthOrderorsetDepthOrder(I went with the former, opting for brevity)DrawCommand, or is it sufficient to keep the depth order inState? Again, I went with the formerDrawCommand, then do we need tom_ForceNewDrawCommandwhenctxPopStateruns if the depth order is different?State, then is it OK togetState(ctx)from theend(...)function in order to read the depthOrder forbgfx::submit?I am happy to change anything (naming, etc) to match convention here