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"

Lighting channels and real-time lighting

Hi everyone,

I've implemented lighting channels much like in UE3 by putting an FLightingChannelContainer in ULightComponentBase, UPrimitiveComponent, all their SceneInfos etc. and doing the AND operation in ULightComponent::AffectsPrimitive() and ULightSceneInfoCompact::AffectsPrimitve().

And it works, but only for static lights ― and only after rebuilding the level lighting. Real-time lights seem to ignore the channels, even though I made sure FLightPrimitiveInteractions are not instantiated for components with non-overlapping channels.

Where should I look to fix that?

Product Version: Not Selected
Tags:
more ▼

asked Nov 21 '14 at 03:40 PM in C++ Programming

avatar image

Leszek Godlewski (Astronauts)
6 1 3 4

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

1 answer: sort voted first

Okay, I've managed to implement it myself.

G-buffer B's alpha channel normally contains only the shading model ID, of which there are 6. So they only occupy 3 bits, leaving 5 bits free. I'm populating them with 5 lighting channels by properly adjusting the G-buffer encoding and decoding functions. Light channel bitmasks are injected via new uniform buffer fields in FPrimitiveUniformShaderParameters and FDeferredLightUniformStruct. The masks are ANDed in GetDynamicLighting() in DeferredLightingCommon.usf.

Auxiliary code is trivial.

more ▼

answered Nov 27 '14 at 12:59 PM

avatar image

Leszek Godlewski (Astronauts)
6 1 3 4

avatar image Waffle SS. May 21 '16 at 02:52 PM

Could you share your code/the files you changed to achieve this?

avatar image Leszek Godlewski May 21 '16 at 03:55 PM

Not really, I no longer work at The Astronauts for whom I made these changes. However, the description above is verbose enough for any programmer to follow and implement them, modulo the new selective output stuff Epic added sometime after 4.7.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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