PDA

View Full Version : A basic doubt about shader



iris_raj
06-01-2007, 03:21 AM
Dear openGLProgrammers,

I want to pass an array(float kernel[9]) to my fragment shader. How do it using glUniform command.

Thanks in advance
RAJESH.R

Komat
06-01-2007, 04:42 AM
// In shader

uniform float kernel[ 9 ] ;

// In program

GLfloat values[9] ;
GLint location = glGetUniformLocation( program_handle, "kernel" ) ;
glUniform1fv( location, values, 9 ) ;

iris_raj
06-01-2007, 04:55 AM
Thanks a lot
RAJESH.R