Performs instanced rendering by using glDrawElementsInstanced and glVertexAttribDivisor. glDrawArrayInstanced works in a similar fashion using glVertexAttribDivisor to instance geometries and triangles.
Пікірлер: 17
@GermanTutorials2 жыл бұрын
Thanks, you really helped me alot with my current assigned for my computer graphics lecture. Been searching the web the whole day till i stumbled upon your brilliant video. Keep it up!
@kentarveolsen399 жыл бұрын
the Tooth item.. hehe made me laugh ;) .. thanx anywho for the effort :)
@C5FlyingSquad10 жыл бұрын
Thank you very much sir, I've really been trying to understand this whole instancing thing.
@bardackx29 жыл бұрын
that was simple! thanks!
@srhalnon10 жыл бұрын
Thanks for this. I havent looked at your other videos but ive already subscribed Its nice to see some videos covering some slightly more advanced topics. How have i not found you yet!
@JamieKingCS10 жыл бұрын
Hehe, thanks!
@srhalnon10 жыл бұрын
Jamie King Im confused about one thing though, You seem to bind 2 different buffers to GL_ARRAY_BUFFER in your program, is your vertex shader pulling attributes from 2 different buffers or am i missing something?
@mattmunson591410 жыл бұрын
Sean Halnon Jamie King I think it pulls from the enabled attribute arrays, not from the buffer currently bound to GL_ARRAY_BUFFER. So yes it pulls from two buffers, even though one of those is no longer bound to GL_ARRAY_BUFFER. Am I right on this?
@vectork33 жыл бұрын
@@mattmunson5914 yes!
@peki_ooooooo2 жыл бұрын
Cool!!!
@drcvagos-iu8 жыл бұрын
this is great
@ncvitak10 жыл бұрын
I have a question. I have OpenGL 4.1 however I am aiming to produce applications that use OpenGL 3.2 for compatibility purposes. glDrawElementsInstanced is available at OpenGL 3.1, however glVertexAttribDivisor is only available in OpenGL 3.3. Is there any way I can get the same effect without using glVertexAttribDivisor, but perhaps something to do with gl_InstanceID? Your tutorials are great by the way. They are the most informative on youtube so keep it up :)
@C5FlyingSquad10 жыл бұрын
You can try to encode the necessary matrices into a texture, and read the texture in the vertex shader instead of the fragment shader. You can then somehow use a system to convert texture coordinates to a single value and compare it with the gl_instanceID. This can then fetch the correct matrices from a texture.
@raj.blazers8 жыл бұрын
+C5FlyingSquad Do u have any tutorials on the same? I have huge number of transformation matrix4 to be encoded into textures.
@C5FlyingSquad8 жыл бұрын
+Arul Raj Never seen a tutorial on this. But you can try to be creative here: just create a 2D array with all your matrices, with each pixel representing a matrix element (or you can be more efficient and use sub pixels). You can then create a buffer with that, and use some OpenGL functions to create a texture from that 2D buffer. I hope I answered your question, as it's been 2 years.
@DarkOutsideNow2 жыл бұрын
New reply to an old question, but its great question to provided an updated answer with. from the official source: www.khronos.org/opengl/wiki/Vertex_Specification#Separate_attribute_format
@AssassinGrudge8 жыл бұрын
does this will help when creating voxel engine something like Minecraft ?