View Issue Details

IDProjectCategoryView StatusLast Update
0006546The Dark ModCodingpublic15.07.2024 10:14
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Target VersionTDM 2.13 
Summary0006546: Proper system for measuring light factor of bodies
DescriptionThere is so-called "light awareness system" which is used to measure how lit are various objects (e.g. guard bodies).
The value is later used in AI code to decide whether AI sees the object or not.
This system ignores projection/falloff textures and shadows.

The goal is to implement a system on CPU which would compute light value the same way as rendering shaders do it.
TagsNo tags attached.

Relationships

related to 0003584 resolvedgrayman Object Illumination code is wrong 

Activities

stgatilov

stgatilov

08.07.2024 20:36

administrator   ~0016789

First I committed generic and minor fixes/improvements, completely unrelated to the problem:
  r10808 Fixed bug in idWinding::ClearFree.
  r10809 Fixed self-assignment in idList and idHashIndex.
  r10810 idRenderWorldLocal::TraceAll: quickly retunr false for zero-length rays.
  r10811 Support TF_DEFAULT filtering in CPU-side idImage sampling.
  r10812 Added idList::FillZero method + converted some usages.

The following commits contain generic but more involved improvements:
  r10813 Support debug polygons with depthtest = false.
  r10814 Added idRenderWorld::DebugFilledBox method.
  r10815 Implemented exponential search algorithm.
  r10816 Exposed cubemap sampling on CPU as idImage::Sample method.
  r10817 Added a way to make image CPU-resident during runtime.
  r10818 Refactor loading particle collisions texture using new defer mechanism.
  r10819 Implemented generic Poisson sampling.
I tested this stuff independently, it should work fine =)

Finally some commits specific to the new system:
  r10820 Added idRenderModel::GetLoadVersion method to detect model reloads.
  r10821 Now it is possible to generate point samples on idRenderModel.
  r10822 Added LightEstimateSystem + LightQuerySystem to track light intensity at various objects.
The last is the main one: it adds both halves of the huge system.

The testmap is here:
  r17085 Added test map for debugging LightEstimateSystem.

So the new stuff is in trunk now, and it is possible to enable it by setting "g_lightQuotientAlgo 1".
However, I have not enabled it as new default yet.
I'm afraid I'll have to review all the usages because the new system work correctly only if you continuously "track" entities.
And the old system seems to enjoy quering intensity at random instant moments and doing nothing after that.

Debug visualization is controlled by cvar "g_showLIghtQuotient".
Also there are various settings in cvars "g_les*".
stgatilov

stgatilov

15.07.2024 10:14

administrator   ~0016795

Some generic fixes and improvements of LES:
  r10827 Set residency IR_BOTH if image is not found => defaulted.
  r10828 idRenderWorld::TraceAll now passes RenderEntity handle into filter too.
  r10832 Save/restore Light Estimate System.

And some commits for integration:
  r10829 Updated default track duration from 300 ms to 10 sec.
  r10833 Always track dead/unconscious AI bodies and dropped melee weapons in LES.

I tried looking the code which uses GetLightQuotient, and there are just too many nested usages.
That's why I concentrate on the cases where it is actually requested all the time, and they are:
  1) dead/KOed AI bodies
  2) dropped melee weapons
  3) alive AIs

Cases 1,2 should be covered now since they are simply tracked all the time.
Case 3 is partly covered by default track duration larger than visual stim period, the first stim will most likely return zero value though.

P.S. I have noticed that there are tons of non-entity queries into the old LAS.
Replacing them with the new LES will be hard =(

Issue History

Date Modified Username Field Change
25.06.2024 07:23 stgatilov New Issue
25.06.2024 07:23 stgatilov Status new => assigned
25.06.2024 07:23 stgatilov Assigned To => stgatilov
02.07.2024 00:27 nbohr1more Relationship added related to 0003584
08.07.2024 20:36 stgatilov Note Added: 0016789
15.07.2024 10:14 stgatilov Note Added: 0016795