Varying transparency of star & galaxy labels

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 8 months
Location: Hamburg, Germany

Post #21by t00fri » 04.06.2006, 09:52

Hi again,

I added a crucial enhancement to the distance dependent label transparency for galaxy and star labels!

Previously, the once attributed transparencies stayed constant when the field of view decreased, i.e. upon zooming in with "SHIFT mouse left" movement!

++++++++++++++++
Therefore the legibility of labels for very distant galaxies
and stars remained pretty bad for all fields of view.

Now this improves when zooming in! Yet there is the
same hierarchy of label transparencies in ANY given field of view.
++++++++++++++++

Here are the required code changes in src/celengine/render.cpp:

a) Stars:
----------
Replace the code in the curly parentheses starting about in line 6888 (CVS code!)

Code: Select all

            if (dot(starDir, viewNormal) > cosFOV)
            {
                char nameBuffer[Renderer::MaxLabelLength];
                starDB->getStarName(star, nameBuffer, sizeof(nameBuffer));
                float distr = labelThresholdMag/max(1.0f, (faintestMag - 4.0f))/log10(1.0f + 1.0e-1f * distance);
                if (distr > 1.0f)
                   distr = 1.0f;
                renderer->addLabel(nameBuffer,
                                   Color(0.5f, 0.5f, 1.0f, distr),
                                   Point3f(relPos.x, relPos.y, relPos.z));
                nLabelled++;
            }


b) Galaxies:
--------------
Replace the code in the curly parentheses starting about in line 7269 (CVS code!)

Code: Select all

        && dot(relPos, viewNormal) > 0)
    {
        float distr = (1.0f - 0.5f * log10(relDistanceToScreen))/log10(1.0f + 8.0e-7f * distanceToDSO);
        if (distr > 1.0f)
           distr = 1.0f;
       renderer->addLabel(dsoDB->getDSOName(dso),
                           Color(0.1f, 0.85f, 0.85f, distr),
                           Point3f(relPos.x, relPos.y, relPos.z));
    }


Bye Fridger
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 15 years 9 months

Post #22by ElChristou » 04.06.2006, 12:00

t00fri wrote:...Therefore the legibility of labels for very distant galaxies
and stars remained pretty bad for all fields of view...


This is a bit normal, if distant bodies are suppose to have their labels almost transparents (->black)...
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 15 years 9 months

Post #23by ElChristou » 04.06.2006, 12:10

Paolo wrote:...If the factor that drives the transapercy should be adjusted using a slider in the GUI instead that being hard coded should be even more amazing...


IMO, if the tuning is well done, we won't need the slider; now if we really go to a "all customable" settings philosophy, I think we will soon have to add a "Reset to default" button in the pref panel.
Image

neo albireo
Posts: 68
Joined: 03.02.2005
With us: 15 years 10 months
Location: Switzerland

Post #24by neo albireo » 27.12.2006, 15:24

Now that finally I have the possibility to test this new feature, I must say that I absolutely love it! This is definitely one of the very big highlights of 1.5.0.

I would really love to have the same transparency with all labels, i.e. asteroids, comets, even planets and moons, spacecraft and locations. But as Fridger mentioned above, that would need quite a lot of work.

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 8 months
Location: Hamburg, Germany

Post #25by t00fri » 27.12.2006, 15:35

neo albireo wrote:Now that finally I have the possibility to test this new feature, I must say that I absolutely love it! This is definitely one of the very big highlights of 1.5.0.

I would really love to have the same transparency with all labels, i.e. asteroids, comets, even planets and moons, spacecraft and locations. But as Fridger mentioned above, that would need quite a lot of work.


Not really!

I followed merely Chris' judgment, although a number of further testers liked my corresponding labels also very much for stars...

I have done all the required code since long, but left it off upon Chris' request for now. Chris wants to have an option for turning this feature off in case of stars.

I would have preferred to add my "fading" labels for all objects in 1.5.0 and add the respective switch later...Such switches are kind of tedious, since we have no free key shortcuts anymore and cross-platform GUI coding work takes it's time...

Bye Fridger
Image

neo albireo
Posts: 68
Joined: 03.02.2005
With us: 15 years 10 months
Location: Switzerland

Post #26by neo albireo » 27.12.2006, 15:42

t00fri wrote:I would have preferred to add my "fading" labels for all objects in 1.5.0 and add the respective switch later...Such switches are kind of tedious, since we have no free key shortcuts anymore and cross-platform GUI coding work takes it's time...

I can understand that there should be a possibility to turn it off... but why not in celestia.cfg? I don't think that you really need to switch while running the program... it's more a taste thing. I really like the transaparency labels and think it gives a much better feeling of 3D-distributions.
If it doesn't go to 1.5.0, can you provide a patch? Maybe on Celestial Matters?

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 8 months
Location: Hamburg, Germany

Post #27by t00fri » 27.12.2006, 17:06

neo albireo wrote:
t00fri wrote:I would have preferred to add my "fading" labels for all objects in 1.5.0 and add the respective switch later...Such switches are kind of tedious, since we have no free key shortcuts anymore and cross-platform GUI coding work takes it's time...
I can understand that there should be a possibility to turn it off... but why not in celestia.cfg? I don't think that you really need to switch while running the program... it's more a taste thing. I really like the transaparency labels and think it gives a much better feeling of 3D-distributions.
If it doesn't go to 1.5.0, can you provide a patch? Maybe on Celestial Matters?


Sure I can provide a patch. But since I am a Celestia developer, I rather try to convince Chris that we have it included ASAP ;-)

Bye Fridger
Image

neo albireo
Posts: 68
Joined: 03.02.2005
With us: 15 years 10 months
Location: Switzerland

Post #28by neo albireo » 27.12.2006, 17:14

t00fri wrote:Sure I can provide a patch. But since I am a Celestia developer, I rather try to convince Chris that we have it included ASAP ;-)

Yes, of course :) Good luck!
Actually, I tried to follow your above descriptions of the change that has to be made to render.cpp in order to have the transparent labels for stars. I changed the code of my local file celestia/src/celengine/render.cpp as suggested in Xcode. Then I cleaned (even deleted the whole build folder inside /macosx) and built a new deployment-build. But it doesn't show any changes - the labels are not different then before.

This is the first time I actually try to change something in the code, so I guess I did something fundamental wrong, maybe I would need to do more than just cleaning or something.. Could anybody tell me what could have gone wrong? I'm quite excited about the possibility to change the code. Maybe I'll learn the relevant languages when I find the time, after having learned Chinese that should be possible ;)

[edit]
OK, I did everything right - I just didn't realize that when in OpenGL 2.0 modus, render.cpp is probably not used. So the changes appeared only in the "normal" modi.

And I can say now: I really like transparency for star labels. It could even be a little more obvious, for my taste. Maybe I'll play around with the values...[/edit]

neo albireo
Posts: 68
Joined: 03.02.2005
With us: 15 years 10 months
Location: Switzerland

Post #29by neo albireo » 14.05.2007, 17:04

t00fri wrote:Sure I can provide a patch. But since I am a Celestia developer, I rather try to convince Chris that we have it included ASAP ;-)

Bye Fridger


Now that Chris just committed a very nice fading effect for orbits and solar system bodies (at least for some of them), I am hoping a lot that Fridger's star labels fading code will be implemented as well and that there will be a similar solution for all other labels still missing the fading. I really love the fading.

Something still bothers me a lot (this and the star brightness jump actually prevents me from using the newest CVS versions for doing public presentations): The distance in which p.e. the planet orbits are visible should be increased - just when Jupiter's orbit would start to fade away as elegantly as Mars' orbit, all planet orbits disappear abruptly now. At the same time all Asteroids' and Comets' orbits disappear, making it impossible to see the orbits of rather far distanced bodies from some data catalogue addons at all.

I also would like a fading in/out of labels when activating/deactivating them like it is done in Stellarium, although I would prefer a costumized user setting. In Stellarium, it is too slow for my taste. However, other than the distance and/or importance weighted fading that has a real use for orientation and 3D-feel this would merely be an eye-candy.

Using a version from 5 hours ago on a Mac Book Pro.

Avatar
Cham M
Posts: 4325
Joined: 14.01.2004
Age: 56
With us: 16 years 10 months
Location: Montreal

Post #30by Cham » 14.05.2007, 17:22

I agree totally with neo albireo. The new fading effect is very nice. However, the last orbits are still disappearing abruptly.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 10 months
Location: Seattle, Washington, USA

Post #31by chris » 14.05.2007, 18:25

Cham wrote:I agree totally with neo albireo. The new fading effect is very nice. However, the last orbits are still disappearing abruptly.


I don't see this effect of the last orbits disappearing abruptly . . . When I zoom out from the Solar System, all of the orbits fade out smoothly.

I agree that Fridger's label fading code should be included for stars. I've mailed him about checking it in.

--Chris

neo albireo
Posts: 68
Joined: 03.02.2005
With us: 15 years 10 months
Location: Switzerland

Post #32by neo albireo » 14.05.2007, 18:52

chris wrote:I don't see this effect of the last orbits disappearing abruptly . . . When I zoom out from the Solar System, all of the orbits fade out smoothly.


It happens at around 200 AU from Sol (between 100 and 300 AU), sometimes one can move around the Sun and it switches on and off.

Avatar
selden
Developer
Posts: 10138
Joined: 04.09.2002
With us: 18 years 2 months
Location: NY, USA

Post #33by selden » 14.05.2007, 19:16

Orbits are visible on my Windows system out past 700 au.

I fear this may be yet another problem in the MacOS graphics drivers :(
Selden

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 8 months
Location: Hamburg, Germany

Post #34by t00fri » 14.05.2007, 19:24

chris wrote:
Cham wrote:I agree totally with neo albireo. The new fading effect is very nice. However, the last orbits are still disappearing abruptly.

I don't see this effect of the last orbits disappearing abruptly . . . When I zoom out from the Solar System, all of the orbits fade out smoothly.

I agree that Fridger's label fading code should be included for stars. I've mailed him about checking it in.

--Chris


My God ... It has been so long ago that I threw my fading star label code out of my everyday version (to avoid it to be over written by daily CVS updates) that I can't find my best version off hand now ;-)

I am sure it's still somewhere and I will go on searching...

@Cham: do you still have my "good" star labels somewhere?? It was only a few lines . I have sent them to you and to Christophe(aka ElChristou) around 11/8/2006

+++++++++++++++++++++++++++++
@Chris: as to your new fading orbits: generally I like them a lot. But for some reason Pluto's orbit is NOT displayed while all other planetary orbits are. What's the trick?
+++++++++++++++++++++++++++++

Bye Fridger
Image

Johaen
Posts: 341
Joined: 14.01.2006
With us: 14 years 10 months
Location: IL, USA

Post #35by Johaen » 14.05.2007, 19:34

t00fri wrote:+++++++++++++++++++++++++++++
@Chris: as to your new fading orbits: generally I like them a lot. But for some reason Pluto's orbit is NOT displayed while all other planetary orbits are. What's the trick?
+++++++++++++++++++++++++++++


Pluto's not a planet? :wink:
AMD Athlon X2 4400+; 2GB OCZ Platinum RAM; 320GB SATA HDD; NVidia EVGA GeForce 7900GT KO, PCI-e, 512MB, ForceWare ver. 163.71; Razer Barracuda AC-1 7.1 Gaming Soundcard; Abit AN8 32X motherboard; 600 watt Kingwin Mach1 PSU; Windows XP Media Center SP2;

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 10 months
Location: Seattle, Washington, USA

Post #36by chris » 14.05.2007, 19:44

t00fri wrote:+++++++++++++++++++++++++++++
@Chris: as to your new fading orbits: generally I like them a lot. But for some reason Pluto's orbit is NOT displayed while all other planetary orbits are. What's the trick?
+++++++++++++++++++++++++++++

Bye Fridger


I don't think it has anything to do with the new fading code . . . The problem is that the orbit of Pluto is now defined with respect to the Pluto-Charon barycenter. The orbit of the barycenter around the Sun isn't drawn because it's not a planet. We need to modify the code that handles orbit rendering slightly. It should either show the orbit of a planet-moon system barycenter, or of the planet itself. In the short term, the former is easier.

--Chris

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 18
With us: 18 years 8 months
Location: Hamburg, Germany

Post #37by t00fri » 14.05.2007, 20:50

OK, I found my last fading star labels code again ;-)

Bye Fridger
Image

Avatar
Cham M
Posts: 4325
Joined: 14.01.2004
Age: 56
With us: 16 years 10 months
Location: Montreal

Post #38by Cham » 15.05.2007, 00:34

The labels are all fading out smoothly. This is very nice. But as mentioned before, the last orbits are disappearing abruptly at around 0.0175 LY from Sol (no smooth fade out). If I go in, the first orbits are fading in and out smoothly without any problem. Just the last orbits aren't behaving correctly with distance.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Kolano
Posts: 125
Joined: 15.02.2005
With us: 15 years 9 months
Location: New Jersey

Post #39by Kolano » 15.05.2007, 05:36

chris wrote: It should either show the orbit of a planet-moon system barycenter, or of the planet itself. In the short term, the former is easier.


Looking forward to eventual barycenter orbits, it's a bit odd without them. When you say "or of the planet itself" I presume you mean an approximation of the planet's orbit, since if it does have a planet-moon barycenter the real planet orbit is a wobbly shape not a smooth ellipse.
System:
Asus A8N-SLI Premium nForce4 SLI
AMD Athlon 64 X2 4200+
2xeVGA GeForce 7800 GTX 256MB
2gb Dual Channel DDR (400) 3200

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 18 years 10 months
Location: Seattle, Washington, USA

Post #40by chris » 15.05.2007, 06:33

Kolano wrote:
chris wrote: It should either show the orbit of a planet-moon system barycenter, or of the planet itself. In the short term, the former is easier.

Looking forward to eventual barycenter orbits, it's a bit odd without them. When you say "or of the planet itself" I presume you mean an approximation of the planet's orbit, since if it does have a planet-moon barycenter the real planet orbit is a wobbly shape not a smooth ellipse.


For Pluto, the wobble would be so small as to be unnoticeable. Pluto orbits the Sun at a distance of roughly five billion kilometers, yet it is displaced from the Pluto-Charon barycenter by only about 2400 km.

--Chris


Return to “Development”

Who is online