Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

Discussion in 'Assets and Asset Store' started by xenius, Mar 2, 2015.

  1. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Sounds good ;)
     
  2. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    Hi all

    Here is our little Pre-Alpha Teaser for our game VAPORUM.
    We use Alloy shaders and its nifty features, this way I want to thanks Rust Ltd, you make great shaders.
    Unity version is 5.3.1f1.

     
    chelnok, xenius, Furax and 3 others like this.
  3. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160

    Thank you a lot for the hard work !
    I have been very busy the last 2 weeks, but i am gonna gite that package a try as soon as i can, i am sure my forest is gonna look 10 times better already.

    For HolyFireGames : The issue with the specular highlight is the same as in this thread :
    http://forum.unity3d.com/threads/speedtree-shader-broken.399099/

    In Forward :
    Grab 20160422105300 w1900h1200 x30y62z-77r140.jpg

    In Deffered / Linear :
    Grab 20160422114636 w1900h1200 x66y69z-89r146.jpg

    Defferred + linear lightning = Completly wrong speedtree shader leaves crappy effect...

    Hopefully that last alloy package fixes that.
     
  4. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Hi Rust,

    I have stupid question: Con I convert also a direction light into an Alloy Area Light or there are performance issue?
    Area Light usually is just for point and spot :)

    Thanks
     
  5. Deleted User

    Deleted User

    Guest

    @Unreal Vision
    Yes, we added Directional Disc area lights a couple versions ago. Also, the area light component is mandatory for Directional, Point, and Spot lights in our system.
     
  6. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Thanks @n00body

    I have another stupid question:
    We use only Substance Designer to "publish" our texture (in sbsar and sometimes in tga).

    We know that you implement SpecularAA pre-filter from ReadyAtDawn into Map Packer.
    Into Substance I found SpecularAA as shader to calculate on-the-fly instead of prefiltering.

    If you confirm this appoach, how can I prefilter roughness map into Designer?
    This is possibile? I asked to Wes that in substance we cannot use mip-map ...

    Hope to have clarification from you :)

    Thanks,
     
  7. Deleted User

    Deleted User

    Guest

    @Feydwin @HolyFireGames
    I figured it out! It will require a rewrite of our SpeedTree shader, but I believe I can fix the light-bleeding issue once and for all.
     
    Teila likes this.
  8. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    That would be amazing. :) Great job!
     
  9. Deleted User

    Deleted User

    Guest

    @Feydwin @HolyFireGames
    Well that took WAY longer than I'd like. I had to completely rewrite our old hybrid SpeedTree shader to be built entirely on Alloy's framework. However, it appears to have fixed the problem once and for all:

    No correction
    No Correction.jpg

    Facing Correction
    Facing Correction.jpg

    As an added bonus, the rewrite allowed me to easily add instancing support to the new SpeedTree shader. :)
     
  10. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Awesome !!!
    Can;t wait to try it out !

    When do you think we can get our hands on that shader ? ))
     
  11. Deleted User

    Deleted User

    Guest

    @Feydwin
    Unfortunately, this one relies on a bunch of framework changes we made for our current code, so it's only available in the Alloy 3.4 beta for Unity 5.4. If you're willing to deal with Unity 5.4 bugs, then it will be available the next time we push a beta to the asset store.
     
  12. Deleted User

    Deleted User

    Guest

    @Unreal Vision
    Unfortunately no, you can't have pre-calculated specular AA with "*.sbar" files, since they are generating their textures at runtime.
     
  13. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Ok with SBAS is impossible, but wuold be possible pre-filter packed map in substance designer and export tga?
    We use a standard workflow to output map from designer, and add your packer map is an additional step.

    Thanks :)
     
  14. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
  15. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
  16. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Skolstvo: Also, some fudgery is always involved, as in RL an eye is a multi-layer translucent surface with fairly complex optical properties. Even with a great eye shader one frequently just tweaks the input data til a desired result is found, esp. based on one's lighting setup.
     
  17. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    I was talking about the rest of the eye surface.

    Wouldn't it have been simpler to model the eye a little bit more correctly. Taking basic lens/eyeball proportions into account. The the lens part is unrealistically tiny in proportion to the rest of the eye. Must have been a pain to fit the eye model into the eye slits.
     
  18. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Any help? :p
     
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey @Skolstvo, here is a sample of the Alloy Eye Shader in use on a character for my game... now that I have time, I will be able to go over how to create and set up the eye in a video tutorial. This looks a lot better in game...





    Here is the eye with the new set up with cataracts. All of these are in game.. now I used to model the eye in two pieces, and while that is more realistic, I found a method for getting the curvature of the eyeball into the normal and AO map... and I will be more than happy to share my set up on video...

     
    punk and Deleted User like this.
  20. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
  21. Deleted User

    Deleted User

    Guest

    @Unreal Vision
    Do you mean you have SP pack the values into a map matching Alloy's packed map format, or are you exporting individual maps from SP and then packing them in Alloy?
     
  22. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Looking really good ;)
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Wasn't easy coming up with this. To take full advantage of Alloy, you need to use IBL...
     
    punk likes this.
  24. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    In order to get the precalculated Specular AA in the packed map, do I leave the Variance Bias slider at 0 in the Material Map Channel Packer like in the crash course video? The description seems to indicate that moving towards zero reduces the effect.

    Also a followup question ton one I asked last year about modding:

    I'm able to load a self-created packed map as an AssetBundle at runtime without problems. However, I'm trying to use the Channel Packer for the precalculated Specular AA, but in the crash course video, it says the actual created map is in the library folder, and that the packed map file in the project folder is less than 1KB in size. How do I then create an AssetBundle out of the packed map file? Having the actual packed map output to the project folder would simplify things.
    Thanks in advance.
     
  25. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Korindian: This is speculation on my part, as I haven't used Assetbundles, but my understanding is that building asset bundles is akin to building an actual build, so the data should transfer into the bundle correctly.
     
  26. Deleted User

    Deleted User

    Guest

    @Korindian
    The "Variance Bias" slider was originally put in when our old Specular AA implementation wasn't producing good results for extremely smooth materials. We added that slider to increase the overall roughness of the material to compensate. Nowadays, it's largely pointless, and is only still there for legacy reasons.

    As for the weird way packed maps work, trust me when I say we don't like it either. However, Unity makes it really complicated to override mip levels for texture maps, so we have to do some slightly hacky stuff to hijack it. It would be nice if they had an official way to do the same task. :/
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Good morning Alloy Team... just a quick heads up for those who will end up using Hair and Transmission Materials in their scenes...

    For some reason, there is a sorting issue whenever your hair and a transmissive surface cross the view... it results in a NASTY artefact that I unfortunately caught. Also if you set your hair's alpha blending to 1, you can see your level geometry faintly under it. You can see the artefact clearly when the hair crosses the transmissive surface (the white parts are untextured, using them as shoji screens, using Transmissive Legacy). The rest of the scene is core shaders.
    Screenshot 2016-05-05 09.33.31.png
     
  28. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    @n00body - Hi there, do you have any idea when the next beta will be uploaded with the SpeedTree fixes? I'm interested in picking the package up once we're able to use those to fix our huge issues with SpeedTrees. Thanks!
     
  29. Deleted User

    Deleted User

    Guest

    @HolyFireGames
    We'll push them as soon as I finish making a last minute addition. I just realized that after the work I did to fix that issue, I am now able to make our SpeedTree shaders use our transmission lighting model.
     
  30. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    Awesome, can't wait :) Thanks.
     
  31. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    @xenius @n00body Thanks for the quick replies.

    I did a couple of tests, and it seems that both in the editor and build, the _AlloyPM packed map in an AssetBundle does include all the texture data, which is great, thanks.

    As a follow up to console errors with the Map Channel Packer when trying to upgrade Alloy (after deleting the Alloy folder), trying to open the Map Channel Packer window causes the window to spout more errors and the inability to close or move the window. However, if I import the Alloy package and shaders into an empty project, and then copy the folder into my actual project, all problems go away. I believe this has something to do with accessing Alloy area light components in script, which means that when I delete the Alloy folder before upgrading, I'm left with script console errors related to that. Trying to import the Alloy package with those unresolved console errors is what causes the problems with the Map Channel Packer on import.

    Left a 5-star review for you guys... thanks for the constant great support, especially as new versions of Unity get released.
     
  32. Deleted User

    Deleted User

    Guest

    @Korindian
    The problem you were encountering centers around a file that maps all the packed map config files. The problem is that our tool expects it to be there, but it might not be due to import order. In general, the easiest way to fix it is to delete that specific file, and then reimport that file.
     
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Morning guys... so the hair issue I was having has been confirmed and maybe we can lock it as a bug. Here are my two characters who have hair and it is using the same hair shaders... except one is fine and the other is messed up big time... in the side by side shot, you can see the masked character with her hair messing up when it crosses the transmission shaders. Those same bright objects are transmissive materials.

    Screenshot 2016-05-08 07.25.11.png This has to be a bug :(
     
  34. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
    This is one of my first attempts with the alloy shader (used the car paint shader)

    I haven't quite fixed the flicker and used some post processing (color grading, tone mapping, Anti-Aliasing and some bloom)
    Also Alloy seems to support substance right out of the box
     
    KRGraphics, punk and Deleted User like this.
  35. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi Everyone!

    Alloy 3.4.0 beta 2 is Released!
    (Will be live later today)
    Version 3.4.0 b2
    =====================
    Shaders:
    - Added single-pass stereo rendering support.
    - Added "Skin (Forward)" shaders whose parameters and lighting behavior match our "Deferred Skin" pipeline.
    - Added instancing support to most of the shaders, including "SpeedTree".
    - Changed "Skin" shaders to remove scattering mask so that the metallic mask and controls could be restored.
    - Changed "* SingleSided" & "* DoubleSided" shaders to "* OneSided" and "* TwoSided" for easier navigation.
    - Fixed "SpeedTree" and "Hair" shaders' incorrect lighting on backfaces.
    - Moved "Skin (Legacy)" shaders into the "Legacy" sub-folder/menu.
    - Optimized "Transmission TwoSided" shaders to use fewer passes.

    Tools:
    - Added Mask Cutoff parameter to "Deferred Skin" to support thresholding transmission as a scattering mask.
    - Changed "Deferred Skin" to never have shadowed transmission.
    - Changed "Deferred Transmission" to only be shadowed for "TwoSided", or when "OneSided" shadow culling is set to Front.
    - Fixed "Deferred Skin" blocky normal artifact.
    - Removed "Deferred Skin" Bias and Scale parameters due to their lack of clarity and often being left on their defaults.
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    AWESOME!!
     
  37. Deleted User

    Deleted User

    Guest

  38. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    @n00body Hey there, I just picked up Alloy to use the SpeedTree shaders in the latest Unity 5.4 Beta. I can't seem to get wind working. No matter what I try, it doesn't seem to blow in the wind at all. I have other tree's using Unity's default shader that work, but the tree with Alloy shaders on it doesn't seem to do anything. Am I missing as step for needing to use the Alloy shader with SpeedTree's? When I click on the tree in the scene view I see the outline of the tree blowing in the wind, but the geometry of the terrain doesn't follow it.

    Thanks
     
  39. Deleted User

    Deleted User

    Guest

    @HolyFireGames
    Yeah, I found out the hard way this morning that instancing with SpeedTree is causing that, so I have to disable that feature on that shader. I also found out that all our shaders need to be patched to fix a z-fighting issue with multiple lights in forward mode when using instancing. Rest assured, they'll be fixed in our next beta release.

    In the meantime, you can fix the shader by going into the "SpeedTree.shader" file and deleting all the "#pragma multi_compile_instancing" lines.
     
  40. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    Thanks for the quick reply, that fixed it :)
     
  41. Deleted User

    Deleted User

    Guest

    @HolyFireGames
    So did the two-sided fix address your lighting issue?
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    PitHeimes likes this.
  43. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    We're doing more tests today but so far it looks like the issue is definitely fixed. Awesome job!
     
  44. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Apologies if this has already been answered, but is it feasible to use Alloy only for the Speedtree shader? I have everything else set up nicely using the standard shader with substances, I just want to get the best Speedtree results as I can.

    Following on from this, is it a relatively easy process to create trees in the Speedtree modeller, and then get them into Unity with an Alloy shader?

    Thanks a lot
     
  45. Deleted User

    Deleted User

    Guest

    @HolyFireGames
    If it's happening on Unity's shaders as well, then that's an engine bug. Please report it in the beta forums.
     
  46. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    Just figured that, so I deleted it :)
     
  47. Deleted User

    Deleted User

    Guest

    @Aurecon_Unity
    Umm...Well technically it could be done, but you'd be paying a lot of money just to disable all our features and use only one of our shaders.

    As for the modeler, I personally don't know as I just worked from a reference tree that was provided to us by a customer.
     
  48. Elowan

    Elowan

    Joined:
    Aug 14, 2013
    Posts:
    106
    I got a question on how to export texture-sets from Substance Painter 1 to Alloy packed map:

    Do I just have to use the pre-made export-settings for Alloy or do I have to kind of add a "127 grey filled" texture-channel for "specularity" ???

    Reading all this stuff here sometimes confuses me ;)
     
  49. Deleted User

    Deleted User

    Guest

    @Elowan
    Yeah, you need to have a dummy texture (eg. SP's specular) and just fill it to middle gray. Then you just set the export map channels to match Alloy's packed map format and you should be good.
     
    Elowan likes this.
  50. Deleted User

    Deleted User

    Guest

    3.4.0b2 BUG
    Okay everyone, so @GiTS_ pointed out to me that Alloy 3.4.0b2 is crashing the editor when applied to skinned meshes. It seems that Unity's new instancing feature is not playing nice with those types of models just yet. We'll disable it in the next beta, but for now you can patch it out this way:
    1. In the "Project" inspector, open the file "Alloy/Shaders/SM3/Core/Core.shader".
    2. In the code window, hit Ctrl+Shift+H.
    3. Do a mass replace of "#pragma multi_compile_instancing" and replace it with an empty string to delete all of them from the shader files.
    4. Hit Ctrl+Shift+S.
    5. Close the code window, and click back into the editor.
     
    Last edited by a moderator: May 12, 2016