playMaker

Author Topic: Accessing Shader parameters. [SOLVED]  (Read 5270 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Accessing Shader parameters. [SOLVED]
« on: February 24, 2013, 05:16:27 PM »
So, I've been looking at the Get/Set property action and for some parameters it's okay (such as the texture plates that the material might be using) but for others, it's either something that i can't make heads or tails of or it just isn't accessing it.

things like in the toon shader, there's a range value that you use to determine the thickness of the outline... something like that.

are there any actions that i may have missed that might be able to help dig around in the shaders to get at the guts there or is this something that isn't implemented?

I completely understand that the main focus is on the new roll out of PM so i understand if this doesn't get much attention but still, it'd be neat to be able to mess around with those settings.
« Last Edit: March 11, 2013, 01:29:30 AM by Alex Chouls »

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Accessing Shader parameters.
« Reply #1 on: February 25, 2013, 01:31:52 PM »
Since i've been delving into shaders and such, I am not sure this is do-able (but if you know my hunch to be false, feel free to correct me) because it's technically a different kind of language.

some properties do seem adjustable but that seems more because they are defined as "constants" as it is... so, things like material offsets and tiling, main texture bitmaps, etc... all that being said, it's still pretty darn powerful but i think i may have to do a workaround for now.

Still, if it is do-able, i can imagine that it'd be a very robust way of adding even more control to one's game ;)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Accessing Shader parameters.
« Reply #2 on: February 25, 2013, 01:39:36 PM »
Have you played with Set Material Float? That should let you set named shader parameters...

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Accessing Shader parameters.
« Reply #3 on: February 25, 2013, 02:20:12 PM »
Yep, that does it.

Though, I had to dig into the shader file to find the name (the displayed name on the shader parameter page showed "Outline width" whereas the value it was needing was "_Outline")

If i may make a suggestion (not sure if this is possible) but when you drag the material into the drop-down slot, would it be possible to have it find the variables that it can work with (and maybe have a field under that that updates to show the string/name of the parameter you've selected so that it can take some of the guessing out of it or so that the user doesn't need to open the shader file in monodevelop to find the right one they're looking for?)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Accessing Shader parameters.
« Reply #4 on: March 11, 2013, 01:29:08 AM »
I agree, that would be ideal... I'll look into it...

Red

  • Hero Member
  • *****
  • Posts: 563
Re: Accessing Shader parameters. [SOLVED]
« Reply #5 on: March 13, 2013, 09:51:05 AM »
That would be awesome! Thank you!

though, i do understand that this is probably not as high up there on priorities as other things, it's awesome that you'd look into it! no pressure. makes no sense adding to your list of priority things to do since i'm sure you probably have a big enough list as is. :P

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Accessing Shader parameters. [SOLVED]
« Reply #6 on: July 05, 2013, 06:07:58 AM »
i was on this stage too,

should be nice to do this for sure!