playMaker

Author Topic: How to add a Shader  (Read 3619 times)

jgalvezpa

  • Junior Playmaker
  • **
  • Posts: 58
How to add a Shader
« on: November 08, 2013, 11:30:00 PM »
Hello sorry for the newbie question it is my 1st time with shaders, i bought a glow plugin that bring lot of shaders, i want to know how can i apply it in my fsm.
for example i want that when i click an object it start glowing
Thanks

Blitztron

  • Playmaker Newbie
  • *
  • Posts: 3
Re: How to add a Shader
« Reply #1 on: November 09, 2013, 02:41:33 AM »
Hav you tried using Set Material?

parallel

  • Full Member
  • ***
  • Posts: 155
Re: How to add a Shader
« Reply #2 on: November 09, 2013, 05:12:07 AM »
Create a material, choose the shader (in the drop down list) and then assign material either beforehand or at runtime with 'set material'.

jgalvezpa

  • Junior Playmaker
  • **
  • Posts: 58
Re: How to add a Shader
« Reply #3 on: November 09, 2013, 02:12:36 PM »
yes but im using 2D sprites with transparency when i apply a shader somethings appear a black or white image in my sprite

pottering

  • Playmaker Newbie
  • *
  • Posts: 3
Re: How to add a Shader
« Reply #4 on: November 09, 2013, 05:23:33 PM »
I'm a noob, but I think that "2D" in Unity is usually a 3D object with a texture/material of a image of a 2D sprite, so when you apply the shader it changes the texture/material and your 2D sprite disappears with it.
I'm guessing it is not really a Playmaker problem, but probably the way the shader was programmed.

jgalvezpa

  • Junior Playmaker
  • **
  • Posts: 58
Re: How to add a Shader
« Reply #5 on: November 11, 2013, 01:35:49 AM »
i want to change the shader of a game object in the fsm, not the material how can i achieve that?
« Last Edit: November 11, 2013, 01:38:20 AM by jgalvezpa »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to add a Shader
« Reply #6 on: November 11, 2013, 01:41:17 AM »
Hi,

 You simply can't, Unity doesn't work like that. Shaders belongs to materials, so if you want to change a GameObject shader, you have to switch material.

bye,

 Jean