Idea For Static dynamic Lighting In Maps

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Idea For Static dynamic Lighting In Maps

Postby Steve5563 » Mon Jan 28, 2019 8:05 am

something i thought of a little while ago and i want to share it from a mappers perspective on how visuals can improve dramatically and also having good performance at the same time when making a new map with gzdoom builder.

with my experience in mapping the only thing that doesn't hurt the frame rate in doom is the textures. the resolution of the textures also doesn't matter once they have been loaded.
as we all know textures are just pre rendered images which can give us good visuals and still retain good fps ---- pre rendering as much as we can is key to get decent visuals and good fps.

a new way is needed when it comes to lighting custom maps in doom to improve visuals drastically when it comes to lighting and shadows which can really take doom to the next dimension,

so the current problem with dynamic lights and the gzdoom engine from my experience is that it absolutely hates dynamic lights ( real time rendering ) especially when using lots of them in a map just to create static lighting in the areas of a map which can lead the fps to tank very quickly if you get carried away with them.

pre baking the static dynamic lighting effects on the textures is what we need to create the next leap forward with lighting in doom maps.
the problem with pre baked lighting is this wont visually wont work when your eyes are expecting to see the player/monster sprites interacting with the baked lighting, it will look fake and unrealistic when a player moves throughout the baked lighting area.
especially when you have a dark map with lots of brightly baked lighting everywhere and the player/monster/decoration sprites wont look correct as they move through the area transitioning from bright baked lighting to pitch black areas. they will just appear at the sectors brightness level.

what i think is needed to get the best of both worlds is to bake dynamic lighting on the maps geometry / textures,
and to also to create a new type of dynamic light that only interacts with "actors " such as the player/monster/decoration sprites etc. and not with the maps textures/geometry.

so when we build a new level in gzdoom builder and we are at the stage where we are ready to start lighting the map up with the new static dynamic "baking" lights, which we can use for observing the lighting that we are placing in the map ( like we do now in gzdoom builder ) to get the colour/scale/brightness to our liking.
once we are happy with the lighting we can then use this new baking light to bake the lighting to the maps textures / geometry.
after the baking process is finish we can then select all of the baking lights that we placed in the map and change them over to this new type of dynamic light. " dynamic actor interacting light "
this new " dynamic actor interacting light" has 2 cool and very important features.

no.1---interacting area----this light does not render its light source on the maps textures/geometry as this is already taken care of during the baking process (pre rendered),
this new light only interacts with actors such as player sprites/monsters/decoration etc this is used only to adjust the color and brightness of the sprites and has its own interacting radius displayed in gzdoom builder,


no.2 --- trigger radius---- because this light only interacts with actors, you now have the option to also create a trigger radius which is a little bigger then the lights " interacting radius ".
this trigger radius is to activate the light just before a "actor" enters the interacting area which is the dynamic lights radius circle you see in gzdoom builder,
the trigger radius keeps the light activated when an actor is inside this radius and when the actor walks outside of the trigger radius area the light turns off and the pc does not have to calculate anything with this light anymore until it is triggered again.
( this trigger radius may not even be needed as the light only interacts with actors im just giving ideas if it is needed)

maybe shadows could also be generated in the baking process as well with the baking lights.
and maybe the shadow maps feature that's in gzdoom currently has, can also be modified to suit this new "actor interacting light ",
this light uses the shadow maps calculations to interact and adjust the sprites brightness/colour which corresponds to the baked lighting / shadows on the textures with out adding shadows to the textures/map geometry,
as the baking process takes care of this visual effect.

by doing lighting this way you now have visually created the illusion that there is a real static dynamic light source and shadows in the area with out the performance hit we currently have from a real static dynamic light placed in the map being rendered in real time, and with the possibility to be turned on and off when needed with out visually altering the textures lighting is really cool in my opinion.

with baked lighting you could also go as far as adding PBR maps to the textures and bake those effects in to the map aswell. the light wont look realistic as the light wont interact with player movement and angle to the light source but it can create a good visual boost to a textures depth and roughness.

this was a little project i done awhile ago just using Gimp which is a image editor program like Photoshop that has a dynamic light baking effect in it. i got some textures online and also made some of my own and creating some normal maps for the textures using the baking effect in gimp i then scaled the textures in gzdoom builder to suit the maps layout and fake light sources.
this gives you a good idea visually what pbr/normal maps turn out like when baked to a texture in doom with out using a single dynamic light and no shadows.

DOOM 2 Pre Rendered Lighting Demo ---- https://www.moddb.com/games/doom-ii/add ... hting-demo











Last edited by Steve5563 on Tue Jan 29, 2019 8:54 am, edited 2 times in total.
User avatar
Steve5563
 
Joined: 27 Jan 2019
Location: Australia

Re: Idea For Static dynamic Lighting In Maps

Postby Caligari87 » Mon Jan 28, 2019 8:48 am

This is actually being worked on already. dpJudas has been slowly pushing updates to a feature branch to enable pre-rendered lightmaps. They'll also interact with dynamic lights properly, since they use a shader instead of hard-baking the lighting information to a texture.

Spoiler: "screenshots"

Not quite ready for prime-time yet, but pretty close last I heard.

The in-development branch is here, as well as dpJudas's light-baking program ZDRay, if you want to test it. You will need to be familiar with compiling the software yourself and using the command line, among other things.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Idea For Static dynamic Lighting In Maps

Postby Steve5563 » Mon Jan 28, 2019 10:35 am

sounds and looks good, yea i have no idea how to do the compiling i just make maps, curious does the player / monster sprites adjust their brightness and colour according to the new lighting and shadows in the screenshots or does the sprites brightness and color still rely on sector lighting in the baked lighting area?
User avatar
Steve5563
 
Joined: 27 Jan 2019
Location: Australia

Re: Idea For Static dynamic Lighting In Maps

Postby HAL9000 » Mon Jan 28, 2019 10:43 am

Just posting reply to bookmark this,
ZDray looks awesome!
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: Idea For Static dynamic Lighting In Maps

Postby wildweasel » Mon Jan 28, 2019 11:26 am

HAL9000 wrote:Just posting reply to bookmark this,
ZDray looks awesome!

You can find a "bookmark topic" button at the bottom of every thread view, so posting in the thread is not necessary in order to do so.
User avatar
wildweasel
「お前はもうトースト」[you are already toast.]
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: Idea For Static dynamic Lighting In Maps

Postby HAL9000 » Mon Jan 28, 2019 12:51 pm

wildweasel wrote:You can find a "bookmark topic" button at the bottom of every thread view, so posting in the thread is not necessary in order to do so.


Thank you! I did not notice that button :D
>Insert the more you know meme here<
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: Idea For Static dynamic Lighting In Maps

Postby XLightningStormL » Tue Jan 29, 2019 1:29 am

Shouldn't ZDray just have a compiled version made for people anyway? It'd be easier for people to test, unless the ZDoom team is just trying to floodgate for test purposes.
User avatar
XLightningStormL
DUSK Wiki Master
 
Joined: 09 May 2016
Discord: XLightningStormL#7461
Twitch ID: XLightmingStormL

Re: Idea For Static dynamic Lighting In Maps

Postby Graf Zahl » Tue Jan 29, 2019 3:53 am

It makes no sense to release an unfinished tool for an unfinished work branch of the engine.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest