Login  Register

Re: Need Help Solving OpenGL/GLSL 4.4 Issues

Posted by jmaasing on Jul 20, 2014; 3:16pm
URL: https://forum.jogamp.org/Need-Help-Solving-OpenGL-GLSL-4-4-Issues-tp4032557p4032598.html

That's not how shader based OpenGL works. You have to do everything yourself in the shader code, right now your shader hardcodes both position and color so that's what you get.
On the OpenGL side you must set up input data that your shader reads. There are many ways to do so but usually it involves creating vertex buffers with data that is different for each vertex. Or by using shader uniforms for data that is the same for all vertices.

Here is a good tutorial I used when learning modern OpenGL: http://www.arcsynthesis.org/gltut/