X_PUTSHADER issue

Previous topic - Next topic

9940

Code (glbasic) Select

uniform vec3 Color;
void main (void)
{
   gl_FragColor = vec4(Color, 1.0);
}


Code (glbasic) Select

X_SETSHADER 1
X_PUTSHADER "Color", XXXX
X_DRAWOBJ 0, 0


What I should put instead of XXXX since X_PUSHADER only supports floats?

Hemlos

#1
I had to edit my own code here.....GLSL is a very rigid language and unforgiving...

try 'main( void )'


And if that doesnt work, then try this:

Code (glbasic) Select

//Color.frag
uniform float R;
uniform float G;
uniform float B;

void main( void )
{
   gl_FragColor = vec4(R,G,B, 1.0);
}


Code (glbasic) Select
X_PUTSHADER "R", red
X_PUTSHADER "G", green
X_PUTSHADER "B", blue



btw i started a glsl thread recently:
http://www.glbasic.com/forum/index.php?topic=3148.0
Bing ChatGpt is pretty smart :O