[osg-users] Set color in fragment shader

2014-07-29 Thread ying song
Hello everyone, I downloaded a 3d model which is in 3ds file format. At first I distorted this model in the vertex shader. Then I want to set the color of the model as same as the original color, but I don't know how to do it. I tried: 'gl_FragColor = gl_Color;' in the fragment shader, but

Re: [osg-users] Set color in fragment shader

2014-07-29 Thread Bram Vaessen
don't forget to pass the color in the vertex shader: gl_FrontColor = gl_Color; for texture you use texture coordinates: usually gl_TexCoord[0] = gl_MultiTexCoord0; in the vertex shader and then for example use texture2D( sampler2D, vec2 [,float bias] ) to sample a color from the texture at the