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

Shader Sandwich - A Layer Based Approach to Shader Creation

Discussion in 'Works In Progress - Archive' started by spike1, Nov 22, 2014.

  1. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58

    Edit: This is a very outdated thread, go here for the released asset! Here's a quick video of it as well:

    So yeah, everything else on this page is super old :).

    Hi!
    Having looked around for a bit, I couldn't find any layer based shader editors, so I figured I'd make one :). There are several other shader editors out there, but all of them are node based. While node based shader editors are more advanced, they can end up making simple things quite complicated. A layer based shader editor offers the same features but in a simplified interface.

    I am hoping to get this out on the asset store in a few weeks, I'm thinking it'll be around $30-$40. It would be great to see what people are willing to pay for this, I don't want to overprice it :D. There will probably be a free version as well, just with more limited features.

    If you have any suggestions/additions you would like to see in it, feel free to ask :). I'm more than happy to add even highly obscure features if I know it'll be of use to someone :).

    Examples(All surfaces use custom shaders):

    Fur and a bunch of other weird stuff :D.​

    Shell based grass with proper sorting, reflective water + perlin noise waves

    Procedural Terrain based on perlin noise with tri-planar texture mapping.

    Stylized character.

    - Burn shader with glow and................... something else.....

    So far it supports many things:​
    • Multiple diffuse types - Lambert, Oren-Nayar, Translucent, Unlit
    • Stencils
    • Transparency - Cutout/Fade
    • HSV and RGB color alteration + Inversion ect
    • Combining Normals
    • Realtime preview
    • And a ton more!
    The interface (Sorry for the ugliness of the free version of Unity :D):

    The default diffuse shader.

    The procedural terrain.​

    All I've really got left to do is simplify the interface.

    Thanks for viewing!
     
    Last edited: Sep 2, 2015
    FBTH, Kirbyrawr and Rutenis like this.
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    interesting...
     
  3. FBTH

    FBTH

    Joined:
    Jul 25, 2012
    Posts:
    272
    The grass ones are awesome! I like what you are doing, keep it up :)
     
  4. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Thanks guys :). All the shaders I create as tests will be usable in the editor. I've created a page for Shader Sandwich on my primary website where you can find a full feature list along with planned features :). I did a test with an old model I made to compare the default shaders to custom made ones, here were the results.

    It uses all sorts of things such as translucency, Oren-nayer shading and depth writing hair. It's pretty clear that the Shader Sandwich custom shaders are better, and they all took about 5 minutes each. More updates soon :)
     
    Last edited: Nov 28, 2014
  5. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Sorry about the links above, fixed them :).
    I've added a few more options and optimized some shader generation code :). I've added a the option to treat the layer as a height map and convert it to a normal map on the fly, useful for procedural textures. A new set of options are also available in layers, the math panel. It allows you to mathematically edit the output of the layer, once again good for procedural textures and other effects :).
    Here's quick procedural wood texture I made, no texture inputs:

    And a screenshot of the maths panel - The interface still needs work :).

    Along with this I've added the ability to merge normal maps, and recalculate normals after vertex movement (It was sort of working for the terrain, but was still pretty buggy).

    Anyway, I've just got to add some more layer effects (Displacement, mainly), and fix some menu bugs before being complete! I'm thinking of re-working the entire interface as it's all a little clunky, and obviously I also have to write the documentation. After that I'll lock down the features and test it all out for bugs and such. If you have any feature requests, the sooner they come in the better :).
     
  6. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58


    Ok, POM is now integrated into the editor properly (It was very hidden before), along with the addition of silhouette clipping, and self shadowing :). For those who don't know what that is, it's a shader technique that allows the representation of really detailed geometry like bricks, chipped wood ect, that properly moves with the camera while only using low poly objects. The cube in the above example is just that, the default cube!

    It's pretty easy to use, just tick it on, set a layer to use the height influence then ramp up the quality. Still need to fix shadow casting, but other than that it's working great and looking awesome.
    Anyway, there won't be any updates for the next few days, going on a quick holiday :). Once again, if there are any suggestions, just ask and I'll add it as soon as possible.

    I'm going to update the features page with two versions, one that shows all the bugs and such along with it, and a more flashy page with screenshots of all the different features. I'll also add what feature I'm currently working on along with what I've got planned next.

    Well, see you guys in a few days :).