openGL raytracing

honkFactory
Unregistered
 
Post: #1
This subject was brought up in another thread but I think it deserves a thread of its own. In short, how do you raytrace in openGL? I only have one object composed of triangles and one light source. Is it hard to raytrace and keep specular and ambient light?
Thanks
A.W.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
You don't raytrace in OpenGL. What you could do is write a program that exports your generated asteroids into a file format a 3D package can read.
Quote this message in a reply
honkFactory
Unregistered
 
Post: #3
Hmm. I don't own any 3d rendering software. (If y'all know of any free or shareware packages drop me a line.) I would also like to rerender my asteroid before every level for slightly different light conditions and positions so maybe it would be best to keep my rendering within openGL.
A.W.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
POV-ray is a free ray-tracer. Meshwork (amongst others) can export in a format it understands.

If you want to do this in-game, though, It seems like ray-tracing is probably a lot of work for not-much-better results. Try stencil shadows (or even soft stencil shadows since this is off-line).
Quote this message in a reply
henryj
Unregistered
 
Post: #5
got to http://www.flipcode.com There are lots of ray tracing resources. Even some realtime stuff.

Ray tracing is a lighting model which opengl doesn't support. OpenGL only does gouraud lighting. The general approach is to use ray tracing, radiosity or whatever to generate textures and/or light maps which you then apply to your models as textures via opengl.
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #6
and I can imagine making an asteroid out of a sphere that you subtract other spheres from which would be ideal for real-time raytracing.

check out <http://www.2tothex.com/raytracing/> which has Mac OS X example projects.

how many 'roids we talking about here at once?

hth,
Codemattic
Quote this message in a reply
Post Reply