Stream Output of Geometry Shader in VL.Stride

VL.Stride now provides easy ways and examples for developers to wrote draw shader (vertex and pixel shaders), texture shader, and compute shader. Is there any plan which is working on the stream output of geometry shader? This process seems to be necessary when the geometry (mesh/model) have to be modified before it was skinned by the readymade (i.e. PBR) materials.

Actually, I have written my own nodes to achieve my aim. I attach my example here StreamOutTest.zip (26.9 KB) My patch simply draws quad particles and deforms the teapot mesh in geometry shaders. The stream output was then skinned with vvvv gamma’s PBR material. Everything work, however, the file, VL.Stride.Rendering.Instancer.vl in lib.packs.VL.Stride.Runtime… have to be included in dependencies, since I had copied the algorithms of StreamOutInstancer, and used those internal nodes such as MeshDrawerStreamOut. (my patch was developed in vvvv gamma 2021.3.0)

My question is: instead of my work-around, is there any more official way provided in the existing (or future) gamma version, which could achieve what I am doing? i.e. output modified mesh from geometry shader. I even have not tested the performance of my work-around nodes.

1 Like

wow, you really got everything, it think.

the reason why we didn’t include those stream out nodes is that it was an older technology for instancing, before we got that properly integrated in stride.

the stream out (aka transform feedback) itself is kind of a slow technique that isn’t really recommended nowadays:

what you should do with modern GPUs is modifiying the vertex buffer in a compute shader and bind it as vertex buffer to a material. unfortunately we didn’t have time to implement that before the release. but you might be able to hack it somehow.

but for now what you did is totally fine and i guess we can just forward all those nodes as experimental, so you can use them without the missing dependency.

another idea we are just developing with the FUSE team is to modify the vertex positions directly in the material. which is possible via composition and ShaderFX nodes. in this case you can only transform vertices, and not add/remove them. but it seems that this is what you did with the teapot. i can look for an example patch.

1 Like

@tonfilm Thank you very much for the inspiring reply. Haha, I never knew the burden of geometry shaders. I always chose to use GS or CS depending on convenience or even my mood. Now I will try to write compute shaders to modify the mesh’s vertex. I am happy to learn new thing :)

“another idea we are just developing with the FUSE team is to modify the vertex positions directly in the material. …”

I remember that I had tried to transform the vertex by displacement offsets, but now the input pin of displacement map only accepts scalar value. If it accepted vector value, then, it could provide more possibilities.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.