Celestia 1.4.0 PR 4 / OGL2 still buggy with ATI

Report bugs, bug fixes and workarounds here.
Topic author
Ynjevi
Posts: 132
Joined: 13.01.2003
With us: 21 years 10 months

Celestia 1.4.0 PR 4 / OGL2 still buggy with ATI

Post #1by Ynjevi » 01.11.2004, 17:48

I have 3D Club RADEON 9600 XT (driver v.6.14.10.6476) and Windows XP.

Now Saturn's rings show almost correctly except for the double shadow on the rings. Nothing else has changed :(

Image

Image

Image

Here's the error log:

Code: Select all

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: varying vec4 diffFactors;
  8: varying vec2 diffTexCoord;
  9: uniform float ringWidth;
 10: uniform float ringRadius;
 11: varying float ringShadowTexCoord0;
 12:
 13: void main(void)
 14: {
 15: float nDotVP;
 16: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 17: diffFactors.x = nDotVP;
 18: diffTexCoord = gl_MultiTexCoord0.st;
 19: vec3 ringShadowProj;
 20: ringShadowProj = gl_Vertex.xyz + lights[0].direction * max(0, gl_Vertex.y / -lights[0].direction.y);
 21: ringShadowTexCoord0 = length(ringShadowProj) * ringWidth - ringRadius;
 22: gl_Position = ftransform();
 23: }

