Jump to content

  • Log In with Google      Sign In   
  • Create Account

Sponji

Member Since 14 Jan 2011
Online Last Active Today, 02:37 PM

Posts I've Made

In Topic: [OGL] Textures are not displaying properly

25 May 2016 - 12:20 PM

And you've made sure the shaders compile fine? Does glGetUniformLocation return valid location? Did you bind the attribute locations correctly? Btw, AMD's CodeXL is the new gDEBugger.


In Topic: [OGL] Textures are not displaying properly

25 May 2016 - 11:47 AM

I don't see anything wrong with the vertex attributes, but yeah, it's usually unnecessary to disable them. You can just set up everything in your VAO and its buffers and attributes will be remembered next time you bind the VAO.

 

One problem could be with your glUniform call, you're passing weird stuff for it, you shouldn't use texture id for it. Maybe that's not the actual problem if the texture id is a sane number for glActiveTexture call, but at least I'd suggest fixing that one.

GLuint texture_id = ...;
int index = 0;
glActiveTexture(GL_TEXTURE0 + index);
glUniform1i(shader.getUniformLocation("sampler"), index);
glBindTexture(GL_TEXTURE_2D, texture_id);

In Topic: glMultiDrawArrays does not render properly

23 May 2016 - 02:10 PM

And did you try using byte offset for glBufferSubData and index offset for glMultiDrawArrays?


In Topic: glMultiDrawArrays does not render properly

23 May 2016 - 01:55 PM

I haven't used multidraw things myself, but isn't your offset wrong? Shouldn't it be the index for the first vertex, and not the byte offset?

// Offset += (VertexBuffer.size() * sizeof(GLfloat));
Offset += ShapeVertices.size()

In Topic: Framerate Independent Mouse Movement

14 May 2016 - 05:05 PM

I am setting the rotation inside the update loop, does that matter?

 

That's what I've been trying to say, I don't know about all the code you have but I'm guessing you're adding the same input multiple times.


PARTNERS