Product Chat / Are there limits in light markers?

Author
Message
Skonlogick
4
Years of Service
User Offline
Joined: 9th Nov 2019
Location: Brazil
Posted: 1st Dec 2019 22:01
Hi, I'm using quite alot of light markers in my project, must be nearing 40 right now I think, but as of lately I'm seeing something weird, and I believe it is either a bug or a engine limitation.

Say I have a wall, and I add 3 light markers, static, with 100 radius each, right next to the wall. For some reason, when I add the second or third one, the first light just stops working, it doesn't emit any lightning at all.

To better represent it, it's kinda like this:
I --> Wall
o --> Light Marker


I o <-- Stops working when the other 2 are added.
I o
I o
R5 3600X - GTX 1060 6GB - 16GB RAM
https://cooltext.com/
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Dec 2019 23:00
yes there is a limit, you can increase it (it's in settings.ini or setup.ini or whatever the file is called) but honestly you don't need 40+ lights in your level, this will make the engine work harder than it needs to - perhaps a better solution is to dynamically move the few lights the player can see as needed.

also if it's a big map you should definitely make sure you are happy with loading times etc by testing a standalone now in case you get too far and decide it would be better to break the map into sections later.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Skonlogick
4
Years of Service
User Offline
Joined: 9th Nov 2019
Location: Brazil
Posted: 1st Dec 2019 23:12
It's definetly a big map, that's for sure. I'll go test a standalone now and see how long it takes, thank you. Such a shame that there is a limit for this.
R5 3600X - GTX 1060 6GB - 16GB RAM
https://cooltext.com/
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 2nd Dec 2019 00:15
Here's to hoping that 2020 is the year we are living in the future.
PM
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 2nd Dec 2019 00:48
Quote: "Here's to hoping that 2020 is the year we are living in the future."


I'd be alright with what we had 20 years ago. Anything at all will be fine.
Skonlogick
4
Years of Service
User Offline
Joined: 9th Nov 2019
Location: Brazil
Posted: 2nd Dec 2019 02:27
So how do you guys deal with multiple sources emitting lights? Say I want to have 30 different lamps in my game, how would you do this?
R5 3600X - GTX 1060 6GB - 16GB RAM
https://cooltext.com/
Wolf
Forum Support
16
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 2nd Dec 2019 03:47
Make sure the player can only see 3 or 4 at a time if dynamic. Alternatively, if you want to have them all in one scene, you can place them as static lights, sacrifice a goat and press "shift and F3". (results may vary, no guarantees)
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 2nd Dec 2019 04:02
Yes, Wolf. Totally! Those are pretty awesome shadows. And just think, that
surely had to be done with 32 bit. So I try not to rant too hard about 32 bit GG.
Just seems like a good way to eliminate some memory issues in one swoop??

My paranoia lies in broken stand- alone. I do have that paranoia I must admit.
PM
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 2nd Dec 2019 06:02 Edited at: 2nd Dec 2019 06:27
And use AmenMoses light control script.
You can have groups of lights that are only activated when within the specified range.
You can find it in his sticky in the scripts forum.

Also, when testing said light control script, I made a level with heaps of lights - about 48. But even increasing the limit in setup file I could not get above 50-60 I think is was.

Quote: "Here's to hoping that 2020 is the year we are living in the future."

I have a feeling we gonna be doing a bit of time travel - but not likely to the future - lol.


OldFlak....
aka Reliquia
i7-4790 @ 3.2GHz. 8GB Ram. NVidia GeForce GTX 1060 6GB. M1: Acer 31.5" @1920x1080 M2: Samsung 31.5" @ 1920 x 1080. M3: Acer 24" @ 1920 x 1080. OS: Windows 10 Pro 64-bit Insider.
PM
Skonlogick
4
Years of Service
User Offline
Joined: 9th Nov 2019
Location: Brazil
Posted: 2nd Dec 2019 07:33
That script seems very useful performance wise, I will try it out tomorrow. Now that I decided to go for a new project, I will use more levels to allow for more and better lightning.

Just one more question, what is the difference between static and dynamic lightning?

Thanks everyone for the answers!
R5 3600X - GTX 1060 6GB - 16GB RAM
https://cooltext.com/
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 2nd Dec 2019 08:30
Yeah, AM's scripts are super efficient - there is also one for audio

Use static lights for light mapping - turn range up for that
Problem with light mapping is that it will break something, and apparently also creates a huge fpm file.

OldFlak....
aka Reliquia
i7-4790 @ 3.2GHz. 8GB Ram. NVidia GeForce GTX 1060 6GB. M1: Acer 31.5" @1920x1080 M2: Samsung 31.5" @ 1920 x 1080. M3: Acer 24" @ 1920 x 1080. OS: Windows 10 Pro 64-bit Insider.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Dec 2019 09:05 Edited at: 2nd Dec 2019 09:08
The difference is that static (light mapped) lights are pre calculated so any shadows etc are permanent to the map during game - so not good for moving objects or characters.

Real time lights are calculated each frame so they are necessary for characters etc as they will always be moving the shadow / light needs to be updated constantly.

Static lights increase load times / size but are better for performance and allow a higher limit of lights while dynamic / real-time lights are quite demanding on the system so should be kept to only a couple active at any one time (seen by the camera).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 2nd Dec 2019 14:41 Edited at: 2nd Dec 2019 15:25
Hmmm now I read that each individual interior model layout could have up to 38 lights ?
Well that's been working for me anyway.

Basically if I make one complete level as one model then im limited to the 38.
But creating them as sections / modules has allowed me many more dynamic lights without any problems so far.

EDIT …
Just did a test with my modules using 60 lights … No problems.
And it seems I can make another right beside it.



The only person ever to get all his work done by "Friday" was Robinson Crusoe..

Attachments

Login to view attachments
PM
Skonlogick
4
Years of Service
User Offline
Joined: 9th Nov 2019
Location: Brazil
Posted: 2nd Dec 2019 15:50
Thanks for the information everyone, I will rely mostly on static lightning for now, as my project won't have moving objects for now.

Quote: "Just did a test with my modules using 60 lights … No problems."


Did you change anything in the settings.ini of GG? This is interesting. Could it be that by having more entities means you can place fewer light markers as well? Or is the limit based solely on other light markers?

R5 3600X - GTX 1060 6GB - 16GB RAM
https://cooltext.com/
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 2nd Dec 2019 16:14
Quote: "
A new dynamic light that run using a mesh based system, what this means is that lights is now always lit
nomatter how many dynamic lights you have, each mesh on a level can have up to 40 light calculations.

It work by ignoring lights that do not reach a mesh , so on a per pixel basic it know how many lights the pixel have and ONLY process those,
So if you have a screenshot of you level , only the pixel that are actually lit by dynamic lights will do the calculation the rest dont make any calculations,
so you can have one mesh sampling lights from 40 sources and many that have zero light sources , so overall this will be faster and everything will always be lit.

The terrain could get lights comming in from all lights placed on a level, so the terrain ligth is by default set to use a way faster vertex light, but also have a fading system running where it will fade out the lights on the terrain at a distace you can define , this is by default set to the same range as the shadows, but ALL lights within this range will always be lit on the terrain. Also added the possibelity for you to enable the old fading system on the terrain , and also a option to set the terrain to use per pixel lights if you prefer this.

Everything is real-time so all lights on a level can be moved around with no fps drops, if you have moving lights you might consider to use per pixel terrain lights terrainusevertexlights=0 for a more smooth movement.

A new spot light type has been added to the GUI so you can set a dynamic light to a spot light, use "rotate" on the light object to set where the spot points.

The system is made so you can define how you like it to work Speed vs. Visuals. with no shader changes needed.

Added: All per pixel lights now use PBR light reflections.
Added: Setup.ini - maxtotalmeshlights , allow you to define the max number og lights a single mesh can have lit at any time.
Added: Setup.ini - maxpixelmeshlights , allow you to set how many per pixel lights a single mesh can have lit at any time, when this number is exceded everything will switch to way faster per vertex light.
Added: Setup.ini - terrainoldlight , allow you to switch terrain to use the old fading light system, can be faster in some cases.
Added: Setup.ini - terrainusevertexlights , set the terrain only use the way faster per vertex light system.
Added: Setup.ini - maxterrainlights , allow you to set how many lights the terrain can have lit at the same time.
Added: Setup.ini - terrainlightfadedistance , set the fade distance for terrain lights. terrain light fade is only active if you use more then the total , if you use less then all light is always on withut fading at this distance.
Added: Setup.ini - showstaticlightinrealtime , possible to enable static light to always light unless in prebake mode, so you can see the static light while editing, range and intentity is decreased by 30% to try to match lightmapper.
Added: Spot light to all shaders.
Added: Spot light selection box to GUI.
Added: Support for "gun flash light","fireball dynamic light","explosion light". Now use the new light system.
Fixed: pbroverride=0: all those shaders also got support for the new light system.
Fixed: Allow dynamic light to remove shadows.
"

GPU: GeForce RTX 2070 SUPER PassMark: 14817
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Dec 2019 21:31 Edited at: 2nd Dec 2019 21:31
Ok so I'm not really understanding all this.

Here is a video:

Each fluorescent light fitting has two dynamic lights placed on it, all have my light control script attached and all have identical settings.

But as you can see in the video only ten of the dynamic lights come on.

How does this 'ten' map to the ini file settings? i.e. with the default settings we have:
[LIGHTING]
maxtotalmeshlights=38
maxpixelmeshlights=12
terrainoldlight=0
terrainusevertexlights=1
maxterrainlights=20
terrainlightfadedistance=4500
showstaticlightinrealtime=1

I can't see a 10 in there anywhere!
Been there, done that, got all the T-Shirts!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 2nd Dec 2019 23:32
It's probably 12 that are on,

change to
maxtotalmeshlights=38
maxpixelmeshlights=38

And see if more come on - 38

Cheers.



GPU: GeForce RTX 2070 SUPER PassMark: 14817

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 3rd Dec 2019 20:29


That fixed it.
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 4th Dec 2019 00:45 Edited at: 4th Dec 2019 00:48
Sorry yes Skonlogick did ask above I just noticed if I changed anything in the setup ini .
Indeed I did same as cybernescence from 12 to 38
Originally I thought there were 38 in total and I had to rob peter to pay paul .. IE drop the maxterrainlights=20 and add it to the maxpixelmeshlights but either way it still seems to work
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Dec 2019 20:08
I just made them both 100, didn't seem to break anything.
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 5th Dec 2019 00:40
Forgot to comment on the vid ..
That looks excellent … the flicker was a great addition
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th Dec 2019 19:57
It's all one script too.

Currently the flicker delay is hard-wired in the script, I really need to make it part of the light parameters or something.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th Dec 2019 23:51
nice to see so many dynamic lights are possible but i wonder how it would hold up when shadows are added... not that you'll be able to see many with it being so white washed

lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-10-07 00:24:55
Your offset time is: 2024-10-07 00:24:55