Vbo VboMesh Vao and Compute shaders

I’ve hit a bit of a snag, and I can’t find some examples that are going to help me solve this without someone that knows better.

I want to basically get a VboMesh into a Compute shader. I have an initial buffer that will hold my results, but I want to also pass in meshes, to process and rasterize to my buffer.

What I have so far, I am not even sure it makes sense honestly. It’s doesnt help that I get confused around the Vao and Vbo connections.

Does anyone have any example of binding VboMesh and it’s attribute layout to a compute shader? Or can offer me some direction?

Thank you

Hi,

are you writing your own real-time path tracer? :slightly_smiling_face::wink:

Maybe instead of a VboMesh, you can store your vertex and normal data in a SSBO of your own design? Just create a struct containing your data, e.g.

struct VertexData {
    ci::vec4 position;
    ci::vec4 normal;
    ci::vec4 color;
    ci::vec2 coord;
    ci::vec2 reserved;
};

and stick to a convention similar to GL_TRIANGLES (every 3 vertices create 1 triangle). You can then take that data and render directly to an output image.

-Paul

Thanks Paul,

I had actually considered that. The only thing stopping me is it sounded crazy to me, importing the mesh as a standard VBOMesh… then converting that into that custom ssbo struct. But I might look into that. Otherwise, I have to find a new method of importing my meshes.

Kind of like a path tracer. Looking at voxel cone tracing.:wink: