GLSL Problems on Radeon cards

Started by
3 comments, last by Mekanikles 16 years, 2 months ago
Hi, me and my friend have come across a very strange problem. It seems that, for us anyway, GLSL cannot utilize simple variables under Radeon cards (9800 and x1650 confirmed). If we set a local variable X to, say 1, reading it on the next line results in a 0; For example:

vec4 diffuseLighting(int X) {
	return gl_LightSource[X].diffuse;
}

void main()
{
	gl_FragColor = diffuseLighting(1);
}


This code allways displays the diffuse color for LIGHT0. If we, however, change the X to a 1 to directly access LIGHT1 then it works. Could this be a version or a driver problem? Or is GLSL poorly supported on Radeon cards? Any help would be greatly appreciated. Thnx /Mekanikles EDIT: Confirmed that it works on Nvidia cards. [Edited by - Mekanikles on February 22, 2008 4:49:33 AM]
Advertisement
You mean that it always index light 0 in the example above?

Previously "Krohm"

yes, variables allways reads as 0 regardless of what I set them to, in this case, it means that LIGHT0 is allways indexed.
It's a known bug.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Um, ok? Is there a solution then?

This topic is closed to new replies.

Advertisement