Posts by paulocanedo • 161 points
9 posts
-
0
votes1
answer124
viewsA: How to change the color of each rendered object in opengl C++ with shaders?
To use different colors in Opengl with shaders, you’ll basically have two ways to do this: Uniform buffer Uniform: this way you will define the same color for a whole call draw*, that is, everything…
-
1
votes1
answer85
viewsA: How does Modern Opengl work?
Have you studied Opengl version 3.2 (or higher) or any version prior to this? if you used the glVertex function it is because it was in the version below the 3.2, which is totally different from how…
-
2
votes2
answers74
viewsA: How do I know if a Shader is working?
You can use GLSL linter that does syntax checking of your shader files, there are extensions for it in some text editors (I use in vscode)in your case you need to extract the Shader string in a new…
-
4
votes1
answer306
viewsA: Send two triangles to a Vertex Shader. Opengl, C++, GLSL
There is a function there called positionTriangulo2(...), it does not have its implementation there but it seems to me that you still do not understand the concept of modern Opengl. The idea of…
-
0
votes1
answer86
viewsA: Texture error in opengl
unsigned int object; // cria textura glGenTextures(1, &object); // gera textura in this section the function 'glGenTextures' generates a reference to a storage area for a texture, whenever you…
-
0
votes2
answers1115
viewsA: Treatment of exceptions in C++
You can imitate what other programming languages do, such as Java, where there is an interface Trowable, all the exections released in Java must implement this interface, so the virtual machine…
-
1
votes1
answer790
viewsA: C++ - Movement on the X-axis (animation) - Opengl
Analyzing your code, it seems to me that you are not drawing the code by changing the values of the eixo X, every time you change the value of the X-axis, you need to call the glFlush(), then in…
-
1
votes2
answers106
viewsA: Capture a 3D click in openGL
There are different techniques for working with object selection in OpenGL. I know these two: Each object in the scene must have an id in memory, when you capture the click, you must go through all…
-
1
votes1
answer50
viewsA: Global variables in GLSL?
I’m not sure what you’re trying to do. Variables like varying serve to pass data from Vertex Shader to Fragment Shader. There are variables of type attribute that you send the values through your…
openglanswered paulocanedo 161