Advanced lighting?
I've recently experimented with bringing HDR to Celestia.
My version does NOT use shaders. It runs even in the Basic render path.
However dynamic range is only 2x.
Here's what a star looks like before:
After:
Venus:
Technical details:
- Does not use float buffers, scene is stored compressed 2x in a regular 8bpp RGBA texture so antialiasing, alpha blending comes for free
(but dynamic range is not very high, also there will be mach banding etc but texture mapping tends to hide this...)
- Uses glCopyTexImage2D and blending instead of FBO and shaders etc so backward compatibility is very high
(ought to work 100% even on a Geforce 4MX)
Speed can be slow, but on my 9700 it's much faster than ATI's simple HDR demo (which uses float buffers)
- "Tone mapping" is very simplistic, stars are not handled so no star fading yet
- Model and bump mapping illumination currently incorrect
Citations:
"Practical Implementation of SH Lighting and HDR Rendering on PlayStation 2"
Yoshiharu Gotanda, Tatsuya Shoji, 2005.
My version does NOT use shaders. It runs even in the Basic render path.
However dynamic range is only 2x.
Here's what a star looks like before:
After:
Venus:
Technical details:
- Does not use float buffers, scene is stored compressed 2x in a regular 8bpp RGBA texture so antialiasing, alpha blending comes for free
(but dynamic range is not very high, also there will be mach banding etc but texture mapping tends to hide this...)
- Uses glCopyTexImage2D and blending instead of FBO and shaders etc so backward compatibility is very high
(ought to work 100% even on a Geforce 4MX)
Speed can be slow, but on my 9700 it's much faster than ATI's simple HDR demo (which uses float buffers)
- "Tone mapping" is very simplistic, stars are not handled so no star fading yet
- Model and bump mapping illumination currently incorrect
Citations:
"Practical Implementation of SH Lighting and HDR Rendering on PlayStation 2"
Yoshiharu Gotanda, Tatsuya Shoji, 2005.
-
- Posts: 18
- Joined: 18.07.2007
- With us: 17 years 4 months
- Location: Shelton, Washington
dirkpitt wrote:I've recently experimented with bringing HDR to Celestia.
My version does NOT use shaders. It runs even in the Basic render path.
However dynamic range is only 2x.
Here's what a star looks like before:
After:
Venus:
Technical details:
- Does not use float buffers, scene is stored compressed 2x in a regular 8bpp RGBA texture so antialiasing, alpha blending comes for free
(but dynamic range is not very high, also there will be mach banding etc but texture mapping tends to hide this...)
- Uses glCopyTexImage2D and blending instead of FBO and shaders etc so backward compatibility is very high
(ought to work 100% even on a Geforce 4MX)
Speed can be slow, but on my 9700 it's much faster than ATI's simple HDR demo (which uses float buffers)
- "Tone mapping" is very simplistic, stars are not handled so no star fading yet
- Model and bump mapping illumination currently incorrect
Citations:
"Practical Implementation of SH Lighting and HDR Rendering on PlayStation 2"
Yoshiharu Gotanda, Tatsuya Shoji, 2005.
Oh my GOD! Please say that rendering will make it to Celestia 1.5.0's official release! That star rendering looks fantastic! Very realistic!
And for the Venus rendering, I assume that when you look at it more directly (read, near full in phase) will the center of the planet's disk appear a near-white as it does in reality? That rendering there is almost *EXACTLY* like what I see through my high-powered Meade ETX telescope!
Excellent, excellent work! I sure hopes it hits 1.5.0's official release, and furthermore maybe an option to enable/disable it via the "Render options" dialog?
Again, I'm very impressed!
- Chuft-Captain
- Posts: 1779
- Joined: 18.12.2005
- With us: 18 years 11 months
Ditto to srosenow_98's comments.
Very, very cool (well *hot* actually) dirkpitt. I can almost feel the searing heat of that sun!
I'm particularly impressed that you've achieved this in a basic render path. This means even my lowly graphics hardware may one day be able to display this.
Very, very cool (well *hot* actually) dirkpitt. I can almost feel the searing heat of that sun!
I'm particularly impressed that you've achieved this in a basic render path. This means even my lowly graphics hardware may one day be able to display this.
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)
CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS
-- Gerard K. O'Neill (1969)
CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
srosenow_98 wrote:Oh my GOD! Please say that rendering will make it to Celestia 1.5.0's official release! That star rendering looks fantastic! Very realistic!
And for the Venus rendering, I assume that when you look at it more directly (read, near full in phase) will the center of the planet's disk appear a near-white as it does in reality? That rendering there is almost *EXACTLY* like what I see through my high-powered Meade ETX telescope!
Excellent, excellent work! I sure hopes it hits 1.5.0's official release, and furthermore maybe an option to enable/disable it via the "Render options" dialog?
This is strictly an unofficial experiment at this point - it is far from release quality. (It's probably too optimistic to expect anything like this in 1.5.0...)
This said, yes, the sunlit side of Venus does become almost white. And I already made an instant keyboard toggle for myself for easier debugging.
Performance wise, currently frame rate is roughly proportional to the window area so it takes a big hit if the window is large (e.g., full screen).
I have a couple of ideas on how to fix that though.
Christophe - there are a couple of obvious quality problems I'd like to fix first.
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
Nice work DW! The appearance of brilliance for stars is quite good. If you can work out some of the nits, this would be a nice option to offer users with graphics cards that ca't support full HDR. How does it work with labels and orbits? I supose these end up getting the bloom effect applied if they're too bright. I wonder if it might be possible to take advantage of destination alpha to mark only certain pixels for bloom?
And speaking of full HDR, the key feature that is required is support for 16-bit floating point frame buffers with alpha blending. Some older hardware (GeForce FX, Radeon X800, Radeon 9x00 series) have 16-bit floating point frame buffers, but without support for alpha blending with these formats, it's not much use. Later cards should all be able to do true HDR, though we'll have to be a little careful with the limited range of 16-bit floating point values. The GeForce 8 series supports alpha blending with 32-bit floating point frame buffers, but I have big concerns about performance.
--Chris
And speaking of full HDR, the key feature that is required is support for 16-bit floating point frame buffers with alpha blending. Some older hardware (GeForce FX, Radeon X800, Radeon 9x00 series) have 16-bit floating point frame buffers, but without support for alpha blending with these formats, it's not much use. Later cards should all be able to do true HDR, though we'll have to be a little careful with the limited range of 16-bit floating point values. The GeForce 8 series supports alpha blending with 32-bit floating point frame buffers, but I have big concerns about performance.
--Chris
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
chris wrote:How does it work with labels and orbits? I suppose these end up getting the bloom effect applied if they're too bright. I wonder if it might be possible to take advantage of destination alpha to mark only certain pixels for bloom?
Yes, orbits and labels still need to be handled specially. That's why none of the above screenshots show any labels, orbits, or markers.
-
- Developer
- Posts: 3776
- Joined: 04.02.2005
- With us: 19 years 9 months
yes, please give us at least a patch-file.
i'm dying to see this live
i'm dying to see this live
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)
dirkpitt wrote:Here's another test.
I call this "3 Phases of Venus" aka "ElChristou look - stars now adapt brightness!"
I think this is wonderful, the final solution, indeed.
It's like if my iris opens as soon as Venus luminosity dims, exactly what really happens.
Very appreciated, dirkpitt, thank you.
Bye
Andrea
"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
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
There's still a couple of major eyesores that I need to fix before any sort of public testing.
In particular, star brightness away from any visible planets suddenly jumps.
Currently, I'm only basing saturation mag ("max" brightness) on the brightest body (planet/model).
If there are no nearby planets or satellites I need to tone down the saturation mag smoothly.
A related issue causes stars to not yet darken if there's a bright sun in the scene.
Also, bloom quality is dreadful. (Luckily I think it's a simple mistake)
There are lots of other issues, but fixing the above is probably enough for a "first milestone".
In particular, star brightness away from any visible planets suddenly jumps.
Currently, I'm only basing saturation mag ("max" brightness) on the brightest body (planet/model).
If there are no nearby planets or satellites I need to tone down the saturation mag smoothly.
A related issue causes stars to not yet darken if there's a bright sun in the scene.
Also, bloom quality is dreadful. (Luckily I think it's a simple mistake)
There are lots of other issues, but fixing the above is probably enough for a "first milestone".
-
- Posts: 53
- Joined: 19.03.2007
- With us: 17 years 8 months
- Location: united kingdom
This may seem like a very basic question, but...
I'm having trouble trying to reconcile the relative brightnesses of:
- Dark side of Venus (Celestia claims apparent magnitude ~ -15 ?!)
- Deep space (Celestia claims ~ 3)
Why is the dark side of Venus (seen close up) so bright?
For comparison, Wikipedia claims that the full moon, as seen from Earth with no atmosphere, has apparent magnitude ~ -12.6.
Why is the dark side of a planet "brighter" than the full moon?
Are non-visible wavelengths being considered by Celestia's calculations?
BTW, Pluto's dark side is -6 ~ -7 at ~ 10,000 km. This seems unusually bright..
I'm having trouble trying to reconcile the relative brightnesses of:
- Dark side of Venus (Celestia claims apparent magnitude ~ -15 ?!)
- Deep space (Celestia claims ~ 3)
Why is the dark side of Venus (seen close up) so bright?
For comparison, Wikipedia claims that the full moon, as seen from Earth with no atmosphere, has apparent magnitude ~ -12.6.
Why is the dark side of a planet "brighter" than the full moon?
Are non-visible wavelengths being considered by Celestia's calculations?
BTW, Pluto's dark side is -6 ~ -7 at ~ 10,000 km. This seems unusually bright..
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
dirkpitt wrote:This may seem like a very basic question, but...
I'm having trouble trying to reconcile the relative brightnesses of:
- Dark side of Venus (Celestia claims apparent magnitude ~ -15 ?!)
- Deep space (Celestia claims ~ 3)
Why is the dark side of Venus (seen close up) so bright?
For comparison, Wikipedia claims that the full moon, as seen from Earth with no atmosphere, has apparent magnitude ~ -12.6.
Why is the dark side of a planet "brighter" than the full moon?
Are non-visible wavelengths being considered by Celestia's calculations?
BTW, Pluto's dark side is -6 ~ -7 at ~ 10,000 km. This seems unusually bright..
There are a few things going on here . . . Venus has a much higher albedo than the Moon, is closer to the Sun, is larger (thus reflecting more light overall), and although you don't specify as much, my guess is that the camera is also closer to Venus than the Earth-moon distance. Unless the phase angle is exactly 180, Venus is going to seem quite bright; in fact, light forward scattered by the atmosphere will make Venus appear brilliant even at 180, though Celestia doesn't account for this in it's magnitude calculation.
However . . . One significant factor that Celestia's apparent magnitude calculation does not take into account is perspective. When you're close the surface of Venus on the side opposite the Sun, you won't see any lit portions because they are over the horizon. Since the apparent magnitude function is currently used to determine the brightness of planets so distant that they're rendered as points, this geometric shortcut isn't a problem. But, it's a serious shortcoming for your usage; you'll have to write a new, more complicated apparent magnitude function to use when perspective can't be neglected.
There will always be limitations with this approach to calculating overall scene brightness, even with a new apparent magnitude function. Irregular objects won't be handled correctly, and eclipses will give you headaches. I'm not saying this to discourage you from trying: it's probably the only thing that will work when using 8 bit per channel frame buffers, and on many graphics cards 8 bits is all you get.
--Chris
chris wrote:light forward scattered by the atmosphere will make Venus appear brilliant even at 180, though Celestia doesn't account for this in it's magnitude calculation.
In fact a quick search also uncovered a page of Venus transit observations that describe this Titan-like atmospheric "ring": Transit of Venus 2004