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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Sync directional light color change in time with material color change

I currently have a material that cycles through different colors based on the algorithm seen here:

alt text

I can apply this to an object or a floor and it has a nice effect, but of course it doesn't actually light up any other objects in the scene. As you can see, these two cubes I've placed in for testing are solid black.

alt text

I have added a dynamic directional light to the scene, but while I can get it to cycle through colors randomly using a Timeline, I can't seem to get it in sync with the same algorithm as the material, so the colors are off. Is there any way I can achieve the effect of the changing material lighting the scene appropriately?

Things I have tried:

  1. Emissive dynamic lighting. According to the docs, you must turn off pre-computed lighting to do this, and this is not an option for my project. If there is another way to do this, I'm still open to the idea.

  2. Recreating the algorithm in blueprints for the directional light. I haven't been successful with this, but I'm no Blueprints expert.

Product Version: UE 4.19
Tags:
capture.png (224.5 kB)
capture2.png (1.4 MB)
more ▼

asked Jul 02 '18 at 04:28 AM in Blueprint Scripting

avatar image

Drgy55
39 5 10 14

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

2 answers: sort voted first

You could change the light of your material in blueprints with a dynamic material instance. Just type in "create dynamic" and I'm sure it will show up. You can use it to set material parameters dynamically, you have to make a parameter for Color and plug it into emission. Then add a set vector parameter from your dynamic material

more ▼

answered Jul 02 '18 at 06:40 AM

avatar image

Atornity
229 3 13 14

avatar image Drgy55 Jul 02 '18 at 03:44 PM

Oh! This sounds promising, will test when I get home today and update...

avatar image Drgy55 Jul 02 '18 at 10:05 PM

I created a Timeline for my Directional Light as before to change the color, changed my material to have just a vector parameter for color going into emissive, added the same color-changing Timeline to blueprints of the objects with that material applied, and used a dynamic material instance node to change the color using that Timeline.

Works perfectly, thank you!

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

did you tried to make material function with this algirithm, and use it in floor material and in directional light's light function material?

more ▼

answered Jul 02 '18 at 05:06 AM

avatar image

redbox
4.3k 80 17 104

avatar image Drgy55 Jul 02 '18 at 05:43 AM

Thank you for your idea, but unfortunately light functions only affect the light's intensity parameter and not the color.

avatar image redbox Jul 02 '18 at 06:19 AM

oh yes, I forgot about that, sorry...

avatar image redbox Jul 02 '18 at 06:20 AM

it looks like only option you have - use the same timeline for light color and material color.

(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