My Globular Cluster Package for Testing

The place to discuss creating, porting and modifying Celestia's source code.
ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Re: My Globular Cluster Package for Testing

Post #61by ANDREA » 20.09.2008, 16:30

Vincent wrote:
ANDREA wrote:And, being so close to both 1.6 and to the globular clusters release, would it be possible to add to .cel and .celx commands the ones regarding such objects, I mean
renderflags set/clear "globularclusters" and
labels set/clear "globularclusterss" ?
Vincent?
Andrea, I've modified renderflags, orbitflags and labels CEL commands so that CEL and CELX share
the same table of names for these commands. That means that all names added to CELX will be used by
CEL too. As an example, there will be no need to add 'globulars' to CEL since Fridger already added it to CELX. :)
If Chris is OK, I'll check in this change in a couple of hours, as well as the change that adds globulars and the
new grids to the Windows View Option dialog.
Thanks a lot, Vincent, I'll add these commands to the .cel Wiki manual I'm writing just now.
BTW, I fear that your LUA EDU TOOLS don't work in Fridger's new r4446, but may be I made some installation mistake with them.
Could you please kindly chcek if the problem is mine?
Thanks a lot.
Bye

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Re: My Globular Cluster Package for Testing

Post #62by danielj » 20.09.2008, 16:31

Very interesting,but I will wait to test until it is available to the normal Celestia.I read and think it?s too complicated to work in a SVN version that it isn?t present in Cartrite?s site.But no hurry;I?m sure the globular rendering will be improved each time more...

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Re: My Globular Cluster Package for Testing

Post #63by ANDREA » 20.09.2008, 16:33

Vincent wrote:Fridger, I get black globulars at high zoom value (see screenshot below)
Here's how you can try to reproduce the problem:
- Select M80 and zoom in until FOV reaches ~1'
- Increase distance with the mouse wheel
This only happens when the observer is in the neighbourhood of the Milky Way.
As an example, this doesn't happen when I move the observer out of the Milky
Way and try the above procedure with Pal5 instead of M80. It seems that the
problem is due to the superposition of galaxies and globulars sprites...
Yes, I confirm, it happens only when the Milky Way is in the background. 8)
Bye

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

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

Re: My Globular Cluster Package for Testing

Post #64by t00fri » 20.09.2008, 16:34

danielj wrote:Very interesting,but I will wait to test until it is available to the normal Celestia.I read and think it?s too complicated to work in a SVN version that it isn?t present in Cartrite?s site.But no hurry;I?m sure the globular rendering will be improved each time more...

Daniel,

Cartrite has built already a version SVN-4449 with my new globular code. Just go and download it.

Fridger
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: My Globular Cluster Package for Testing

Post #65by Cham » 20.09.2008, 16:34

Fridger,

I'll try your suggestion next. But here's a quick reproduction of the dark blurry disk I was talking about (I rised the luminosity and contrast of the picture to reveal clearly the dark disk effect) :
dark-disk.jpg
"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!"

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: My Globular Cluster Package for Testing

Post #66by Vincent » 20.09.2008, 16:39

Vincent wrote:Fridger,

I get black globulars at high zoom value (see screenshot below)
Here's how you can try to reproduce the problem:
- Select M80 and zoom in until FOV reaches ~1'
- Increase distance with the mouse wheel

This only happens when the observer is in the neighbourhood of the Milky Way.
As an example, this doesn't happen when I move the observer out of the Milky
Way and try the above procedure with Pal5 instead of M80. It seems that the
problem is due to the superposition of galaxies and globulars sprites...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

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

Re: My Globular Cluster Package for Testing

Post #67by t00fri » 20.09.2008, 16:40

Vincent wrote:Fridger,

I get black globulars at high zoom value (see screenshot below)
Here's how you can try to reproduce the problem:
- Select M80 and zoom in until FOV reaches ~1'
- Increase distance with the mouse wheel

This only happens when the observer is in the neighbourhood of the Milky Way.
As an example, this doesn't happen when I move the observer out of the Milky
Way and try the above procedure with Pal5 instead of M80. It seems that the
problem is due to the superposition of galaxies and globulars sprites...

Yes that's right, but here we need Chris L's OGL expertise. Apparently something gets wrong with the glBlendFunc() when there are superimposed galaxies in addition.

But anyway, I am used to plenty of analogous effects since a long time which also showed there is a rendering bug of some kind. Hence this calls for a /general/ solution beyond the new code.

@Andrea: this also applies to the phenomena you spotted earlier.

Fridger
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Re: My Globular Cluster Package for Testing

Post #68by Cham » 20.09.2008, 16:41

