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"

Lerping two colors based on pixel z-axis value

Hi! I would like to lerp my material by two different colors based on the pixel z-axis value. How could I accomplish that?

Thank you!

Product Version: UE 4.15
more ▼

asked Apr 05 '17 at 09:48 PM in Rendering

avatar image

Iacopo Antonelli
8 3 6 9

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

1 answer: sort voted first

Hey ginwakeup,

Maybe something like this is what you're looking for? AbsoluteWorldPosition lets you get the pixel location, and then you can us the Mask node to get the Z coordinate.

alt text

If you're using Lightmass, one caveat is that it doesn't seem to use the AbsoluteWorldPosition node; I suspect it just uses 0 when it's baking but I'm not actually sure. In either case, if you're baking your lighting, I wouldn't expect fully accurate bounce lighting from this. If this is for an emissive material or an object that isn't part of a light bake, it should be fine.

zaxiscolorlerp.png (637.7 kB)
more ▼

answered Apr 06 '17 at 02:03 AM

avatar image

107 2 6 12

avatar image Iacopo Antonelli Apr 06 '17 at 11:06 AM

Thank you very much! That was exactly what I need.

(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