Login  Register

Re: Help with shaders

Posted by Demoscene Passivist on Feb 12, 2012; 3:24pm
URL: https://forum.jogamp.org/Help-with-shaders-tp3737063p3737432.html

If u want to access the color from the fixed function pipeline in a fragment shader theres already a buildin read-only varying in GLSL:
varying vec4  gl_Color; 
varying vec4  gl_SecondaryColor;

For a full list of buildin variables at ur disposal for free take a look here 

Take a look at these fragment shaders and the corresponding JOGL2 code where I use the fixed function material properties to set GL_FRONT later on used in the fragment shader ... hope that helps

Other than that u can ofcourse set a color uniform explicitly from ur code. Take a lookhere where I set a lightcolor array to individual colors for later shader use.