View Full Version : Shader Objects Types
11-06-2008, 08:26 AM
Do shader objects attached to the same program have to be of the same type only vertex or fragment shaders exclusively?
I got a working/compiled vertex shader, but when i attach even an empty trivial fragment shader i get a link error, with no specific log info.
11-06-2008, 10:31 AM
Shader program can bind many shaders of different types.
Make sure you matched varying variables between shaders at different stages.
Furthermore make sure you do not use too many varying variables.
11-06-2008, 12:21 PM
Then what could be wrong with this crashing at program link with no specific error from log info???
uniform sampler2D baseTexSamp;
uniform sampler2D bumpTexSamp;
//varying vec3 fragNormal;
//varying vec3 lightDir;
//float f = dot(normalize(lightDir), normalize(fragNormal));
//gl_FragData = vec4(clamp(f, 0.0, 1.0) * texture2D(baseTexSamp, vec2(gl_TexCoord)));
gl_FragColor = vect4(texture2D(baseTexSamp, gl_TexCoord.st));
No vertex shader assigned, only this fragment.
11-07-2008, 12:19 AM
from a quick view : you have a typo , vect4 -> vec4.
And you don't need to wrap it around vec4 at all since texture2D returns a vec4.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.