Search Unity

Shader Sandwich - A Powerful Layer Based Shader Editor for Artists

Discussion in 'Assets and Asset Store' started by spike1, Jul 29, 2015.

  1. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    ShaderS means Shader Sandwitch haha. I know the performance of the standard shader is slower than older options but that is because it's per pixel with specular and other unique features like reaction to GI.

    I really don't understand what you mean by your 2nd image having vertex color, none of what is going on with your image has to do with vertex colors as vertex colors store very low resolution color information in the RGBA channels and unless that character has about 100, 000 polygons there is no way to make the 2nd image appear that smooth.

    I believe I remember now what the actual terms mean, you are looking for a Matcap Toon Shader, like these:

    1.Is this what you want: https://www.assetstore.unity3d.com/en/#!/content/7449


    2. Look at the last character-is that what you want? :https://www.assetstore.unity3d.com/en/#!/content/8221


    3. The creater of that asset also has a big customizable toon shader. Check out the web GL demo here:
    http://jeanmoreno.com/unity/toonycolorspro/
    Asset store link: https://www.assetstore.unity3d.com/en/#!/content/8105



    This might help too with you Shader Coding:
    https://docs.unity3d.com/400/Documentation/Components/SL-SurfaceShaderLightingExamples.html
     
  2. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Duh, I've hear it mentiond as SS but I guess I didn't read all the forum pages.

    But, umm... if you've never used vertex paint for painting characters, then this is going to be confusing for you no matter what. With vertex paint you can paint over the object, same as texturing, the only thing is that the color data is stored per vertex as you mentioned. Now, most software doesn't have support to display the vertex paint as is, they usually either ignore it or use it for effects only. But you can still create shaders that will display the vertex colors, and usually the process is WYSIWYG, so however you paint it in your 3D modeling software, that's how it's going to look in the engine or renderer (that's another pro). (By the way the second image is from a video tutorial, and yes, it's 100% vertex colors, painted in blender).

    Anyway, I wasn't talking about the smoothness of the second image, I know the limitations of using vertex colors. And no, you don't need a 100k polygons for a decent paint-job for working in-engine. A lot of places are going to have solid colors so you can leave the vertex count low on those areas... And whenever you need a smoother transition you just duplicate a vertex in place, or create one close by the original vertex, and then the transition between points will look better (like you'd do around the cheeks in that image). And yes, it's true, it might be difficult to get low poly objects to look good easily while staying ultra low poly, but losing the texture is a huge boost to performance in most cases, really worth the sacrifice of having more vertex in the object, specially if you use this techniques mostly for the characters, not the world. I do that, and that makes them pop out from the background so nicely. Also, in most devices triangle count isn't the bottleneck, it's the maps (textures, normals, AO, Height, etc).

    Anyway, what I meant was the painted/drawn feel and crispness of the colors in the second picture. You just don't get that easily from texturing. Plus, there's the annoying UV unwrapping and stuff if you use textures, and as a one man team that's a lot of wasted time.
     
    Last edited: Sep 18, 2016
  3. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    I haven't had any issues with clarity when it comes to Shader Quality. The first image you sent me I believe was using a Vertex Legacy shader which is not per pixel so the diffuse map becomes fairly blurry or shows color artifacts. Using a per-pixel shader such as the bumped specular shader will remove those artifacts. You may also be seeing Unity's built in compression going on so there are a few things you might need to have in check:

    - in the settings of your project you should turn Anistropic filtering to Forced On (I always do this it gets rid of the zags within textures)
    - turn mipmap filtering for that texture off since it causes blur to the texture and honestly isn't implemented the best in Unity.
    - While your at it why not add Anti-Aliasing to 4 (it's pretty much free in forward rendering, deferred is not mobile friendly)
    - Set the import compression settings to true color - it increases crispness at the cost of filesize, see if it makes a difference.
    - Also remember to make sure all your cameras are using the Quality settings for their rendering path otherwise you may think the settings are working when they are - this is a issue with Unity applying the main camera settings to the scene view so if you put AA on 4 but in play mode and in the editor were seeing no changes then it's cause your camera has it's own settings applied and is not using the Quality Settings.

    With those in check your diffuse textures should look very nice - for a face 256-1024 is more than enough for crisp detail.

    While you can use the UVFree shaders found in the asset store I do not think there is a way around the texturing issue. After all Blender and Zbrush both have their built in Automatic Unwrappers.

    So the crispness you are talking about is probably due to some sort of setting you have on because I have never heard of a complaint about the crispness of the diffuse texture using the right settings and the right resolution.

    Finally the diffuse is only the beginning, the shader's way of handling light is quite important so things like the rimlight shaders, toon, ramps and other stuff make a big difference.

    From the first image I saw the character looked like he was made of clay whereas your anime girl looked like she was made of gloss. That effect is somewhere in shader sandwitch.
     
  4. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Ummm, I'm guessing the word crispness is not the right one then (English is not my first language). Anyway, I just like the look you get from vertex colors, and the easy of use. And I do know how to setup my project... Most of my scenes have textures too, it's mostly just my characters that don't. I don't know how to describe it, really, but vertex colors just have something I like, it's not that I'm complaining that all my textures look blurry in unity or anything, they look just fine. The qualities of the rendering are just different. Vertex color paint (with a proper shader) look less 3D, even though they are, and the brightness of the colors is like unlit shaders but without the hassle of the UV Unwrapping (and AutoUnwrapping sucks in characters), also they can receive shadows just fine if you have the right shaders. It's hard to explain really. Besides you can do tons of other effects with vertex colors.

    ..By the way, she wasn't made of glossy mats, man... but I guess, that misunderstanding's a testament to the great quality of the technique. Basic vertex shaders are mostly the same as unlit, they just don't use textures but instead use the vertex data (and as you probably already know, unlit shaders basically light the whole model evenly). For the rest it was just some cellshading and outlines. Some of the "gloss/specularity" in the eyes was fake, painted over, just an artistic paint-job, the other shiny parts in the eyes and cheeks were actual geometry painted white. The guy was showing some techniques he had just learned while he was in japan. but you know, I'll just get you the youtube links so you can watch them too. And anyway, I don't need my characters to look that great (although I wish I could). Pulling off some of those shader effects might not be so easy or practical in a game engine, I was just showing it to you so you could see what it can achieve.
     
    Last edited: Sep 19, 2016
  5. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Here is the tutorial. Just a heads up, at the point he uploaded this video the guy was a still render 3d Artist, he didn't know all that much about optimizations for game engines or anything (not sure if he does now, because I haven't checked his newest videos). But you can still learn some great artistic tricks from what he is showing. Doesn't matter if your style is anime or plain toon or whatever. Though, for doing vertex painting more efficiently in a 3D engine you have to look else where. I remember reading several other sites explaining how to achieve this without the need for a huge poly count. (some of which I've already mentioned, you just increase the vertex count in the areas that matter), but anyway, if I can I'll get you some of the links for those pages so you can take a look. Though, the only one I clearly recall right now is the one from Oberon's court, but that one's about using vertex color to get a "pure" textureless 3D effect as the guy from little chicken said.

    Here's the two articles slash tutorials they posted about it.
     
    Last edited: Sep 19, 2016
  6. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    As far as I know this snapshot I put earlier appears to get the closest effect to that video girl and if you tweak it you might have what you need. Also Matcaps are really powerful, I have seen them do crazy things and they do not need any UVW data to work:

    Anyway if you manage to get something with your shader in Unity let us know by posting it.
     
  7. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Yeah, if I manage anything interesting I'll share. I'll also look into those matcap shaders too. Though, aren't those better for still renders than moving objects? I'll have to take a look and see how they look in gameplay (though, they might be great for the props and environment! so thanks again for pointing them out :) ).
     
  8. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    crash course to vertex painting power

     
    Alverik likes this.
  9. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Hey, thanks for the great video. And sorry for the late reply. Anyway, one of my dogs died today so I felt like "what the heck I need a change of pace from all this coding". So a while ago I spent some time doing some of the tuts and I really enjoyed them a lot. I'll try to learn how to use Shader Sandwich properly, little by little. I'm sure I'll be able to make the shaders I want with it (Maybe I'll even give it a shot at making some like the ones mentioned in the video). I know I haven't used it much yet, but I really, really love this asset. It's just really freaking cool. And playing around with it really made my day.
     
  10. VirtualVassal

    VirtualVassal

    Joined:
    Oct 5, 2015
    Posts:
    13
    Just wanted to pop in here and say I did pull the trigger on Shader Sandwich, mostly for the fur portion, and I have to say, it's exactly what I needed.

    Just using the basic Tessellation Fur right now and I'm more than satisfied. Seems to be on par with some of the other fur-only shader assets out there. Haven't even delved into the shader creation itself yet, but this alone was worth the buy for me.

    Have a good one.
     
    Alverik likes this.
  11. Malveka

    Malveka

    Joined:
    Nov 6, 2009
    Posts:
    191
    Hey all,

    I've been giving Shader Sandwich a look and it appears easy to use and flexible. One thing I haven't been able to glean from the basic tutorials or the forum here is whether or not it supports the creation of animated procedural noise shaders. One of the tutorials demonstrated the ability to scroll a noise texture, but I'm looking for a more sophisticated effect in which the noise itself is animated over time. Here's a crude example of the kind of effect I mean:



    Thanks for the info!
     
  12. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Hey guys, I was checking the tutorials, (specifically toon shading and grass) and I've noticed Shader Sandwich's interface is now different (as has been mentioned). Anyway, I don't see the Shells tab and the number of options in the Shells section is now different.

    How do you change the culling and color and stuff for the shells in the current version?
     
  13. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello,

    Is the creator of this asset still supporting it?

    Regards,
    Carlos
     
  14. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Late reply, but, no idea, lol... you'll have a better chance of contacting him through twitter (he actually answered my previous question, but I did send him a twit instead... you can find his contact info in his website).

    Anyway, the asset still works fine. Though, just in case I'm using the asset in Unity 5.5 (I have several versions installed anyway). If a shader works fine in 5.5 it'll most likely work in other Unity versions too. So it's up to you.
     
    Last edited: May 20, 2017
  15. siumanchun

    siumanchun

    Joined:
    Apr 7, 2013
    Posts:
    44
    Shader Sandwich 1.3 Don't support Unity 5.6.x !
    the currently open shader has no passes !
    this is only caused by loading a buggy file or some really bad internal ,
    i'm really sorry
     
    spike1 likes this.
  16. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    UAS15_SocialMediaResizedWStuff.jpg
    World's most poorly thought out advertisement...

    Hey everyone! I know it's been a while, but for now I just want to say that, yay! The new version is out and it is a huge step up from the previous ones, boasting features like a completely redesigned interface and workflow that simplifies things while increasing the possibilities, next-gen effects like Sub Surface Scattering and Curved Parallax Occlusion Mapping support, a shader speed increase, and just a whole bunch of other stuff; the full-ish change log is below:
    - Generally a 20% shader speed increase

    - Fully updated workflow and interface
    ----- New Ingredients panel
    ----- Completely redesigned Inputs panel (WYSIWYG material inspector style)
    ----- Much improved Preview window and Layers panel (layer type previewing for example)
    ----- More consistent interaction (dragging, copy paste, undo support almost everywhere, etc)
    ----- Faster mini previews (GPU accelerated)
    ----- Optimization warnings (definitely to be improved however)

    - New Sub Surface Scattering ingredient, for realistic renders
    ----- Incredibly powerful and easy to configure
    ----- Good performance
    ----- No precalculations
    ----- Additionally included is a faster translucency approximation, good for things with large SSS

    - Improvements to Diffuse and Specular
    ----- New Shader Sandwich shader model included, with more realistic fresnel and roughening (including ambient diffuse roughness). Gives a much better impression of glossy materials and rough, velvet like ones.
    ----- Any Diffuse and Specular type can now be mixed together.
    ----- Diffuse translucency mode has been much improved to be faster and give better results.

    - Much improved Parallax Occlusion mapping, with a huge speed up and quality increase for virtually every use. Plus:
    ----- Curved objects with sillhouette clipping now supported
    ----- Depth correction (so correct intersections with other objects)
    ----- Shadow correction
    ----- Multiple POM surfaces can be created and Z-Tested against eachother within the shader
    ----- Displacing up is supported now (no idea why you'd want to though XD)

    - Completely revamped blending system, that allows intuitive transparency control without a seperate alpha layer channel
    ----- Automatic premultiplication support for better multi texture blending without edge artifacts.
    ----- Transparency has a few better settings for Z-Writing

    - Improved Deferred mode support
    ----- Automatic warnings for anything that won't work right

    - Set inputs to use masks, allowing per pixel control over almost every setting

    - New Layer Types
    ----- Random noise
    ----- Fluid noise
    ----- Curvature
    ----- Front
    ----- Number
    ----- Vector
    ----- Also all the procedural types can now be Gamma corrected (on by default, be sure to turn it off in vertex displacement and whatnot)

    - New Effects
    ----- Higher quality blur effect (Poisson Blur), with full weights control and banding reduction
    ----- Fractal Detail
    ----- Color Split
    ----- RGB to HSV, and vice versa
    ----- Mask Multiply
    ----- Distance to line

    - Improved Effects
    ----- Anti aliasing effect much more effective
    ----- Theshold effect optimized

    - New Ingredients
    ----- Flat shading
    ----- Displacement Mapping
    ----- Convert to Points
    ----- Convert to Wireframe
    ----- The SSS one mentioned above

    - Simplified layer Mapping area with increased options
    - Improved custom lighting access
    - Inputs time speed can be changed
    ----- Plus just a lot more replacements in general
    - More sensible vertex displacement system
    - Tessellation phong smoothing finally works
    - Finally updated the in-built documentation, online one coming soon
    - Fixed countless edge cases and bugs
    ----- Made some more...
    - Better serialization support (such as loading new code or entering and exiting play mode)
    - Added Use Tangents support for some of the lighting types
    - Removed the Fadeout option in the layers panel - will return as an effect in the next version.
    And on top of all this the new version will be 40% off in the "Make it Pretty" sale that'll run from the 28th of August to the 3rd of September - so if you've been thinking of getting it that'll be the perfect time! :D

    So as for the new version:
    Due to the extensive changes, old shaders might not load 100% correctly - I've tried pretty hard to make the legacy loading robust though, so most of you shouldn't have any issues. Some things that might pop up are:
    - The Fade transparency slider has had a functionality change which'll cause it to behave differently (previously it subtracted from the alpha, now it multiplies). Depending on what you do with the alpha channel you might want to add a clamp (so it doesn't become negative), since previously it automatically did.
    - POM shadowing has been replaced with proper integration into Unity's shadow system...however it now looks a lot worse - I should be re-adding it in the next version, so look forward to that XD
    - As mentioned above I took out the Fadeout option in the layer blending since it just seemed kind of arbitrary. I'll be re-adding it in the next version as an effect.
    - Oh yeah, I'll have Unity 4 updated soon, if anyone's interesting in beta testing it then send me an email :)

    The PDFs included in the package have been updated (finally :p), and I've been updating the online documentation and'll publish it in a day or so; I'll also have to go through and re-create all the past tutorial videos (Why do I keep changing the interface...).


    So I know it's been a while since I've posted here - there are reasons but I'd rather not go into them - but with that said I figure I owe you guys some sort of road map.

    As for the future of Shader Sandwich, I've got a whole bunch of things planned to be released over the next half a year or so as I finalize them:
    • Shader Sandwich: Interact ($5) - A bunch of additions that allow for interaction, such as from physics collisions and Unity wind zones.
    • Shader Sandwich: Image Effects ($15) - Adds image effect capabilities such as C# code generation and utilities to cast screen space rays and whatnot.
    • Shader Sandwich: Paint ($5) - Some tools for texture splatting - such as for permanent footsteps in snow or for spray-painting walls.
    • Vertex Toastie ($10) - A tool for baking several vertex attributes, such as Ambient Occlusion, Indirect Scattering, Curvature, Thickness, and whatever else comes to mind.
    What I'm planning is after the sale I'll be raising the price to an even $50 (figured the SSS was worth at least $5 :p). A month or so after that I'll be releasing Interact as a separate addon - but I'll also make a few larger changes.

    Since I don't really want to charge anyone who's stuck with me over the last two years for anything, at that point I'll create a "Shader Sandwich Bundle" thingo that'll eventually include Shader Sandwich + what I listed above - and'll be about $70 (so $15 saved). I'll then create a temporary free upgrade pathway for a week or so to let everyone upgrade. So basically if you get Shader Sandwich before then you get a ride to tons of free stuff haha XD

    I'm releasing those as separate assets since I really don't want to increase Shader Sandwich past $50, but also know I've been significantly undervaluing everything - hopefully this keeps Shader Sandwich accessible while also letting me have lunch out every so often.

    Since this is all a rather large commitment, and considering my rather flaky appearances, I'm going to be holding myself to a bi-weekly forum update of some sort - be it a new tutorial, shader example, or just a showing of what I've worked on. Hopefully this, plus the latest update, will help gain back some trust which I've rightly lost.

    So yeah sorry about the kinda weird new version + sale + future ramblings announcement, but hopefully that clears things up :). If you've got any questions, please by all means ask away :)

    Regards,
    Sean Boettger​
     
    rrahim, chiapet1021 and Alverik like this.
  17. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Considering how much testing I did I feel kinda dumb letting these bugs slip by, but anyway here's a quick patch that fixes some issues.
    Fixed Perlin Noise and Fluid Noise function name collision
    Fixed Color/Split mini preview
    Fixed Mapping Texture space
    Fixed UV Maps larger than 1
    Fixed Inputs erroring when added in latest version (How did I miss this...)
    Fixed SSS shadow variable collision
    Fixed Add blend mode in Premultiplied mode
    Fixed Poisson blur Alpha
    Fixed timestep in Preview window
    Set Emission's base alpha to 0 (from 1)

    I'll be releasing a proper bug fix version after the sale ends, since just due to the scope of this update there are bound to be some regressions here and there - but in the mean time I'll release any patches I finish up here :)
    Knowing my luck I'll release so many if you import them all you get the entire asset :p
     

    Attached Files:

    Alverik likes this.
  18. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Hey everyone!

    Just found out that the sale's started, so that's nice :p

    So I've gone ahead and launched the updated documentation - it's not fully complete but I figure something's better than nothing. You can find it here, along with a link to the previous documentation :).

    Finally I'll be releasing a second patch at some point tomorrow - turns out working on documentation is a pretty good way to find bugs o_O

    Regards,
    Sean Boettger
     
    Last edited: Aug 28, 2017
    antoripa and Alverik like this.
  19. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Glad you are back. Will spread the word to people I know. Shader sandwich is a very nifty tool after all, have to spread the word :)
     
    spike1 likes this.
  20. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Thanks Alverik :)

    I've added some more to the documentation and fixed a few images (btw I forget to mention on it that for lots of images you can hover to see animated previews of settings and such, should probably put that somewhere), and I've also created a quick patches page here. Just put in your invoice number (should be in the email Unity sent you when you get the asset) and then you'll have access to the latest patch :) - let me know if any of you have trouble with it.

    Speed up and look improvement to Shader Sandwich Specular Model
    Fixed Shadow issues when Displacing and Setting in world space

    Change Surface Transparency to "Set Alpha Channel"
    Fixed Gradient preview
    Fixed Flat Shading w/ OpenGL and flipped Y
    Fixed Specular quality modes.
    Fixed initializing ouputNormals when using Tangent to World matrix
    Optimized using TTWM
    Fixed Displacement Mapping Crevice setting
    Fixed retaining focus on old settings when switching selected ingredient
    Fixed Misc Settings saving correctly
    Removed archaic X2 from Specular (You'll notice types other than Sandwich and Unity Standard will look slightly dimmer)

    I'm gonna see if I can get yet another remake of the beginner tutorials out sometime tomorrow, so yeah :)
    Hope anyone who's bought the asset recently has been enjoying it!

    Regards,
    Sean Boettger
     
    Alverik likes this.
  21. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hey .. I bought the asset .. and added the patch
    But when I create a new shader I see only Albedo and Metalness .. where are the other ?
    upload_2017-8-30_6-6-53.png
     
  22. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Umm, maybe gotta reread the documentation. I see the same (checked with and without the patch), but if I load a file from the examples it does show other layers correctly. He did say the workflow has been redesigned. The online tutorials aren't updated yet I think (the video tutorials definitely aren't, and they have a warning in the description).

    - Oh, the included PDF tutorials seem updated already (the images look current), will start by reading those.
     
    Last edited: Aug 30, 2017
    antoripa likes this.
  23. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Yes, if i open an example i see all the stuff. I played with options, but no got how enable other layer
     
  24. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Hi everyone!

    Sorry about the confusion, the included tutorials have been updated so I'd start by reading those (even if you've already learnt Shader Sandwich). To get more layer channels you just have to go into the Ingredients panel (use the navigation at the bottom left of the screen), and add an ingredient such as Emission or Displacement (it starts off by default with Diffuse and Specular, hence the Albedo and Metalness ones :p). The new Ingredients panel behaves similarly to the Layers one, and you can see a run down of ingredients here.

    Here's a gif just in case I wasn't clear :)

    AddingIngredients2.gif
     
    antoripa and Alverik like this.
  25. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Just read the Tutorial PDFs, I do really like the new workflow, it feels much cleaner and clearer than before. Same for the interface.

    By the way, I love the "bread" name for the new tab, once you understand what it's for, it really fits (since it's for the higher lever stuff, like inputs).

    Also, loved the examples (opened them with shader sandwich and checked the preview window). Though, it might be a good idea to setup a demo scene to show them in action in actual models (and show the best way to use the example shaders, since some may expect specific inputs). Also, the mobile skin shader throws me an error:

    Shader error in 'Shader Sandwich/Shader Preview': undeclared identifier 'perceptualRoughness' at line 234 (on d3d11)

    ...but, it might simply be because I'm using d3d11 mode (since the shader is designed for mobile)... if so, it would be nice if SS can warn you when you load a shader in the wrong mode, though it's not entirely necessary.

    Anyway, it feels easier to use than before, I'm liking all the changes :)
     
    Last edited: Aug 30, 2017
    roykoma and antoripa like this.
  26. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Hi @spike1

    ShaderSandwich looks interesting! I have two questions:

    * Is instancing supported?
    * Can e.g. water be rendered infinite?
     
  27. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Thanks Alverik, I'm super glad to hear the new workflow wasn't a giant mistake :eek::p. I was kinda worried when working on it but that put a big grin on my face! And nice catch with the mobile SSS shader, it was yet another bug to do with the Specular Quality setting - fixed it now though, will be in the next patch :). I'll also see what I can do about a demo scene :)

    @daschatten
    Instancing isn't currently supported sorry, but I don't think it'll be too difficult to add when glancing over the documentation. So consider it an upcoming feature - if that's any help :). I'm not sure I understand the second question, but I can say Shader Sandwich won't have any trouble making a shader to be used on a huge ocean mesh or anything - let me know if you meant something else :)
     
    Alverik likes this.
  28. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Thx @spike1, Instancing would be really helpful :)

    Regarding the water i want to add a water to my (large) scene which shows everywhere. So if the player is at 0,0,0 it shows up, and if player is at 10000,10000,10000 it shows up. As i understood i can do this woth a large plane (> play area size)?
     
  29. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @daschatten
    Ah I understand :) There are a few ways of doing this, depending on your target hardware and visual goal. The simplest way is definitely just a very large plane - however if you want the water to animate in any way (like waves and such), then you'll need a huge number of vertices.

    A common technique here is to have multiple small water planes in a grid next to each other with LOD applied - so the planes further away have less vertices than the ones up close. Unity has built in support for such LOD meshes, and Shader Sandwich has tessellation support which could be used for automatic LOD - if targeting DX11 and up.

    Another way to do it would be to have a smaller mesh (still large enough to look "infinitely" distant), that has a script attached to it that places it where the player is (but so it doesn't move up and down with the player) - then just apply all textures and displacements in world space rather than with the UV map (which Shader Sandwich can do), so they don't move with the mesh itself.

    Hopefully that makes sense and gives a good run down :)
     
    Alverik and daschatten like this.
  30. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Great to see you back in action @spike1 :) These updates are awesome!

    I was wondering if you'd checked out the scriptable render loop functionality Unity has been developing to replace the current render pipeline. More specifically, there are a couple of new render loops (one a modern HD version, another more optimized for mobile) that Unity is working one alongside the render loop API.

    I ask because I feel like surface shaders and the associated assets to make them are in a bit of limbo right now. I'm not sure if current shaders will port over easily (or at all) to the "new world," so to speak. From what I've read in the experimental graphics forum, SRLs are fast approaching a point where they can be used in lieu of the current (legacy?) render pipeline. I think the HD loop is supposed to be in a rough, but usable state in October.

    Would love to read about your thoughts on the topic and how you see Shader Sandwich fitting into the mix.

    Thanks!
     
    Alverik and spike1 like this.
  31. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    A new update out of the blue I see! I have good news for you as well spike1:

    You can safely drop Unity 4 support if you wish.


    I am using Unity 5 and it's new recent features coupled with some lightmap baking asset store tools make it no longer a viable stay. So that should help remove a chunk of headache from you hehe.
     
    Alverik and spike1 like this.
  32. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Sorry for the delay guys, the video tutorials are going to have to come out a bit later due to me being sick - instead I've started working on the text based tutorials - I've got the beginner tutorials mostly transferred to the website, the shell based fur one, and I've been working on a new one that highlights one of the neat aspects of the new ingredients system - multiple speculars. I'll be publishing those tomorrow once I double check some things :)

    I've also been working on another patch - turns out there are some visual differences between the latest version of Unity's standard shader (revision one billion) and mine, so I've made the code adjust between versions to match. I actually wasn't sure whether I should try and make every shader look like the latest regardless of the version of Unity, or change between them like the Standard shader itself did - let me know if you have any thoughts there :)

    I also accidentally disabled the specular light radius (yeah there's area lights in the latest version in case you didn't know :D), so I've gotten that working again too :). That'll probably be out in a couple of days while I check for more bugs.

    @chiapet1021
    Haha thanks :). Oh gosh, honestly I heard about scriptable render loops ages ago but completely forgot to look into them. Seems like a great step for Unity assuming they make it more robust than their command buffers - however yeah it poses a bit of a problem. I don't think there's any way to really support every possible home-grown configuration (other than custom packages which I could offer I suppose). Shader Sandwich does have one advantage over most of the other shader editors though, in that it hides most of the actual shader stuff as much as possible. So for the more official render loops I should be able to support them while having everything work the same to the user (like with Forward and Deferred support for example).

    As for other custom render loops, I'll likely end up continuing abstracting as much of the code base as possible into re-usable connectable bites - as I've done with layer types and ingredients - so that writing custom shader export routines in C# won't be too much of a hassle. If I can get that working well then I might add a nice but limited interface on top of that - but I figure that won't be necessary since if the user's writing their own render loops then I doubt they'll have trouble with a bit of code. The latter stuff I mentioned is pretty far off, but I'll see if I can get the official render loops working before the end of the year. Hopefully that's useful :)

    @SilverStorm
    Haha yeah it must be a bit of a surprise :D. Regarding Unity 4, thanks :), I wish I could drop it, but I think I'll continue supporting it for a little while longer anyway just in case anyone else is still using it (doubt it though :p).
    Also oh my gosh your signature is great :D
     
    Last edited: Sep 1, 2017
    Alverik and chiapet1021 like this.
  33. victorkin11

    victorkin11

    Joined:
    Apr 20, 2013
    Posts:
    175
    Hi!

    I want to know what make shader sandwich different between "shader forge" and "ampilify shader editor" ?
    Except the price & artist friendly, did it support multi pass effect?
     
  34. barcode802

    barcode802

    Joined:
    Apr 6, 2014
    Posts:
    36
    @spike1 are shaders created with Shader Sandwhich 'portable' so that they can be used and exist in a project without the Shader Sandwhich asset being inside the project? I reviewed documentation and this thread but couldn't find any information on this. I understand that competing products have this feature - but yours sounds like it's easier to use.
     
  35. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Yes, it creates regular .shader files. You don't need Shader Sandwich installed in a project to use them. (I actually have a dedicated project just for SS, from where I just copy the resulting shaders).
     
    Last edited: Sep 6, 2017
  36. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Ummm, SS does have a lot of its own shader features you can use with it, hard to name them from memory though. You're probably better off reading the change logs or waiting for @spike1 to answer I guess. But, I'd say one of the things that'd make you use SS over the others IS the workflow. It's a lot more visual, and well, friendly to use. It's sort of fun playing around with it, and last major update really made things even better.
     
  37. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Hey everyone! I've submitted the next version (1718.1) to Unity so hopefully it'll be up in a week or so :) You can download it in advance (with the asset store tools included XD) from here. Here's a full update log:
    Small update, mostly bug fixes and work flow enhancements :)

    Added:
    Shader Demo Scene
    Normalize option to the Height To Normals effect
    Added Axis selection to Simple Rotate
    Added Color/Distance Fade effect
    Added option to view the Mix Amount's value (View/Mix Amount Values)
    Hologram example shader
    New Edge Faded Water example shader
    Two Cartoon example shaders
    Point Particles example shader​

    Changed:
    Speed up and look improvement to Shader Sandwich Specular Model
    Multi sampling effects stack correctly (finally XD)
    Ingredients interface by inferring the correct order when adding the first of an ingredient - Parallax Mapping and Displacement Mapping will start off being placed at the top, and Tangent Normals and Flat Normals will automatically go either at the top, or beneath the prior mentioned ones.
    Improved Ingredients Interface - Ingredients that require others to function sensibly will automatically add them.
    Set Emission's base alpha to 0 (from 1)
    Surface Transparency to "Set Alpha Channel"
    Finalized transparent + effects behaviour
    Re-ordered Screen Layer Types, and renamed Depth to Depth Behind for clarity
    "Depth Behind" and "Behind" Layer Types now set the Queue to Transparent when auto.
    World Reflection vector now updated when using Tangent Normals ingredient
    World Normals and Reflections update with Tangent Normals in deferred mode now (for parity with forward)​

    Fixed:
    Differences between SS Standard Specular and Unity's nomadic one.
    Specular quality modes.
    Specular light size...that one was really stupid of me.
    Specular color in medium quality...once again I have no idea how I managed that one
    Removed archaic X2 from Specular (You'll notice types other than Sandwich and Unity Standard will look slightly dimmer)
    Specular mix amount blending when in premultiplied mode
    Douple pre-multiplication with Set Alpha Channel
    No variables with double underscores should be created now (for OpenGL support, needed...sometimes?)

    Custom direct lighting not saving or loading correctly (If this affects you please contact me, saved files can be fixed really easily!)
    Light Size with SSS
    DX11 SSS shadow variable collision
    Flat Shading w/ OpenGL and flipped Y
    Misc Settings saving correctly
    Fixed Shadow issues when Displacing and Setting in world space
    Can't remember if I added this earlier, but POM now correctly fixes mipmaps which fixes weird outlines and whatnot.
    Displacement Mapping Crevice setting

    Perlin Noise and Fluid Noise collision
    Color/Split mini preview
    Gradient preview
    Poisson blur Alpha
    Displace and Set effects loading

    Mapping Texture space
    UV Maps larger than 1
    Inputs erroring when added Unity 5.4>
    Add blend mode in Premultiplied mode
    Timestep in Preview window
    Initializing ouputNormals when using Tangent to World matrix
    Optimized using TTWM

    Retaining focus on old settings when switching selected ingredient

    Displacement Mapping at glazing angles - and added an option to turn it off
    Finally fixed negative shader vars sometimes throwing errors when exported
    Re-mapped input Blending sliders
    Negative layer previews getting absoluted​
    But yeah, sorry about the kinda iffy previous version, I had to rush a bit to get it out before the sale started and I wasn't able to test it as thoroughly as I'd hoped. This new version is significantly more stable and the workflow should be easier to pick up now :). It also comes with some new example shaders, the Fadeout effect, and some other stuff :)

    I haven't made much headway on the tutorials due to finishing this version, but I figured it was better to get this out sooner rather than having to answer tons of the same emails over and over XD

    @victorkin11
    I don't own Shader Forge so I can't give specifics, but I'll do my best to compare them :) If anyone who's used Shader Forge/Amplify Shader Editor has any corrections feel free to mention them.

    As Alverik said, the main reason to use Shader Sandwich is its awesome (IMO) workflow XD

    Pretty much every other shader editor uses a node based system, that involves connecting nodes such as textures and UV Maps together, and to outputs like Color and Normal, etc to create the shader; Shader Sandwich on the other hand uses a layer based system, that functions similarly to an image editor.

    Their systems are more flexible overall, but at a higher complexity, while Shader Sandwich makes a lot of things very simple to accomplish, while admittedly making less common stuff more cumbersome to create than in the others. Node based editing is a lot like programming the shader by hand, only the code is visualized - Shader Sandwich abstracts nearly all of the programmy stuff away.

    Shader Sandwich also comes with a lot of complicated stuff readily in-built, such as a really easy to use blending system, multiple procedural noise types, wireframe generation, Parallax Occlusion Mapping, and Sub Surface Scattering, which as far as I know the others don't (well, I think Amplify has POM from memory). Shader Sandwich also supports multiple passes - which can be used to create outlines for the model or shell based fur - while Shader Forge (and I think Amplify?) do not.

    My reply is probably a bit biased towards Shader Sandwich, so if you want to get a second opinion I'd definitely recommend contacting Shader Forge and Amplify Shader Editor's developers as well :).

    @barcode802
    As Alverik said, yep :p

    Anyway I'll get back to working on the tutorials again, hopefully they'll be done soon :p

    Also, as a break I started working on additional way to create fur (so that'd be 3 now XD), that'll be included at some point in the future once it runs decently on my computer XD. Here's a screenshot of how it looks (no textures or anything):
    Fur.jpg
    Super early in development but the technique looks significantly more realistic than any of the other ways in SS, of course at a fps price. Just figured I'd put this here in case anyone's interested XD


    Oh and another sale has started! I forgot but Shader Sandwich is in the Back to School Sale so yeah if you missed the last one you have another chance :D
     
    Last edited: Sep 6, 2017
    Alverik likes this.
  38. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Great fur! Hope you get it decent enough for production!
     
  39. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @Alverik
    Haha thanks :) It's always hard to tell whether a shader is efficient enough, since I can't run any games without some pretty bad lag haha :p

    Anyway I just figured I'd throw this out here: I had to re-create the original hologram shader for someone, so I've attached it here in case anyone prefers it to the included new one :)

    Regards,
    Sean Boettger

    Edit: Oh and if it shows an error in your version of Unity, just open it up in SS and re-save; I saved it in the latest version and Unity auto replaced parts of the shader code with new functions the older ones don't have XD.
     

    Attached Files:

    Last edited: Sep 8, 2017
    Alverik likes this.
  40. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Cool, will check it now :)

    Anyway, it just needs to be ok (though it is hard to measure that, lol). I think most right now are probably aware that a fur effect like that will most likely be a bit on the heavy side (so it'll need to be used sparingly anyway). Maybe you should just release it for beta testing, people will be able to give their own opinion that way (will be able to test it in many more PCs that way).
     
    Last edited: Sep 11, 2017
    spike1 likes this.
  41. vertexcolor

    vertexcolor

    Joined:
    Mar 11, 2013
    Posts:
    18
    Hey!

    First of all, I'm loving the new updates to Shader Sandwich and I can't wait for the rest to come!

    Recently I got inspired to start making tutorials, and I made my first one on topic of Shader Sandwich. It is a simple tutorial on how to make a terrain shader. In this example, we will make an unlit shader, but of course you can make all kind of terrain shaders with this technique. The shader can handle up to 4 textures and uses the default unity terrain.

    Link to the tutorial: http://maxartz15.com/shader-sandwich-how-to-make-a-unlit-terrain-shader/


    If you have some time to check it out and give some feedback, that would be great!
    Also would it be nice if some of you could share some insights on your shader sandwich projects :) I would like to know how other people are using the asset and what they create.
     
    Alverik and spike1 like this.
  42. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Alright I've finally updated the text versions of the beginner tutorials - they're a bit better than the included ones so I'll see if I can update those in the next version. And thank you for the great tutorial @maxartz15, it's included on the documentation page too :D

    Also I'm not really sure where to put this, but I just figured I'd mention a cool feature in the new version of Shader Sandwich - when dragging sliders you can hold down shift to enter precision mode, which slows down the movement and allows you to go over and under the default range; I'd love if this was natively integrated into Unity, but for now hopefully it's useful in SS at least :)

    The new tutorial should be out soon, for those curious it's basically a method of making more transparent water look less plasticy by using multiple specular lobes and the new translucency stuff :)

    @Alverik Yeah that's a good idea, once it's in a better state I'll be sure to do that :)
     
    Alverik, antoripa and vertexcolor like this.
  43. JViz

    JViz

    Joined:
    Dec 17, 2013
    Posts:
    3
    Hi! I'm enjoying Shader Sandwich quite a bit!

    I wanted to use Shader Sandwich with MegaSplat, but since you declare ShaderUtil in the public namespace, it breaks all kinds of things. When you want to declare classes, you want to wrap them in namespace like this:

    namespace ElectronicMindStudios {
    public class ShaderUtil {
    ...
    }
    }

    Then when you want to use your code in another script you put this at the top:
    using ElectronicMindStudios;

    If you're declaring more classes in the namespace, you don't have to declare that you're using it.

    This way, if someone else wants to use ShaderUtil they don't get your copy of ShaderUtil. You probably want to do this for all of your classes, just to avoid any possible name collisions.
     
    Last edited: Sep 14, 2017
  44. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Hi, thanks :)

    @JViz
    Yeah you're totally right, I actually had planned to make that change for all the classes but never got around to it (especially since I thought it'd involve some extra work regarding how the plugin system stores its type names and whatnot). Turns out it was really easy though, the fix is finished and'll be in the next update :)

    As for the tutorial, I accidentally expanded the scope a bit, but I figured it was worth it since I've had a lot of people ask me about this type of shader, and the included one is pretty basic. It's now going to be a proper ocean shader tutorial; it'll create a really flexible shader that should work in pretty much any situation, and'll cover some cool stuff such as the new sphere lights, underwater lights (translucency), nicer night time reflections with somewhat impressionistic bluer glows around specular highlights, the new vertex displacement stuff, and mapping everything in world space so scaling up the ocean plane simply increases the size of the ocean rather than scaling up the same portion of it.

    Here's a couple of screenshots of it:
    VeryNiceOcean.jpg
    Night building HDR from http://noemotionhdrs.net/index.html - thanks!
    VeryNiceOcean2.jpg

    Also I remember a while ago a couple of people wanted to make the lava shader actually move, and while I gave them simple solutions (Just the Mapping/Offset effect), I figured why not make a more complex one that distorts as it moves - it's attached if you're interested in one way of doing that :p
     

    Attached Files:

    Last edited: Sep 14, 2017
    antoripa and Alverik like this.
  45. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Hi, I'm trying to follow along with your outdated water tutorial & I'm having an issue with the z input value being set to time/basic/slow. Where do i set this on the new version please?
     
  46. vertexcolor

    vertexcolor

    Joined:
    Mar 11, 2013
    Posts:
    18
     
    derkoi and spike1 like this.
  47. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Thanks, that's helped. :)
     
  48. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Hi! I'm in need of a silhouette highlighting shader (either to use it per objects or as an image effect), but for a VR project in single pass stereo... Any idea how I can do a really nice/performant outline shader with SS? I should just be able to do it with shells right? I've tried a few outline image effects but they all break with single pass stereo... so I was thinking maybe if I make it affect just the object I might be able to swap to a copy of the mesh with an outline shader, I'm jut not sure if it'll be faster or slower that way, lol (and performance is key in VR). So any advice and ideas before I start to work on it would be greatly appreciated :)

    Also, I want it to work with any object, so I'm skipping tricks like making a duplicated version of the object in the 3d modeling software and inverting normals, etc (I just have too many items and hotspots, and too many features to code to bother using that method right now...).
     
  49. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @maxartz15 Thanks for the help :)

    @Alverik
    Yeah shells should work well, they're just another render of the mesh so they're pretty cheap :). Only possible issue I can think of is depth perception, since depending on how you set them up they'll either appear just behind the object (preferable) or in front (with the real object still appearing on top), so if you have any issues there let me know :).

    One way to implement the highlight in game would be to render the outline separately in its own gameobject that just moves to the selected object's transform and uses its mesh. This way you don't need to worry about switching the original object's materials around, creating duplicate shaders etc :). Actually, thinking about it now you probably won't even need shells if you do it that way, just make the highlight shader puff out a bit with the Displace ingredient, then set it to Cull the front faces rather than the back (in the Misc ingredient). Hopefully that makes sense :)
     
    Alverik likes this.
  50. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Cool, thanks! it's turning out pretty well :D (considering it's my first "effect" lol). Anyway, I just wanted to ask. How would I make it so that the outline follows the mesh silhouette properly? (or make it not show inside an object). Currently it looks wrong in some angles (basically, inside):


    Since it's VR I can't control the angle in which people will see objects. Can I do something about it? or should I switch to shells instead? Though, this is how it looks the rest of the time (with an HDR color and bloom. And I like it, heh):


    Also, it's not necessary, but, is there some way to have the displacement get thicker when far and thinner when close to the camera? that would help keep the outline properly discernible at all times (since it get's really thin when you move away). Though, I can probably code that transition in c# I guess (would be cool if the shader did it though, since the shader would most likely do it faster).

    Anyway, thanks in advance for any advice :)