Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @devang_xprt
    Okay so here's the deal. We have a shader called "Glass/HighQuality" that does one grab pass for each object rendered using that shader. This allows them to stack their distortion and color tint effects. It will get you the results you want, though I recommend against stacking up lots of glass objects with this shader, as those grab passes aren't cheap.

    To see it in action, jump to time index 55:52 in this video:
     
  2. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Any help with substance Painter would be appreciated.
    I move Alloy shaders to :
    "...\Substance Painter\resources\shelf\allegorithmic\shaders"
    But they don't appear , i only see Substance Painter default shaders ?
    Any tips ?
     
  3. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @zenGarden
    Please PM me and we can continue this conversation there. Thanks.
     
  4. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    Okay, I've updated our website's documentation for our Substance Designer & Painter preview shaders with steps to get each tool to detect and load them.
     
    John-G and zenGarden like this.
  5. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    725
    Thanks for reply
     
    xenius likes this.
  6. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    591
    Hello,

    could you support the gamma color space? I have some shader whose don't like the linear color space, e.g. the HE water shader. The support for linear color space is nice, but dropping the compatibility with gamma color space is not a good idea. I have no trouble with another shader, e.g. RTP, to set it back in gamma color space, but you just provide linear...
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,729
    Just my 2p but the only reason to use gamma (ever) is if the device doesn't support it or it's a recent mobile (where it's possible it's still too slow). I can't see it being a chief reason on console or desktop for primary slowdown on current gen.

    If the HE water shader is your reason then get that fixed instead of butchering your entire game's look because linear allows you to forget about lighting issues which is a major balance problem otherwise...
     
    chelnok, n00body and xenius like this.
  8. apple92

    apple92

    Joined:
    Nov 27, 2013
    Posts:
    6
    Hey there…

    So I finally bought this Shader Framework and tried different use cases.

    One thing that might be a bug (or at least not expected behaviour) is, that the distortion of a glass Shader also distorts objects, which are actually in-front of it.

    I made three Screenshots to show that problem (the third is of course just to show the effect in an extreme way. I'd like the effect of the second one if not for this rather strange behaviour). I know it's probably not intended for such a use, but I thought I should tell you anyway. The effect without distortion is actually already pretty nice :)


    Glass_Distortion_1.jpg Glass_Distortion_2.jpg Glass_Distortion_3.jpg


    Besides that I'm quite happy so far. Easy shader setup and great quality.
    Here is a screenshot of my Alloy Shader Framework Playground ;) (with some additional Plugins)

    With DoF:
    nice_to_work_with.jpg

    Without DoF:
    nice_to_work_with_lessEffects.jpg

    regards Michael
     
    Last edited: Jun 7, 2015
    n00body likes this.
  9. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @mkgame
    As @hippocoder pointed out, there is no reason to adopt gamma-space unless your chosen hardware platform forces you to do it. It makes all the lighting math wrong resulting in worse overall visuals and inconsistent material illumination between different lighting environments. Not to mention the fact that it is a headache to support both spaces.

    In short, we have no plans to support gamma-space. Period.

    @apple92
    That's a limitation of the screen-space distortion technique we use for our Glass shaders. You see, to get the correct look we had to make sure that Glass materials were drawn at the same time as translucent objects. Since it uses a capture of the scene up to the moment where the Glass material renders, it can have visual artifacts where opaque objects in front of it will leak into the distortion since they are drawn before the Glass material.

    Hope that helps. ;)

    EDIT:
    It looks like in your case you have a draw order issue as the result of having one Glass object inside another. The outer object is getting drawn after the inner one. As a result, it picks it up in the distortion.
     
    Last edited: Jun 7, 2015
  10. apple92

    apple92

    Joined:
    Nov 27, 2013
    Posts:
    6
    @n00body

    Expected something like that. It works well with low distortion/no distortion and with a proper setup one can also use a higher distortion Value. Just wanted to check whether it was a bug or really technical limit ;) (In sense of: worth the performance cost).

    Thanks for the fast reply.
     
  11. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    591
    I developing a game, where i don't care about such small details. Again, it is a game, not a film, not a real life demonstration. It is an RTS game, there is no realistic first person view. A lot of assets works with gamma color space and don't support the linear one and if they support it, then they still support the gamma color space for this reason. E.g. in Unity asset store nearly all the water shader, whose looking acceptable, Unistorm and more. HE shader has more than 100.000 lines of non readable shader code, cannot fix it, but looks awesome with gamma color space for top down games.

    Then tell me, what good looking water shader (definitelly not Unity ones) works with linear color space...
     
    Last edited: Jun 7, 2015
    KRGraphics likes this.
  12. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    591
    I was guessing this, then only your asset force me to use the linear color space, that makes me headache, because its hardly supported by the Unity assests. I know, some asset developers working on linear color space adaption, but in my oponion its too early to just go with linear color space.
    By the way, Lux and Jove support gamma color space, in my case is Alloy probably not the best physical based shader option...
     
  13. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,276
  14. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    591
    That is not so easy, water with linear color space support. There is simply nothing in Unity store and even Smart Water does not support it yet.
     
  15. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi, I just checked out the crash course video. This framework looks amazing. I really like your UI.

    I'm especially interested in POM as that's what I miss the most in the Unity standard shader. Does POM utilize shader LOD so that it only renders when you're up close to save performance? If so, is it possible to change the LOD distance yourself?
     
    xenius likes this.
  16. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    339
    Do games made by using Alloy support DX9 ?
     
  17. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @Sir Spunky
    We haven't implemented that yet, but it is on the agenda. The problem is that regular parallax and POM have very different behaviors. So it is tricky to mix the two.

    As for LOD, our implementation does provide tweak-able parameters for reducing sample counts based on viewing angle. For example, you really don't need too many samples when you are looking straight down on a POM surface as when you are viewing it at a grazing angle.

    @hakankaraduman
    Yes, unless you use our tessellation shaders, since that functionality is dependent on SM5.0 features. Otherwise all our regular shaders are designed to compile for SM3.0 by default.
     
    hakankaraduman and Sir-Spunky like this.
  18. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    Hi Everyone,

    I just wanted to post a handy dandy SUPER IMPORTANT REMINDER

    Unity 5.1 will be dropping veeery soon. DO NOT INSTANTLY UPDATE TO IT IF YOU'RE USING ALLOY. Alloy 3.1.x will NOT work correctly in 5.1 due to our light inspector override (I've had several people using 5.1 RC ping me about this).

    Please, give us at least 24 hours to test on the final shipped version so that I can push an update informed vs. blind. The fact that the last RC was released weeks ago means that any number of little damn things might have changed in-between then and now. We've already had to fix bugs in the 5.x release cycle that have occurred due to changes that did NOT appear on the Unity Change log, so I ask of you to at least give us a day or so once it drops.

    In addition, if something breaks and you're using a Beta/RC version of Unity, please do not come screaming for a fix because your project is broken because you didn't check first to see if we knew of breaking changes. Please ask here on the thread first BEFORE you migrate your entire ginormous project to a beta version of Unity.

    Cheers
     
    Karearea likes this.
  19. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    272
    after watching the crash course video, i've come to the conclusion that you need more HDRI lit spheres in your demo images. the shift compared to the built-in shader is really noticeable. while the art you have looks really pretty its hard to see what is the shaders and what is just the art. get a material stand to show some shader effects on! helps people understand what they are getting.

    P.S. don't know if you guys have any plans for a clear coat shader of any kind(rough under-reflection+smooth over reflection). its a really pretty effect that is more what car paint actually does than just the flakes you have now(pretty as that is).
     
    Last edited: Jun 9, 2015
  20. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    272
    photo is worth a thousand words.
    Goblin1.png
     
    John-G and KRGraphics like this.
  21. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @Cynicat Good idea :p Once things calm down a bit I should really do another mat-sample scene like I did back in Alloy 1 times.

    re Clearcoat: In general, we've tried to stay away from forward-only opaque shaders where possible, as a lot of folks will then try to use them centrally, and then lose the performance benefit from deferred rendering. A clearcoat shader can't be implemented as deferred compatible, as by definition it's a multipass shader using its own type of lighting math.

    I know the carpaint shader isn't quiiiite a fancy-pants as it could be, but we wanted to keep that deferred compatible so that say... 10 cars all with 2 spot lights of headlights wouldn't obliterate one's framerate.

    Lastly, what's that pic from?
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    I'm glad I saw this updated post and gonna wait for the green light to update to unity 5.1. I should try out the carpaint shader just for the hell of it. And stuff like clear coating and iridescence will have to be faked with a multicolour specular
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    This is a nice pic... I think I could get very close in rendering quality to the pic you just posted in Unity....
     
  24. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    You could get away with this using the alloy glass shader and just use two offset normal maps that pan against each other... basic glass and water have nearly the same IOR so from far away, use the Low Quality glass shader...
     
  25. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    BOOM
    Alloy 3.2 is now on the Asset Store

    Notes:
    - Alloy 3.2 is Unity 5.1 and up ONLY
    - THIS REQUIRES an Alloy Directory (the scripts and shaders dirs) blow-out before installation.

    I'll have a feature video out sometime before the weekend to show ya guys how to play with the new toys :)

    Changelog:
    Version 3.2.0
    =====================
    Shaders:
    - Added the "TriPlanar/Full" and "TriPlanar/Lite" shaders.
    - Added TriPlanar variants of "Terrain/4Splat" and "Vertex Blend/4Splat".
    - Adjusted the normal projection for "Oriented/Blend" and "Oriented/Core".
    - Merged "Directional/Blend World" and "Directional/Blend Object" into "Directional Blend".
    - Migrated all the emission effects to using the new Unity HDR color picker.
    - Modified the "Transmission DoubleSided" shader to add the parameters Shadow Weight & Invert Back Normal.
    - Fixed the backface lighting for the "Transmission DoubleSided" shaders.
    - Removed the legacy features flags.
    - Renamed "Hair/Translucent" -> "Hair/HighQuality" and "Hair/Base" -> "Hair/LowQuality" for clarity.
    - Renamed "Vertex Blend 4Splat" -> "Vertex Blend/4Splat" for grouping flexibility.

    Scripts:
    - Removed the legacy Intensity Gain color control from our inspector definition system.
    - Removed the AlloyUtils.IntensityGain() utility function.

     
    Don-Gray likes this.
  26. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    272
    i can see where you would have problems with deferred. i can't think of a way. closest would be to sample the reflection probe for the under-coat. but then i'm stuck. how to get that past deferred lighting. =< lets cross our fingers for forward plus rendering!

    The PBR library i'm working on for blender. its a metallic shader with a glaze over it. metallic has a base and rim color, glaze is a layer you add over it. funny part is they have the same IOR. theres no reflection offset.
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    I can't wait to play with 3.2
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,997
    Hey guys. I just had a play with the new hdr emission option and I really like how easy it is to change the brightness of the emission. I'm tempted to try out the real time emission with a moving object that is not static.
     
  29. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    339
    Just one more question, noob here obviously :)

    Is this a completely new rendering pipeline other than Unity 5's built-in or just a collection of premade shaders? For example, can someone use shaders made with ShaderForge with also using Alloy?
     
  30. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @hakankaraduman
    1. Alloy is a pre-made shader set, including a deferred override shader, and uses Unity's pipeline for most things.
      • We've modified Unity's light UI to let us have intensities higher than 8.
      • We've modified the UI to support our spherical area light system.
    2. Yes you can use other shaders alongside Alloy, but:
      • In deferred mode, deferred-compatible shaders will end up using Alloy's lighting model instead of Unity's due to the override shader.
      • Forward rendered shaders will continue using whatever lighting model they are set to use. They will not be able to use Alloy's spherical area lights, and will render them as if they were plain old punctual lights.

    Hope that helps.
     
    chelnok, hakankaraduman and Tethys like this.
  31. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    332
    Hi, I've been having a little trouble with the difference in lighting models between the Built-In Shader and Alloy's replacement one. It appears Alloy is far less sensitive to point light intensity, regardless of whether an Alloy Area Light component is present on the point light.

    My issue is that I need to set all point lights to a value that looks bright enough to show up with Alloy's replacement shader set, but then anything rendered in forward looks overbright. My particular use case is an ocean asset that reflects everything in forward, and therefore picks up the overbrightened surfaces. It's happening in particular with RTP terrains, although continues to occur with other terrain shaders also (including the Alloy one).

    I gather the onus is on the ocean asset to render reflection in deferred? I just wanted to check I'm not missing the point somewhere.

    Cheers,

    Nick
     

    Attached Files:

  32. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @ddnharris I believe this is a case of works in A, works in B, doesn't work in A+B
    When in deferred mode, non-alloy shaders will use our lighting model, but in forward, they will use their own. To my knowledge most Ocean planar-reflections are using a schema where the reflection is drawn forward. So in this case, rtp terrain reflected in a forward pass for the ocean would draw using its own lighting model, and unity's light falloff (which is more intense).

    What is confusing to me though is that you mention the Alloy terrain shader also exhibits this behavior, which it should definitely NOT. Even forward-only alloy shaders should exhibit our light falloff behavior correctly. But, it's the Unity-frigging-terrain system, so who knows.

    If you would, could you put together a repro project for me consisting only of a small terrain config'd with RTP as you have it, and a 2nd scene with an alloy terrain. Pop the water system you're using in, and a couple points lights, then zip the whole project up and pass it to me on dropbox? I will investigate.

    Also, are you using Unity 5.0.2, or 5.1? Which version of Alloy is in the project?
     
  33. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    332
    Yeah, it seems oddly specific to Terrains I think..

    I'm on 5.1 and Alloy 3.2
     
  34. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    332
    The Alloy terrain shaders DO treat the Alloy lighting model correctly in forward. My mistake sorry- I set that shader on the terrain, saved and closed/opened Unity and it updated. RTP obviously uses the Unity forward lighting model so the difference persists there- do you still want the repro or is it something I should ask the author of RTP about supporting?
     
  35. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @ddnharris If you could give me a simple repro project with just rtp, the water, and some alloy shaders setup in a proj would be useful. We have an idea we'd like to investigate first to do some clever header replacement. If the guy who did RTP is using Unity's headers, we _should_ be able to just drop a header override into the folder with it, and it will _just_ modify the light falloff for it.

    I would rather not have to bother RTP's author if at all possible (we hate making work for others).
     
  36. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    332
    Really liked your Null Op blog about proprioception btw, particularly your idea for light probes as scent probes. Have you considered vector fields? I've been using Megaflow to define vector 3s for wind in a scene and highly recommend it- with moving sources you could generate scent coming off a player, that would even adapt to movement nicely. Worth considering perhaps: http://www.west-racing.com/mf/?page_id=5892

    Edit,

    I'm not terribly comfortable sharing purchased assets from 3rd parties- is there something I can dig into that would help you regarding RTP?
     
  37. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @ddnharris are you able to read the RTP shader files to see if they're including Unity headers? :p
     
  38. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    332
    :D Point taken. I'll sort something out.

    Here is one of the assets I've been converting over to Alloy. Well worth the effort and I'm pretty chuffed about the improvement over the standard shader.
     

    Attached Files:

    John-G likes this.
  39. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    Karearea likes this.
  40. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I have been doing some testing on the Transmission shader (double sided) and here are some of the results on a test model. Found one issue and looking for some possible help on the other item I found.

    The left sails are a double sided mesh, they look great in this setup. The right one is a single sided plane and a cloth object and it is looking good, but you can tell that the coloring on the backside is completely different even using the same material.


    At a certain angle it begins to lose the lighting on the material. In this pic the back of the sail is correctly lit. If I move the camera to the left a bit, it loses the light. I turned the ambient light down to make it more visible. You can see the light beginning to be lost on the furthest aft sail, then the next pic has the main sail as well.



    Cloth object on left, static mesh on right. I am not sure what it is doing with the backfaces. It is the same material that is on the single sided mesh on the right, but for some reason the double sided mesh turns white.


    We would just use single sided planes except we run into an issue with SSAO Pro then. You can see the SSAO render through the backside of the plane mesh. Not sure if this is something that needs to be brought up to the SSAO dev or if it can be done with the shader itself. Also, you can see that the backside of the single sided mesh is much darker than the other mesh. I have tried most all of the settings to no avail.

    Hopefully you can take a look at it. Thanks.
     
  41. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @CaptainMurphy It would probably be easiest if you send me a repro project with just the ship, Alloy, in a scene with sunlight as you have it (make sure the project settings are all correct). It may be a case of something it broken, or it may be a case simply of transmission in this form not being able to get the exact look you want.

    Regarding SSAO, there's not anything else we can do on that front. I know our shaders are being seen by that buffer correctly, so if they are still drawing wrong, it is due to the way a given SSAO effect works. It may simply not be able to handle forward-only opaque shaders period. Make sure you are running Unity 5.1 with Alloy 3.2, as the camera-depth-normals texture that most SSAO effects depends on is totally bugged in Unity 5.0x.
     
  42. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,276
    I see the intensity of the emissive type has been removed?
     
  43. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @Don Gray
    Yes. We've switched to Unity's built-in HDR color picker for all our emission effects.
     
  44. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,276
    Is this a scripting only feature or is there a (graphical) interface?
     
  45. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
  46. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,276
    Though I've heard of it, I've never seen it, where is this located?
     
  47. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @Don Gray
    All our emission effects have "Tint" colors. Clicking them will pop up the HDR Color picker.

    For any further questions, please PM me.
     
    Don-Gray and John-G like this.
  48. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,276
    Ok, got the HDR Color Picker now, thanks.
     
  49. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    I have a Newbie question. I have a pack of substances from Allegorithmic, can these be used directly with Alloy Core shader?
     
  50. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @Zaddo67 You will not be able to drop a standard substance onto an Alloy shader, as we use a custom packed map setup, and Allegorithmic hasn't yet completed their (planned) channel-rearrangement system for the Unity integration.
     
    Zaddo67 likes this.
unityunity