Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: moondust.games on June 18, 2019, 11:37:44 AM

Title: VFX Graph and Shader Graph - exposed parameters
Post by: moondust.games on June 18, 2019, 11:37:44 AM
Hello Jean

I'm playing with VFX Graph and Shader Graph in Unity 2019. Sorry if this has been discussed (I couldn't find anything) but are there any actions yet to be able to set or change the exposed parameters with Playmaker?

In case you haven't looked into these yet when you expose a parameter being used in either graph it puts the variable in the inspector panel so it can be manipulated outside of the graph window. Shader Graph parameters can be given scriptable names like "_colour" so they can already be targeted with Playmaker but as yet I can't find a way to target the VFX Graph exposed params.

Hopefully some actions are in the pipeline or any info on how to do this would be great! Thank you.
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: jeanfabre on July 04, 2019, 03:14:14 AM
Hi,

 Sorry for the delay!

I need to check this out indeed. There is no plan yet to support this, but it make sense we do because of the great power these vfx and shader graphs gives,

Bye,

 Jean
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: djaydino on July 04, 2019, 04:34:22 AM
Hi.
There are several Set/Get Material actions, i believe you can use those to adjust the shader values on a material.

If you want to change only on the targeted object, you can use 'Material Property Block' (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))
you can add [PerRendererData] to a property, then unity will not make an instance of the object

The link below shows you what the difference would be :
http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: bluedonkey on April 08, 2020, 09:42:23 AM
Hi , I would like to control an exposed parameter via Playmaker. Am I missing anything, this seems to be tricky to do? I'm pretty new to playmaker, so apologies if I missed something obvious.
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: djaydino on April 08, 2020, 10:34:44 AM
Hi.
Which parameter are you trying to acces.
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: bluedonkey on April 08, 2020, 11:02:35 AM
I just want to access some custom floats exposed from the vfx graph. In my case gravity and turbulent noise.

Thanks
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: djaydino on April 09, 2020, 07:15:16 AM
Hi.
you should be able to set them with set material float
once you know the correct name of the property
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: t4d on October 27, 2021, 06:16:23 PM
can you give more detail on how to use a material set action to change a VFX float please ?

in the playmaker action what do you set the material to ? VFX does not seem to have a material ?

I tried using "get material" action and then uses the material it found to then set the material float but that did not work?

What's the material index value set to ?


Dragging the Visual effect into playmaker shows alot of Variables.
how do I set the Exposed Float variable value in the visual effect ?
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: djaydino on October 28, 2021, 01:16:22 PM
Hi.
You can use the action "Set Material Property Block Float" (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))
to change the value only on a certain object.
or
"Set Material Float" which will change for all objects that uses that material.

Material index in most cases is 0, unless you have a object with multiple materials.

The Named Float/Property Name depends on the shader.
if you select a material in the project window, then in the inspector on the title right click and select edit shader.
It will open the shader file and you can look there what name you need.

usually it has a underscore like this : _Opacity
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: Luceid on September 05, 2023, 12:43:54 PM
In case anyone found this from google searching like I did, the info on this thread is most likely incorrect. Set material works fine for shader graph, but VFX graph requires the "call method" action to be used. There will be a huge dropdown of methods to choose from once you drag your VFX in. I needed "void SetFloat (string,float)" where the string is the parameter name, and the float was the variable I wanted to alter. Make sure the variable is exposed in the VFX graph if it doesn't work.
Title: Re: VFX Graph and Shader Graph - exposed parameters
Post by: djaydino on September 06, 2023, 12:55:29 PM
Hi.
Have you tried looking on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) and its not recommended to use call method (especially if you would use it Every Frame)

as its mirroring, which is slower than dedicated actions. (which would be fine in most cases)
But build for other platforms you might need to use Linker Wizard (http://hutonggames.com/playmakerforum/index.php?topic=11126.0) to make sure its included in a build