Per Pixel Lighting/Real time shadows

Paratus

Lifer
Jun 4, 2004
17,527
15,579
146
At work we've got issues calculating shadows that fall across the solar arrays for the International Space Station. Those calculations are part of the analysis done to predict power generation from the solar cells. Each run takes several hours basically because the certified tools were all written in the late eighties

So.......


Could the D3 engine (or others) be used to perform real time shadow and lighting across the solar arrays, if it was provided with a 3d model of the station along with the appropriate data on sun/earth positions.

Basically I'm asking whether any current engine actually calculates real lighting and shadows or are they all approximations? If a current engine does this could it be done on a GPU in real time?

 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
The main trouble would be how the D3 engine outputs the data. Right now it feeds the data right to the renderer and displays an image on the screen. How would you get that data before it is sent to the renderer?

This may interest you: http://en.wikipedia.org/wiki/GPGPU

Take a look at the Applications section. I can imagine the nightmare of making a GPU app though. :Q Then again, I can also imagine how hard it is to calculate light rays so maybe it'll be easy for those people.

They have an example of calculating radiosity in this pdf: http://developer.nvidia.com/object/gpgpu_beyond_graphics.html

Brook GPU programming language: http://graphics.stanford.edu/projects/brookgpu/

GPGPU.org is also a good resource but it seems to be down at the moment.
 

Paratus

Lifer
Jun 4, 2004
17,527
15,579
146
Originally posted by: xtknight
The main trouble would be how the D3 engine outputs the data. Right now it feeds the data right to the renderer and displays an image on the screen. How would you get that data before it is sent to the renderer?

This may interest you: http://en.wikipedia.org/wiki/GPGPU

Take a look at the Applications section. I can imagine the nightmare of making a GPU app though. :Q Then again, I can also imagine how hard it is to calculate light rays so maybe it'll be easy for those people.

They have an example of calculating radiosity in this pdf: http://developer.nvidia.com/object/gpgpu_beyond_graphics.html

Brook GPU programming language: http://graphics.stanford.edu/projects/brookgpu/

GPGPU.org is also a good resource but it seems to be down at the moment.

Some good links there. I'm going to have to take a closer look at them.

Thanks!
 

Munky

Diamond Member
Feb 5, 2005
9,372
0
76
Even modern games heavily rely on approximations to speed up performance. Im not sure on the exact internal workings of the Doom3 engine, but no engine to date models lighting 100% accurately. If you just want a quick test to see if a polygon is inside a shadow of another object or not, then D3-style stencil shadows will do the job just fine. But it will definitely not account for details sush as scattered light reflecting off other objects and illuminating the polygon that's supposed to be shadowed from direct lighting. For those types of rendering, you're dealing with raytracing, and while it could be accelerated on a gpu, it's more complicated than D3 style lighting.

The other approach is instead of rendering the scene directly, you could use a gpu to calculate all the math for the lighting model you're using, and then send the results back to the cpu. The basic approach is you use pixel shaders to do the heavy math, and store the results in a texture. Then you copy the texture into a buffer in main memory, and then the cpu can continue to work with the data. In that regard a modern high end gpu will certainly leave any desktop cpu in the dust, but the only drawback is that gpu's are more limited than cpus in things like numeric precision, data types, and of course dynamic branching.