Page 1 of 1

Shadows and reflections

Posted: 20.08.2010, 06:50
by chris
Jason-1 oceanography mission shown with shadows and reflections. The model is from the NASA 3D resources site:

http://www.nasa.gov/multimedia/3d_resources/models.html
(converted used Autodesk's FBX Converter)

jason1.jpg


--Chris

Re: Post your Celestia pictures!

Posted: 20.08.2010, 07:51
by Chuft-Captain
chris wrote:Jason-1 oceanography mission shown with shadows and reflections. The model is from the NASA 3D resources site:

http://www.nasa.gov/multimedia/3d_resources/models.html
(converted used Autodesk's FBX Converter)

jason1.jpg


--Chris
Reflections as well as shadows! That's a nice surprise! Is this in SVN? :)

Re: Post your Celestia pictures!

Posted: 20.08.2010, 09:28
by Hungry4info
That is beyond WOW.!! 8O

Re: Post your Celestia pictures!

Posted: 20.08.2010, 11:15
by selden
Chris,

Could you provide the same sceen drawn by Celestia v1.6.0 to show just how much better the new algorithms look?

Re: Post your Celestia pictures!

Posted: 20.08.2010, 16:46
by chris
selden wrote:Chris,

Could you provide the same sceen drawn by Celestia v1.6.0 to show just how much better the new algorithms look?

Here are some comparisons with ordinary rendering, shadows only, and finally with both shadows and reflections:

jason-normal.png

jason-shadow.png

jason-reflect.png


There's nothing too cutting edge here: the code just renders the scene six times into the faces of a 512x512 cube map, and that cube map is used for per-pixel reflections. It's a brute force way of doing reflections, but the results are fairly high quality. Note that there are no reflections of the spacecraft geometry. Only background objects are drawn into the cube map. This both saves rendering time and prevents artifacts. If you want a complex object to show reflections of its own geometry, then you need something like proper ray tracing.

This code is not ready to go into the Celestia SVN repository right now, unfortunately.

--Chris

Re: Shadows and reflections

Posted: 21.08.2010, 13:46
by Chuft-Captain
Q1: How do you determine what's a "background" object? Is a background object defined as "any object other than the object the reflections fall on"?
ie. If the solar panels were to implemented as a separate mesh and positioned in SSC, would they then reflect the "background" spacecraft body? (and visa-versa)

Q2: How are you determining how reflective each object is? I'm assuming this is determined by the surface properties defined in the modeling tool...eg. Animator

CC

Re: Shadows and reflections

Posted: 21.08.2010, 18:23
by Reiko
So this means meshes will now be able to cast shadows? :D

Re: Shadows and reflections

Posted: 22.08.2010, 17:08
by chris
Chuft-Captain wrote:Q1: How do you determine what's a "background" object? Is a background object defined as "any object other than the object the reflections fall on"?
ie. If the solar panels were to implemented as a separate mesh and positioned in SSC, would they then reflect the "background" spacecraft body? (and visa-versa)

Background objects are those located at a distance which is large relative to the size of the reflecting object(s). The background must appear very similar as seen from any reflecting point, otherwise the reflection effect won't look right. So for a spacecraft, the solar panels don't meet this requirement. But a spacecraft like ISS could be the background for a smaller object such as an astronaut's helmet:
http://cache.boston.com/universal/site_ ... 44-011.jpg
There would be slight inaccuracies since the scale difference isn't huge, but it would certainly be good enough to fool the eye.

Q2: How are you determining how reflective each object is? I'm assuming this is determined by the surface properties defined in the modeling tool...eg. Animator

I'm loading Wavefront OBJ files. The material definitions for OBJ files allow specifying whether or not a material is reflective (illumination model 3)
http://local.wasp.uwa.edu.au/~pbourke/dataformats/mtl/
I've actually changed the illumination model from the one described in the linked spec: the reflected color is modulated by the specular color and/or texture, which is key to making the gold foil look metallic instead of like glossy plastic.

--Chris

Re: Shadows and reflections

Posted: 23.08.2010, 08:25
by Chuft-Captain
chris wrote:
Chuft-Captain wrote:Q1: How do you determine what's a "background" object? Is a background object defined as "any object other than the object the reflections fall on"?
ie. If the solar panels were to implemented as a separate mesh and positioned in SSC, would they then reflect the "background" spacecraft body? (and visa-versa)
Background objects are those located at a distance which is large relative to the size of the reflecting object(s). The background must appear very similar as seen from any reflecting point, otherwise the reflection effect won't look right. So for a spacecraft, the solar panels don't meet this requirement.
.. but would they still reflect? ... (even if not very accurately) ... or are you hard-coding in some distance limits?

chris wrote:But a spacecraft like ISS could be the background for a smaller object such as an astronaut's helmet:
http://cache.boston.com/universal/site_ ... 44-011.jpg
Nice pic!
How about a 27km long cylinder as the background for 3 x 20km mirrors! (in close proximity) :wink:
... I think I'd be willing to put up with a few distorted reflections in this circumstance. :)

chris wrote:
Q2: How are you determining how reflective each object is? I'm assuming this is determined by the surface properties defined in the modeling tool...eg. Animator
I'm loading Wavefront OBJ files. The material definitions for OBJ files allow specifying whether or not a material is reflective (illumination model 3)
http://local.wasp.uwa.edu.au/~pbourke/dataformats/mtl/
I've actually changed the illumination model from the one described in the linked spec: the reflected color is modulated by the specular color and/or texture, which is key to making the gold foil look metallic instead of like glossy plastic.
Does this mean we'll have to convert our 3DS's and CMOD's to OBJ files in order to implement reflections?