View Issue Details

IDProjectCategoryView StatusLast Update
0000563The Dark ModCodingpublic15.07.2021 23:19
Reportercrispy Assigned ToSteveL  
Status closedResolutionno change required 
Product VersionSVN 
Summary0000563: Add ability to turn off shadow-casting for distant lights (optimization)
DescriptionPerformance is heavily impacted by shadow-casting lights. Portalizing well to prevent too many such lights from being rendered simultaneously is the traditional solution, but this may not be practical in certain outdoor environments.

Furthermore, in a large outdoor environment, there may be little point in rendering shadows cast by distant lights; the player probably won't notice, and it won't affect gameplay since the player would not be relying on those shadows to stealth. Therefore, there is a desire among mappers to be able to disable shadowcasting on lights which are some distance away.
Additional InformationCrispy's suggested implementation: Add a spawnarg to lights controlling the distance past which the light becomes non-shadow-casting. Defaults to 0, meaning this feature is turned off.

When the light spawns, if its spawnarg is nonzero *and* it is normally shadow-casting, then add it to a global linked list. Remember to remove it from the list when it is destroyed, and remember not to enable this feature on lights which don't cast shadows anyway.

Every few seconds, iterate the global linked list and turn shadow-casting on the light on/off appropriately (idLight::renderLight->noShadows).
TagsNo tags attached.


has duplicate 0005478 new Extend basic LOD system spawnargs to support other entities 
has duplicate 0005668 resolvedduzenko hide_distance won't work for lights 




22.02.2011 01:25

developer   ~0003632

SEED \ LOD related?


22.02.2011 07:13

reporter   ~0003635

Yes, good find. I'll assign it to myself and see that some appropriate spawnarg is added. The Think() routine in lights should then take care of that.


17.02.2013 21:07

developer   ~0005069

Trying to find a mapper workaround...

Is there a way to collect the LOD transition by script such as <example_entity>.getKey ?

You can switch the shadows off on lights via the <example_entity>.setShader script.

You can also get the distance via:

distance = $player1.distanceTo($<example_entity>);

but I think it would be a tad expensive...


14.09.2014 18:01

developer   ~0006995

Looks like some related changes exist in SVN. Is this issue closed?


14.09.2014 19:18

administrator   ~0006997

This can already be done by LOD, don't know if there is another method.


14.09.2014 19:39

reporter   ~0006998

I vote close it. The mapper control side is amply fulfilled by LOD, and we don't want any more automated interference. There are already enough problems with parallel moonlights glitching because of other optimizations that cut out a light's interactions if it's more than a couple of visleafs away. LOD gives the designer full control over the distance->shadowcasting equation.


14.09.2014 20:25

developer   ~0006999

Yeah, the only relevant issue I see standing is tracker:

which is not about shadow-casting but "light existence".

It would be cool if LOD\Hide Distance could control that.


14.09.2014 21:38

reporter   ~0007003

That's already fixed for 2.03 :) Normal lights with brightness 0 0 0 never generated interactions anyway so it affects only blendlights, as Tels notes in that tracker. Fix 0003752 makes blendlights turn off too when they get an Off() signal, or fade to zero "brightness".


15.09.2014 09:59

reporter   ~0007006

I'd vote close this bug without action, too. Distant lights can be managed with LOD, so there is no need for another automated way, which would only interfere with lights like moonlight etc.


15.09.2014 10:00

reporter   ~0007007

Note for nbohr1more: entity existance based on distance can already be managed with SEED (culling of entities), so this should already be covered.

Issue History

Date Modified Username Field Change
03.02.2008 08:34 crispy New Issue
22.02.2011 01:25 nbohr1more Note Added: 0003632
22.02.2011 07:13 tels Note Added: 0003635
22.02.2011 07:13 tels Assigned To => tels
22.02.2011 07:13 tels Status new => assigned
22.02.2011 07:13 tels Status assigned => acknowledged
22.02.2011 07:13 tels Target Version => TDM 1.05
13.03.2011 12:32 tels Assigned To tels =>
14.03.2011 11:09 greebo Target Version TDM 1.05 =>
17.02.2013 21:07 nbohr1more Note Added: 0005069
14.09.2014 18:01 nbohr1more Note Added: 0006995
14.09.2014 19:18 Springheel Note Added: 0006997
14.09.2014 19:39 SteveL Note Added: 0006998
14.09.2014 20:25 nbohr1more Note Added: 0006999
14.09.2014 21:38 SteveL Note Added: 0007003
15.09.2014 09:59 tels Note Added: 0007006
15.09.2014 10:00 tels Note Added: 0007007
15.09.2014 17:45 SteveL Status acknowledged => closed
15.09.2014 17:45 SteveL Assigned To => SteveL
15.09.2014 17:45 SteveL Resolution open => no change required
30.12.2020 23:38 nbohr1more Relationship added has duplicate 0005478
15.07.2021 23:19 nbohr1more Relationship added has duplicate 0005668