I’ve built out a component-based system that aids the user in determining a superficial illumination value for an object/actor/player character/whatever that can be used for applications like stealth light/shadow mechanics or puzzle games.
Probe components account for point, spot, directional & sky lights, as well as custom “illumination volumes” in box or sphere shape for LPV injected emissive objects. (Note: LPV emission injections are broken in 4.20, the version this video was recorded in, but in case it makes it back into the engine or another solution comes up/people need to identify custom illumination areas, this is a workable solution.)
In this video, the player character has probes on head, shoulders, hands, torso, and feet (8 total.) Stress testing this with an average of 38 light overlaps per probe (not featured in this demo video) trace counts ran upwards of 300 traces per frame, or 72,000 traces per second, with no discernible impact on performance.
This is so cool ! Once I tried to recreate Splinter Cell gameplay but amount of tracing from many light sources tanked performance to unplayable framerate. Seeing this with not killing FPS is amazing !!!
After realizing I overlooked the need to work with existing light setups/baked lighting, I refactored how my light probe framework checks for lights, clearing two loops off of my trace function, which can now run 500 traces per frame with no frame time cost. (75k traces per sec @ 150fps)
Example: a player with 8 probes (distributed to extremities, head and torso) can overlap 65 light bounds at once and trace for illumination based on distance to light source from probe (and view cone angle for spotlights on half of these traces) before frame times are affected.
Thanks! It could definitely be included & tracked as a variable in the probe, as the bound volume that the probe references has a reference to whatever light it’s representing, so you’d just need to pass the color through in the Probe Detection function I’ve built in. I’ll mark down to include getting the referenced light properties in the example docs I’m writing out.