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"

Partially change material of mesh at runtime

Hi all, I would like to have a dipping effect at runtime, which means that a mesh can change its material for those parts that intersected another volume. It's like dipping a brush into a paint bucket and then pull it out again. Those parts that have been dunked into the paint have then permanently a new material. Is this something one can implement with ue4? Any ideas? Thanks for your help!

alt text

Product Version: UE 4.7
Tags:
more ▼

asked Jan 03 '16 at 03:15 PM in Rendering

avatar image

Carl Mahnke
1 1 2 3

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

1 answer: sort voted first

Hello Carl Mahnke,

This is something that is possible, but will require some intermediate to advanced knowledge of Dynamic Material Instances and Material Parameter Collections in order to change the affected object's material at runtime. To learn more about these techniques, we have some really helpful documentation that you can follow to understand it better.

Material Instances

https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/HowTo/Instancing/index.html

Material Parameter Collections

https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ParameterCollections/index.html

In your case, you will probably want to have the mask as an alpha with additive color and modifiable opacity. This way, when you dunk the paint brush into the color, you can set the opacity of the mask to an opaque value, and add color at the same time.

Cheers,

Andrew Hurley

more ▼

answered Jan 03 '16 at 07:47 PM

avatar image Carl Mahnke Jan 08 '16 at 07:08 PM

Hi Andrew, thanks for your ideas. Working with a mask was also my first thought, but here comes the catch, where I think UE4 is reaching its limits. As the paint brush can be inserted into the paint bucked in any angle and also multiple times I need something like a dynamic mask.

avatar image AndrewHurley Jan 11 '16 at 02:30 PM

So your next task is going to be running traces on the geometry, so that no matter what angle you are placing the brush into the paint, it can correctly apply the material instance parameter.

This is something that is going to take some time to test and attempt as I have not tested this example myself, but in theory it should work pretty straight forward.

Let me know if you get stuck or need further advice.

Thanks,

Andrew Hurley

(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