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"

switching between material functions

Hello everyone,

I'm currently working on a customizer that allows the user to switch materials on different objects/configurations throughout the level. The problem I'm facing at the moment is that some objects have a unique normal map that needs to be applied no matter what material the user selects. My way of doing this at the moment is having all "base materials" as material functions that a master shader uses: alt text

My problem is however, I'm having trouble figuring out how to change the Mat_Leather input based on what the user selects. Is there a way to set up a switch case(with more then 2 materials functions) that I can access and change using external factors(like a blueprint).

Product Version: UE 4.12
Tags:
capture.png (213.5 kB)
more ▼

asked Aug 30 '16 at 06:21 PM in Rendering

avatar image

Zpanzer
28 1 2 8

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

2 answers: sort voted first

Hi Zpanzer,

It looks like you are looking for the LerpMultiple node. Depending on the output of your material function you can use different LerpMultiple nodes and a scalar parameter to choose which is displayed. I've attached a screenshot showing off a very simple application of the node. If you want to access this with Blueprint I would create a material instance dynamic (MID) and set the scalar parameter value assigned to the lerp node's alpha input.alt text

lerpmultiple.jpg (229.0 kB)
more ▼

answered Aug 30 '16 at 09:52 PM

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

It looks like your normal map is a material parameter. If you give that parameter the same name in all of your materials, then the object's Blueprint can create a dynamic material instance and then set that material instance's texture parameter (which is the same name in all of your materials) to the normal map for that object.

more ▼

answered Aug 30 '16 at 10:58 PM

avatar image

sranck
301 6 6 18

(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