Question

I am trying to build an editor with OpenGL where I will draw lines, polygons, triangles...The problem is that I want to pass ONE color for all vertices. I know how to send a color for each vertex, but I want to send only one color for all vertices. Can anyone help? I think I should do it with vertex shader. Also I am using only Qglfunctions.

Was it helpful?

Solution

Create a vec4 uniform in your fragment shader to hold the color and use that to populate gl_FragColor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top