Page 1 of 1

Multiple light sources with multiple shadows crashes

Posted: 01.09.2010, 18:03
by selden
This crash is seen in both Celestia v1.6.0 and when built from the most recent svn download (r5050)

The attached zip file contains an addon, with instructions, which demonstrates this problem. I have only tested it under Windows XP Pro, SP3, with the most recent patches.

It shows a moon orbiting around a planet in a multi-star system (Castor -- I don't claim that the stellar orbits are realistic, though.) When the moon reaches a particular position in its orbit, Celestia crashes.

Re: Multiple light sources with multiple shadows crashes

Posted: 02.09.2010, 15:26
by Boux
I just gave it a go (build 5050).
- native Win32 --> instant crash
- Win Qt4 --> no crash
Possible suspect(s): Windows OpenGL Api and/or bug in Celestia code
Qt uses its own QtOpenGL4.dll interface which may explain why it is not crashing.
Selden I believe you are running an Nvidia graphic card.
I am running ATIs.
This would exclude both drivers then...

Re: Multiple light sources with multiple shadows crashes

Posted: 02.09.2010, 15:58
by selden
Sorry, yes, the system with the crash does have an Nvidia card.

System specs:
2GB, 1.86 GHz Core2Duo E6300, 32bit WinXP Pro SP3
256MB, Nvidia Quadro NVS 290, ForceWare v191.78

Re: Multiple light sources with multiple shadows crashes

Posted: 02.09.2010, 16:20
by Boux
Did you try the Qt version on your side?

Re: Multiple light sources with multiple shadows crashes

Posted: 02.09.2010, 17:39
by selden
No, I didn't test it with the QT version. I don't have a working version of the Windows QT version of Celestia and really don't the time available that seems to be needed to get it to build from scratch.

Re: Multiple light sources with multiple shadows crashes

Posted: 02.09.2010, 19:06
by Boux
The attached zip contains an SVN 5050 celestia-qt4 build with its associated dlls.
Just drop all the files in your Celestia installation directory.
http://www.quickfixcomm.com/Celestia/Celestia-Qt4-5050.zip

Re: Multiple light sources with multiple shadows crashes

Posted: 02.09.2010, 19:31
by selden
Thanks!

The QT version doesn't crash on my system, either.

It has other issues, but I think they're irrelevant for this particular problem.

Re: Multiple light sources with multiple shadows crashes

Posted: 03.09.2010, 10:37
by selden
Celestia v1.6.0 and r5050 also crash in this rather different configuration:

8GB, 1.6GHz, Core i7-720QM; 64bit Win7 Pro
512MB, Nvidia Quadro NVS 3100M; ForceWare v258.96

The Qt version does not.

Re: Multiple light sources with multiple shadows crashes

Posted: 04.09.2010, 01:48
by John Van Vliet
--- edit ---

Re: Multiple light sources with multiple shadows crashes

Posted: 04.09.2010, 07:48
by Boux
Nice shader error...

Code: Select all

Fragment shader source:
  1: #version 110
  2: uniform sampler2D diffTex;
  3: varying vec2 diffTexCoord;
  4: uniform vec3 ambientColor;
  5: uniform float opacity;
  6: vec4 diff = vec4(ambientColor, opacity);
  7: varying vec4 diffFactors;
  8: uniform vec3 lightcolor0;
  9: uniform vec3 lightcolor1;
 10: uniform vec3 lightcolor2;
 11: uniform vec3 lightcolor3;
 12: varying vec3 position_obj;
 13: uniform vec4 shadowTexGenS1_0;
 14: uniform vec4 shadowTexGenT1_0;
 15: uniform float shadowFalloff1_0;
 16: uniform float shadowMaxDepth1_0;
 17: uniform sampler2D cloudShadowTex;
 18: varying vec2 cloudShadowTexCoord0;
 19: varying vec2 cloudShadowTexCoord1;
 20: varying vec2 cloudShadowTexCoord2;
 21: varying vec2 cloudShadowTexCoord3;
 22:
 23: void main(void)
 24: {
 25: vec4 color;
 26: float shadow;
 27: shadow = diffFactors.x;
 28: shadow *= 1.000000-texture2D(cloudShadowTex, cloudShadowTexCoord0).a*0.750000;
 29: diff.rgb += shadow * lightcolor0;
 30: shadow = diffFactors.y;
 31: shadowCenter.s = dot(vec4(position_obj, 1.0), shadowTexGenS1_0) - 0.5;
 32: shadowCenter.t = dot(vec4(position_obj, 1.0), shadowTexGenT1_0) - 0.5;
 33: shadowR = clamp((2.0 * sqrt(dot(shadowCenter, shadowCenter)) - 1.0) * shadowFalloff1_0, 0.0, shadowMaxDepth1_0);
 34: shadow *= 1.0 - shadowR;
 35: diff.rgb += shadow * lightcolor1;
 36: shadow = diffFactors.z;
 37: diff.rgb += shadow * lightcolor2;
 38: shadow = diffFactors.w;
 39: diff.rgb += shadow * lightcolor3;
 40: color = texture2D(diffTex, diffTexCoord.st);
 41: gl_FragColor = color * diff;
 42: }

Error compiling fragment shader:
Fragment shader failed to compile with the following errors:
ERROR: 0:31: 'shadowCenter' : undeclared identifier
ERROR: 0:31: 's' :  field selection requires structure, vector, or matrix on left hand side
ERROR: 0:32: 't' :  field selection requires structure, vector, or matrix on left hand side
ERROR: 0:33: 'shadowR' : undeclared identifier
ERROR:  compilation errors.  No code generated.