Shader Objects Types

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.

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.

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;

void main() 
{
    //float f = dot(normalize(lightDir), normalize(fragNormal));
    
	//gl_FragData[0] = vec4(clamp(f, 0.0, 1.0) * texture2D(baseTexSamp, vec2(gl_TexCoord[0])));
	
	gl_FragColor = vect4(texture2D(baseTexSamp, gl_TexCoord[0].st));
}

No vertex shader assigned, only this fragment.

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.