How to make OffscreenRendergraph use a custom GraphicsPipeline. #1041
-
I saw in rendertotexture.cpp that the OffscreenRendergraph will end up creating a rendergraph, and the GraphicsPipeline will end up being saved in the stageGroup, but what if you tie them together. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
I'm confused but what you've written so can't begin to suggest a solution. It would be helpful to take a step back and explain what you are trying to achieve, then dive into an explanation of what you've tried so far. |
Beta Was this translation helpful? Give feedback.
-
I used vulkan to implement a colorpick feature and now want to try to do the same with vsg. |
Beta Was this translation helpful? Give feedback.
-
colorpick works: By assigning a unique color value (or the color corresponding to the object ID) to each mesh in the scene, these colors are then rendered on the OffscreenRendergraph. After the user clicks on a position on the screen, the color of the clicked position in the image rendered by the OffscreenRendergraph is detected, and the value of this color is parsed to determine the mesh selected by the user And the question I asked to simplify is, what about the OffscreenRendergraph // load shaders // set up graphics pipeline ... |
Beta Was this translation helpful? Give feedback.
-
Using colour coded meshes to do picking sounds really awkward and expensive. This type of approach is really old and even when it was first used by some apps it sill wasn't something I would have recommend. So please take another step back and let us know exactly what you are wanting to achieve, with deciding upon the low level way you've decided to achieve it. Then we can point have more sensible discussion about how to achieve it rather than trying to cobble together something that works but for something shouldn't be done in first place. |
Beta Was this translation helpful? Give feedback.
-
Yes, what I want to achieve is picking picking node |
Beta Was this translation helpful? Give feedback.
-
I see what you mean. Thank you very much |
Beta Was this translation helpful? Give feedback.
I'm left guess exactly what you mean, do you mean "use a screen space rectangle to select objects in the scene?"
For that type of work I'd create a PolytopeIntersector class and do the test of the CPU along the lines of the LineSegmentIntersector class. The OSG's has a equivalent class which can be used for this type of operation and works well so implementing something equivalent for the VSG should be possible.
The way you convert a screen space rectangle into a Polytope is to create a Plane for each side of the rectangle with the plan extending into eye space, then transformed into world space/object space. The vsg::LineSegmentIntersector does the equivalent for a point - extending into…