Hi all:
I downloaded and installed the new Celestia 1.5.0. By default, it seems to use the OpenGL 2.0 graphics style, but it doesn't work to me: all planets have a red look. That is, it does not apply textures. All the other graphics styles seems to work fine. Any suggestion? Does anyone else have the same problem as me?
Nevertheless, I have to add that the latest 1.4.x release works me fine with the OpenGL 2.0, too.
Thanks!
Gallas
--
Celestia 1.5.0 & OpenGL 2.0
- Adirondack
- Posts: 528
- Joined: 01.03.2004
- With us: 20 years 8 months
"red look" means that the graphics driver is reporting an error when it compiles the vertex shaders. As Adirondack said, the very first thing to do is to update your computer's graphics drivers. They're downloadable for free from the Website of either the company that made your computer or the company that made your graphics card. Be sure to deinstall the old drivers, reboot, install the new drivers and reboot again. Otherwise they will *not* install properly.
If that does not fix your problem, please provide a copy of shaders.log. It includes the exact shader error message. Celestia writes that file in the directory where you started Celestia. It's likely to be on your desktop. Also, please provide the details about your graphics hardware and OpenGL software. It's available in Celestia's Help menu, OpenGL Info.
If that does not fix your problem, please provide a copy of shaders.log. It includes the exact shader error message. Celestia writes that file in the directory where you started Celestia. It's likely to be on your desktop. Also, please provide the details about your graphics hardware and OpenGL software. It's available in Celestia's Help menu, OpenGL Info.
Selden
-
- Posts: 114
- Joined: 21.07.2004
- Age: 50
- With us: 20 years 3 months
- Location: Regensburg, Germany
Gallas wrote:Thanks to both. I will try it.
But, in spite of working fine the 1.4.x version (with OpenGL 2.0), do you really think that it has to do with drivers?
Regards,
Gallas
--
Indeed Celestia 1.5.0 comes with many new features that require recent graphics drivers. Remember that Celestia 1.4.1 is almost two years old!
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
Re: Celestia 1.5.0 & OpenGL 2.0
Gallas wrote:Hi all:
I downloaded and installed the new Celestia 1.5.0. By default, it seems to use the OpenGL 2.0 graphics style, but it doesn't work to me: all planets have a red look. That is, it does not apply textures. All the other graphics styles seems to work fine. Any suggestion? Does anyone else have the same problem as me?
Nevertheless, I have to add that the latest 1.4.x release works me fine with the OpenGL 2.0, too.
Thanks!
Gallas
--
What graphics card do you have in your system? And are you running Windows, Mac OS X, or Linux?
--Chris
I am running in a Windows XP SP1. The main board is a 2.84 GHz CPU with 1.5 GB RAM memory. The graphics card is a nVidia GeForce FX5200 128 MB.
I am downloading the most recent nVidia driver, but it will take me long time with my 56 KB connection before I can try it.
Meanwhile, this is the "shaders.log" file that Celestia 1.5.0 creates when I start it up. (Sorry I do not know how to attach a file, so I am inserting the text bellow).
--->
Vertex shader source:
1: #version 110
2: uniform vec3 light0_direction;
3: uniform vec3 light0_diffuse;
4: uniform vec3 light0_specular;
5: uniform vec3 light0_halfVector;
6: uniform vec3 eyePosition;
7: varying vec2 diffTexCoord;
8: varying vec2 nightTexCoord;
9: uniform float textureOffset;
10: uniform vec3 atmosphereRadius;
11: uniform float mieCoeff;
12: uniform float mieH;
13: uniform float mieK;
14: uniform vec3 rayleighCoeff;
15: uniform float rayleighH;
16: uniform vec3 scatterCoeffSum;
17: uniform vec3 invScatterCoeffSum;
18: uniform vec3 extinctionCoeff;
19: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
20: float NV = dot(gl_Normal, eyeDir);
21: varying vec4 diffFactors;
22: varying vec3 normal;
23: varying vec3 lightHalfVec0;
24: varying vec3 scatterEx;
25: uniform float cloudShadowTexOffset;
26: uniform float cloudHeight;
27: varying vec2 cloudShadowTexCoord0;
28:
29: void main(void)
30: {
31: float NL;
32: normal = gl_Normal;
33: NL = max(0.0, dot(gl_Normal, light0_direction));
34: diffFactors.x = NL;
35: lightHalfVec0 = light0_direction + eyeDir;
36: diffTexCoord = gl_MultiTexCoord0.st + vec2(textureOffset, 0.0);
37: nightTexCoord = gl_MultiTexCoord1.st;
38: {
39: cloudShadowTexCoord0 = vec2(diffTexCoord.x + cloudShadowTexOffset, diffTexCoord.y);
40: }
41: {
42: float rq = dot(eyePosition, eyeDir);
43: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
44: float d = sqrt(rq * rq - qq);
45: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
46: vec3 atmLeave = gl_Vertex.xyz;
47: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
48: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
49: rq = dot(atmSamplePointSun, light0_direction);
50: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
51: d = sqrt(rq * rq - qq);
52: float distSun = -rq + d;
53: float distAtm = length(atmEnter - atmLeave);
54: float density = 0.0;
55: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
56: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
57: density += exp(-h * mieH);
58: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
59: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
60: density += exp(-h * mieH);
61: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
62: vec3 ex = exp(-extinctionCoeff * density * distAtm);
63: float cosTheta = dot(eyeDir, light0_direction);
64: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
65: float phRayleigh = 1.0;
66: scatterEx = ex;
67: gl_FrontSecondaryColor.rgb = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
68: }
69: gl_Position = ftransform();
70: }
Error compiling vertex shader:
(1) : error C0104: Unknown pre-processor directive #version
Fragment shader source:
1: #version 110
2: uniform sampler2D diffTex;
3: uniform sampler2D nightTex;
4: varying vec2 diffTexCoord;
5: varying vec2 nightTexCoord;
6: uniform vec3 ambientColor;
7: uniform float opacity;
8: varying vec4 diffFactors;
9: vec4 diff = vec4(ambientColor, opacity);
10: varying vec3 normal;
11: vec4 spec = vec4(0.0);
12: uniform float shininess;
13: varying vec3 lightHalfVec0;
14: uniform vec3 lightcolor0;
15: uniform vec3 lightspecColor0;
16: varying vec3 scatterEx;
17: uniform sampler2D cloudShadowTex;
18: varying vec2 cloudShadowTexCoord0;
19:
20: void main(void)
21: {
22: vec4 color;
23: float shadow;
24: float NH;
25: vec3 n = normalize(normal);
26: shadow = diffFactors.x;
27: shadow *= (1.0 - texture2D(cloudShadowTex, cloudShadowTexCoord0).a * 0.75);
28: diff.rgb += shadow * lightcolor0;
29: NH = max(0.0, dot(n, normalize(lightHalfVec0)));
30: spec.rgb += shadow * pow(NH, shininess) * lightspecColor0;
31: color = texture2D(diffTex, diffTexCoord.st);
32: gl_FragColor = color * diff + float(color.a) * spec;
33: float totalLight = diffFactors.x;
34: totalLight = 1.0 - totalLight;
35: totalLight = totalLight * totalLight * totalLight * totalLight;
36: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
37: gl_FragColor.rgb = gl_FragColor.rgb * scatterEx + gl_SecondaryColor.rgb;
38: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
Vertex shader source:
1: #version 110
2: uniform vec3 light0_direction;
3: uniform vec3 light0_diffuse;
4: uniform vec3 light0_specular;
5: uniform vec3 light0_halfVector;
6: uniform vec3 eyePosition;
7: varying vec2 diffTexCoord;
8: uniform float textureOffset;
9: uniform vec3 atmosphereRadius;
10: uniform float mieCoeff;
11: uniform float mieH;
12: uniform float mieK;
13: uniform vec3 rayleighCoeff;
14: uniform float rayleighH;
15: uniform vec3 scatterCoeffSum;
16: uniform vec3 invScatterCoeffSum;
17: uniform vec3 extinctionCoeff;
18: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
19: float NV = dot(gl_Normal, eyeDir);
20: uniform vec3 ambientColor;
21: uniform float opacity;
22: varying vec4 diff;
23: varying vec3 scatterEx;
24:
25: void main(void)
26: {
27: float NL;
28: diff = vec4(ambientColor, opacity);
29: NL = max(0.0, dot(gl_Normal, light0_direction));
30: diff.rgb += light0_diffuse * NL;
31: diffTexCoord = gl_MultiTexCoord0.st + vec2(textureOffset, 0.0);
32: {
33: float rq = dot(eyePosition, eyeDir);
34: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
35: float d = sqrt(rq * rq - qq);
36: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
37: vec3 atmLeave = gl_Vertex.xyz;
38: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
39: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
40: rq = dot(atmSamplePointSun, light0_direction);
41: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
42: d = sqrt(rq * rq - qq);
43: float distSun = -rq + d;
44: float distAtm = length(atmEnter - atmLeave);
45: float density = 0.0;
46: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
47: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
48: density += exp(-h * mieH);
49: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
50: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
51: density += exp(-h * mieH);
52: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
53: vec3 ex = exp(-extinctionCoeff * density * distAtm);
54: float cosTheta = dot(eyeDir, light0_direction);
55: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
56: float phRayleigh = 1.0;
57: scatterEx = ex;
58: gl_FrontSecondaryColor.rgb = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
59: }
60: gl_Position = ftransform();
61: }
Error compiling vertex shader:
(1) : error C0104: Unknown pre-processor directive #version
Fragment shader source:
1: #version 110
2: uniform sampler2D diffTex;
3: varying vec2 diffTexCoord;
4: varying vec4 diff;
5: varying vec3 scatterEx;
6:
7: void main(void)
8: {
9: vec4 color;
10: color = texture2D(diffTex, diffTexCoord.st);
11: gl_FragColor = color * diff;
12: gl_FragColor.rgb = gl_FragColor.rgb * scatterEx + gl_SecondaryColor.rgb;
13: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
Vertex shader source:
1: #version 110
2: uniform vec3 light0_direction;
3: uniform vec3 light0_diffuse;
4: uniform vec3 light0_specular;
5: uniform vec3 light0_halfVector;
6: uniform vec3 eyePosition;
7: uniform vec3 atmosphereRadius;
8: uniform float mieCoeff;
9: uniform float mieH;
10: uniform float mieK;
11: uniform vec3 rayleighCoeff;
12: uniform float rayleighH;
13: uniform vec3 scatterCoeffSum;
14: uniform vec3 invScatterCoeffSum;
15: uniform vec3 extinctionCoeff;
16: varying vec3 scatteredColor0;
17: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
18: float NV = dot(gl_Normal, eyeDir);
19: varying vec3 scatterEx;
20: varying vec3 eyeDir_obj;
21:
22: void main(void)
23: {
24: float NL;
25: {
26: float rq = dot(eyePosition, eyeDir);
27: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
28: float d = sqrt(rq * rq - qq);
29: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
30: vec3 atmLeave = gl_Vertex.xyz;
31: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
32: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
33: rq = dot(atmSamplePointSun, light0_direction);
34: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
35: d = sqrt(rq * rq - qq);
36: float distSun = -rq + d;
37: float distAtm = length(atmEnter - atmLeave);
38: float density = 0.0;
39: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
40: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
41: density += exp(-h * mieH);
42: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
43: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
44: density += exp(-h * mieH);
45: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
46: vec3 ex = exp(-extinctionCoeff * density * distAtm);
47: scatterEx = ex;
48: scatteredColor0 = sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
49: }
50: eyeDir_obj = eyeDir;
51: gl_Position = ftransform();
52: }
Error compiling vertex shader:
(1) : error C0104: Unknown pre-processor directive #version
Fragment shader source:
1: #version 110
2: varying vec3 scatterEx;
3: varying vec3 eyeDir_obj;
4: uniform float mieK;
5: uniform float mieCoeff;
6: uniform vec3 rayleighCoeff;
7: uniform vec3 invScatterCoeffSum;
8: uniform vec3 light0_direction;
9: varying vec3 scatteredColor0;
10:
11: void main(void)
12: {
13: vec3 color = vec3(0.0, 0.0, 0.0);
14: vec3 V = normalize(eyeDir_obj);
15: float cosTheta = dot(V, light0_direction);
16: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
17: float phRayleigh = 1.0;
18: color += (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * scatteredColor0;
19: gl_FragColor = vec4(color, dot(scatterEx, vec3(0.333, 0.333, 0.333)));
20: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
<---
Thanks,
Gallas
--
I am downloading the most recent nVidia driver, but it will take me long time with my 56 KB connection before I can try it.
Meanwhile, this is the "shaders.log" file that Celestia 1.5.0 creates when I start it up. (Sorry I do not know how to attach a file, so I am inserting the text bellow).
--->
Vertex shader source:
1: #version 110
2: uniform vec3 light0_direction;
3: uniform vec3 light0_diffuse;
4: uniform vec3 light0_specular;
5: uniform vec3 light0_halfVector;
6: uniform vec3 eyePosition;
7: varying vec2 diffTexCoord;
8: varying vec2 nightTexCoord;
9: uniform float textureOffset;
10: uniform vec3 atmosphereRadius;
11: uniform float mieCoeff;
12: uniform float mieH;
13: uniform float mieK;
14: uniform vec3 rayleighCoeff;
15: uniform float rayleighH;
16: uniform vec3 scatterCoeffSum;
17: uniform vec3 invScatterCoeffSum;
18: uniform vec3 extinctionCoeff;
19: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
20: float NV = dot(gl_Normal, eyeDir);
21: varying vec4 diffFactors;
22: varying vec3 normal;
23: varying vec3 lightHalfVec0;
24: varying vec3 scatterEx;
25: uniform float cloudShadowTexOffset;
26: uniform float cloudHeight;
27: varying vec2 cloudShadowTexCoord0;
28:
29: void main(void)
30: {
31: float NL;
32: normal = gl_Normal;
33: NL = max(0.0, dot(gl_Normal, light0_direction));
34: diffFactors.x = NL;
35: lightHalfVec0 = light0_direction + eyeDir;
36: diffTexCoord = gl_MultiTexCoord0.st + vec2(textureOffset, 0.0);
37: nightTexCoord = gl_MultiTexCoord1.st;
38: {
39: cloudShadowTexCoord0 = vec2(diffTexCoord.x + cloudShadowTexOffset, diffTexCoord.y);
40: }
41: {
42: float rq = dot(eyePosition, eyeDir);
43: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
44: float d = sqrt(rq * rq - qq);
45: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
46: vec3 atmLeave = gl_Vertex.xyz;
47: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
48: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
49: rq = dot(atmSamplePointSun, light0_direction);
50: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
51: d = sqrt(rq * rq - qq);
52: float distSun = -rq + d;
53: float distAtm = length(atmEnter - atmLeave);
54: float density = 0.0;
55: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
56: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
57: density += exp(-h * mieH);
58: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
59: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
60: density += exp(-h * mieH);
61: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
62: vec3 ex = exp(-extinctionCoeff * density * distAtm);
63: float cosTheta = dot(eyeDir, light0_direction);
64: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
65: float phRayleigh = 1.0;
66: scatterEx = ex;
67: gl_FrontSecondaryColor.rgb = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
68: }
69: gl_Position = ftransform();
70: }
Error compiling vertex shader:
(1) : error C0104: Unknown pre-processor directive #version
Fragment shader source:
1: #version 110
2: uniform sampler2D diffTex;
3: uniform sampler2D nightTex;
4: varying vec2 diffTexCoord;
5: varying vec2 nightTexCoord;
6: uniform vec3 ambientColor;
7: uniform float opacity;
8: varying vec4 diffFactors;
9: vec4 diff = vec4(ambientColor, opacity);
10: varying vec3 normal;
11: vec4 spec = vec4(0.0);
12: uniform float shininess;
13: varying vec3 lightHalfVec0;
14: uniform vec3 lightcolor0;
15: uniform vec3 lightspecColor0;
16: varying vec3 scatterEx;
17: uniform sampler2D cloudShadowTex;
18: varying vec2 cloudShadowTexCoord0;
19:
20: void main(void)
21: {
22: vec4 color;
23: float shadow;
24: float NH;
25: vec3 n = normalize(normal);
26: shadow = diffFactors.x;
27: shadow *= (1.0 - texture2D(cloudShadowTex, cloudShadowTexCoord0).a * 0.75);
28: diff.rgb += shadow * lightcolor0;
29: NH = max(0.0, dot(n, normalize(lightHalfVec0)));
30: spec.rgb += shadow * pow(NH, shininess) * lightspecColor0;
31: color = texture2D(diffTex, diffTexCoord.st);
32: gl_FragColor = color * diff + float(color.a) * spec;
33: float totalLight = diffFactors.x;
34: totalLight = 1.0 - totalLight;
35: totalLight = totalLight * totalLight * totalLight * totalLight;
36: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
37: gl_FragColor.rgb = gl_FragColor.rgb * scatterEx + gl_SecondaryColor.rgb;
38: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
Vertex shader source:
1: #version 110
2: uniform vec3 light0_direction;
3: uniform vec3 light0_diffuse;
4: uniform vec3 light0_specular;
5: uniform vec3 light0_halfVector;
6: uniform vec3 eyePosition;
7: varying vec2 diffTexCoord;
8: uniform float textureOffset;
9: uniform vec3 atmosphereRadius;
10: uniform float mieCoeff;
11: uniform float mieH;
12: uniform float mieK;
13: uniform vec3 rayleighCoeff;
14: uniform float rayleighH;
15: uniform vec3 scatterCoeffSum;
16: uniform vec3 invScatterCoeffSum;
17: uniform vec3 extinctionCoeff;
18: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
19: float NV = dot(gl_Normal, eyeDir);
20: uniform vec3 ambientColor;
21: uniform float opacity;
22: varying vec4 diff;
23: varying vec3 scatterEx;
24:
25: void main(void)
26: {
27: float NL;
28: diff = vec4(ambientColor, opacity);
29: NL = max(0.0, dot(gl_Normal, light0_direction));
30: diff.rgb += light0_diffuse * NL;
31: diffTexCoord = gl_MultiTexCoord0.st + vec2(textureOffset, 0.0);
32: {
33: float rq = dot(eyePosition, eyeDir);
34: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
35: float d = sqrt(rq * rq - qq);
36: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
37: vec3 atmLeave = gl_Vertex.xyz;
38: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
39: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
40: rq = dot(atmSamplePointSun, light0_direction);
41: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
42: d = sqrt(rq * rq - qq);
43: float distSun = -rq + d;
44: float distAtm = length(atmEnter - atmLeave);
45: float density = 0.0;
46: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
47: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
48: density += exp(-h * mieH);
49: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
50: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
51: density += exp(-h * mieH);
52: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
53: vec3 ex = exp(-extinctionCoeff * density * distAtm);
54: float cosTheta = dot(eyeDir, light0_direction);
55: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
56: float phRayleigh = 1.0;
57: scatterEx = ex;
58: gl_FrontSecondaryColor.rgb = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
59: }
60: gl_Position = ftransform();
61: }
Error compiling vertex shader:
(1) : error C0104: Unknown pre-processor directive #version
Fragment shader source:
1: #version 110
2: uniform sampler2D diffTex;
3: varying vec2 diffTexCoord;
4: varying vec4 diff;
5: varying vec3 scatterEx;
6:
7: void main(void)
8: {
9: vec4 color;
10: color = texture2D(diffTex, diffTexCoord.st);
11: gl_FragColor = color * diff;
12: gl_FragColor.rgb = gl_FragColor.rgb * scatterEx + gl_SecondaryColor.rgb;
13: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
Vertex shader source:
1: #version 110
2: uniform vec3 light0_direction;
3: uniform vec3 light0_diffuse;
4: uniform vec3 light0_specular;
5: uniform vec3 light0_halfVector;
6: uniform vec3 eyePosition;
7: uniform vec3 atmosphereRadius;
8: uniform float mieCoeff;
9: uniform float mieH;
10: uniform float mieK;
11: uniform vec3 rayleighCoeff;
12: uniform float rayleighH;
13: uniform vec3 scatterCoeffSum;
14: uniform vec3 invScatterCoeffSum;
15: uniform vec3 extinctionCoeff;
16: varying vec3 scatteredColor0;
17: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
18: float NV = dot(gl_Normal, eyeDir);
19: varying vec3 scatterEx;
20: varying vec3 eyeDir_obj;
21:
22: void main(void)
23: {
24: float NL;
25: {
26: float rq = dot(eyePosition, eyeDir);
27: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
28: float d = sqrt(rq * rq - qq);
29: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
30: vec3 atmLeave = gl_Vertex.xyz;
31: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
32: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
33: rq = dot(atmSamplePointSun, light0_direction);
34: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
35: d = sqrt(rq * rq - qq);
36: float distSun = -rq + d;
37: float distAtm = length(atmEnter - atmLeave);
38: float density = 0.0;
39: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
40: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
41: density += exp(-h * mieH);
42: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
43: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
44: density += exp(-h * mieH);
45: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
46: vec3 ex = exp(-extinctionCoeff * density * distAtm);
47: scatterEx = ex;
48: scatteredColor0 = sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
49: }
50: eyeDir_obj = eyeDir;
51: gl_Position = ftransform();
52: }
Error compiling vertex shader:
(1) : error C0104: Unknown pre-processor directive #version
Fragment shader source:
1: #version 110
2: varying vec3 scatterEx;
3: varying vec3 eyeDir_obj;
4: uniform float mieK;
5: uniform float mieCoeff;
6: uniform vec3 rayleighCoeff;
7: uniform vec3 invScatterCoeffSum;
8: uniform vec3 light0_direction;
9: varying vec3 scatteredColor0;
10:
11: void main(void)
12: {
13: vec3 color = vec3(0.0, 0.0, 0.0);
14: vec3 V = normalize(eyeDir_obj);
15: float cosTheta = dot(V, light0_direction);
16: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
17: float phRayleigh = 1.0;
18: color += (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * scatteredColor0;
19: gl_FragColor = vec4(color, dot(scatterEx, vec3(0.333, 0.333, 0.333)));
20: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
<---
Thanks,
Gallas
--