I'm very curious if you have had any luck getting this to work in OSG.
After watching some of the online demo's regarding mesh shaders 
(specifically Unreal), it would be great if there was a way for this to be 
implemented in OSG.

On Wednesday, May 26, 2021 at 9:15:15 AM UTC-5 Werner Modenbach wrote:

> Hi users,
>
> I'm currently experimenting with the usage of meshlets in OSG.
> Robert already implemented the corresponding draw methods. Thanks Robert!
> The main thing necessary to make it work is the indexed access to almost 
> every data given by the CPU, 
> which is very limited in the traditional shader pipeline. I.e. a vertex 
> shader can only access 1 Vertex at a time.
> Mesh shaders can fetch any vertex by index and any number of vertices.
>
> A typical use/definition of the shader structures may be:
>
> //-------------------------------------// transform_ub: Uniform buffer for 
> transformations//
> layout (std140, binding = 0) uniform uniforms_t { 
>   mat4 ViewProjectionMatrix;
>   mat4 ModelMatrix;} transform_ub;
>  //-------------------------------------// vb: storage buffer for 
> vertices.//struct s_vertex {
>       vec4 position;
>       vec4 color;};
>  
> layout (std430, binding = 1) buffer _vertices {
>       s_vertex vertices[];} vb;
>  
>  //-------------------------------------// mbuf: storage buffer for 
> meshlets.//struct s_meshlet {
>       uint vertices[64];
>       uint indices[378]; // up to 126 triangles
>       uint vertex_count;
>       uint index_count;};
>  
> layout (std430, binding = 2) buffer _meshlets {
>       s_meshlet meshlets[];} mbuf;
>
>
> So all data is given via BufferObjects.
>
> Meshlet shaders are kind of compute shaders with output to the rasterizer 
> and thus a fragment shader.
> The indexed access is like:
>
>   uint mi = gl_WorkGroupID.x;
>   uint thread_id = gl_LocalInvocationID.x;
>  
>   uint vertex_count = mbuf.meshlets[mi].vertex_count;
>   for (uint i = 0; i < vertex_count; ++i) {
>     uint vi = mbuf.meshlets[mi].vertices[i];
>  
>
> Precondition for the indexed access is having the data given via 
> BufferObjects.
> In OSG we have only predefined types (Indices, Vertices and Images) for 
> BufferObjects.
>
> Has anybody any experience deriving a more general class for putting 
> arbitrary structs in BufferObjects (i.e. struct s_meshlet)?
> I think that shouldn't be such a big deal or am I overseeing something.
>
> @Robert: Or can you provide any hints to me for creating such a derived 
> class?
>
> If I manage getting this working I'll provide it to the community because 
> mesh shaders are really great for many applications!
>
> Many thanks in advance
>
> - Werner -
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/44681b37-aba2-47a1-ab38-5f3685af8b14n%40googlegroups.com.

Reply via email to