Provide a example about how to use ArrayState #701
-
I found |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
ArrayState is essentially helper class for handling scene graphs that use vertex shaders that process vertices in non standard ways i,e move the vertices around in ways that are as simple as modelmatrix * vertex. They provide a form CPU emulation of vertex shader so CPU routines can process vertex and primitive data without knowing the details of every possible shader combination. There isn't an vsgExamples example of using vsg::ArrayState, but both the vsg::ComputeBounds and vsg::LineSegmentIntersector implementations found in the VulkanSceneGraph use it so may be helpful. There are also implementations of custom ArrayState provided by the built in ShaderSets to handle shaders that move the vertices around such as displacement maps etc. What task are you looking to tackle that you think ArrayState will be helpful? |
Beta Was this translation helpful? Give feedback.
-
@HowellDong I am moving this question to the Disucssion pages as this is the appropriate place to ask questions. The Issue tracker is for build and runtime issues not general questions how to do things. |
Beta Was this translation helpful? Give feedback.
-
I am trying to parse gltf model with tiny-gltf library. I am confused that how vsg::LineSegmentIntersector or ComputeBound know the infomation about vertex's position attribute. (I know vsgXchange using assimp to parse model files, but I want to do a excise. It make me understand vsg better). |
Beta Was this translation helpful? Give feedback.
ArrayState is essentially helper class for handling scene graphs that use vertex shaders that process vertices in non standard ways i,e move the vertices around in ways that are as simple as modelmatrix * vertex. They provide a form CPU emulation of vertex shader so CPU routines can process vertex and primitive data without knowing the details of every possible shader combination.
There isn't an vsgExamples example of using vsg::ArrayState, but both the vsg::ComputeBounds and vsg::LineSegmentIntersector implementations found in the VulkanSceneGraph use it so may be helpful.
There are also implementations of custom ArrayState provided by the built in ShaderSets to handle shaders that move …