Tag Info

New answers tagged


Instead of building the cube in geometry shader from a point, its better to do an instanced render of a simple cube VBO, and forego a geometry shader entirely. The only time you wouldn't want to do that is if each cube has rapidly changing orientation and you need to recalculate its modelview every pass. In which case, have position and orientation as ...


Your geometry shader should take a single point (center of the cube) with a front vector and an up vector. You can then output 12 triangles (6 faces x 2 tri for a quad) using the single point as the center of the cube and the cross-product of front & up for the right vector. // table of all triangle vertices to make the cube const vec3 face_table[12*3] ...

Top 50 recent answers are included