38,017 questions
284
votes
3
answers
15k
views
Once upon a time, when > was faster than < ... Wait, what?
I am reading an awesome OpenGL tutorial. It's really great, trust me. The topic I am currently at is Z-buffer. Aside from explaining what's it all about, the author mentions that we can perform custom ...
249
votes
13
answers
228k
views
How to debug a GLSL shader?
I need to debug a GLSL program but I don't know how to output intermediate result.
Is it possible to make some debug traces (like with printf) with GLSL without using external software like glslDevil?
247
votes
11
answers
178k
views
How do you render primitives as wireframes in OpenGL?
How do you render primitives as wireframes in OpenGL?
210
votes
5
answers
84k
views
What is state-of-the-art for text rendering in OpenGL as of version 4.1? [closed]
There are already a number of questions about text rendering in OpenGL, such as:
How to do OpenGL live text-rendering for a GUI?
But mostly what is discussed is rendering textured quads using the ...
190
votes
17
answers
9k
views
How are 3D games so efficient? [closed]
There is something I have never understood. How can a great big PC game like GTA IV use 50% of my CPU and run at 60fps while a DX demo of a rotating Teapot @ 60fps uses a whopping 30% ?
176
votes
5
answers
117k
views
What is the correct file extension for GLSL shaders? [closed]
I'm learning glsl shading and I've come across different file formats. I've seen people giving their vertex and fragment shaders .vert and .frag extensions. But I've also seen .vsh and .fsh extensions,...
175
votes
5
answers
141k
views
Vertex shader vs Fragment Shader [duplicate]
I've read some tutorials regarding Cg, yet one thing is not quite clear to me.
What exactly is the difference between vertex and fragment shaders?
And for what situations is one better suited than the ...
162
votes
2
answers
56k
views
What's the concept of and differences between Framebuffer and Renderbuffer in OpenGL?
I'm confused about concept of Framebuffer and Renderbuffer. I know that they're required to render, but I want to understand them before use.
I know some bitmap buffer is required to store the ...
158
votes
3
answers
50k
views
Differences and relationship between glActiveTexture and glBindTexture
From what I gather, glActiveTexture sets the active "texture unit". Each texture unit can have multiple texture targets (usually GL_TEXTURE_1D, 2D, 3D or CUBE_MAP).
If I understand correctly, you ...
148
votes
5
answers
93k
views
What are Vertex Array Objects?
I am just starting to learn OpenGL today from this tutorial: http://openglbook.com/the-book/
I got to chapter 2, where I draw a triangle, and I understand everything except VAOs (is this acronym OK?). ...
147
votes
6
answers
102k
views
What does glLoadIdentity() do in OpenGL?
I'm new to OpenGL and I'm a little overwhelmed with all of the random functions that I have in my code. They work and I know when to use them, but I don't know why I need them or what they actually do....
127
votes
9
answers
88k
views
opengl: glFlush() vs. glFinish()
I'm having trouble distinguishing the practical difference between calling glFlush() and glFinish().
The docs say that glFlush() and glFinish() will push all buffered operations to OpenGL so that one ...
125
votes
9
answers
191k
views
Using OpenGl with C#? [closed]
Is there free OpenGL support libraries for C#? If so, which one do I use and where do I find sample projects?
Does C# provide classes for OpenGL?
123
votes
2
answers
95k
views
Do conditional statements slow down shaders?
I want to know if "if-statements" inside shaders (vertex / fragment / pixel...) are really slowing down the shader performance. For example:
Is it better to use this:
vec3 output;
output = input*...
123
votes
1
answer
282k
views
How to properly link libraries with cmake?
I can't get the additional libraries I am working with to link into my project properly.
I am using CLion, which uses cmake to build its projects. I am trying to use several libraries in conjunction ...