playMaker

Author Topic: Material lerp action?  (Read 2730 times)

twerkface

  • Playmaker Newbie
  • *
  • Posts: 8
Material lerp action?
« on: November 25, 2017, 07:54:06 PM »
Is there an action or is it possible to use existing actions to emulate Material.lerp to blend between two materials over time?

https://docs.unity3d.com/ScriptReference/Material.Lerp.html

Arnoob

  • Junior Playmaker
  • **
  • Posts: 63
Re: Material lerp action?
« Reply #1 on: November 26, 2017, 06:08:21 AM »
Not directly, but you can already get/set material floats, colors and vector4.
Simply get the values you need to be lerped from your material. Then lerp them with the usual value interpolation actions (interpolate color, animate float etc...) and set the result to the destination material every frame.

twerkface

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Material lerp action?
« Reply #2 on: November 26, 2017, 12:24:53 PM »
Ah, thanks. This won’t work with changing between two different textures, will it?

Arnoob

  • Junior Playmaker
  • **
  • Posts: 63
Re: Material lerp action?
« Reply #3 on: November 26, 2017, 08:55:02 PM »
Sadly no, it is impossible to do it by script, you need to do it with a shader that lerp between two textures.

The closest thing to do that would be to modify the texture itself at runtime, and that's frankly very complicated, especially with playmaker (I am currently trying to create some texture modification actions, but due to fact that you need to use standard arrays,it is really a pain).

I advise you to take a look at Amplify Shader in order to have a visual scripting interface (like playmaker) for the shaders, that's what I use personally, and it's really good for that IMO.