Error compiling vertex shader:
ERROR: 0:20: 'max' : no matching overloaded function found
ERROR: 1 compilation errors.  No code generated.

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1);
  3: uniform vec3 lightcolor0;
  4: varying vec4 diffFactors;
  5: varying vec2 diffTexCoord;
  6: uniform sampler2D diffTex;
  7: uniform sampler2D ringTex;
  8: varying float ringShadowTexCoord0;
  9:
 10: void main(void)
 11: {
 12: vec4 color;
 13: float shadow;
 14: shadow = diffFactors.x;
 15: shadow *= (1.0 - texture2D(ringTex, vec2(ringShadowTexCoord0, 0.0)).a);
 16: diff += shadow * vec4(lightcolor0, 0.0);
 17: color = texture2D(diffTex, diffTexCoord.st);
 18: gl_FragColor = color * diff;
 19: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: uniform vec3 eyePosition;
  8: varying vec4 diffFactors;
  9: varying vec2 diffTexCoord;
 10: uniform vec4 shadowTexGenS0_0;
 11: uniform vec4 shadowTexGenT0_0;
 12: varying vec3 shadowTexCoord0_0;
 13:
 14: void main(void)
 15: {
 16: float nDotVP;
 17: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
 18: diffFactors.x = (dot(lights[0].direction, eyeDir) + 1.0) * 0.5;
 19: diffTexCoord = gl_MultiTexCoord0.st;
 20: shadowTexCoord0_0.x = dot(gl_Vertex, shadowTexGenS0_0);
 21: shadowTexCoord0_0.y = dot(gl_Vertex, shadowTexGenT0_0);
 22: shadowTexCoord0_0.z = dot(gl_Vertex.xyz, lights[0].direction);
 23: gl_Position = ftransform();
 24: }

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1);
  3: uniform vec3 lightcolor0;
  4: varying vec4 diffFactors;
  5: varying vec2 diffTexCoord;
  6: uniform sampler2D diffTex;
  7: varying vec3 shadowTexCoord0_0;
  8: uniform float shadowScale0_0;
  9: uniform float shadowBias0_0;
 10:
 11: void main(void)
 12: {
 13: vec4 color;
 14: float shadow;
 15: vec2 shadowCenter;
 16: float shadowR;
 17: shadow = 1.0;
 18: shadowCenter = shadowTexCoord0_0.st - vec2(0.5, 0.5);
 19: shadowR = clamp(dot(shadowCenter, shadowCenter) * shadowScale0_0 + shadowBias0_0, 0.0, 1.0);
 20: shadow *= sqrt(shadowR);
 21: shadow = min(1.0, shadow + step(0.0, shadowTexCoord0_0.z));
 22: diff += (shadow * diffFactors.x) * vec4(lightcolor0, 0.0);
 23: color = texture2D(diffTex, diffTexCoord.st);
 24: gl_FragColor = color * diff;
 25: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: uniform vec3 ambientColor;
  8: varying vec4 diff;
  9: varying vec2 diffTexCoord;
 10:
 11: void main(void)
 12: {
 13: float nDotVP;
 14: diff = vec4(ambientColor, 1);
 15: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 16: diff += vec4(lights[0].diffuse * nDotVP, 1.0);
 17: diffTexCoord = gl_MultiTexCoord0.st;
 18: gl_Position = ftransform();
 19: }

Fragment shader source:
  1: varying vec4 diff;
  2: varying vec2 diffTexCoord;
  3: uniform sampler2D diffTex;
  4:
  5: void main(void)
  6: {
  7: vec4 color;
  8: color = texture2D(diffTex, diffTexCoord.st);
  9: gl_FragColor = color * diff;
 10: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: uniform float shininess;
  8: uniform vec3 ambientColor;
  9: varying vec4 diff;
 10: varying vec4 spec;
 11: varying vec2 diffTexCoord;
 12:
 13: void main(void)
 14: {
 15: float nDotVP;
 16: float nDotHV;
 17: diff = vec4(ambientColor, 1);
 18: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 19: nDotHV = max(0.0, dot(gl_Normal, lights[0].halfVector));
 20: diff += vec4(lights[0].diffuse * nDotVP, 1.0);
 21: spec += vec4(lights[0].specular * (pow(nDotHV, shininess) * nDotVP), 0.0);
 22: diffTexCoord = gl_MultiTexCoord0.st;
 23: gl_Position = ftransform();
 24: }

Fragment shader source:
  1: varying vec4 diff;
  2: varying vec4 spec;
  3: varying vec2 diffTexCoord;
  4: uniform sampler2D diffTex;
  5:
  6: void main(void)
  7: {
  8: vec4 color;
  9: color = texture2D(diffTex, diffTexCoord.st);
 10: gl_FragColor = color * diff + color.a * spec;
 11: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: varying vec2 diffTexCoord;
  8: varying vec2 normTexCoord;
  9: varying vec3 lightDir0;
 10: attribute vec3 tangent;
 11:
 12: void main(void)
 13: {
 14: float nDotVP;
 15: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 16: vec3 bitangent = cross(gl_Normal, tangent);
 17: lightDir0.x = dot(tangent, lights[0].direction);
 18: lightDir0.y = dot(-bitangent, lights[0].direction);
 19: lightDir0.z = dot(gl_Normal, lights[0].direction);
 20: diffTexCoord = gl_MultiTexCoord0.st;
 21: normTexCoord = gl_MultiTexCoord1.st;
 22: gl_Position = ftransform();
 23: }

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1);
  3: uniform vec3 lightcolor0;
  4: varying vec2 diffTexCoord;
  5: uniform sampler2D diffTex;
  6: varying vec2 normTexCoord;
  7: varying vec3 lightDir0;
  8: uniform sampler2D normTex;
  9:
 10: void main(void)
 11: {
 12: vec4 color;
 13: vec3 n = texture2D(normTex, normTexCoord.st).xyz * 2.0 - vec3(1.0, 1.0, 1.0);
 14: float l;
 15: l = max(0.0, dot(lightDir0, n)) * clamp(lightDir0.z * 8.0, 0.0, 1.0);
 16: diff += vec4(l * lightcolor0, 0.0);
 17: color = texture2D(diffTex, diffTexCoord.st);
 18: gl_FragColor = color * diff;
 19: }

mk
Posts: 19
Joined: 28.11.2003
With us: 20 years 11 months
Location: Warsaw, Poland

Post #2by mk » 01.11.2004, 20:45

Similar situation with Radeon 9600 ('pro' 400/400; 256MB), Win XP and Omega Drivers 2.5.58

Code: Select all


Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: uniform float shininess;
  8: uniform vec3 ambientColor;
  9: varying vec4 diff;
 10: varying vec4 spec;
 11: varying vec2 diffTexCoord;
 12: varying vec2 nightTexCoord;
 13: varying float totalLight;
 14:
 15: void main(void)
 16: {
 17: float nDotVP;
 18: float nDotHV;
 19: diff = vec4(ambientColor, 1);
 20: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 21: nDotHV = max(0.0, dot(gl_Normal, lights[0].halfVector));
 22: diff += vec4(lights[0].diffuse * nDotVP, 1.0);
 23: spec += vec4(lights[0].specular * (pow(nDotHV, shininess) * nDotVP), 0.0);
 24: totalLight += nDotVP;
 25: totalLight = 1.0 - totalLight;
 26: totalLight = totalLight * totalLight * totalLight * totalLight;
 27: diffTexCoord = gl_MultiTexCoord0.st;
 28: nightTexCoord = gl_MultiTexCoord1.st;
 29: gl_Position = ftransform();
 30: }

Fragment shader source:
  1: varying vec4 diff;
  2: varying vec4 spec;
  3: varying vec2 diffTexCoord;
  4: uniform sampler2D diffTex;
  5: varying vec2 nightTexCoord;
  6: uniform sampler2D nightTex;
  7: varying float totalLight;
  8:
  9: void main(void)
 10: {
 11: vec4 color;
 12: color = texture2D(diffTex, diffTexCoord.st);
 13: gl_FragColor = color * diff + color.a * spec;
 14: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
 15: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: varying vec2 diffTexCoord;
  8: varying vec2 normTexCoord;
  9: varying vec3 lightDir0;
 10: attribute vec3 tangent;
 11:
 12: void main(void)
 13: {
 14: float nDotVP;
 15: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 16: vec3 bitangent = cross(gl_Normal, tangent);
 17: lightDir0.x = dot(tangent, lights[0].direction);
 18: lightDir0.y = dot(-bitangent, lights[0].direction);
 19: lightDir0.z = dot(gl_Normal, lights[0].direction);
 20: diffTexCoord = gl_MultiTexCoord0.st;
 21: normTexCoord = gl_MultiTexCoord1.st;
 22: gl_Position = ftransform();
 23: }

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1);
  3: uniform vec3 lightcolor0;
  4: varying vec2 diffTexCoord;
  5: uniform sampler2D diffTex;
  6: varying vec2 normTexCoord;
  7: varying vec3 lightDir0;
  8: uniform sampler2D normTex;
  9:
 10: void main(void)
 11: {
 12: vec4 color;
 13: vec3 n = texture2D(normTex, normTexCoord.st).xyz * 2.0 - vec3(1.0, 1.0, 1.0);
 14: float l;
 15: l = max(0.0, dot(lightDir0, n)) * clamp(lightDir0.z * 8.0, 0.0, 1.0);
 16: diff += vec4(l * lightcolor0, 0.0);
 17: color = texture2D(diffTex, diffTexCoord.st);
 18: gl_FragColor = color * diff;
 19: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: uniform vec3 ambientColor;
  8: varying vec4 diff;
  9: varying vec2 diffTexCoord;
 10:
 11: void main(void)
 12: {
 13: float nDotVP;
 14: diff = vec4(ambientColor, 1);
 15: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 16: diff += vec4(lights[0].diffuse * nDotVP, 1.0);
 17: diffTexCoord = gl_MultiTexCoord0.st;
 18: gl_Position = ftransform();
 19: }

Fragment shader source:
  1: varying vec4 diff;
  2: varying vec2 diffTexCoord;
  3: uniform sampler2D diffTex;
  4:
  5: void main(void)
  6: {
  7: vec4 color;
  8: color = texture2D(diffTex, diffTexCoord.st);
  9: gl_FragColor = color * diff;
 10: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: varying vec4 diffFactors;
  8: varying vec2 diffTexCoord;
  9: uniform float ringWidth;
 10: uniform float ringRadius;
 11: varying float ringShadowTexCoord0;
 12:
 13: void main(void)
 14: {
 15: float nDotVP;
 16: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
 17: diffFactors.x = nDotVP;
 18: diffTexCoord = gl_MultiTexCoord0.st;
 19: vec3 ringShadowProj;
 20: ringShadowProj = gl_Vertex.xyz + lights[0].direction * max(0, gl_Vertex.y / -lights[0].direction.y);
 21: ringShadowTexCoord0 = length(ringShadowProj) * ringWidth - ringRadius;
 22: gl_Position = ftransform();
 23: }

Error compiling vertex shader:
ERROR: 0:20: 'max' : no matching overloaded function found
ERROR: 1 compilation errors.  No code generated.

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1);
  3: uniform vec3 lightcolor0;
  4: varying vec4 diffFactors;
  5: varying vec2 diffTexCoord;
  6: uniform sampler2D diffTex;
  7: uniform sampler2D ringTex;
  8: varying float ringShadowTexCoord0;
  9:
 10: void main(void)
 11: {
 12: vec4 color;
 13: float shadow;
 14: shadow = diffFactors.x;
 15: shadow *= (1.0 - texture2D(ringTex, vec2(ringShadowTexCoord0, 0.0)).a);
 16: diff += shadow * vec4(lightcolor0, 0.0);
 17: color = texture2D(diffTex, diffTexCoord.st);
 18: gl_FragColor = color * diff;
 19: }

Vertex shader source:
  1: uniform struct {
  2:    vec3 direction;
  3:    vec3 diffuse;
  4:    vec3 specular;
  5:    vec3 halfVector;
  6: } lights[1];
  7: uniform vec3 eyePosition;
  8: varying vec4 diffFactors;
  9: varying vec2 diffTexCoord;
 10: uniform vec4 shadowTexGenS0_0;
 11: uniform vec4 shadowTexGenT0_0;
 12: varying vec3 shadowTexCoord0_0;
 13:
 14: void main(void)
 15: {
 16: float nDotVP;
 17: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
 18: diffFactors.x = (dot(lights[0].direction, eyeDir) + 1.0) * 0.5;
 19: diffTexCoord = gl_MultiTexCoord0.st;
 20: shadowTexCoord0_0.x = dot(gl_Vertex, shadowTexGenS0_0);
 21: shadowTexCoord0_0.y = dot(gl_Vertex, shadowTexGenT0_0);
 22: shadowTexCoord0_0.z = dot(gl_Vertex.xyz, lights[0].direction);
 23: gl_Position = ftransform();
 24: }

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1);
  3: uniform vec3 lightcolor0;
  4: varying vec4 diffFactors;
  5: varying vec2 diffTexCoord;
  6: uniform sampler2D diffTex;
  7: varying vec3 shadowTexCoord0_0;
  8: uniform float shadowScale0_0;
  9: uniform float shadowBias0_0;
 10:
 11: void main(void)
 12: {
 13: vec4 color;
 14: float shadow;
 15: vec2 shadowCenter;
 16: float shadowR;
 17: shadow = 1.0;
 18: shadowCenter = shadowTexCoord0_0.st - vec2(0.5, 0.5);
 19: shadowR = clamp(dot(shadowCenter, shadowCenter) * shadowScale0_0 + shadowBias0_0, 0.0, 1.0);
 20: shadow *= sqrt(shadowR);
 21: shadow = min(1.0, shadow + step(0.0, shadowTexCoord0_0.z));
 22: diff += (shadow * diffFactors.x) * vec4(lightcolor0, 0.0);
 23: color = texture2D(diffTex, diffTexCoord.st);
 24: gl_FragColor = color * diff;
 25: }

mk

Commander David
Posts: 73
Joined: 27.06.2002
With us: 22 years 4 months
Location: Germany
Contact:

Post #3by Commander David » 01.11.2004, 21:58

Hi Chris,

here is my Shader.log on a ATI 9500 non Pro

Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: uniform float shininess;
8: uniform vec3 ambientColor;
9: varying vec4 diff;
10: varying vec4 spec;
11: varying vec2 diffTexCoord;
12: varying vec2 nightTexCoord;
13: varying float totalLight;
14:
15: void main(void)
16: {
17: float nDotVP;
18: float nDotHV;
19: diff = vec4(ambientColor, 1);
20: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
21: nDotHV = max(0.0, dot(gl_Normal, lights[0].halfVector));
22: diff += vec4(lights[0].diffuse * nDotVP, 1.0);
23: spec += vec4(lights[0].specular * (pow(nDotHV, shininess) * nDotVP), 0.0);
24: totalLight += nDotVP;
25: totalLight = 1.0 - totalLight;
26: totalLight = totalLight * totalLight * totalLight * totalLight;
27: diffTexCoord = gl_MultiTexCoord0.st;
28: nightTexCoord = gl_MultiTexCoord1.st;
29: gl_Position = ftransform();
30: }

Fragment shader source:
1: varying vec4 diff;
2: varying vec4 spec;
3: varying vec2 diffTexCoord;
4: uniform sampler2D diffTex;
5: varying vec2 nightTexCoord;
6: uniform sampler2D nightTex;
7: varying float totalLight;
8:
9: void main(void)
10: {
11: vec4 color;
12: color = texture2D(diffTex, diffTexCoord.st);
13: gl_FragColor = color * diff + color.a * spec;
14: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
15: }

Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: varying vec2 diffTexCoord;
8: varying vec2 normTexCoord;
9: varying vec3 lightDir0;
10: attribute vec3 tangent;
11:
12: void main(void)
13: {
14: float nDotVP;
15: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
16: vec3 bitangent = cross(gl_Normal, tangent);
17: lightDir0.x = dot(tangent, lights[0].direction);
18: lightDir0.y = dot(-bitangent, lights[0].direction);
19: lightDir0.z = dot(gl_Normal, lights[0].direction);
20: diffTexCoord = gl_MultiTexCoord0.st;
21: normTexCoord = gl_MultiTexCoord1.st;
22: gl_Position = ftransform();
23: }

Fragment shader source:
1: uniform vec3 ambientColor;
2: vec4 diff = vec4(ambientColor, 1);
3: uniform vec3 lightcolor0;
4: varying vec2 diffTexCoord;
5: uniform sampler2D diffTex;
6: varying vec2 normTexCoord;
7: varying vec3 lightDir0;
8: uniform sampler2D normTex;
9:
10: void main(void)
11: {
12: vec4 color;
13: vec3 n = texture2D(normTex, normTexCoord.st).xyz * 2.0 - vec3(1.0, 1.0, 1.0);
14: float l;
15: l = max(0.0, dot(lightDir0, n)) * clamp(lightDir0.z * 8.0, 0.0, 1.0);
16: diff += vec4(l * lightcolor0, 0.0);
17: color = texture2D(diffTex, diffTexCoord.st);
18: gl_FragColor = color * diff;
19: }
Celestia on my System:
AMD Barton 2800+@3000+
1024 MB DDR-RAM
ATI Radeon 9500 non Pro 128MB
_________________
However if God is a mistake, then I do not regret anything. More worth living than this mistake did not give it.

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #4by chris » 01.11.2004, 22:22

Commander David,

What sort of visual results are you getting? I don't see any compilation errors at least . . .

--Chris

symaski62
Posts: 610
Joined: 01.05.2004
Age: 41
With us: 20 years 6 months
Location: france, divion

Post #5by symaski62 » 01.11.2004, 23:06

Image

8)
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Commander David
Posts: 73
Joined: 27.06.2002
With us: 22 years 4 months
Location: Germany
Contact:

Post #6by Commander David » 02.11.2004, 09:39

Chris,

i see the same error`s as Ynjevi in this post. Saturn has 2 ringshadows and appear`s red. Moons, mercury, venus (without athmosphere), jupiter, uranus, neptun are black. Pluto are green/blue. (See screenshots)

Image

Image

Image

And the ShaderLog:


Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: varying vec4 diffFactors;
8: varying vec2 diffTexCoord;
9: uniform float ringWidth;
10: uniform float ringRadius;
11: varying float ringShadowTexCoord0;
12:
13: void main(void)
14: {
15: float nDotVP;
16: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
17: diffFactors.x = nDotVP;
18: diffTexCoord = gl_MultiTexCoord0.st;
19: vec3 ringShadowProj;
20: ringShadowProj = gl_Vertex.xyz + lights[0].direction * max(0, gl_Vertex.y / -lights[0].direction.y);
21: ringShadowTexCoord0 = length(ringShadowProj) * ringWidth - ringRadius;
22: gl_Position = ftransform();
23: }

Error compiling vertex shader:
ERROR: 0:20: 'max' : no matching overloaded function found
ERROR: 1 compilation errors. No code generated.

Fragment shader source:
1: uniform vec3 ambientColor;
2: vec4 diff = vec4(ambientColor, 1);
3: uniform vec3 lightcolor0;
4: varying vec4 diffFactors;
5: varying vec2 diffTexCoord;
6: uniform sampler2D diffTex;
7: uniform sampler2D ringTex;
8: varying float ringShadowTexCoord0;
9:
10: void main(void)
11: {
12: vec4 color;
13: float shadow;
14: shadow = diffFactors.x;
15: shadow *= (1.0 - texture2D(ringTex, vec2(ringShadowTexCoord0, 0.0)).a);
16: diff += shadow * vec4(lightcolor0, 0.0);
17: color = texture2D(diffTex, diffTexCoord.st);
18: gl_FragColor = color * diff;
19: }

Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: uniform vec3 eyePosition;
8: varying vec4 diffFactors;
9: varying vec2 diffTexCoord;
10: uniform vec4 shadowTexGenS0_0;
11: uniform vec4 shadowTexGenT0_0;
12: varying vec3 shadowTexCoord0_0;
13:
14: void main(void)
15: {
16: float nDotVP;
17: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
18: diffFactors.x = (dot(lights[0].direction, eyeDir) + 1.0) * 0.5;
19: diffTexCoord = gl_MultiTexCoord0.st;
20: shadowTexCoord0_0.x = dot(gl_Vertex, shadowTexGenS0_0);
21: shadowTexCoord0_0.y = dot(gl_Vertex, shadowTexGenT0_0);
22: shadowTexCoord0_0.z = dot(gl_Vertex.xyz, lights[0].direction);
23: gl_Position = ftransform();
24: }

Fragment shader source:
1: uniform vec3 ambientColor;
2: vec4 diff = vec4(ambientColor, 1);
3: uniform vec3 lightcolor0;
4: varying vec4 diffFactors;
5: varying vec2 diffTexCoord;
6: uniform sampler2D diffTex;
7: varying vec3 shadowTexCoord0_0;
8: uniform float shadowScale0_0;
9: uniform float shadowBias0_0;
10:
11: void main(void)
12: {
13: vec4 color;
14: float shadow;
15: vec2 shadowCenter;
16: float shadowR;
17: shadow = 1.0;
18: shadowCenter = shadowTexCoord0_0.st - vec2(0.5, 0.5);
19: shadowR = clamp(dot(shadowCenter, shadowCenter) * shadowScale0_0 + shadowBias0_0, 0.0, 1.0);
20: shadow *= sqrt(shadowR);
21: shadow = min(1.0, shadow + step(0.0, shadowTexCoord0_0.z));
22: diff += (shadow * diffFactors.x) * vec4(lightcolor0, 0.0);
23: color = texture2D(diffTex, diffTexCoord.st);
24: gl_FragColor = color * diff;
25: }

Vertex shader source:
1: uniform struct {
2: vec3 direction;
3: vec3 diffuse;
4: vec3 specular;
5: vec3 halfVector;
6: } lights[1];
7: uniform float shininess;
8: uniform vec3 ambientColor;
9: varying vec4 diff;
10: varying vec4 spec;
11: varying vec2 diffTexCoord;
12: varying vec2 specTexCoord;
13:
14: void main(void)
15: {
16: float nDotVP;
17: float nDotHV;
18: diff = vec4(ambientColor, 1);
19: nDotVP = max(0.0, dot(gl_Normal, lights[0].direction));
20: nDotHV = max(0.0, dot(gl_Normal, lights[0].halfVector));
21: diff += vec4(lights[0].diffuse * nDotVP, 1.0);
22: spec += vec4(lights[0].specular * (pow(nDotHV, shininess) * nDotVP), 0.0);
23: diffTexCoord = gl_MultiTexCoord0.st;
24: specTexCoord = gl_MultiTexCoord1.st;
25: gl_Position = ftransform();
26: }

Fragment shader source:
1: varying vec4 diff;
2: varying vec4 spec;
3: varying vec2 diffTexCoord;
4: uniform sampler2D diffTex;
5: varying vec2 specTexCoord;
6: uniform sampler2D specTex;
7:
8: void main(void)
9: {
10: vec4 color;
11: color = texture2D(diffTex, diffTexCoord.st);
12: gl_FragColor = color * diff + texture2D(specTex, specTexCoord.st) * spec;
13: }
Celestia on my System:

AMD Barton 2800+@3000+

1024 MB DDR-RAM

ATI Radeon 9500 non Pro 128MB

_________________

However if God is a mistake, then I do not regret anything. More worth living than this mistake did not give it.

Gordon
Posts: 83
Joined: 17.04.2003
With us: 21 years 7 months
Location: Paris, France

Post #7by Gordon » 14.11.2004, 10:18

Hi,

I have the same problem with an ATI 9600 Pro and the last release.

When I do open GL info I get this :

Vendor: ATI Technologies Inc.
Renderer: RADEON 9600 x86/MMX/3DNow!/SSE
Version: 1.5.4707 WinXP Release
Max simultaneous textures: 8
Max texture size: 2048

Look like the Open GL 2 is not installed but I have the last driver from ATI installed.

Am I right or wrong ? Is there something to do ?

Thank you
Gordon


Return to “Bugs”