Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Using MaterialPropertyDrawer to control render states

Discussion in 'Shaders' started by GThornton, Nov 28, 2013.

  1. GThornton

    GThornton

    Joined:
    Nov 20, 2013
    Posts:
    3
    Hi,

    I was quite excited to see the new MaterialPropertyDrawer functionality, as I thought it was going to help me sort out one of my major issues with using Unity shaders. That is, being able to have one shader with all my code in it, and a simple UI exposed set of controls to twiddle common things like blend modes and various other render states. In the past, I've had to duplicate my shaders just to change a single render state.

    However, it looks like the shader keywords generated by the property drawers (toggle and keywordenum that I've seen) only have an effect on the CG code, and not the renderstate stuff. Does anybody know if this is possible, or if there is some other clever way of sharing one set of shader code with many render-state permutations?

    Thanks,

    Graeme
     
  2. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Bump.
    Please, add some examples.