PDA

View Full Version : using raytracing to create shadows



ksanim
07-31-2001, 11:30 AM
I'm sure everyone knows that OpenGL doesn't consider whether an object is obstructing another when it performs lighting calculations. Are there websites where I could learn how to implement ray tracing in OpenGL to create shadows in these instances?

If possible I'd like to find a source that teaches this at a beginner's level.

Thanks.

08-01-2001, 04:01 AM
OpenGL is for realtime graphics. You can not do ray tracing in real time.

Morglum
08-01-2001, 04:55 AM
OpenGL won't help you if you want to write a raytracer. OpenGL is only able to draw some primitives and ignores what's a light ray. But if you just want shadows, you can do it without performing raytracing. You just project one polygon over another and draw it in black. You could easily find books on this topic, for example, the superbible... On the internet, have you tried NeHe or flipcode ?

Tim Stirling
08-01-2001, 07:16 AM
Originally posted by nvidia_linux:
OpenGL is for realtime graphics. You can not do ray tracing in real time.

Thats not entirely true, realtime ray tracing does exist but it is only the simple stuf done at ultra low resolution (160*100).

zed
08-01-2001, 08:08 PM
i was doing some raytracing the other day 256x256@10fps on my celeron. though it was only a simple antialiased scene with reflections/refractions traced 2 deep

Maku
08-03-2001, 11:55 AM
If I'm right Black & White uses Raytracing.
And it's quit fast.
Now about the shadows.
It can be done with acumulation buffer.

Rob The Bloke
08-03-2001, 01:06 PM
Originally posted by Maku:
If I'm right Black & White uses Raytracing.

I dont think it does - no. The engine was written about 18 months ago. It uses some very clever texture blending stuff, stencil buffer etc. But definately no raytracing. All, the effects such as shadows etc are pre-calculated. The possibilities of doing it dynamically were out of the question cos of the amount of AI stuff involved......