Sign in to follow this  
alan2here

One pass per frame light maps?

Recommended Posts

It's just an idea. It may be more novel that practical, however I really wanted to air it for descussion. I posted in this forum as I am new to serious game coding. If it would be better in another forum please feal free to move it. How it could work: The idea is for light to start from light sources (sky, lights, candle, glowing stuff etc..) and many rays of light travel before the first frame of rendering outward to land on objects. Each texel in the enviroment then remebers the averege angle of movement, colour and brightness of all the rays that land on it as a single value (so infomation is lost here). Light which enters a block on the players head (there eyes) gets desplayed on the screen (more on how this works further down). The first frame is drawn to the screen which will always just contain mostly black with some verry bright bits where light sources are. Then the light stored in each texel is projected onto the aprorate surfaces based on the information stored in each texel. We have lost lots of rays here as each texel only stored averege information (the lights also project new light again). Some rays which are now less bright enter the eyes as well as some new ones from the lights (which in turn will ajust the infomation in each texel). The next frame is drawn which now contains more infomation, it is still verry odd looking. It won't be untill about the 3rd frame when the view will look more normal. Probbable Advanteges: The information stored at one time is always at a manegable amount The number of calculations each frame is always at a manegable amount Reflective surfaces can simply reflect a higher percentege of light Surfaces that need to defuse light only need to scatter it more randomly You can move light sources or objects about and maintain realitic shadows Propper HDR with aperture that will ajust gradually to difrent averege light over the view and blur that is relitive to the over-brightness of each pixel could be made easy(er) Could be an Advantege or Disadvantege: Moving light sorces or objects about results in light that lags Reflective surfaces may have to be used responibly (If HDR was implemented properly then the player would expreance temporery blindness when entering and exiting verry bright areas) Eyes: The eyes would have to only allow light to enter each pixel at the aproprate angle (as if they are around one side of a sphere and only allow light to enter if it is coming straight on as opposed to an angle). They could alternitivly contain an area that destorts the parth of light to act as a lense so that not too much excess light was lost.

Share this post


Link to post
Share on other sites
You wouldn't be able to see the light source if it was let say behind something else. When the rays of light reach you then you can see them and they will be the colour and brightness of the things they have reflected off.

You could make it so that no light was alloud to enter the eyes if it had no bounces, this would make lights invisable but still able to light stuff. Point lights would be efectivly invisable anyway, only showing directly as a sigle point of light where they send however meany rays into the enviroment from that single point (probbably at random angles) each frame.

Share this post


Link to post
Share on other sites
Correct me if I'm wrong, but isn't this just a description of ray tracing?

And I disagree about the number of calculations being manageable. The key part is that many rays are being emitted by lights. Doing a calculation between each ray and each texel of each object would be prohibitive.

Unless I'm misunderstanding. I'm not normally one to be picky about spelling and grammar, but your description is hard to read :P

Share this post


Link to post
Share on other sites
Quote:
Original post by alan2here
You wouldn't be able to see the light source if it was let say behind something else. When the rays of light reach you then you can see them and they will be the colour and brightness of the things they have reflected off.
Oh, I think I misunderstood "The first frame is drawn to the screen..." etc.

Anyway, if I understand you correctly, this is basically a technique known as "radiosity." It came into popular usage around the time of the original Quake games, and is still used by some games (for example, Half-Life 2, though it uses an updated variant of it).

The principle problem is that it's too slow to do in realtime (people are pushing for faster approaches but I've not seen anything more than some academic papers yet). It's too slow to do the texel->texel projection step in realtime. You basically have to render the entire scene from each individual texel's point of view, summing the result to calculate the total input energy - that's a lot of texels and a lot of rendering. Tools like Quake's RAD tend to do things at a coarser level than per-texel to speed things up, and they still take several minutes to evaluate the system until it reaches a stable state.

Doing one bounce per frame would make that time shorter but would still lead to very slow framerates, coupled with some very odd effects while the major bounces are still being calculated. Then consider that the scene when you started calculating your bounces might have changed since then - you'd be bouncing around light from a source that isn't even on anymore. That's pretty slow light.

Share this post


Link to post
Share on other sites
Quote:
Original post by gharen2
Correct me if I'm wrong, but isn't this just a description of ray tracing?

And I disagree about the number of calculations being manageable. The key part is that many rays are being emitted by lights. Doing a calculation between each ray and each texel of each object would be prohibitive.
No, standard ray tracing traces every ray of light whereas this artifically limits the infomation being transfered every frame. The number of calculations may still be unmanegable but it is smaller than in ray tracing (I think they would be manegable for powerfull PC's and well writtain code).


Quote:
Unless I'm misunderstanding. I'm not normally one to be picky about spelling and grammar, but your description is hard to read :P
Sorry :(


Quote:
Anyway, if I understand you correctly, this is basically a technique known as "radiosity." It came into popular usage around the time of the original Quake games, and is still used by some games (for example, Half-Life 2, though it uses an updated variant of it).
two key diffrances are, one pass every frame instead of 40 passes on each compile of a map and rays get drawn when they enter they eyes istead of just hitting a surface (reflection and refraction made easy). This may have to be split into light maps that has a diffrent sized grid that individal texels but it cant be too big else there would be an output that is too grainy looking.[/quote]


Quote:
until it reaches a stable state

some very odd effects

bouncing around light from a source that isn't even on anymore

That's pretty slow light.
It dosn't need to reach a stable state, in fact it wont do if things are moving a lot. Yes there would be some verry odd effects like light could be aranged to bounce around in a loop using (100% reflect, 0% refract) mirrors where the light could take sevral frames to get to a point in the loop each time round. The light would be pritty slow, but I think the potental for superiour rendering quality would make up for it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this