[bzr] Light shines through doors
#64
Well, usually I only wanted to attend to bugs for the Bugfix release and what I did now will most likely not be an option already for the Bugfix version (but I am planning that with a single code line change everyone can try it out).

Still I am pretty much done with my first draft of the new dynamic lighting. If I have to describe it to how it works then I would need to say: It almost works like sound. Descenteer brought up this fact about illumination. And I took care of that. Now the old lighting just lights everry point depending on the distance between the light source and the point of the wall. However this light does not care if there is something between this point and the light source - like a wall.

An illustraction of a "U-turn" tunnel shows pretty much the disadvantage of the old system and how I want to improve it:
http://www.dxx-rebirth.com/blog/zico3/oldnfcd.png

Here you already see my new approach:
Before the light source is able to light up something, it has to find it's way through the actual level architecture and the amount how much a wall will light up is calculated by the distance the light had to travel.

Advantages:
- This lighting does not change the atmosphere much but it effectively removes bright flashes of light where no light source is visible but compliments towards global illumination in a more realistic way (in terms of how the engine works).
- If a light source is visible to you, the changes compared to the original lighting is insignificant however. This way the general atmosphere will possibly not change for you.
- This code already works with grills, fences and so forth so the light can travel through "open" parts the player cannot pass.
- Since the lighting path depends on the Render path created from the player POV this lighting works very well with doors and other 2D walls. It does not work all the time - depending on the render path and level architectures but for most part if a light source is on the other side of a door than you yre the door will not light up. Markers are different - they are specifically written to be bright but also limited to their own segment. Their light will be visible through doors. Still I think by the nature of markers this is acceptable.
- This lighting does NOT need any openGL acceleration. It STILL works with engine builtin functions ONLY. This way it still looks VERY "original" and "classic". Still this way is not the fastest one. There is a reason normally lighting is done via OpenGL or Direct3D. Therefor I still need more optimizations. Currently this new lighting increases the game requirements from 10% to 100% depending on if you play a standard sized level or a level with 9000 segments and 350 objects. Still I was not able to get "more" than the double CPU usage of the standard lighting but I also have not even begun to optimize it.
- Still I suspect in the end the new lighting will always need a bit more CPU usage. So I am probably going to add an option to fall back to the old lighting if necessary. If I can optimize the new light very good it will only be an INI option but if the new lighting will have a significant raise of your CPU usage, I'll add a menu option for this
EDIT START:
- This system will work for both colored and uncolored light. I only have choosen to use colored light in my examples since it shows the effects better.
- This new routine does NOT change the lighting the level itself has (i.e. static light or light emitted by lamps. Only light emitted by OBJECTS is affected by this. So it will not compromise the work of the level authors in any way.
EDIT END

Oh and by the way here is a little example image which sows howthis new lighting works with doors:
http://www.dxx-rebirth.com/tmp/comp2.png
It's not the best example I'll admit since shield powerups are VERY dim. Howewver you can see that with the door closed there is no blue light visible. If opened the whole area around the door is slightly blue. Even the ledge on top of the Screenshot is still illuminated while there is no real visible connection to the light source (the powerup). This way however it stays very realistic and "original" in the same way.
The greatest pleasure in life is to do what people say you cannot do.
Uhm... Honey, there's a head in the toilet!
Reply


Messages In This Thread
[bzr] Light shines through doors - by tryone - 05-05-2011, 04:51 PM
RE: Light shines through doors - by Ryusei117 - 05-05-2011, 05:01 PM
RE: Light shines through doors - by tryone - 05-06-2011, 01:24 PM
RE: Light shines through doors - by Ryusei117 - 05-06-2011, 08:57 PM
RE: Light shines through doors - by Hawkins - 05-06-2011, 09:02 PM
RE: Light shines through doors - by Ryusei117 - 05-06-2011, 09:29 PM
RE: Light shines through doors - by Ryusei117 - 05-06-2011, 09:58 PM
RE: [bzr] Light shines through doors - by tryone - 05-07-2011, 10:53 AM
RE: [bzr] Light shines through doors - by tryone - 05-31-2011, 07:04 PM
RE: [bzr] Light shines through doors - by Hawkins - 05-31-2011, 08:11 PM
RE: [bzr] Light shines through doors - by tryone - 06-13-2011, 02:25 PM
RE: [bzr] Light shines through doors - by Hawkins - 06-16-2011, 07:13 AM
RE: [bzr] Light shines through doors - by Hawkins - 06-16-2011, 09:27 PM
RE: [bzr] Light shines through doors - by Hawkins - 06-23-2011, 01:14 PM
RE: [bzr] Light shines through doors - by Hawkins - 06-23-2011, 01:20 PM
RE: [bzr] Light shines through doors - by Hawkins - 06-23-2011, 04:56 PM
Re: [bzr] Light shines through doors - by zico - 07-07-2011, 09:06 AM
Re: [bzr] Light shines through doors - by Hawkins - 07-07-2011, 10:10 AM
Re: [bzr] Light shines through doors - by zico - 07-07-2011, 10:11 AM
Re: [bzr] Light shines through doors - by lloyd - 05-30-2012, 09:48 PM
Re: [bzr] Light shines through doors - by zico - 05-30-2012, 09:58 PM
Re: [bzr] Light shines through doors - by lloyd - 05-30-2012, 11:50 PM
Re: [bzr] Light shines through doors - by zico - 05-31-2012, 08:59 AM
Re: [bzr] Light shines through doors - by lloyd - 05-31-2012, 05:31 PM
Re: [bzr] Light shines through doors - by zico - 05-31-2012, 06:53 PM
Re: [bzr] Light shines through doors - by lloyd - 05-31-2012, 07:22 PM
Re: [bzr] Light shines through doors - by Hawkins - 06-01-2012, 03:02 AM
Re: [bzr] Light shines through doors - by lloyd - 06-02-2012, 01:03 AM
RE: Light shines through doors - by zico - 05-05-2011, 06:06 PM
RE: Light shines through doors - by zico - 05-06-2011, 01:49 PM
RE: Light shines through doors - by zico - 05-06-2011, 09:36 PM
RE: [bzr] Light shines through doors - by zico - 06-01-2011, 02:40 PM
RE: [bzr] Light shines through doors - by Zealot - 06-06-2011, 08:32 PM
RE: [bzr] Light shines through doors - by zico - 06-06-2011, 08:45 PM
RE: [bzr] Light shines through doors - by Zealot - 06-07-2011, 06:00 AM
RE: [bzr] Light shines through doors - by zico - 06-07-2011, 07:52 AM
RE: [bzr] Light shines through doors - by Zealot - 06-07-2011, 09:44 AM
RE: [bzr] Light shines through doors - by zico - 06-07-2011, 09:59 AM
RE: [bzr] Light shines through doors - by zico - 06-16-2011, 06:58 AM
RE: [bzr] Light shines through doors - by zico - 06-16-2011, 07:20 AM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 10:10 AM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 10:39 AM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 11:05 AM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 12:22 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 12:42 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 01:12 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 01:25 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 01:45 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 02:07 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 02:45 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 04:59 PM
RE: [bzr] Light shines through doors - by zico - 06-23-2011, 06:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)