Xonotic Forums
[SUGGESTION] Fake dynamic Global Illumination - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Suggestion Box (https://forums.xonotic.org/forumdisplay.php?fid=20)
+--- Thread: [SUGGESTION] Fake dynamic Global Illumination (/showthread.php?tid=368)



Fake dynamic Global Illumination - unfa - 05-02-2010

Hi all.

I just got an idea while playing some egypt-like map with lightmaps calculated with bouncing rays.

My idea is to make players light up their environment while standing in a bright light. It would require just spawning a dynamic light in the center of a player object and calculating it's colour and brightnes. That wouldn't be too expansive for resources, but may look really cool.

Those images should view my idea:
http://www.mediafire.com/imageview.php?quickkey=dmwm3mdzkgm
http://www.mediafire.com/imageview.php?quickkey=gggnuujmxwj
http://www.mediafire.com/imageview.php?quickkey=kaivtnyjqqj

There is another idea that would work much better and for all objects, but may slow down the game:

A light may be given the parameter IL (Indirect Ligting). The IL number is an amount of dynamic lights that are generated for this light:

IL = 0 - no indirect lighting for this light object
IL = 1 - one ray is being casted (for spotlights) and a dynamic omni light is being placed where the ray hits (with energy being calculated upon the hit distance)
IL = 8 - eight rays and eight dynamic lights (each carry the 1/8 of energy) are casted
and so on.

For sun lights this would generate a grid of lights that are covering the whole map. Some system to reduce their number would be required (where no one is moving)

For omni lights that would make a spherical grid.


RE: Fake dynamic Global Illumination - tZork - 05-02-2010

Well the light that most ppl use and see in Darkpalces/Xonotic is pre-complied as lightmaps, so you will not be able to affect things like GI/IL in-game. When it comes to map compile-time you have access to full gi tough -bounce and -bouncegrid. You can scale the "bouncyness" on a per material bases rather then per light basis with a shader command (q3map_bounceScale), witch is a far better way then per light. the drawback is that -bounce does cost you map compile time, often allot of it.


RE: Fake dynamic Global Illumination - unfa - 05-02-2010

I think you misunderstood me. I don't want to recalculate lightmaps each frame! Smile
I just want to put around some dynamic lights to fake raltime global illumination! I wouldn't require any more compiling calculation for maps. Just some more for the game each frame: trace some rays, check hit points and put dynamic lights in proper places (without shadows). Just that!
It would be working over the map's static lighting not with it.

When I say 'dynamic' I mean the same type of light that is spawned on explosion, Nex hitting a wall and a jumppad being used.


RE: Fake dynamic Global Illumination - tZork - 05-02-2010

no i understood you, but since the lights are static compiled theres no point in making it "half real-time". its far better to let q3map2 handle it as light wont change in game anyhow.


RE: Fake dynamic Global Illumination - unfa - 05-02-2010

So what are the dynamic lights then? Stuff that makes whole corridor go white when I use the Electro Combo?
The only information this would need is the same that is used for "realtime world lighting".


RE: Fake dynamic Global Illumination - Lee_Stricklin - 05-02-2010

Basically your saying get the game to do an old-school, but rarely used technique that involves only showing light if they do something to make it (example pop a shot off), or walk into a spot that has light. Sounds neat if it's doable, I've seen it done in older N64 titles like Turok 2 and it looked amazing.


RE: Fake dynamic Global Illumination - unfa - 05-03-2010

I think I can make it work in Blender Game Engine, but I don't know the game or engine code Tongue


RE: Fake dynamic Global Illumination - tZork - 05-03-2010

Well the dynamic / real-time light lights are eh rel-time, but they are already rather "expensive" adding another weight to em is not something to many ppl will use and thus not a high prio. So unless someone with ze relevant skills take an interest its unlikely to happen anytime soon.


RE: Fake dynamic Global Illumination - unfa - 05-03-2010

(05-03-2010, 10:14 AM)tZork Wrote: they are already rather "expensive"
I found the realtime shadows to be most expansive about them. Those lights faking IL would work without shadows. So maybe they won't be such a pain for the GPU


RE: Fake dynamic Global Illumination - top_cat - 05-09-2010

It might be possible to do some sort of realtime global illumination on the GPU shaders - I imagine though that you'd need to use OpenGL3/4 for the pipeline to be flexible enough.


RE: Fake dynamic Global Illumination - PineTrees - 05-10-2010

(05-09-2010, 07:17 AM)top_cat Wrote: It might be possible to do some sort of realtime global illumination on the GPU shaders - I imagine though that you'd need to use OpenGL3/4 for the pipeline to be flexible enough.

Why?