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"

Dynamic Mask Texture

Hi,

I would like to know what is the best way to dynamically update a mask texture. For example: I want to clean a dirty car using my mouse. So, I trace a ray from mouse position to my car´s surface, detect the contact point, and then I want to convert this point to a uv coordinate of a texture that I can dynamically update. Anyone can help!?

Thanks

Daniel

Product Version: Not Selected
Tags:
more ▼

asked Sep 06 '14 at 06:21 PM in Rendering

avatar image

danielvmacedo
192 15 16 129

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey danielvmacedo -

You may want to begin looking at the Location Based Opacity tutorial from Epic Technical Artist Alan Willard, it is a good jumping off point to help drive your material change.

Thank You

Eric Ketchum

more ▼

answered Sep 08 '14 at 08:14 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 701 255 733

avatar image danielvmacedo Sep 08 '14 at 08:41 PM

Thats interesting, however I don´t see how can I dynamically pass multiple contact points for hiding geometry or the texture. What I was thinking is: Create a blueprint with a sphere component and a decal that I can point to the car's geometry projecting the dirty texture... when my tracer collide with the sphere I start to change the decal's parameters until I destroy it completely, what do you think!?

Thanks for the help!

Daniel

avatar image danielvmacedo Sep 08 '14 at 08:46 PM

Nevermind.... I didnt know about collection parameter! I think I can make it to work. Thanks!

avatar image lucabelluccini Mar 09 '15 at 10:12 PM

The videos of Location Based Opacity are great... I am wondering if it would be possible to generate multiple sphere masks dynamically.

avatar image Lovecraft_K ♦♦ STAFF Mar 09 '15 at 10:41 PM

Hey lucabelluccini -

I haven't set that up, but it is possible. You would have to use two sets of variables to control the rendering of the two spheres in the world and you would duplicate the sphere mask area of your material and add them together in the material, but it should be possible.

Thank You

Eric Ketchum

avatar image lucabelluccini Mar 19 '15 at 10:57 PM

Hello, what I finally did is a predefined set of sphere masks embedded in the material, each one with its radius and position parameters.

Then I access the dynamic material instance each time I want to modify them and I add them up in the opacity node of the material.

It would be great to have some sort of internal buffer in the material itself (once you set the sphere, it is stored internally), but I know the sphere is not a real volume but an operator on the rendered pixels... So this is not possible.

A detail: as parameter, I do not assign the world position but the local position. In this way I can use this mask also for dynamic meshes (I take the local position parameter and add it to the object position). Just rotations are not covered... But that's temporarly ok.

avatar image Boron91 Sep 18 '15 at 07:53 PM

Hello there:

I was having the same issue with having more than one sphere mask, and your idea really helped! I tried having up to three spheres and it looks awesome.

However, I don't know how many sphere masks I will end up using simultaneously in each level, and if the number grows big, manually adding the sphere masks escalates poorly. Did you find any solution for this problem? Maybe some kind of automation in the material?

Thanks for your time, Jaime

avatar image Lovecraft_K ♦♦ STAFF Sep 21 '15 at 07:48 PM

Hi Jamie -

Here is a sample of using a single Material with a single set of variables to have a dynamic mask across several assets by using a setup in Blueprints.

Test Project 4.9.1

So this is just a brief setup, but by altering what each Dynamic Material uses you can have multiple masks without the multiple sphere mask setup.

Thank You

Eric Ketchum

dynamicmask.zip (687.7 kB)
avatar image Alivender Oct 16 '15 at 10:30 AM

Hi,

I am looking into this exact same problem, but in my case I want to mask out the intersecting faces of many spheres overlapping each other. I have arrived at pretty much the same conclusion as Boron91. If I have e.g. 3 spheres overlapping each other, then I need the material they use to add together 3 sphere masks. However if it's all dynamic and there could be potentially unlimited number of overlapping spheres, then the problem becomes impossible to solve without having arrays in the material, and those are not in.. Right now, in my project I can enforce the rule that no two spheres can come closer than the maximum radius of either. This way, mathematically, each sphere can only be overlapped by maximum of 12 other spheres, which become manageable.

Kind regards,

Alivender

avatar image TorQueMoD Jan 02 '16 at 07:07 AM

I'm curious if you might be willing to put together a tutorial on how to set this up as I'm looking to create a similar effect to washing a car via materials.

(comments are locked)
10|2000 characters needed characters left
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