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 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
    1.Just want to point out I keep getting a cleaning up leaked objects warning. That UnityGUISkin has been leaked every once in a while when I use Shader Sandwitch.

    2.For some reason quite a good number of the Shaders in SS don't display shadows despite setting them in the misc areas. The only one so far I checked that does is the Pom shader in enhanced graphics but I can't see any difference in how the shader is setup (I haven't checked inside the code though as that would defeat the purpose of SS).
    I have attached my shader here:

    3. I also wanted to ask, I often don't use the cubemap shader that comes as part of the PBR Unity4 shader. Is that going to impact performance since it is empty and the shader seems to be expecting it?
     

    Attached Files:

    Last edited: Dec 19, 2015
  2. Guideborn

    Guideborn

    Joined:
    Jun 15, 2013
    Posts:
    231
    Will you ever made a video tutorial explaining how to do that super awesome hologram shader? Thanks!
     
  3. Fabioisriva

    Fabioisriva

    Joined:
    Feb 3, 2016
    Posts:
    15
    Hii just some quick noob question,
    1.can I use this to create UI shaders ?
    2. Can I port it to shader model 2.0 ?

    Thx!
     
  4. mensch-mueller

    mensch-mueller

    Joined:
    Nov 25, 2014
    Posts:
    156
    Hi
    Is there any effort going on with Shader Sandwich, or is it one of these assets that become DEPRECATED like more and more assets I have bought last year?

    Michael
     
  5. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Ask the developer directly using this email: ztechnologies.com@gmail.com

    He apparently has finished the product and has stopped answering us here on the forums as it says on his first post that the product is complete.

    That's very confusing because the last update was made November for version 1.2 and while it has been a while since I messed with Shaders I don't think he has implemented my AO shader or better water yet.

    Regardless the product is still very useful and makes most shader types easy.
     
  6. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Is it compatible with deferred rendering or just forward?
     
  7. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    Hi,

    Have you got a How to on creating a water shader?

    This would be super awesome if you do!

    Cheers

    Great asset btw

    Daniel
     
  8. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Hi everyone!
    I am so so so so so so so so so so so sorry for not having been around for the last few months! It was actually my entire internet presence, I managed to gain a life for a bit haha. But nah, in all honesty development just became really difficult, with every new feature hitting a roadblock I tried for weeks to solve but never could. I'm sure most of you aren't interested in my excuses though, if you are you can read about my adventures with Unity on my blog (http://electronic-mind.org/pages/Posts.php?Post=106)

    But anyway before I go ahead and answer 3 month old questions I figured I'd announce the new version :).

    So yeah, Version 1.3 is out!
    Here's the list of changes:
    - Completely rewritten shader generation and many core parts of Shader Sandwich
    - No longer Surface Shaders, so more possibilities in the future!!
    - Improved Interface (looks pretty slick in my opinion haha)
    - Improved realtime previews
    - Less code regeneration (really fast editing!)
    - More optimized code generation (especially for unlit)
    - Unlimited passes
    - Parallax Occlusion Mapped shadows
    - Custom fallbacks and replacements
    - Tessellation Point generation
    - New Mask layer type
    - Unity 5.3+ support
    - Updated documentation
    - Fixed(?) shadow casting? I know a few people had issues with this but I could never recreate it...hopefully it's fixed :)
    - Some stuff to improve mobile shaders speed
    - ZTesting and render queue selection added.
    - Some stuff I've forgotten...
    - A whole lot of bug fixes..
    - A whole ton of junk code I need to remove...
    - A whole lot of new bugs that I haven't found yet...​

    I'm really sorry about the lack of new features, I've mostly been changing how Shader Sandwich works in the code rather than adding new features. However in theory adding new features will be much easier now, so I'm hoping to get a new update with all the features I've promised out soon :)

    Alright now to answer everyone's question (I know I'm way too late for most of these but figured it might be useful for others asking the same questions):
    @NightmarexGR
    Yes you can use the grass shader as fur and it'll move with skinned meshes correctly :). Shadow wise, it should cast and receive shadows fine. It depends somewhat on the method though, for example the shell based grass might not cast shadows due to it being transparent, while the tessellation based one will.

    @Everyone asking about skin shading

    Shader Sandwich can definitely do a passable skin shader currently, although it certainly isn't up to the latest tech standards. I'll be adding volumetrics and proper SSS next version which will definitely help. Another thing to consider is the art assets and the lighting however, as the lighting in that video is kept extremely soft and ambient, which helps simulate the look of SSS considerably. Notice for example around 3:10, where the skin looks a little more fake when the lighting is harsher. But anyway, Shader Sandwich can certainly currently do some decent skin shading, and in the next version it'll be up to the latest standards :).

    @SilverStorm
    1. Yeah sorry about that, I've done some research and the warning itself is harmless, but there doesn't seem to be a way to fix it currently. I'll keep looking around though. I've noticed the frequency that it appears has gone down significantly in the new version though, so maybe some internal changes I've made have at least partially fixed it.
    2. Since I've rewritten shader generation I believe it should be fixed (at it works in all my tests), however I don't have Unity 4 Pro so I can't confirm if it works with lights other than Directional lights in U4, it'd be great if someone could confirm if it's been fixed or not :).
    3. It won't impact performance if you use it or don't, however the PBR shader relies on the cubemap for providing reflections around the object, and it'll be pretty obvious if it's just reflecting white. However if it's part of the art style or looks fine then there's no reason having it blank should cause any problems.

    @Guideborn
    Yep! In fact that'll be coming out in about 24 hours, will be recording it tomorrow morning (so really soon, 'tis 12am here haha).

    @Fabioisriva
    I'll admit I've never tested it out with UI shaders, but I don't see why it couldn't. However it may involve a bit of manual work (using custom replacements and fallbacks for inputs for example) since it doesn't have anything built in to help with this.
    And yes you can use Shader Model 2 with this, you can set it in the Passes area in the Misc settings :).

    @mensch.mueller
    Yeah sorry I could understand why you'd think that. I'm definitely not planning on dropping support for Shader Sandwich any time soon, I've just been super busy and having a lot of trouble adding the features people have wanted, hence why I've stayed kinda quiet. It probably wasn't the best move I could have made, but it was this or continue to promise features I kept failing to deliver. So yeah sorry, hopefully this post clears things up :).
    @Cereal_Killa
    Currently this produces shaders that are rendered in forward rendering mode, however these still work when deferred mode is enabled. Just like default Unity transparent shaders, the objects with Shader Sandwich shaders are just rendered in forward mode. I am hoping to add proper deferred support in the near future however I can't really say when, I'll need to research what is necessary first :).
    @djgriff
    I finally finished it haha, here you go :)

    On the note of tutorials I've updated all the beginner ones to fit with the new interface and default settings and such, still have yet to update the text based documentation though. I'm hoping to get all that done over the next few days, time permitting of course.

    So yeah, I'm really sorry about the lack of updates and I can understand if some of you are annoyed. I'm going to try and remain extremely active for at least the next month while I try and get all these new features finished, so hopefully that works out :). Thanks to anyone who's purchased Shader Sandwich as it's really helped me pursue my interests and possible future career, I hope I can make it up to you.
     
  9. mensch-mueller

    mensch-mueller

    Joined:
    Nov 25, 2014
    Posts:
    156
    Hi John!
    Glad you are back. I had been worried about you :). And about the new version: Thanks a lot!
    And we all know from experience that things take sometimes (mostly) longer than planned :rolleyes:.

    Cheers and have some good days
    Michael

    Edit: Great Water Shader Tutorial -this is really useful!
     
    Last edited: Apr 16, 2016
  10. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Thinking about buying it, but have a question, is this tool generates clean shader code, without keywords usage? Or, if it will introduce new keywords - how many?
     
  11. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Well, no answers for two weeks and that's during sale time? Not a best marketing strategy. You just lost a potential customer.
     
  12. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @montyfi
    Gosh I'm an idiot, sorry :(. To answer your question Shader Sandwich generates relatively clean code (some cases it's really good, other cases it can be a little messy), and only uses in-built shader keywords.

    @Guideborn + numerous others that asked
    Hologram Shader Tutorial!

    I know it took ages, I've just got to stop promising such quick turn-arounds. I'm just used to having unlimited free time (last year I wasn't enrolled at a school), but now that I'm back I'm really trying to focus hard on getting good grades, at the expense of pretty much everything else. So I'll just try to be more realistic.

    I've also updated the documentation, so now you should be able to find out how some of the new features work easier :).

    Anyway due to how much school is taking over I'm just going to say I don't know when the next version will be coming out, I've barely had time to work on it (or spent that time working on personal projects like songs or whatnot to keep sane), so yeah.

    I'll keep trying to get tutorials out though, I find currently they take about a week to get together (I'm sure some tutorial veterans are scoffing here haha), but just in case I'll say I'll try to get one out every second week. Does anyone have any ideas for the next one? Thanks :).
     
    Alverik and montyfi like this.
  13. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    @spike1 Thank you for the honest answer, I will try your tool. Good luck with school, but please keep an eye on your thread :)
     
  14. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
    Hello, I am wondering do the shaders in shader sandwich support the alloy lighting model and settings?

    thank you!
    --Joshua
     
  15. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    I'm so sorry @jammer42777, for some reason I didn't get an email notification from your post and haven't checked manually in the mean time, I'll make sure to check more often.

    But yeah, currently Shader Sandwich doesn't support integration with any other shader packages (including Alloy), and in all honesty I'm not sure what integration with it would involve. I'm still working on adding custom code support however, and it's possible that'll be enough to allow some level of integration. Also if I ever purchase it I'll take a look at what I can do :).


    @EveryoneElse
    I've been slowly making my way through to version 1.4, still a few weeks away but I can share a couple of the new features at least :). A lot of these were requests from users so if you have a feature idea and I don't think it'll be too difficult then it'll probably make it in, feel free to ask :).
    • Alpha to Coverage support (was really easy to be honest haha)
    • The ability to set an input to a mask (so basically almost any setting in Shader Sandwich can now be altered across the shader rather than set to one value, pretty cool :D)
    • Proper shadows for vertex displacement and when using transparency (cutout and some options for fade).
    • Some fixes when using a linear color space.
    • A bunch of other smaller additions like the ability to set the replacement shader, pre-multiply alpha, etc.
    • Some other stuff/effects (and a bunch of bug fixes)
    I hoping to add proper support for deffered rendering as well as fit in at least some of the volumetrics technology I showed off months ago, but yeah no guarantees sorry :(.

    I'm also hoping to sometime next week release an updated and vastly improved fur tutorial, possibly with some scripting to enable dynamics when the object with the fur is moved around. Here's a screenshot of what I've managed to achieve in some more recent attempts, I think it's much better than my previous ones (although still using the awful Shader Sandwich grass texture haha) :)


    But yeah sorry about the lack of updates, hopefully you'll all bare with me while I slowly get everything in order haha.
     
    Alverik and zyzyx like this.
  16. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Copied from the "new" Unity forums (thank you so much Unity team for reverting! :D)

    I hope it isn't a surprise by now that I've missed all my deadlines haha... school has been pretty time consuming but in all honesty it's mostly just 'cause I've been trying to work on other things. Shader Sandwich just doesn't have...any sort of userbase nor momentum and the amount of time I have to spend on it just doesn't seem worth it for the most part. I've a feeling this is mostly my fault due to my infrequent posts and updates but yeah, that sort of stuff does dishearten me a little and makes me feel like pursuing other things, especially considering how powerful it already is. But hey, I'm still working on it and it's likely I won't stop adding features (I really enjoy developing it, such a great learning experience!), just figured I should voice this all. I know I probably shouldn't say this sort of stuff but I'm hoping a level of transparency is appreciated...also I like attention haha XD.

    However, on that note I am working on the next version and it's shaping up to be a pretty huge release! I'm hoping to get it out this month but we'll see how semester two of school goes...Anyway, I know I should probably do this at release rather than now, but here's a run down of some of the new features to wet your appetite while I let y'all starve .

    Vertex Toastie!

    I've been working on an additional part to Shader Sandwich called Vertex Toastie, which lets you bake per-vertex ambient occlusion and surface thickness, along with the ability to bake in real-time per-vertex or bake data for a real-time ambient occlusion solution! It's pretty good in my opinion haha, I've been able to improve the looks of my own projects pretty quickly with it and the real-time ambient occlusion is looking extremely promising - it's not screen-space, can update in real-time, and in theory should support global-illumination as well. For those who have been around for a while it's based on the technique @SilverStorm recommended, surprised at how I used to think it was complex haha. It's all still very WIP but is coming along fairly nicely, here's some screenshots

    (AO applied on my house asset - not the best test due to the sparseness of the vertices at most areas but I'm hoping it gets the idea across ).


    No Ambient Occlusion


    Ambient Occlusion

    Interface (slightly out of date, will look different in the final version but you get the idea.)
    VertexToastieExample2.gif
    (That monkey is like, 60,000 polygons or something...)

    Of course the per-vertex AO is only as accurate as the density of the mesh it's being applied on, but theoretically it doesn't cost any time to use, shouldn't have an impact on FPS (can easily be used on mobile), and is just a very simple way to increase the quality of graphics. Of course for those who want higher quality but don't want to suffer through half an hour of normal Unity baking, there'll be a real-time solution that operates per-pixel. It's based on a GPU gems article that I'm almost done implementing, so yeah that's cool too .

    Translucency/SSS!
    So that per-vertex thickness map I mentioned earlier? Well it can be used to create fairly realistic translucency that lets you create more realistic wax, skin etc. Shader Sandwich has always had a "translucent" diffuse mode, but it was rubbish. This one creates really great looking results with only minimal tuning (it's not physically based so there's a bit of skill involved in setting this well, will make a tutorial on it hopefully soon after release). Once again some screenies


    Translucency Strength, 0.75 is a bit high XD

    Programmer art XD

    Deffered Support!
    Yep, Shader Sandwich now supports rendering in deferred mode! Previously it would still work in deferred rendering mode but would just render in standard forward rendering - no more . This means it'll properly receive lighting, interact in depth maps, etc correctly .

    Other Misc Features!
    Of course I've added a bunch of other ones . In conjunction with the misc ones I mentioned two posts ago, I've added:
    PBR Metal model - you can choose between the metal and specular model now
    Passes - you can choose what passes to generate in a more fine-tuned way.
    Parallax Occlusion Mapping Depth Correction - now objects can correctly intersect with parallax occlusion mapped objects, along with depth based image effects working right . I'm still working on the proper curve support I mentioned ages ago, that'll probably come the version after this one (It needed the ability to bake vertex data, which is what Vertex Toastie does! This'll just extend it ).

    The most visually striking image here

    New Effects - Gaussian Blur, Color Split, RGB to HSV (and vice versa) Stretch, and more! Plus some geometric functions like getting the distance to a line or circle rather than just a point!

    So yeah that's probably what the next release will contain, hopefully it comes soonish . For those who want a copy in advance feel free to email me (ztechnologies.com@gmail.com) with your purchase code or whatever they're called and I can send you one . Alright then see y'all later!

    Also I love the new forum's smilies, probably the only really good thing about it haha, I'm just going to copy them in here now XD
     
    zyzyx and Alverik like this.
  17. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Wholy moly, per vertex AO , per pixel AO and a skin shader....yikes man your on fire!
    Can't wait for the update, I still hope it works in 4.6, I have been going crazy with 4.6!

    You know to make a bit extra money you can always sell your shaders in the asset store? If you make a good water shader with your own plugin then feel free to sell it on the asset store for some extra income.

    I can definitely understand your frustration with the products user base and such, you seem quite proficient in programming as well, I wouldn't mind working with you on a commercial game at some point.
     
    Alverik likes this.
  18. RaiuLyn

    RaiuLyn

    Joined:
    Sep 14, 2014
    Posts:
    39
    Don't be dishearten by the lack of user base. If anything, starting out is always the hardest part and you're setting some time from school to provide updates is amazing. Appreciate the updates, btw.

    Thanks for the update on skin shading! While I'm still learning the ins and outs of Shader Sandwich, I can understand better than I did with ShaderForge.

    My results:
    https://drive.google.com/file/d/0B2EOCdhyXGhwbndiejQ2RTJDYTg/
    ^ I don't know how but that happened while I was following the Lava tutorial. Still had fun though

    https://drive.google.com/file/d/0B2EOCdhyXGhwNmpVTDBfS1hWcnc/view?usp=sharing
    ^ Once I got some basic understanding of the stuff, I tried to create a sky shader with moving Hexagons. But I don't know how to make it any brighter than it is since emission works when camera is close to the shader.
     
  19. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Wow, I just noticed this asset and I must say it looks amazing! I'll be getting it as soon as my budget allows (sort of tight right now).

    Anyways, as RaiuLyn said, don't be disheartened. The quality of the asset looks impressive. You just need to do more marketing. Try to advertise yourself on other forum threads (check for questions, which you know your asset can solve). Also try talking to other asset developers with assets that may play nice with yours, so you can then implement integrations (even if the job needed is minimal).

    The advantage of doing integrations is that usually the other asset developer will post about it in their forums page and in their asset store's page , inadvertently advertising you too. The more popular the assets you integrate to, the better for your asset's standing and general visibility. Also many times, if the other developers likes your asset, they may end up doing the integration themselves, so you'll end up doing little work.

    For starters, contact assets which have to do with illumination or reflection (like SEGI), they may need to integrate your shaders so they work right with their assets. Also try contacting assets used for prototyping (like probuilder or SabreCSG). If your API or shaders can do special stuff at runtime you should definitely contact playmaker, so they can translate those to playmaker actions (would be a plus for non coders too). And if your asset play's nice with terrains you should check asset's which do procedural terrain generation, like gaia or terrain composer 2. Etc.

    Anyways, every time an user mentions your asset doesn't work with another one, you should probably take a look, cause doing the integration might end up been a benefit for you.
     
    zyzyx likes this.
  20. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    Looks really cool and I'm very interested in buying it. How does it compare to similar solutions like ShaderForge and Shader Engine Pro? What are the limitations?
     
  21. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    It's a lot easier to use than standard node based systems. The video tutorials that are offered really go in depth and it's pretty fun to tinker with it too. But also once the shader file is created it can be used in any project without importing the plugin to other projects which is quite handy cause I hate having a lot of plugins in my projects....

    The quality of the shaders themselves have only been improving since the first release. The author has implemented quite a few of the requests that have been offered so if you want what is perhaps the easiest plugin for shaders then I would recommend this, it has quite a few good examples too that I haven't seen elsewhere like animated grass which I used for hair lol. You can try checking out the latest water tutorial here (I requested this shader as well as the skin shader seen above, also....legend has it he is making a realtime per-pixel AO shader....:)
     
    Alverik likes this.
  22. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    226
    @SilverStorm Thanks for you detailed reply! That sold me, now I have to sell it to my employer :)
     
    Alverik and SilverStorm like this.
  23. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Just wanted to say I've been following this asset for a while now, and the update to create deferred shaders will definitely tip the scales for me to purchase.

    I'm assuming some options/effects will be restricted to forward rendering only, or at least create shaders that continue to be rendered in forward, even if the scene uses deferred lighting. Would it be possible to let us know where that divide is?

    Thanks!
     
    Alverik likes this.
  24. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Oh my gosh so many replies haha

    First off thanks so much for the kind words everyone, honestly comments like yours really make my day!

    @SilverStorm
    Thanks, and yeah sorry for taking so long to get around to the AO . I had considered selling some of the shaders separately, but I just was never sure what to price them at ( a lot of shader packs I see are Shader Sandwich's price XD), and in all honesty I don't like charging money for things haha. I'm planning on selling Vertex Toastie as a separate asset however, while also including it in Shader Sandwich (since the two go hand-in-hand), but that's mostly because some people might just want the AO stuff without having to also pay for Shader Sandwich XD. Also thanks for replying to zyzyx haha, it's cool to see users replying to others .

    @RaiuLyn
    Thanks, and that's cool to hear . Interesting shaders as well, my guess with the lava shader would be one of the textures got set to the rim-light mapping mode, but it creates a pretty interesting effect here .

    @Alverik
    I've never really considered doing integrations before but that's a really good idea . Particularly with things like Terrain Composer and Playmaker , it'd be pretty cool to have a level of integration, now to get the courage to contact them haha. And yeah I should market it more, I just have all sorts of weird prejudices against trying to post it around for some reason. If I want to grow the userbase a bit more though it'd probably be a good idea, thanks so much for your advice .

    @zyzyx
    Haha glad @SilverStorm sold you on it, I'd have replied with pretty much what they said! Yeah Shader Sandwich is a lot easier to use than most of the other systems I've seen, but at the cost of a bit of flexibility. I actually recently discovered it has a bunch of features some of the others don't however (like arbitrary multi-passes) so that's cool too XD.

    @chiapet1021
    Yeah any shader that isn't supported by deferred will just be rendered in forward, and Shader Sandwich will let you know which ones the shader can use . Anything involving proper transparency (cut-out is fine) or custom lighting (including Parallax Occlusion Mapped shadows, they'll only work for one directional light), won't work, but the other features should all be alright .

    Thank you everyone y'all amazing!
     
    Alverik, chiapet1021 and SilverStorm like this.
  25. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Is the Pixel AO real-time one ready to beta test?
    If so I would be glad to test it! While I do use 4.6 I can use whatever Unity version to test it.
     
    Alverik likes this.
  26. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    Oh yeah, sorry about not answering your first question haha XD. I haven't tested in out in Unity 4 yet but I see no reason why it wouldn't work (not using anything Unity 5 specific), so that shouldn't be a problem

    As for beta testing, thanks, but yeah it's not quite ready yet haha, there's no proper interface for using it and it's buggy as heck . I should have it in a usable state sometime next week however, I'll send you a copy then . I'd at least post a picture of how it looks but I've also...completely broken it... trying to add in some optimizations, so I'll need to fix that first as well haha.

    I can say that it was looking really good, and for <3000 polygons it was working perfectly (updating in real time and everything). Anything more than that and the frame-rate dipped considerably - the new optimizations should make polycount far less important however so that'll be good . I've also added in some rudimentary GI, so yeah that'll be working properly too . So yep, next week .
     
    Alverik likes this.
  27. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Rudimentary GI as well! Yikes! I can't wait!
     
    Alverik likes this.
  28. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Yeah, that sounds amazing! :D

    Specially when you work with mobile and can't depend much on image effects both the AO and GI would be a really big plus!
     
  29. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Be interesting to know what "rudimentary GI" means, hint hint @spike1
     
    Alverik likes this.
  30. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @chiapet1021
    Haha, at that point the GI was pretty much just an emission (it didn't take into account the lighting of the surface being reflected), so yeah XD. That's all added now though (you can see in one of the GIFs below how it only reflect where the light hits), so it should be proper GI .

    @Alverik
    Thanks . As for mobile, I have to say I'm not sure how performant this technique is, at least when it's at a good quality. However I have several new optimization ideas that might make it possible to be used on mobile (no guarantees), as long as mobile can support Floating Point or ARGBInt RenderTextures, not sure which I'll go with yet (can anyone confirm these?) and branching (potentially optional). Especially if used per-vertex it could be doable, will need to do a lot of tests though .

    Anyway, progress has been kind of slow, come up against a bunch of weird problems due to Unity internal stuff (never had this problem before grumble grumble...), but a bit has been made . I've got some terrible GIFs and images to show off for now at least, although nothing really good to actually show the technique off on (that works at least...) so excuse the geometry XD. The terrible framerate is due to the GIFs capturing at 10fps for file size reasons (although I wouldn't say the AO/GI is running at 60fps just yet, averaging 20-30fps on my mid to low end graphics card currently. It's very much fill-rate dependent rather than poly-count dependent however due to the prior optimizations, when per-vertex it's 60fps quite happily )

    AOClearer2.jpg

    There's definitely something going wrong with the cubes in the next few shots, this is all very early stuff!
    AOClearer1.jpg
    GIClearer.jpg
    RTAO1.gif
    RTGI2.gif

    So yeah, hopefully that's somewhat interesting to see at least haha, I'll try and have some better images once it's a bit quicker, and easier to work with and apply to entire scenes. For those who were wondering about a beta version, sadly that more than likely won't be ready this week, sorry! I'll definitely try and get one sent out next week however, pretty sure I have ways around all the problems that have come up, just have to implement them .

    So yeah, that's all I have currently, see you all next week!
     
    Alverik and chiapet1021 like this.
  31. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    @spike1 Those GIFs are gorgeous, even if you aren't happy with the FPS :) Can you provide a bit more detail on how the GI works? Not from a "this is my secret sauce" perspective :p More like what types of shaders from SS can have it (forward vs deferred, opaque vs cutout vs fade), what lights will affect it (directional/point/spot + emissive materials), etc. Looking super awesome!
     
    Alverik likes this.
  32. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @chiapet1021
    Haha thanks, I really can't wait to get this working in a proper scene .

    And yeah sure . The actual idea behind it is pretty simple (based on the GPU gems article @SilverStorm posted a link to a little bit back), on the CPU side I create several textures that consist of information about all the faces in a scene (position, size, normal and color), and then on the GPU side I loop through the textures like an array and then calculate the coverage that face has on that pixel/vertex; loop through all and add them up to get the ambient occlusion and bounce lighting. That's the basic method at least, on top of that I'll be trying to compress the several (currently 5) textures into a single floating point Render Texture, and there's also some hierarchical culling that lets the shader skip entire objects, faces or combine them to speed things up a bit .

    I'm pretty sure any type of Shader Sandwich shader should support it, both in deferred and forward, and any transparency type .

    One thing that might be a problem is lights, especially in forward rendering mode where the AO/GI will have to be calculated multiple times for each light, and FPS is already low enough haha. Another thing is in forward mode Unity seems to only render the part of the mesh that is being lit by a light (which confuses me since I thought that would only happen in Deferred mode, please let me know if I'm wrong haha), so it wouldn't render part of an object that light might bounce onto in regards to the GI.

    I'm thinking currently I'll just have to calculate several lights in the base of the shader (in both forward and deferred) for the bounce lighting, and then let Unity take care of the direct lighting...or something like that XD.

    Hopefully that made sense, it's 3:54am here so my typing might not be as legible as I generally hope haha

    One last thing, here's one of the images but with the AO/GI turned off, really shows how much of a difference it makes
    GIClearerOff.jpg
     
    Alverik likes this.
  33. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Oh gosh, get some sleep @spike1! We need you fresh to keep working on the update. :D

    Thanks for the explanation. Yeah, I figure for forward rendering and forward-rendered shaders (e.g., transparency/fade), having too many lights in the scene will be cost prohibitive. It can already be that way for less fancy shaders, so one that calculates GI on the mesh for you? Yeah... :)

    It would also be super helpful to get more guidance on how scene complexity affects performance. E.g., how well does performance scale against increasing geometry/polycount vs number of models/meshes, that sort of thing.

    Thanks!
     
  34. spike1

    spike1

    Joined:
    Feb 20, 2013
    Posts:
    58
    @chiapet1021
    Haha! Must...resist...answering..questions

    But yeah sure . On the shader side what matters is how many polygons are close to the vertex/pixel (depending if being calculated per-vertex or per-pixel). The data texture stores several copies of the face data at increasing levels of detail, for example level 0 might just be a "face" per object, that's pointed in the general direction and has the same size as the entire object; then level 1 might be parts of an object, or faces that are similar and can be joined; etc down to the lowest level which contains accurate face data.

    So if the shader can detect that the face is far enough away it'll just use the lowest level, else, it traverses down to the next level and checks that. So as long as it can use the approximations of large portions of the scene it runs alright (hopefully better than alright in the future haha), but in places full of really close detail it can choke a bit. There is a maximum iteration counter however so the frame-rate can be kept up easily, it just won't sample all the faces it needs to (which would just end up with an object being a bit brighter than it should be, not exactly a game breaker ).

    The CPU side only recalculates what moves and changes, so on that end it's just how dynamic the scene is and how many polygons are in the object that moves (it can recalculate 30,000 polygons no trouble on my computer so that probably won't be the slow end of things) .

    Hope that makes sense, I'm gonna go to sleep now haha XD.
     
    Alverik and chiapet1021 like this.
  35. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Haha okay, thanks so much. I'll wait at least 8-9 hours before I post my next question :p
     
    Alverik likes this.
  36. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Wow those images look great! One optimization that could be made is lowering the overall resolution of the images you are storing so it makes it a tonne easier on performance. This can work thanks to the way Ambient Occlusion isn't as noticeable when an RGB texture is applied so we might get away with it.

    This is awesome, you also said it only calculates moving objects which is great for me where there are scenes with a stationary camera and their is plenty of scenery but it's mostly static, allowing the characters who move to be Pixar looking with this AO haha can't wait to test it out and optimize it to Timbuktu lol.

    It works in 4.6 right, I also personally do not care for the GI version so maybe for performance it would be good to separate the GI and AO or something especially if that causes incompatibility?

    Also this is accurate per pixel AO right, so it's not a fake approximation like the screen space ones right, this is the real deal?
     
    Alverik likes this.
  37. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Hi, everyone! Recently I've really become a fan of using vertex colors and toon outlines so I was wondering what would be the workflow to make shaders with those features? Also, I must admit I've been deep into coding the gameplay of my project for a long while so I haven't had the time to watch all of Shader Sandwich's tutorials yet, so any advice from anyone more experienced would be greatly appreciated!

    Also, I'll probably need to make several types of shaders for different occasions, like just for vertex color, or for vertex color and a texture/and a normal map (to use with third party models, I used to have a third party vertex shader in which I could use the base vertex color to lighten the color of the texture, but with unity 5.4 it's gone kaput). I'd also love to know how to make Unlit shaders with shadow support (and unlit+vertex, hehe).

    Anyway, any advice would be greatly appreciated :)
     
  38. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    As for the floating point and ARGB I am not sure, I guess whatever provides the best compatibility and performance?

    How is the update progress going? I notice that the last release of SS was about 5 months ago. Any news?
     
  39. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Alverik likes this.
  40. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Thanks, that looks cool (I'm taking a copy of the free one :)).But I wasn't talking about texture blending (as cool as that is, lol). I just want to know how to make shaders that take the vertex colors for cartoon/anime style character models, but I want them to accept shadows, toon outlines, or in some cases multiply a base vertex color against a texture to lighten it up to my taste (also for cartoon/anime style composition).

    I'll first take a look at all the tutorials and tinker with the plugin. I really want to learn how to harness the whole power of Shader Sandwich. The magic of knowing how to create you own shaders after all, is the power it gives you to make all manners of special effects (which can also be used as image effects, not just shaders for models). That's something which I've seen in shader coders, which I'd like to be able to do at least a bit (Through Shader Sandwich :D).

    (Well, I'm still deep in C# right now, so I'll take it slow, heh)
     
  41. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    wouldn't it just be easier to get a toon shader?
    Try the matcap shaders in the assetstore or try using rim light and outline checkboxes in SS.
     
  42. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Never seen a toon shader which uses vertex colors instead of textures, and I want to hand paint my meshes with vertex colors (it looks nice, it's super light and doesn't need UV Unwrapping). I already have a few vertex color shaders which work but none of them combine all the stuff I'd like to have. And the alternatives aren't working for my project very well.

    I've tried image effects (edge detection) and other shaders but as I said there aren't vertex color toon shaders (not to mention I don't want the shading, just the outlines). I was thinking of the double mesh trick for outlines but my meshes are already a bit higher poly than they should to allow smooth painting, so I don't want a lot of duplicates (even if they are decimated, it would mean too many objects. It would be fine if it was for PC though).

    Bu really, toon shaders just don't look the same (I've tried many already), you just don't get the crisp colorful effect you get from vertex paint (or the speed). I'd rather find out how to make the shaders because, well, I could find out how to modify a toon shader to allow vertex colors, but I don't know anything about how to optimize shader code. And ,what I do know, is that unused texture slots (textures, normal map, ao maps, etc) are still a performance hit even if you leave them empty. It's just a waste of processing. That's why the standard shader is a no, no for mobile. Too heavy and too many maps, many of them which aren't even going to be used at all...
     
  43. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Hmm no that information is not correct the empty slots for the standard shader and the vertex tools don't get used/are stripped if you don't use them. This nice optimization was mentioned long ago when it was introduced and when it was introduced it was maybe 3 years ago so back then smart phones were still in their infancy. You also shouldn't worry about the standard shader as long as you only use 1 realtime light in the scene. Anymore and their is a problem. Every additional slot you use in the standard shader adds 1 draw call. Performance in todays development world is really not a problem since occlusion culling which is now a Unity Free feature creates worlds my friend.

    You should post an image of the quality you want because I need a reference to see what you really want because some of your info is strange and I need a reference to give you further military aid.
     
  44. VirtualVassal

    VirtualVassal

    Joined:
    Oct 5, 2015
    Posts:
    13
    Hello, I have a question for anyone whom is familiar with the fur/grass portion of this shader. Basically I'm looking to apply fur to some of my characters and was either going to get Shader Sandwich or another fur shader (most likely Imperial Fur).

    How versatile is the fur portion of this asset? My player character is a biped covered in fur (it is NOT a furry game, just fyi!). Would I be better served getting a specific fur shader, or will shader sandwich fill my needs? It doesn't need to be realistic fur, just cartoony and able to be applied to a moving mesh.

    Thanks in advance!
     
  45. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Don't sweat it man, it's not a priority at all right now. Also, I do accept some of my learning sources are rather old now, hadn't heard the standard shader had been optimized, but anyway. just to make my point about vertex coloring, here is a comparison between a model textured + celshading shadows and a vertex painted model + cellshading shadows (but otherwise with no textures at all):

    The usual texture+celshading (this a pretty nice quality example though):


    Now, vertex color paint+celshading + selective outlines (in blender's basic, crappy Blender Render engine - Unity's is light years away, as Blender Render is a preview engine):


    You just don't get the same hand drawn and crisp effect with typical textures (or, more like, it's really hard to get right with texturing). Note that even the eyes are painted in vertex colors. No textures, no UV unwrapping and more performant because of the lack of said textures. Problem I have is that I don't have a toon shader that works with vertex color paint. In the meantime I'm just using a regular vertex colors shader (which has the option to receive and cast shadows) but it has no outline or celshading support. Still, it's not much of a problem seeing how they receive regular shading from lights, it just doesn't look as superb as the full vertex color + outline + cell shaded combo (which isn't that hard to achieve with shader nodes in blender).
     
  46. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Raknill, I'm somewhat new to Shader Sandwich myself, so I must admit that I haven't used the fur shader examples yet. What I can say, is that with shader Sandwich you can make much more. It's a tool you can use to make custom shaders. It's in the league of other assets like Shader Forge but it's easier to grasp. Shader Forge, for example, is meant to make a shader coder's life easier using nodes instead of code, so if your not a shader coder yourself it won't be as useful, on the other hand Shader Sandwich is a much more visually oriented tool so it's easier to play around with it. But it still has a learning curve. I myself still need to do a lot of learning but I'm currently in the programming(c#) phase of my project. Anyway, I imagine it can be done, but maybe someone here can enlighten us better about it.

    Edit: Also, remember that shaders are also used to create special effects, and also image effects for the camera (yes, practically all image effects are shaders... Like AO or Bloom). You can see examples of how that's done if you check this guy's new channel: Making Stuff Look Good in Unity (you can also pick up the examples for free, and they're terrific effects). Just try to ignore the shader coding if it hurts your head (like me, lol). Still, to use a shader as an image effect it'll need a c# script companion, and he shows one or two examples of how to do that, so it's great stuff to learn.
     
    Last edited: Sep 16, 2016
  47. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Raknill if you only need something for fur then I would have thought fur factory would be a better way to go as it has tools to brush and paint fur as well as controls to make the fur look dynamic built in. If you don't need or want the paint and brush tools and you only need short fur then shader sandwich could easily do that for you as well as all the other types of shaders. Look at the example in the trailer for shader sandwitch does the fur or grass shader give you the look you want ? If so then you could just apply the examples you get with shader sandwich without even needing to know how to use it.

    Personally I own shader sandwich rather than fur factory because you can do more with it and I wantted something that could help me make customised shaders for a bunch of tasks not just fur. If you absolutely only need fur though I would have thought fur factory would be better. It also depends on which platform you are targeting, if you put a bit of work in with the tool you could probably make a higher quality fur shader with high levels of tessellation with shader sandwich but then it would need a higher performance graphics card to run smoothly, also it would look too realistic to be cartoony so at that point the post processing effects to make it look cartoon would be more important than the fur shader.
     
    Alverik likes this.
  48. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    I have seen that before in Fire Emblem and other anime games....I have also seen it d one before but can't recall how....I know that ShaderS can do it though....might need to think outside the box.
     
  49. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Ummm... I've been doing more research about the standard shader, and whatever some in unity may say, it still performs slower in many cases because it's a much more complex shader, and that's specially true on mobile. According to other users, even now, the phrase "it'll be the preferred shader 80%-90% of the time" thing rings more true for desktop than mobile, as Mobile shaders perform better (as expected), and Legacy shaders even better. The standard shader eats away about 20-30% more performance than the others.

     
    Last edited: Sep 17, 2016
  50. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    ShaderS? I haven't heard of that one... Do you have a link?

    Though, anyway, as I said, I'll just try to figure this out later if it's necessary, right now it's not really important, so you don't need to worry too much about it, really. I'm still just coding the gameplay after all, so it'll take a while before it becomes a priority in my checklist (one or two months from now maybe). Also, I do really want to take my time later to learn Shader Sandwich inside out so I can make the most of it.