Jan
01-22-2004, 12:10 PM
DAMN!!
I feel really stupid, but i donīt know why this does not work. I could not find any tutorial showing how to use this function properly, since this is such a trivial thing.
char ShaderText[1][1024];
strcpy (ShaderText[0],
"uniform sampler2D Texture0;\
uniform sampler2D Texture1;\
uniform sampler2D Texture2;\
uniform sampler2D Texture3;\
\
void main(void)\
{\
vec2 TexCoord = vec2( gl_TexCoord[0] );\
vec4 RGB = texture2D( Texture0, TexCoord );\
\
gl_FragColor = texture2D(Texture1, TexCoord) * RGB.r +\
texture2D(Texture2, TexCoord) * RGB.g +\
texture2D(Texture3, TexCoord) * RGB.b;\
}\0\0\0");
glShaderSourceARB (FragmentShaderObject, 1, (const GLcharARB**) ShaderText, NULL);
The function glShaderSourceARB simply crashes. I donīt know why, i have tried everything.
Note that all obects (FragmentShaderObject, etc.) are created, i just didnīt post the code for it.
Itīs the first time i try to get glSlang running, the piece of shader-code is just a copy out of a tutorial, it should not have any effect.
Thanks in advance,
Jan.
I feel really stupid, but i donīt know why this does not work. I could not find any tutorial showing how to use this function properly, since this is such a trivial thing.
char ShaderText[1][1024];
strcpy (ShaderText[0],
"uniform sampler2D Texture0;\
uniform sampler2D Texture1;\
uniform sampler2D Texture2;\
uniform sampler2D Texture3;\
\
void main(void)\
{\
vec2 TexCoord = vec2( gl_TexCoord[0] );\
vec4 RGB = texture2D( Texture0, TexCoord );\
\
gl_FragColor = texture2D(Texture1, TexCoord) * RGB.r +\
texture2D(Texture2, TexCoord) * RGB.g +\
texture2D(Texture3, TexCoord) * RGB.b;\
}\0\0\0");
glShaderSourceARB (FragmentShaderObject, 1, (const GLcharARB**) ShaderText, NULL);
The function glShaderSourceARB simply crashes. I donīt know why, i have tried everything.
Note that all obects (FragmentShaderObject, etc.) are created, i just didnīt post the code for it.
Itīs the first time i try to get glSlang running, the piece of shader-code is just a copy out of a tutorial, it should not have any effect.
Thanks in advance,
Jan.