chris wrote:PlutonianEmpire wrote:seems to be. 'xcept i haven't added a second star to the sol system.
Can you post the contents the shaders.log file that Celestia creates?
--Chris
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 light1_direction;
7: uniform vec3 light1_diffuse;
8: uniform vec3 light1_specular;
9: uniform vec3 light1_halfVector;
10: uniform vec3 eyePosition;
11: varying vec2 diffTexCoord;
12: varying vec2 nightTexCoord;
13: uniform float textureOffset;
14: uniform vec3 atmosphereRadius;
15: uniform float mieCoeff;
16: uniform float mieH;
17: uniform float mieK;
18: uniform vec3 rayleighCoeff;
19: uniform float rayleighH;
20: uniform vec3 scatterCoeffSum;
21: uniform vec3 invScatterCoeffSum;
22: uniform vec3 extinctionCoeff;
23: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
24: float NV = dot(gl_Normal, eyeDir);
25: varying vec4 diffFactors;
26: varying vec3 normal;
27: varying vec3 lightHalfVec0;
28: varying vec3 lightHalfVec1;
29: varying vec3 scatterEx;
30:
31: void main(void)
32: {
33: float NL;
34: normal = gl_Normal;
35: NL = max(0.0, dot(gl_Normal, light0_direction));
36: diffFactors.x = NL;
37: lightHalfVec0 = light0_direction + eyeDir;
38: NL = max(0.0, dot(gl_Normal, light1_direction));
39: diffFactors.y = NL;
40: lightHalfVec1 = light1_direction + eyeDir;
41: diffTexCoord = gl_MultiTexCoord0.st + vec2(textureOffset, 0.0);
42: nightTexCoord = gl_MultiTexCoord1.st;
43: {
44: float rq = dot(eyePosition, eyeDir);
45: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
46: float d = sqrt(rq * rq - qq);
47: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
48: vec3 atmLeave = gl_Vertex.xyz;
49: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
50: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
51: rq = dot(atmSamplePointSun, light0_direction);
52: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
53: d = sqrt(rq * rq - qq);
54: float distSun = -rq + d;
55: float distAtm = length(atmEnter - atmLeave);
56: float density = 0.0;
57: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
58: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
59: density += exp(-h * mieH);
60: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
61: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
62: density += exp(-h * mieH);
63: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
64: vec3 ex = exp(-extinctionCoeff * density * distAtm);
65: float cosTheta = dot(eyeDir, light0_direction);
66: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
67: float phRayleigh = 1.0;
68: scatterEx = ex;
69: gl_FrontSecondaryColor.rgb = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
70: }
71: gl_Position = ftransform();
72: }
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 lightHalfVec1;
17: uniform vec3 lightcolor1;
18: uniform vec3 lightspecColor1;
19: varying vec3 scatterEx;
20:
21: void main(void)
22: {
23: vec4 color;
24: float NH;
25: vec3 n = normalize(normal);
26: diff.rgb += diffFactors.x * lightcolor0;
27: NH = max(0.0, dot(n, normalize(lightHalfVec0)));
28: spec.rgb += diffFactors.x * pow(NH, shininess) * lightspecColor0;
29: diff.rgb += diffFactors.y * lightcolor1;
30: NH = max(0.0, dot(n, normalize(lightHalfVec1)));
31: spec.rgb += diffFactors.y * pow(NH, shininess) * lightspecColor1;
32: color = texture2D(diffTex, diffTexCoord.st);
33: gl_FragColor = color * diff + float(color.a) * spec;
34: float totalLight = diffFactors.x + diffFactors.y;
35: totalLight = 1.0 - totalLight;
36: totalLight = totalLight * totalLight * totalLight * totalLight;
37: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
38: gl_FragColor.rgb = gl_FragColor.rgb * scatterEx + gl_SecondaryColor.rgb;
39: }
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 light1_direction;
7: uniform vec3 light1_diffuse;
8: uniform vec3 light1_specular;
9: uniform vec3 light1_halfVector;
10: uniform vec3 eyePosition;
11: varying vec2 diffTexCoord;
12: uniform float textureOffset;
13: uniform vec3 atmosphereRadius;
14: uniform float mieCoeff;
15: uniform float mieH;
16: uniform float mieK;
17: uniform vec3 rayleighCoeff;
18: uniform float rayleighH;
19: uniform vec3 scatterCoeffSum;
20: uniform vec3 invScatterCoeffSum;
21: uniform vec3 extinctionCoeff;
22: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
23: float NV = dot(gl_Normal, eyeDir);
24: uniform vec3 ambientColor;
25: uniform float opacity;
26: varying vec4 diff;
27: varying vec3 scatterEx;
28:
29: void main(void)
30: {
31: float NL;
32: diff = vec4(ambientColor, opacity);
33: NL = max(0.0, dot(gl_Normal, light0_direction));
34: diff.rgb += light0_diffuse * NL;
35: NL = max(0.0, dot(gl_Normal, light1_direction));
36: diff.rgb += light1_diffuse * NL;
37: diffTexCoord = gl_MultiTexCoord0.st + vec2(textureOffset, 0.0);
38: {
39: float rq = dot(eyePosition, eyeDir);
40: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
41: float d = sqrt(rq * rq - qq);
42: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
43: vec3 atmLeave = gl_Vertex.xyz;
44: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
45: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
46: rq = dot(atmSamplePointSun, light0_direction);
47: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
48: d = sqrt(rq * rq - qq);
49: float distSun = -rq + d;
50: float distAtm = length(atmEnter - atmLeave);
51: float density = 0.0;
52: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
53: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
54: density += exp(-h * mieH);
55: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
56: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
57: density += exp(-h * mieH);
58: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
59: vec3 ex = exp(-extinctionCoeff * density * distAtm);
60: float cosTheta = dot(eyeDir, light0_direction);
61: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
62: float phRayleigh = 1.0;
63: scatterEx = ex;
64: gl_FrontSecondaryColor.rgb = (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
65: }
66: gl_Position = ftransform();
67: }
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 light1_direction;
7: uniform vec3 light1_diffuse;
8: uniform vec3 light1_specular;
9: uniform vec3 light1_halfVector;
10: uniform vec3 eyePosition;
11: uniform vec3 atmosphereRadius;
12: uniform float mieCoeff;
13: uniform float mieH;
14: uniform float mieK;
15: uniform vec3 rayleighCoeff;
16: uniform float rayleighH;
17: uniform vec3 scatterCoeffSum;
18: uniform vec3 invScatterCoeffSum;
19: uniform vec3 extinctionCoeff;
20: varying vec3 scatteredColor0;
21: varying vec3 scatteredColor1;
22: vec3 eyeDir = normalize(eyePosition - gl_Vertex.xyz);
23: float NV = dot(gl_Normal, eyeDir);
24: varying vec3 scatterEx;
25: varying vec3 eyeDir_obj;
26:
27: void main(void)
28: {
29: float NL;
30: {
31: float rq = dot(eyePosition, eyeDir);
32: float qq = dot(eyePosition, eyePosition) - atmosphereRadius.y;
33: float d = sqrt(rq * rq - qq);
34: vec3 atmEnter = eyePosition + min(0.0, (-rq + d)) * eyeDir;
35: vec3 atmLeave = gl_Vertex.xyz;
36: vec3 atmSamplePoint = (atmEnter + atmLeave) * 0.5;
37: vec3 atmSamplePointSun = atmEnter * 0.5 + atmLeave * 0.5;
38: rq = dot(atmSamplePointSun, light0_direction);
39: qq = dot(atmSamplePointSun, atmSamplePointSun) - atmosphereRadius.y;
40: d = sqrt(rq * rq - qq);
41: float distSun = -rq + d;
42: float distAtm = length(atmEnter - atmLeave);
43: float density = 0.0;
44: atmSamplePoint = atmEnter * 0.333 + atmLeave * 0.667;
45: float h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
46: density += exp(-h * mieH);
47: atmSamplePoint = atmEnter * 0.667 + atmLeave * 0.333;
48: h = max(0.0, length(atmSamplePoint) - atmosphereRadius.z);
49: density += exp(-h * mieH);
50: vec3 sunColor = exp(-extinctionCoeff * density * distSun);
51: vec3 ex = exp(-extinctionCoeff * density * distAtm);
52: scatterEx = ex;
53: scatteredColor0 = sunColor * (1.0 - exp(-scatterCoeffSum * density * distAtm));
54: }
55: eyeDir_obj = eyeDir;
56: gl_Position = ftransform();
57: }
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: uniform vec3 light1_direction;
11: varying vec3 scatteredColor1;
12:
13: void main(void)
14: {
15: vec3 color = vec3(0.0, 0.0, 0.0);
16: vec3 V = normalize(eyeDir_obj);
17: float cosTheta = dot(V, light0_direction);
18: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
19: float phRayleigh = 1.0;
20: color += (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * scatteredColor0;
21: float cosTheta = dot(V, light1_direction);
22: float phMie = (1.0 - mieK * mieK) / ((1.0 - mieK * cosTheta) * (1.0 - mieK * cosTheta));
23: float phRayleigh = 1.0;
24: color += (phRayleigh * rayleighCoeff + phMie * mieCoeff) * invScatterCoeffSum * scatteredColor1;
25: gl_FragColor = vec4(color, dot(scatterEx, vec3(0.333, 0.333, 0.333)));
26: }
Error compiling fragment shader:
(1) : error C0104: Unknown pre-processor directive #version
(21) : error C1002: the name "cosTheta" is already defined
(21) : error C1054: initialization of non-variable "cosTheta"
(22) : error C1002: the name "phMie" is already defined
(22) : error C1054: initialization of non-variable "phMie"
(23) : error C1002: the name "phRayleigh" is already defined
(23) : error C1054: initialization of non-variable "phRayleigh"