سؤال

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.

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top