Announcement

Collapse
No announcement yet.

Set actor / component lighting properties at runtime.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set actor / component lighting properties at runtime.

    Click image for larger version

Name:	Lighting.jpg
Views:	1
Size:	73.8 KB
ID:	1201382

    What I want is to set Lighting Channels in game dynamically. Why all the lighting properties can't be changed during runtime? Is there a good reason for that? As it comes to lighting channels I can't think of a reason, same for "Cast Dynamic Shadow", or "Self Shadow", "Shadow Two Sided"...

    So, next question, is it possible to write functions in C++ for that not changing the source code of the engine. Like, a plugin?

    #2
    Never mind, got that, I guess.

    Code:
    void UTiExtendedLibrary::SetLightingChannels(UPrimitiveComponent * Component, bool Channel0, bool Channel1, bool Channel2)
    {
    	FLightingChannels Channels;
    
    	Channels.bChannel0 = Channel0;
    	Channels.bChannel1 = Channel1;
    	Channels.bChannel2 = Channel2;
    
    	Component->LightingChannels = Channels;
    	Component->MarkRenderStateDirty();
    }
    Truth is, that function could be added, along with others. Might consider writing some library for that later...

    Comment


      #3
      For posterity: 4.25 has a built in blueprint method: https://forums.unrealengine.com/deve...able-variables

      Comment

      Working...
      X