• ### Popular Now

• 15
• 15
• 11
• 9
• 10

This topic is 4500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i'm having a little problem with glsl... when i use the gl_LightSource[0].position, for example give me a link error... (20) : fatal error C9999: not a leaf in member select (39) I look everywhere for a error table of the glsl compiler with no sucess. So i'm really stuck with this error. And the strange thing is , if i made a typo, for example: gl_LightSource[0].posiion ( without the t ) the compiler complain that there is no posiion on the glLightParameters...
void main()
{
vec3 normal, lightDir;
vec4 diffuse;
float NdotL;

normal = normalize(gl_NormalMatrix * gl_Normal);

lightDir = normalize(vec3(gl_LightSource[0].position));

NdotL = max(dot(normal, lightDir), 0.0);

diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;

gl_FrontColor =  NdotL * diffuse;

gl_Position = ftransform();
}

here is the code of the vertex shader... i'm not using fragment shader as my board dos not support... is a onboard geforce 2 but it's accept the ARB_glsl_100

##### Share on other sites
hum... sorry... i forgot to mention... i have tryed this...

if i put, for example.. gl_LightSource[0].position.lll gives me a compile error as expected... but a gl_LightSource[0].position.xyz gives me a link error...

The mistery to me is that it's ocurring a link problem, not a compile error...

but thank you for the suggestion...

just editing to mention that the line thar the linker indicate the error.. is the last line of the file...

i'm really inclined to believe that may be a problem with my driver...

[Edited by - Xunil_RJ on November 27, 2005 8:29:06 AM]

##### Share on other sites
The shader looks fine (well, it compiles and links with a default fragment program in RenderMonkey), so the error might be in your attach/link code?

##### Share on other sites
well... i was using forceware 77.77... and i upload it to 81.something :) and now it's linking without errors...

but thank everyone that tryed to help :D