Skip to content

unitycoder/LumiLightDetection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: Lumi is coming to the Unity Asset Store with new features and support. This repository is no longer being updated.

Lumi

Lumi is a Unity Engine light detector, created to facilitate stealth and horror genre games.

The script has been tested to work best with URP and linear colour space.

Features

  • Supports Directional, Point, and Spot realtime lights.
  • Baked light support via light probes and lightmaps.
  • Accounts for perceived brightness from coloured lights.
  • Runs in editor for quick iteration.
  • Multiple sample points per detector.
  • Two sample point evaluation modes - Average and Max.
  • Disable Updates and manually update when needed.

Performance

Impact on performance is proportional to the number of Sample Points and Lights specified in the LightDetector. Each light check attempts to perform early outs to ensure further calculations are only performed when necessary.

Lights can be added to/removed from a LightDetector at any time during runtime to control performance.

If updating every frame is not necessary, the user can disable the LightDetector component and manually invoke the UpdateSampledLightAmount method at a frequency more suited to their needs.

Limitations

  • When Baked Light Sample Mode is set to Lightmap, following apply:
    • The lightmap textures must be set to read/write enabled.
    • Lightmap should be in HDR (High Quality). See Lightmap data format for more information.
  • Since realtime lights use ray casting, shadow caster mesh colliders need to be accurate.
  • Does not account for soft shadow edges - a sample point is either in shadow or not.
  • Cannot account for screen space Global Illumination solutions.

About

Unity Engine light detection script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%