Hi this is my first post on the forum.
I started learning opengl 6 months ago, and now Im putting to use all the knowledge to make a 3D app for a school project.
I've been following a brilliant series of tutorials on LWJGL from a guy on yt, in particular Im stuck at this video:
https://www.youtube.com/watch?v=Rm-By2NJsrc&t=1305sI need to implement instanced rendering since my application can host lots of Entities, wich all share the same texturedModel (over 5k entities for each kind).
For testing purposes I am only try to get 1 entity to render with this technique.
Basically the problem is that the model is there, but it has some strange artifacts.
This is what the model should looks like:
http://prntscr.com/htaq2jThis is what I got after implementing instancing:
http://prntscr.com/htapq3You can actually see some pieces of the model in the right place, but its all covered in that mess of polygons.
So then I tried to render to points instead of triangles, and this what came out:
http://prntscr.com/htayx8All vertices are there, but they are surrounded by a "sphere" of vertices, and another plane of vertices (
).
I've manually checked the transformation matrix, since its the only per-instance attribute that I have in my VAO right now (I use just that and not the modelViewMatrix since the only thing that changes per-instance is the transfMatrix) and it is ok (compared against the same model's matrix in the rendering engine without instancing, where the models renderes fine).
That made me think that the indices are not loaded correctly in the loadToVAO() method in the DataManager class, but I can't see the problem with that method...
I've stripped down the project with just a few classes in order to be easy to debug.
http://www.mediafire.com/file/lllanhbkmwv6cru/Test_instance.zipCan some one tell me what Im missing? Thanks.