Jump to content
  • Advertisement
Sign in to follow this  
klepto2

GLSL Problem after installing new Catalyst 7.12

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a problem with some of my shaders and I can not find the failure due to the lack of deep shader knowledge. I have yesterday installed the Catalyst 7.12 Version for my X800 Pro gfx card. I was really happy to see that they have fixed the depthmap problems and some FBO issues. But later I have runned some of my older shadercode which I had tested a week ago. But what I should say, nothing than a black screen where the model should be. I have reverted to 7.11 and everything is running fine. But as I want to implement and test shadowmaps I want to have 7.12. This is how it should look: And this is the shader code itself: [fragment]
varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;
uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform float invRadius;

void main (void)
{
	float distSqr = dot(lightVec, lightVec);
	float att = clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0);
	vec3 lVec = lightVec * inversesqrt(distSqr);

	vec3 vVec = normalize(eyeVec);
	
	vec4 base = texture2D(colorMap, texCoord);
	
	vec3 bump = normalize( texture2D(normalMap, texCoord).xyz * 2.0 - 1.0);

	vec4 vAmbient = vec4(1.0,1.0,1.0,1.0) * gl_FrontMaterial.ambient;

	float diffuse = max( dot(lVec, bump), 0.0 );
	
	vec4 vDiffuse = vec4(1.0,1.0,1.0,1.0)  * gl_FrontMaterial.diffuse * 
					diffuse;	

	float specular = pow(clamp(dot(reflect(-lVec, bump), vVec), 0.0, 1.0), 
	                 gl_FrontMaterial.shininess );
	
	vec4 vSpecular = vec4(1.0,1.0,1.0,1.0) * gl_FrontMaterial.specular * 
					 specular;	
	
	gl_FragColor = ( vAmbient*base + 
					 vDiffuse*base + 
					 vSpecular) * att;
}

[vertex]
varying vec3 lightVec; 
varying vec3 eyeVec;
varying vec2 texCoord;
attribute vec3 vTangent; 
					 

void main(void)
{
	gl_Position = ftransform();
	texCoord = gl_MultiTexCoord0.xy;
	
	vec3 n = normalize(gl_NormalMatrix * gl_Normal);
	vec3 t = normalize(gl_NormalMatrix * vTangent);
	vec3 b = cross(n, t);
	
	vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
	vec3 tmpVec = normalize(vec3(gl_LightSource[0].position *gl_ModelViewMatrix) - vVertex);

	lightVec.x = dot(tmpVec, t);
	lightVec.y = dot(tmpVec, b);
	lightVec.z = dot(tmpVec, n);

	tmpVec = -vVertex;
	eyeVec.x = dot(tmpVec, t);
	eyeVec.y = dot(tmpVec, b);
	eyeVec.z = dot(tmpVec, n);
}

Also a small test application is available here: Click here Has ATI changed something with GLSL or are the new drivers simply broken? Any Ideas? thx in advance klepto2

Share this post


Link to post
Share on other sites
Advertisement
I've got a Radeon HD 2900 and has just upgraded my drivers to 7.12. I see the same thing here when running your application... blackness.

Just fiddling with your fragment-shader for a while i noticed that gl_LightSource[0].ambient, gl_LightSource[0].diffuse and gl_LightSource[0].specular seems to be zero. Don't know why though...

Share this post


Link to post
Share on other sites
thx

you're right, glLightSource seems to be zero. I have replaced the ambient, etc stuff by constant vec4 values and this seems to fix it. But I have also no idea why this stuff isn't working anymore.

The same executable was working on 7.11 and refuses to work on 7.12 .
I hope ATI will have a solution for this in relativly short time.

Share this post


Link to post
Share on other sites
It's better to use your own unifoms. Of course, you will have the same uniform present in all your shaders but at least you avoid the bug.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!