t00fri wrote:since the recompiling only takes < 1 minute, it would really be of diagnostic value if you did comment out

if (wgt < 0.95f)

I tried this. I don't see any differences yet. What is this supposed to do ?
"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!"

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

Re: My Globular Cluster Package for Testing

Post #69by t00fri » 20.09.2008, 16:45

Cham wrote:
t00fri wrote:since the recompiling only takes < 1 minute, it would really be of diagnostic value if you did comment out

if (wgt < 0.95f)

I tried this. I don't see any differences yet. What is this supposed to do ?

Get possibly rid of that dark disk. It's a culling statement which might unexpectedly act somewhat different if the monitor resolutions differ.

Anyway, ChrisL has a MAC and he can surely analyze that effect most concisely. I cannot see anything of that sort on my machines and operating systems.

Fridger
Image

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

Re: My Globular Cluster Package for Testing

Post #70by chris » 20.09.2008, 16:55

t00fri wrote:
Cham wrote:
t00fri wrote:since the recompiling only takes < 1 minute, it would really be of diagnostic value if you did comment out

if (wgt < 0.95f)

I tried this. I don't see any differences yet. What is this supposed to do ?

Get possibly rid of that dark disk. It's a culling statement which might unexpectedly act somewhat different if the monitor resolutions differ.

Anyway, ChrisL has a MAC and he can surely analyze that effect most concisely. I cannot see anything of that sort on my machines and operating systems.

Fridger

I can get this effect on my Windows machine too. It's a result of the blend mode. Additive blending would solve the problem, but I thought that you perhaps chose a different blend mode to avoid getting overbright clusters. I'll take a look at the code shortly.

--Chris

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

Re: My Globular Cluster Package for Testing

Post #71by selden » 20.09.2008, 16:58

I defined a "real" Star near the center of 47 Tuc. After going to it, it's fun to make all those cluster stars swirl around (by rotating around the Star) with no reduction of framerate.

Code: Select all

Star "T47"
{
        RA                 6.021 # degrees = 0.4014  # [hours]
        Dec              -72.0808  # [degrees]
        Distance        1.4681e+04  # [ly]

   SpectralType "G2V"
   AbsMag 4.93
}
Selden

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

Re: My Globular Cluster Package for Testing

Post #72by t00fri » 20.09.2008, 17:04

chris wrote:I can get this effect on my Windows machine too. It's a result of the blend mode. Additive blending would solve the problem, but I thought that you perhaps chose a different blend mode to avoid getting overbright clusters. I'll take a look at the code shortly.

--Chris

Aha? But if you can have a look at the OGL stuff it's certainly the most effective action, given my rather basic OGL knowledge.

Fridger
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: My Globular Cluster Package for Testing

Post #73by cartrite » 20.09.2008, 17:10

Concerning the KDE version and the Shift + u and Shift + e, I revised kdeapp.cpp and kdeapp.h and was able to get them working. I am including the files in a zip file attached here.
kdeapp.zip

Never posted a zip file here so I hope it works.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

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

Re: My Globular Cluster Package for Testing

Post #74by t00fri » 20.09.2008, 17:28

cartrite wrote:Concerning the KDE version and the Shift + u and Shift + e, I revised kdeapp.cpp and kdeapp.h and was able to get them working. I am including the files in a zip file attached here.
kdeapp.zip

Never posted a zip file here so I hope it works.
cartrite

Thanks, Steve.

so far the patch looks good to me. If there are no further complaints, do you want me to commit it?

Fridger
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: My Globular Cluster Package for Testing

Post #75by cartrite » 20.09.2008, 17:39

I haven't seen any negative side affects. The options or labels guis are not affected. If you want you can commit it but given this is the first time I did such a thing, maybe we should wait till others can confirm that this does not cause any conflicts? I leave it up to you.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

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

Re: My Globular Cluster Package for Testing

Post #76by t00fri » 20.09.2008, 17:42

cartrite wrote:I haven't seen any negative side affects. The options or labels guis are not affected. If you want you can commit it but given this is the first time I did such a thing, maybe we should wait till others can confirm that this does not cause any conflicts? I leave it up to you.
cartrite

Indeed I was meaning to wait a bit of course.

Fridger
Image

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

Re: My Globular Cluster Package for Testing

Post #77by t00fri » 20.09.2008, 17:50

selden wrote:I defined a "real" Star near the center of 47 Tuc. After going to it, it's fun to make all those cluster stars swirl around (by rotating around the Star) with no reduction of framerate.

Code: Select all

Star "T47"
{
        RA                 6.021 # degrees = 0.4014  # [hours]
        Dec              -72.0808  # [degrees]
        Distance        1.4681e+04  # [ly]

   SpectralType "G2V"
   AbsMag 4.93
}

