x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Determine brighness/light level at location

Hello,

I'm currently working on a system that determines whether the player is in the shadows or lit (and how much), as seen in the old Thief games. Getting the lights that affect the player is easy, but I'm having trouble calculating how much light actually reaches the player at a given distance.

A solution was posted in this post: How do I get the light levels at the player's position? However, it is at the very least incomplete as it does not take into account the intensity of the light and whether inverse squared falloff is used or not. Both, and especially the former, are big deals.

I've been digging through the source of the engine and found some useful information. In particularly the file "Shaders/DynamicLightingCommon.ush" has proven useful. However, parsing through it, I still don't see where the intensity comes into play. There are also variables for which I couldn't find out how they relate to the settings of the light components (e.g. DeferredLightUniforms.LightInvRadius - what is it and where is it set?).

In the PointLightComponent.cpp I found out how the intensity and units relate to one another (line 198).

Help would be greatly appreciated, as I'm currently diving into the depths of the engine's source code and it's quite the ride. It's not easy to find what you're looking for, if there is this much code. I need this to work reliably for point- and spotlight components. Directional and skylight aren't relevant (although, admittedly, they're the most trivial).

Product Version: UE 4.19
Tags:
more ▼

asked May 17 '18 at 11:21 AM in C++ Programming

avatar image

TheSniperFan
194 1 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question