Improved rendering - a preview

The place to discuss creating, porting and modifying Celestia's source code.

Moderator: selden

Improved rendering - a preview

Postby chris » Sat Jul 08, 2006 5:21 pm

I've been working lately on improving the Celestia's rendering of meshes, which has for a long time lagged behind planet rendering and modern graphics hardware capabilities. I've implemented a lot of things which will make meshes look a lot better:

- Models can be shadowed by spherical bodies. Eclipse shadows appear on irregular bodies just as they do on spherical bodies. Satellites in low earth orbit will slip in and out of shadow as the orbit over the night side of Earth. Irregular objects will still not cast shadows themselves, however; that's work for the future.

- The specular lighting model uses a local viewer; this slightly improves the appearance of specular highlights. It affects both spheres and models.

- Models can use emissive, specular, and normal maps (emissive maps had been supported before)

- There's a new 'per-pixel specular' mode that greatly improves the appearance of specular highlights, especially on models with sharply curved surfaces or low tesselation. The tradeoff is that it's slower. I haven't decided how this mode should be toggled on and off.

- When per-pixel specular mode is on, specular highlights will be rendered correctly on normal mapped surfaces (prior to these changes, the normal map is disregarded for specular lighting, with the surface modification only affecting diffuse lighting--it's fine for oceans, but not generally correct.)

Here's demonstration of per-pixel specular lighting. This 'glossy Mars' is not meant to present a realistic example, although specular highlights can be very useful for visualization of surface relief. I anticipate that per-pixel specular lighting will be much more useful for meshes of spacecraft; I'm still in the process of creating a good demonstration.

No bump map (basic render path) or specular lighting:
Image

Bump map, per vertex specular lighting (vertex program path)
Image

Bump map with per pixel specular (OpenGL 2.0 path); this image also demonstrates that the new rendering mode works with multiple light sources.
Image

The new effects are only available in the OpenGL 2.0 render path.

--Chris
User avatar
chris
Site Admin
 
Posts: 4166
Joined: Mon Jan 28, 2002 12:21 pm
Location: Seattle, Washington, USA

Postby buggs_moran » Sat Jul 08, 2006 7:35 pm

Cool! The per pixel speculars will be great on icy moons and metal objects. I love that you are posting a preview of things to come here. I wish it would happen more often from the devs so we non-devs can get a grasp on the future. Especially for model/addon builders.
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M
User avatar
buggs_moran
 
Posts: 827
Joined: Mon Sep 27, 2004 11:04 am
Location: Massachusetts, USA

Postby ANDREA » Sun Jul 09, 2006 2:12 am

Wow Chris, this improvement looks very interesting, and I suppose that other effects could be achievable after this, now or in the next future. :wink:
BTW, I can't wait to see what happens to spacecrafts! 8)
And I fully agree with Buggs, thank you for sharing the state of art of next changes, well done! :D
Bye

Andrea :D
Core 2 Quad Q6600 G0 3.6 GHz- 4 GB DDR2
DELL 2709W 1920x1200-WinXP 32 SP3
WIN 7 64 bit- ASUS P5K-E- 8800 GTX 768MB
SATA II 1.0 TB-320 GB- IDE 1.0 TB EXT-180.43- Celestia 1.6.1
Celestia1.4.1_patch3- Vincent's LUA Edu Tools 1.2
User avatar
ANDREA
 
Posts: 1529
Joined: Sat Jun 01, 2002 4:50 pm
Location: Rome, ITALY

Postby jll » Sun Jul 09, 2006 4:17 am

Wonderful 8O

Does this improvement is only for planet and spacecraft meshes or it runs for nebula meshes too ?

Thanks
JLL
AMD Ath1800+ 512mb : Nvidia GeForce6200 AGP 256mb
WinXPPro:FS1280x1024x32:
Celestia 1.4.1:Earth 4Kdds:Clouds 4Kdds:Night 4Kdds:Moon 4kdds:Galaxy ON
User avatar
jll
 
Posts: 64
Joined: Wed Jun 12, 2002 2:46 pm

Re: Improved rendering - a preview

Postby ElChristou » Sun Jul 09, 2006 5:01 am

TX for those improvement Chris!
The specular highlights are really much better!
(a pity I cannot use OpenGL 2... :x ...but this will change soon :D)

chris wrote:...
- Models can use emissive, specular, and normal maps (emissive maps had been supported before)...


How do you declare a spec or normal map on models?
Image
User avatar
ElChristou
 
Posts: 3807
Joined: Fri Feb 04, 2005 2:05 pm
Location: A Frenchie in Paraguay (South America)

Postby Chuft-Captain » Sun Jul 09, 2006 5:25 am

What do you mean...specular highlights? More like spectacular highlights! :wink: ).
That's looking awesome Chris. It's amazing how much more depth this gives to the contours! Is this likely to be in the next release, or a later one?

Damn! I too, do not have OpenGL 2.0 path. :evil:

BTW: Roughly, what's the performance cost of this?
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

O'NEILL COLONY
User avatar
Chuft-Captain
 
Posts: 1433
Joined: Sun Dec 18, 2005 1:26 am

Re: Improved rendering - a preview

Postby chris » Sun Jul 09, 2006 8:12 am

ElChristou wrote:TX for those improvement Chris!
The specular highlights are really much better!
(a pity I cannot use OpenGL 2... :x ...but this will change soon :D)


Very glad to hear that! What graphics card are you getting?

ElChristou wrote:
chris wrote:...
- Models can use emissive, specular, and normal maps (emissive maps had been supported before)...


How do you declare a spec or normal map on models?


In an ASCII cmod file, a full material definition looks like this:
Code: Select all
material
diffuse 0.5 0.5 0.2
specular 1 1 1
specpower 30
opacity 1
texture0 "basetex.jpg"
normalmap "norm.png"
specularmap "specmask.jpg"
emissivemap "lights.jpg"


All these attributes are also available in the binary format. I think that the 3DS file format may also have a place for a specular mask; if so, I can add it to the 3dstocmod converter so that there's a way to get use specular masks without hand editing ASCII cmod files. Do you have a modeling tool that can work with a specular mask?

--Chris
User avatar
chris
Site Admin
 
Posts: 4166
Joined: Mon Jan 28, 2002 12:21 pm
Location: Seattle, Washington, USA

Postby Dollan » Sun Jul 09, 2006 8:18 am

I'm probably being thick here, but... will this help with the problem of some 3ds models suddenly turning emissive when a planet passes into the field of view?

...John...
"To make an apple pie from scratch, you must first create the universe..."
--Carl Sagan
User avatar
Dollan
 
Posts: 1140
Joined: Thu Dec 18, 2003 6:33 am
Location: Havre, Montana

Postby chris » Sun Jul 09, 2006 8:20 am

Chuft-Captain wrote:What do you mean...specular highlights? More like spectacular highlights! :wink: ).
That's looking awesome Chris. It's amazing how much more depth this gives to the contours! Is this likely to be in the next release, or a later one?

Damn! I too, do not have OpenGL 2.0 path. :evil:

BTW: Roughly, what's the performance cost of this?


The new lighting will be in the next prerelease.

Per-pixel specular lighting requires a good amount of graphics power, especially with multiple light sources. But newer graphics hardware tears through even quite complex scenes like the third Mars image. My GeForce 7900 GTX renders it at 60Hz (refresh rate) even at the full monitor resolution of 2560x1600.

--Chris
User avatar
chris
Site Admin
 
Posts: 4166
Joined: Mon Jan 28, 2002 12:21 pm
Location: Seattle, Washington, USA

Postby jestr » Sun Jul 09, 2006 8:44 am

Hi Chris,this work looks a great improvement,can't wait to test it out on some models.Will the ability to use spec,emissive and normal maps be useable for 3ds models also,or only on cmod models?In 3ds Max I can add all sorts of maps to the models-specular,glossiness,self-illumination (emissive?),opacity,bump (normal),reflection,refraction,and displacement,but I dont know if all of these links are exported in a 3ds model file.Thanks for all your great work,Jestr
jestr
 
Posts: 612
Joined: Sun Sep 14, 2003 7:40 am
Location: Bridgwater,UK

Postby Cham » Sun Jul 09, 2006 10:08 am

This looks very promising. I can't wait to have it all implemented in the official version. Nebulae need special attention, too.
"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!"
User avatar
Cham
 
Posts: 3742
Joined: Wed Jan 14, 2004 9:01 am
Location: Montreal

Postby selden » Sun Jul 09, 2006 1:19 pm

Here's what I see on my home system after compiling today's CVS code.
I'm getting 60 fps performance at ~1600x1200.
This is seen when I put the following .SSC file in /extras/
Code: Select all
Modify "Mars" "Sol" {
   SpecularColor [ 0.5 0.5 0.55 ]
   SpecularPower 25.0
}


Image
vertex shader render path

Image
ogl2 render path

[edit]
Note the highlights on Valles Marineris in the ogl2 path, which are not visible in the vertex shader path.

System:
1GB 3.4GHz P4-550, WinXP Pro sp2
128MB GF 6600GT, ForceWare 84.21
Celestia from CVS
[/edit]
Selden
User avatar
selden
 
Posts: 9075
Joined: Tue Sep 03, 2002 7:21 pm
Location: NY, USA

Postby t00fri » Sun Jul 09, 2006 4:21 pm

Image

My 64k Earth looks unbelievable with the new code.

Bye Fridger
Image
User avatar
t00fri
 
Posts: 8254
Joined: Fri Mar 29, 2002 5:53 am
Location: Hamburg, Germany

Postby Cham » Sun Jul 09, 2006 4:26 pm

t00fri wrote:
My 64k Earth looks unbelievable with the new code.

Bye Fridger


Mars, or Earth ? Can we see more ?
"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!"
User avatar
Cham
 
Posts: 3742
Joined: Wed Jan 14, 2004 9:01 am
Location: Montreal

Postby buggs_moran » Sun Jul 09, 2006 5:53 pm

Reeeeeeealy starting to think I should give compiling a try again...
Homebrew:
WinXP Pro SP2
Asus A7N8X-E Deluxe
AMD Athlon XP 3000/333 2.16 GHz
1 GB Crucial RAM
80 GB WD SATA drive
ATI AIW 9600XT 128M
User avatar
buggs_moran
 
Posts: 827
Joined: Mon Sep 27, 2004 11:04 am
Location: Massachusetts, USA

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 0 guests