I apologize for how slow I am to pick this up, but doesn't calling glBindBuffer right after glBindVertexArray change which vbo is associated with that vao? So wouldn't the vertex positions and...
Type: Posts; User: fiodis
I apologize for how slow I am to pick this up, but doesn't calling glBindBuffer right after glBindVertexArray change which vbo is associated with that vao? So wouldn't the vertex positions and...
So I could replace
glBindBuffer(GL_ARRAY_BUFFER, this->vboId);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->iboId);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vert), (GLvoid*)0);...
What if you do want to change the vertices stored in a VBO between render calls? If the VAO locks things in place, what's the point of flags like GL_STATIC_DRAW or GL_DYNAMIC_DRAW?
I am using a VAO; I create it and bind it just after I initialize GLEW in the beginning. But I don't need to bind the VBO and IBO? What if I have multiple VBOs and IBOs? If I don't bind them, how...
I've used glDrawElements (in OpenGL 3.1) before without problems. Now, however, it doesn't want to draw anything, and I can't figure out why. My render code looks like this:
void renderFunc(){...
So it's okay to detach the shaders (and then, I presume, delete them) before the program itself is ever used? The program will still function correctly, even though its shaders have been detached? ...
I have a function createShader inside a Shader class that takes the filepaths of two vertex and fragment shaders as arguments, loads and compiles them, and uses glCreateProgram to create a shader...
There isn't, as far as I know. Most people do this.
A model I'm loading might or might not use multiple textures (in tga format) for different segments. I don't know in advance how many it will use. So what I do is I count the number of textures at...
I have a very simple vertex shader that takes in vertex position and normals and a MVP matrix:
#version 130
in vec3 in_Position;
in vec3 in_Normal;
out vec4 ex_Color;
//wierd stuff - works...
Ah, you're right, I can just check to see if it's within the size range. I wrote up some GLSL code to do this:
float minX;
float maxX;
float minZ;
float maxZ;
vec2 brushPos;
if...
I realize the vertex shader operates for each vertex. It's comparing the vertex against the brush I'm having trouble with. On the CPU I would construct a vector of X and Z coordinates that lie...
Do you mean in an application running on the .NET framework, or the older Win API? If it's the former, you can't have OpenGL and CLR (common language runtime) code running at the same time, so...
I have a 3D terrain, and I edit it with a rectangular brush defined by a position, width, and length. I'm trying to get this brush to show up as a green rectangle under the mouse. I do this by...
It turns out the gl calls in the destructor were, actually, the problem. Once I moved all the appropriate glDelete calls inside their own Cleanup() function, and called that at the right time, the...
It didn't seem to cause problems when I was only passing vertex position data, though. As soon as I pass vertex color data, either in the same VBO or in a seperate one, I get issues.
Here's the vertex shader:
#version 130
in vec4 in_Position;
in vec4 in_Color;
out vec4 ex_Color;
uniform mat4 MVPMatrix;
I've run a few more tests, and I've found this:
I get a heap corruption error on application closing even when I don't use a custom struct or class to represent a single vertex.
The problem only...
I scrutinized my updateVertices code more closely but couldn't see anything that would be a problem - I reserve memory and resize the vectors properly, and the loop never iterates beyond the vector's...
Thanks for the code sample, but I've since figured out how to use glmUnProject and it's giving me the right results. On thing that tripped me up initially, though, was that even when you're...
I recently made my own vertex class, vertexColored, to hold position and color data. I changed from passing a std::vector of glm::vec3 to my VBO, to passing a std::vector of vectorColored. The...
I'm trying to draw a quad on a 3D terrain under the mouse. To do this, I need to convert the mouse's window coordinates to world coordinates somehow. I Google'd the subject and found a bunch of...
I know you can't have an OpenGL context inside a Windows Form control without some kind of wrapper, like SharpGL or OpenTK. But I've been trying to make a project that includes a Windows Form and,...
Most OpenGL 3.0+ tutorials I look at multiply the model and view matrices together before sending them to the shader. Sometimes they even multiply the projection matrix together with the other two...
Sorry for the double post, but I can't seem to edit my prior one. Here's a couple pictures to illustrate what's happening. This is a wireframe of my cube, from some distance away:...