playMaker

Author Topic: [SOLVED] Changing a specific color in a material  (Read 2633 times)

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
[SOLVED] Changing a specific color in a material
« on: March 09, 2016, 05:41:34 AM »
So I am having a bit of trouble figuring out how to change a specific colour in a shader.

I have made a shader with Shader Forge that has 3 different colours, and I want to be able to control them individually with playmaker. All I can seem to do is change the over all colour of the material.

« Last Edit: March 10, 2016, 09:40:40 AM by jasperPT »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Changing a specific color in a material
« Reply #1 on: March 09, 2016, 02:05:23 PM »
Set Material Color has a Named Color parameter.
https://hutonggames.fogbugz.com/default.asp?W380

I assume you can set each color name in Shader Forge? You should then be able to target them by name...

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: Changing a specific color in a material
« Reply #2 on: March 09, 2016, 02:06:02 PM »
Did you try access it through the 'Set Property' action?
Lock your FSM, Drag in the components feature you need to work with, or your Shader etc... and scroll down to Color (R,G,B) should come up individually.
I haven't tried this with that Plugin, but it's worth giving it a try.

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
Re: Changing a specific color in a material
« Reply #3 on: March 10, 2016, 09:40:22 AM »
Thanks for the help.

I had tried to use the Named Color paramater but it did not work.

Turns out it is because I was using the wrong name.

My color variables are called something like this "Top Color"

So I was trying "_Top Color"

However I looked at the code of the actual shader and it titles these as TopColor

So when I set the parameter instead to "_TopColor" it works perfectly!