TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 3 of 3

Thread: Pretty neat. Someone made a Darkmod style Lighgem detector in Unreal Engine.

  1. #1
    Registered: Jul 2010

    Pretty neat. Someone made a Darkmod style Lighgem detector in Unreal Engine.

    For the past little while I've been working on a light detection method for use in a stealth game like the Splinter Cell or Thief games. I wasn't happy with most of the other implementations I saw as most of them used raycasting the distance from light sources and didn't seem all that accurate. So, after reading up on how The Dark Mod did their light detection ( , I decided to try and implement a similar system in UE4. After a lot of work I finally got it where I like it, mostly.

    It works by having a SceneCapture focused on an octohedron located in the same space as the player. The capture is sent to a RenderTarget which then has every pixel scanned and the brightness of each pixel calculated. The brightness value of the brightest pixel is then returned for whatever you may need it for (eg AI visibility calculations). I've also considered averaging the brightness of every pixel instead of simply returning the brightest pixel, but I haven't tried it yet. In the video, you can see an example of how you might display the lighting information to the player in the form of a progress bar. There's also debug information in the form of a raw float value, and a display of the RenderTarget. Advantages over the "common" implementations (ie raycasting):

    This method takes into account the color of a light source. Some colors will make the player more visible than others. The "perceived luminescence" method from here was used:
    This method works with indirect light bouncing. With raytracing method, the easiest way to implement it was if the line of sight to the player was broken, the player was completely hidden. This would look very unrealistic if there was a lot of bounced light behind the object blocking the line of sight.
    This method works with pretty much any light source, including spotlights.

    Some of the current limitations:

    It's only as accurate as your Volumetric Lightmap. During testing I had a lot of problems with directional light being cast on the player even though he was indoors. I also had to increase the settings of the Volumetric Lightmap quite a bit to get it to be accurate enough for my tastes, eg next to doorways.

    I'm pretty happy with it at the moment, though it's a shame I had so much trouble with directional lights having their indirect bounce applied to the character through walls. Any comments or suggestions on how to improve the system are welcome.

  2. #2
    New Member
    Registered: Feb 2015
    Thats really cool. I like that they took the time to explain how they did it and not just put up a short video of it working.

  3. #3
    Registered: Mar 2001
    Location: Ireland
    Very interesting.
    I hope the author will share the system once it's complete.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts