Author Topic: Player-Influenced Dynamic Texture  (Read 2562 times)

Before I get to my question, I just wanted to say that Substance looks amazing :) I can tell a lot of effort has been put into it.

I'm currently trying to create a simulation for clean laser operation. The main game mechanic is the ability for the user to remove paint/rust/etc with a laser; so, this means I have to dynamically change a texture or material in small sections, and there's currently not a way to do this well in UE4 to meet my needs. Now my question, I'm not very familiar with Substance currently (waiting on download), but is it possible to use one of Substance's features to setup a dynamic substance/texture/etc? I'm attaching a picture link as a visual example of what I'm trying to accomplish.

Thanks,
Fen

http://www.laserage.ie/images/SERVICES_rust%20removal.JPG

You can dynamically do this in your substance files but not "realtime" in the sense that you can update a texture each frame.

When changing a substance, you have to rebake it using the CPU(I think) and that takes milliseconds to seconds depending on your graph complexity.

Once your textures are baked, you then apply them back to the UE4 material.

Thanks for your response. What you say makes sense, I'm just not sure how to do that in UE4. I'll tinker with it some more :).

Create a substance that has the rust and non-rusted metal with an alpha texture that blends between them. You'd want this alpha texture to be able to be set via image input. Then in blueprint/C++ when the laser hits a spot on the model, determine the UV location and update the texel location of the alpha texture and update the image input of the substance.

You can also do this outside of substance using UE4 materials but substance may give you some interesting quality addons like bluing the areas between rust/non-rust etc.

You can also think of using a shader that uses Vertex color as a mask betwwezn the 2 versions of you textures, and use some code to change the VC dynamically depending of the position of your laser

Thanks again for the responses. The hardest part of all of this for me is the small details in C++ syntax needed for creating a header file, and just trying to get relevant examples to learn from. I've found some information over the past 3-4 days, but its either broad concepts or snippets of code on various engine versions; so, its been slow going. I'm not sure how to get raycast impact coordinates as UV coordinates yet, some of the answers on UE4's answerhub indicate it may not be possible, but I've seen a video somewhere of someone doing exactly what I'm trying to do.

I'll report back with more questions once I can get some basic code working.