-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch Rendering #20
Comments
Thanks for the suggestion! I'm still sort of new to OpenGL and didn't know that this was possible. |
Is this still available? |
This is still open! Have at it! |
!Assign (please assign it to me)
Is this the area causing the issue? I see the GameObject class used to model the Object, and then this Renderer class which renders the gameItem |
@xGREGKERSEYx It looks like that for loop is at least part of the code causing the issue. If you look at the render function in the Mesh class, you can see where the draw function is called: public void render() {
// Activate firs texture bank
glActiveTexture(GL_TEXTURE0);
// Bind the texture
if(hasSpriteSheet)
glBindTexture(GL_TEXTURE_2D, spriteSheet.getTextures()[currentFrame].getId());
else
glBindTexture(GL_TEXTURE_2D, texture.getId());
// Draw the mesh
glBindVertexArray(getVaoId());
glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
// Restore state
glBindVertexArray(0);
} You could probably modify that code to draw multiple gameObjects with one call to the draw function. |
@JacksonHoggard Hello! I sent you an e-mail [jhoggard0129@gmail.com] last week. Just wanted to make sure I had everything setup right. I can re-send it or just drop it in here, later. |
@xGREGKERSEYx Hey! Just replied to your email. I tried to be as verbose as possible, but please let me know if you have any questions or if you need any help. Best of luck! :) |
I see that in this Project every single GameObject is rendered using a separate draw call. (Very Slow)
Batch Rendering is not hard to implement. Only thing is one has to overhaul the entire Renderer :(
The text was updated successfully, but these errors were encountered: