Page 1 of 1

No Limit Of Knowledge under OpenGL 2

Posted: 10.03.2006, 23:01
by ajtribick
Celestia 1.4.1, Windows XP.

When I am using the OpenGL 2 render path, the limit of knowledge option does not have any effect, even though on the other render paths it blanks out unknown areas of the texture as expected, e.g. Mercury.

Contents of shaders.log

Code: Select all

Vertex shader source:
  1: uniform vec3 light0_direction;
  2: uniform vec3 light0_diffuse;
  3: uniform vec3 light0_specular;
  4: uniform vec3 light0_halfVector;
  5: uniform float shininess;
  6: uniform vec3 ambientColor;
  7: varying vec4 diff;
  8: varying vec4 spec;
  9: varying vec2 diffTexCoord;
 10: varying vec2 specTexCoord;
 11: varying vec2 nightTexCoord;
 12: varying float totalLight;
 13: uniform float textureOffset;
 14:
 15: void main(void)
 16: {
 17: float nDotVP;
 18: float nDotHV;
 19: diff = vec4(ambientColor, 1.0);
 20: spec = vec4(0.0, 0.0, 0.0, 0.0);
 21: totalLight = 0.0;
 22: nDotVP = max(0.0, dot(gl_Normal, light0_direction));
 23: nDotHV = max(0.0, dot(gl_Normal, light0_halfVector));
 24: diff.rgb += light0_diffuse * nDotVP;
 25: spec.rgb += light0_specular * (pow(nDotHV, shininess) * nDotVP);
 26: totalLight += nDotVP;
 27: totalLight = 1.0 - totalLight;
 28: totalLight = totalLight * totalLight * totalLight * totalLight;
 29: diffTexCoord = gl_MultiTexCoord0.st;
 30: diffTexCoord.x += textureOffset;
 31: specTexCoord = gl_MultiTexCoord1.st;
 32: nightTexCoord = gl_MultiTexCoord2.st;
 33: gl_Position = ftransform();
 34: }

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: varying vec2 nightTexCoord;
  8: uniform sampler2D nightTex;
  9: varying float totalLight;
 10:
 11: void main(void)
 12: {
 13: vec4 color;
 14: color = texture2D(diffTex, diffTexCoord.st);
 15: gl_FragColor = color * diff + texture2D(specTex, specTexCoord.st) * spec;
 16: gl_FragColor += texture2D(nightTex, nightTexCoord.st) * totalLight;
 17: }

Vertex shader source:
  1: uniform vec3 light0_direction;
  2: uniform vec3 light0_diffuse;
  3: uniform vec3 light0_specular;
  4: uniform vec3 light0_halfVector;
  5: uniform vec3 ambientColor;
  6: varying vec4 diff;
  7: varying vec2 diffTexCoord;
  8: uniform float textureOffset;
  9:
 10: void main(void)
 11: {
 12: float nDotVP;
 13: diff = vec4(ambientColor, 1.0);
 14: nDotVP = max(0.0, dot(gl_Normal, light0_direction));
 15: diff.rgb += light0_diffuse * nDotVP;
 16: diffTexCoord = gl_MultiTexCoord0.st;
 17: diffTexCoord.x += textureOffset;
 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 vec3 light0_direction;
  2: uniform vec3 light0_diffuse;
  3: uniform vec3 light0_specular;
  4: uniform vec3 light0_halfVector;
  5: varying vec2 diffTexCoord;
  6: varying vec2 normTexCoord;
  7: varying vec3 lightDir0;
  8: uniform float textureOffset;
  9: attribute vec3 tangent;
 10:
 11: void main(void)
 12: {
 13: float nDotVP;
 14: nDotVP = max(0.0, dot(gl_Normal, light0_direction));
 15: vec3 bitangent = cross(gl_Normal, tangent);
 16: lightDir0.x = dot(tangent, light0_direction);
 17: lightDir0.y = dot(-bitangent, light0_direction);
 18: lightDir0.z = dot(gl_Normal, light0_direction);
 19: diffTexCoord = gl_MultiTexCoord0.st;
 20: diffTexCoord.x += textureOffset;
 21: normTexCoord = gl_MultiTexCoord1.st;
 22: gl_Position = ftransform();
 23: }

Fragment shader source:
  1: uniform vec3 ambientColor;
  2: vec4 diff = vec4(ambientColor, 1.0);
  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 * vec3(2.0, 2.0, 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.rgb += l * lightcolor0;
 17: color = texture2D(diffTex, diffTexCoord.st);
 18: gl_FragColor = color * diff;
 19: }


Posted: 25.03.2006, 13:20
by ajtribick
I guess no-one else has this problem then...

Posted: 25.03.2006, 14:54
by selden
It seems that Overlay textures in general don't work in the OpenGL 2.0 path. I'm sure Chris is aware of the problem, but hasn't come up with a fix yet. He's been working on other features.

Posted: 27.06.2006, 06:04
by chris
This problem has been addressed in the CVS version of Celestia.

--Chris