This is a bug I reported already to Chris, and sent him screenshots of its effects, but I have discovered more details that might be helpful.
The problem appeared when viewing in close range an object with a 3ds mesh: its color seems to fluctuate sharply between different tints of blue, red and yellow as the viewing point moves (even very slightly) with respect to the object. The effect is very noticeable in Amalthea and several asteroids.
What I have discovered is that, when the object is partially visible (because it lies in part beyond the limits of the program's window) the color looks right. This web page shows the effect in more detail: http://bruckner.homelinux.net/celestia_bugs.html
There you can find details about my system, also. I hope this helps to pin this issue down...
Best regards
Bruckner
Color of 3ds meshes
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
I looked at this bug and I *think* that what might be happening is that the colors from rendering the stars are 'leaking' A good way to see if this is what's actually happening would be to modify the colors returned by the StellarClass::getApparentColor method in stellarclass.cpp. Set all the star colors to something easy to spot like Color(1, 0, 1) (magenta) and see if that changes the tint of the 3ds mesh.
--Chris
--Chris
-
Topic authorbruckner
- Posts: 79
- Joined: 30.01.2002
- With us: 22 years 9 months
- Location: Villaviciosa de Od?n, Madrid, Spain
You've got it right
I recompiled with your suggested change, and that was the problem. Amalthea appeared magenta, except when Jupiter was exactly behind (its color varied again, but now in the range of Jupiter's clouds colors). When viewed near the border of the screen, the correct color for Amalthea (red) was rendered.
If I can do anymore to help, don't hesitate to tell me. But remember I'm a Java guy
Best regards.
Bruckner
If I can do anymore to help, don't hesitate to tell me. But remember I'm a Java guy
Best regards.
Bruckner
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
I can't reproduce this problem, but I may have found a fix. Look for these lines of code:
Immediately after them, add these lines:
Let me know if that fixes the problem . . . this could have been the cause of some other weirdness as well.
--Chris
Code: Select all
starTex->bind();
starDB.findVisibleStars(starRenderer,
(Point3f) observer.getPosition(),
observer.getOrientation(),
degToRad(fov),
(float) windowWidth / (float) windowHeight,
faintestMagNight);
starRenderer.starVertexBuffer->render();
Immediately after them, add these lines:
Code: Select all
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
Let me know if that fixes the problem . . . this could have been the cause of some other weirdness as well.
--Chris
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
I forgot to mention that the above code is in render.cpp. If that suggestion doesn't work, try commenting out this line in render.cpp:
--Chris
[/code]
Code: Select all
renderParticles(glareParticles, observer.getOrientation());
--Chris
[/code]
-
Topic authorbruckner
- Posts: 79
- Joined: 30.01.2002
- With us: 22 years 9 months
- Location: Villaviciosa de Od?n, Madrid, Spain
No change
Unfortunately, none of these changes (nor its combination) prevented the bug. I wish I could help you with code... but I will eagerly compile & test anything you like.
Did I mention that .cms meshes dont suffer the problem (and don't accept Color [ R G B ] settings in .ssc files, by the way...)? That may help...
Best regards.
Bruckner
Did I mention that .cms meshes dont suffer the problem (and don't accept Color [ R G B ] settings in .ssc files, by the way...)? That may help...
Best regards.
Bruckner
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
I'm looking into this bug some more . . . the fact that .cms meshes work fine is a good clue about what might be going wrong.
The color does affect .cms meshes, but you must have the line:
(as many asteroids in solarsys.ssc do) in order for it to affect the color the way you want it to. Ordinarily, the color is just used to tint the object when it's distant and only visible as a point or when there's no texture applied. It's not used when rendering the object's texture unless you explicitly enable BlendTexture. For instance, Earth has a bluish color at a distance which is supposed to represent an 'average' color of the oceans and clouds. It would be incorrect to tint the Earth texture with this color.
--Chris
The color does affect .cms meshes, but you must have the line:
Code: Select all
BlendTexture true
(as many asteroids in solarsys.ssc do) in order for it to affect the color the way you want it to. Ordinarily, the color is just used to tint the object when it's distant and only visible as a point or when there's no texture applied. It's not used when rendering the object's texture unless you explicitly enable BlendTexture. For instance, Earth has a bluish color at a distance which is supposed to represent an 'average' color of the oceans and clouds. It would be incorrect to tint the Earth texture with this color.
--Chris