Tag Info

Hot answers tagged

2

I haven't done any benchmarking to compare but there's a relatively unknown feature introduced to core in 4.3 that might be of interest to you. glVertexAttribPointer has somewhat silently been deprecated in favor of a new suite of functions: glVertexAttribFormat provides your attribute location, size, type, and offset (for interleaved vertex data) ...


2

When uploading shader source, you may provide more than one string. The lines of the strings are concatenated into the full text source for the shader compiler. You can thus emulate an include system (poorly) by putting the text of the required sources before the string with the main shader source. This is the origin of the numbers before the line numbers ...


1

You have at least one error. This is incorrect: float newDistance = newPointOnPlane.x + newPointOnPlane.y + newPointOnPlane.z It should instead be: float newDistance = glm::dot(newPointOnPlane, newNormal); Because the "distance" of a plane is the distance along the normal to the plane origin, which is given by the dot product between the normal and the ...


1

The other answers here are good (maybe better) but I wanted to add my 2 cents. One approach is for objects that have static verts to all share one VBO. Just pile on the data from each objects into one huge array and make it a VBO. Track offsets and sizes for each object within the VBO and then draw each individual one like this: ...



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