Color differentiation at a distance

My app displays a large map with various objects some of which are transparent spheres. The camera can move freely in the world and look back over the entire world from high above. From this perspective, some translucent spheres at a certain distance from the camera loose their red color and turn white/lavender, while the spheres nearer the camera stay red. The color of the sphere has meaning in my program so I need the spheres to remain the color I assign them no matter what the distance. Does anyone know why the colors change or how to make them remain the assigned color? Here is how I created the sphere geometry and coloration:


...
    Appearance sAppearance = new Appearance();
    sAppearance.setColoringAttributes(new ColoringAttributes(new Color3f(1.0f, 0.0f, 0.0f), ColoringAttributes.NICEST));
    sAppearance.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.8f, TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA, true, true));
    Shape3D shape = new Shape3D(s.getGeometry(), sAppearance);
...

This shape is then added to the scenegraph and displays correctly except for its appearance when viewed from afar.

Objects should not change colors at any distance.

As far as I see from your code, you do not use lighting, so spheres should be displayed semi-transparent red as rounds. Is it correct?

Do you have any coloring data in your Shape3D?

Is this problem reproducible on other computers?

We need simple test case to reproduce this, so we can check if this is a bug.

Yuri

[quote]Objects should not change colors at any distance.
(…)
We need simple test case to reproduce this, so we can check if this is a bug.
[/quote]
Occasionally I see this “color changing effect” too with my Xith app. It uses lightsource(s). When I move the camera to a certain distance to the objects, some of them “swap” color to black/white or grey or whatever.

However I didn’t manage to spot the cause of the problem so far. When I manage this I’ll report it here. Could well be that I do something wrong…

[quote]Occasionally I see this “color changing effect” too with my Xith app.
[/quote]
The I definitely want a test case.Lets collect more information on this issue. We can start doing this here or in IssueZille (preferred).

Yuri

Yes. So far I can’t reproduce the effect in a reliably way to make a test case. I’ll try however and post again then.

Sorry for the delay with following up on this. The problem appears to be with multitexturing. For our program we were originally multitexturing the terrain with overlays and have switched to a single texture approach with the old layers compiled onto a single texture. For whatever reason, this fixed the problem. Are you using multitexturing in your program that exhibits this problem, Bombadil?

[quote]Sorry for the delay with following up on this. The problem appears to be with multitexturing. For our program we were originally multitexturing the terrain with overlays and have switched to a single texture approach with the old layers compiled onto a single texture. For whatever reason, this fixed the problem. Are you using multitexturing in your program that exhibits this problem, Bombadil?
[/quote]
Yes.
Now you say it I think that’s it. I think my colour swapping problem hasn’t been on scenegraphs without any multi-textured objects.

Good to read your notice - I’ll have a closer look on my app, too.

Especially for Multitexturing - quite important to have a test case for this problem, because of some time ago there were changes in how multitexturing handled, so probably this caused some issues.

Yuri