Hot answers tagged

1

I typically like to define a "GPUData" struct containing the fields that are going to the shader, and keep the GPUDatas for all the particles in an array. Then, when it's time to update the GPU buffer, you can just memcpy out of that array to your mapped buffer (or you can pass the array to glBufferSubData, etc). For the CPU state, rather than ...


1

In accord with the GLSL extension, gl_Layer in a mesh shader is part of the predefined gl_MeshPerPrimitiveNV output interface block. It seems to have the expected definition. This is a per-primitive parameter, so you can set it to a different value for each primitive you output. Basically, yes: layered rendering is available in task/mesh shaders. And since ...


Only top voted, non community-wiki answers of a minimum length are eligible