Cute!

Fridger
Image

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

Re: My Globular Cluster Package for Testing

Post #78by chris » 20.09.2008, 17:51

Here's a patch that addresses the black stars and core in globulars.

glob-patch.zip


I changed just two lines in globular.cpp. First the blending of the sprite:

Code: Select all

@@ -387,7 +387,7 @@
    if (br > 1.0f)
       br = 1.0f;
 
-   glColor4f(Rr * br, Gg * br, Bb * br, A);   
+    glColor4f(Rr, Gg, Bb, A * br);
       
    glBegin(GL_QUADS);      


The alpha factor is multiplied by the brightness instead of the color components. Since source blend mode is GL_SRC_ALPHA, the color components will be multiplied by the alpha factor during rasterization. Thus, my patch results in no change to the color of the stars. Multiplying alpha by br means that a dark cloud sprite will also tend to be nearly transparent.

The change for stars is quite similar:

Code: Select all

       
@@ -462,7 +462,7 @@
       
          Color col  = (r_3d < 2 * r_c && pow2 < 256)? colorTable[255]: colorTable[iR];      
       
-         glColor4f(col.red() * br, col.green() * br, col.blue() * br, 1.0f - wgt);
+         glColor4f(col.red(), col.green(), col.blue(), (1.0f - wgt) * br);
                   
          Point3f relPos = p + offset;


I think that this is OK. Certainly it fixes the dark stars problem, but I look at the code some more to better understand the role of the (1 - wgt) term.

I will also have a look at the possibility of using additive blending.

--Chris

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

Re: My Globular Cluster Package for Testing

Post #79by ElChristou » 20.09.2008, 17:53

t00fri wrote:Christophe, Cham

since the recompiling only takes < 1 minute, it would really be of diagnostic value if you did comment out

if (wgt < 0.95f)

in line 452 of globular.cpp and quickly recompile.

It's better but I'm still able to see a smallest black hole. Now, when I go away from a cluster, the center disappear before all. Is this normal?
Image

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

Re: My Globular Cluster Package for Testing

Post #80by t00fri » 20.09.2008, 18:18

chris wrote:Here's a patch that addresses the black stars and core in globulars.

glob-patch.zip


I changed just two lines in globular.cpp. First the blending of the sprite:

Code: Select all

@@ -387,7 +387,7 @@
    if (br > 1.0f)
       br = 1.0f;
 
-   glColor4f(Rr * br, Gg * br, Bb * br, A);   
+    glColor4f(Rr, Gg, Bb, A * br);
       
    glBegin(GL_QUADS);      


The alpha factor is multiplied by the brightness instead of the color components. Since source blend mode is GL_SRC_ALPHA, the color components will be multiplied by the alpha factor during rasterization. Thus, my patch results in no change to the color of the stars. Multiplying alpha by br means that a dark cloud sprite will also tend to be nearly transparent.

The change for stars is quite similar:

Code: Select all

       
@@ -462,7 +462,7 @@
       
          Color col  = (r_3d < 2 * r_c && pow2 < 256)? colorTable[255]: colorTable[iR];      
       
-         glColor4f(col.red() * br, col.green() * br, col.blue() * br, 1.0f - wgt);
+         glColor4f(col.red(), col.green(), col.blue(), (1.0f - wgt) * br);
                   
          Point3f relPos = p + offset;


I think that this is OK. Certainly it fixes the dark stars problem, but I look at the code some more to better understand the role of the (1 - wgt) term.

I will also have a look at the possibility of using additive blending.

--Chris

Chris,

that sounds almost too simple to me?

Your patch does not affect the RGB colors. No doubt about that ;-)

BUT....

The way I constructed things in alpha was as follows:
--------------------------------------------------------------------

The procedural "cloud" texture is RGBA, with A containing as a weight ONLY the
rho-dependent part

relStarDensity(rho) ; rho = r_2d / r_c

of the overall alpha blending weight.

The resolution dependent (pixelWeight), but rho-independent part is subsequently implemented into the cloud texture via

glColor4f(Rr * br, Gg * br, Bb * br, A);

where A = 3.0f * pixelWeight

Hence altogether we have the overall alpha-weight for the cloud texture:

A * relStarDensity(rho)

For the star sprite textures, the overall blending weight should be

1 - A * relStarDensity(r_2d / r_c))

in order to maintain the underlying King profile, independently of the blending transition. That's what it is in my code!

It seems to me that your simple proposal breaks that basic relation once you multiply with the factor br. At least that's why I didn't do that!

Fridger
Last edited by t00fri on 20.09.2008, 18:28, edited 5 times in total.
Image


Return to “Development”