www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Zlatirbarfast on June 11, 2015, 12:57:54 pm

Title: Config.maxLights not honored?
Post by: Zlatirbarfast on June 11, 2015, 12:57:54 pm
Hello!
I have a situation where I use many light sources, but at any given time only a few of them are lit. Hence I have passed the default maxLights setting (32). But even though I've trided both e.g. Config.maxLights = 128 and Config.setParameterValue("maxLights", 64) as first statements in  thread entry point, i still get the
"WARNING: Tried to modify an undefined light source!" for all light id's > 32 and the light source does not appear. Why is this?
I could of curse work around this by moving some lights to where they are currently needed, but I feel it would be waste of time since I cannot see any reason as to why changing the settings does not take effect. If i read the value of the setting at runtime, it shows the value I set i to...
Title: Re: Config.maxLights not honored?
Post by: EgonOlsen on June 11, 2015, 01:49:51 pm
Make sure that you change this setting before calling new World()...
Title: Re: Config.maxLights not honored?
Post by: Zlatirbarfast on June 17, 2015, 09:33:46 pm
Ok, thanks, I thought it was as something simple as that. Is there any declaration of wish config values that must be set prior to World initialization? Or perhaps in general all changes to Config should be set prior to World initialization?
Title: Re: Config.maxLights not honored?
Post by: EgonOlsen on June 17, 2015, 10:38:44 pm
If it's needed, it should be mentioned in the docs. Just like with maxLights, where it states:
Quote
Has to be modified before constructing the World to take effect.