I have another bright idea with light buffers

K.I.L.E.R

Retarded moron
Veteran
Raytracing on the GPU!
Wrap a buffer around every object in the scene.
Apply the lighting shader on an object, store the reflected vector and the energy lost in the light buffer.
In your scene, from the light-intersection of the object you calculated, calculate a single ray bouncing on, then from that object into infinity, check for intersections in your scene.
If so, you've already stored the vector and current lost energy, on each texel.
Load that light buffer, as a RT and then read the texels off it to do the lighting calculations.

Keep in mind I have yet to try this, it should be fun to try.
Texel ratios are obviously going to be different on each object.
On top of that you would need to read texels from the perspective of each object and then convert them back into world coordinates.

What do you guys think?
 
I think the hard part in any lighting is the scene management. If you want to become really famous, come up with a good way to represent 3D scenes without having to traverse trees to find out if there is some object at that location. Something that uses a kind of 3D index that maps directly to the surface encountered in that direction.
 
Photon Mapping

I wrote a ray tracer that used the same set up you describe. The photon mapping engine first creates intensity maps as textures on the surface of the objects. I am interested if you know about how I could adapt this to run on the GPU. The ray tracer is rings (available at j3d.sf.net) and the photon mapping engine is my own creation. Both are written in Java.
 
You can only ray cast on the GPU and transform from one set of coordinates to another, the texture mapping has to be done from the perspective of the object which has the lights bouncing off it and onto the object which will have the energy passed onto it.
The data about which object has light hitting it and where will it bounce off has to be determined in your scene.

You need to use bounding volumes to determine if a bounced ray intersects an object.
Cast a ray from light position onto the object's position. Cast(GPU).
From the object's position, calculate the reflected ray off the bounding volume and check if other object's in your scene intersect it, if so cast(GPU).
You have to do this over and over and for every object in that part of your scene.

Simplifying the calculations comes down to area based intensity checking. This basically deals with which areas will have the most illumination actually have rays cast to them.
You can also do this by ray tracing(not actual ray tracing rendering, but casting and checking a few times) in your scene and on each step determine if the energy from the light reflection will be strong in the end, so you know when to stop casting on the GPU.
 
Back
Top