Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    I think that's what I wanted to hear. Because early on in the Unity 5.0 beta, I was attempting to understand what was going on in the Standard shader, I started having a completely basic understanding and then they changed stuff and eventually I gave up, since figuring out what was going on in that code was not exactly fun (and man, the standard shader code needs some docs...!)

    What you described sounds like something I can handle (at least with some effort).

    Cheers.
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Check your post effects as well. These can consume a ton. I think really, we need to track shader keywords. It's becoming a problem so I wonder what @Aras might think about that?
     
  3. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Good morning guys. Just a heads up for those of you using Substance Painter 1.5, if you are using the alloy shader the specular values for some reason will not render but you can change them and it will show in the texture. I did a video of this showing the problem. Even created three fresh projects and the results were the same...

    https://dl.dropboxusercontent.com/u/158971/2015-08-28_01-23-03.mp4
     
    Last edited: Aug 28, 2015
  4. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
    I'm wondering if the Transition shader, or any Alloy shaders that support cutout, work with Depth of Field?

    As I understand it, the amount of blur that Depth of Field applies is based on the depth buffer. So for partially transparent objects (fade mode), if the transparent object writes to the depth buffer, the portion of background objects that can be seen through the transparency are only blurred as much as the transparent object itself. If the transparent object does not write to the depth buffer, it gets blurred as much as the background object behind it. Both scenarios result in incorrect depth of field.

    I think using cutout can avoid that. So I guess the question is, do the portions of the object that are fully transparent due to cutout write to the depth buffer or not? If using Depth of Field, will background objects visible through the cutout be blurred correctly?

    Cheers
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    All cutout shaders affect the depth buffer because they're drawn in the opaque pass, and the bits that are cut out do not affect the depth buffer.
     
  6. Wambli

    Wambli

    Joined:
    Feb 14, 2013
    Posts:
    13
    Is there a way to add blur to the glass shader to simulate frosted glass effect?
    Thanks in advance
     
  7. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Here is my attempt to create frosted glass... had to get clever with textures to make this work. :). The trick with this using a noise map... and you have to make a detail map with a lot of tiling... and from far away it looks frosted.

    EDIT: Also tweaking the alpha values to a half way point helps sell the effect. Hope this helps you.



     
    Last edited: Sep 7, 2015
  8. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hi,

    I am running into a little issue with the Core shader / MapPacker

    A picture is worth a thousand words...



    On the right : the model with the prototype shader on it.
    On the left : The model with the core shader, using the mappacked *_alloyPM.

    I made the mappack with the exact same textures. As you can see the roughness turns overkill on the left. Same for the AO.

    What am I doing wrong ?
     
  9. Deleted User

    Deleted User

    Guest

    @Feydwin
    I can tell that you are using an older version of Unity and Alloy. Is there a specific reason that you haven't upgraded to the latest of both? I ask because we completely rewrote the packer's code for Alloy 3.2.6 to address a lot of issues.
     
  10. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Alright , I ll update.
    As for the reason why I did not update : " If it is working, don't f8c* with it". :)
    I was using Alloy mostly for VFX ( dissolve, hologram effects, ect ). Now that I am done with prototyping, started my first real model + texture, so I never ran into that issue before.

    Edit : 3.2.6 --> fixed it. Thank you.
     
    Last edited: Sep 7, 2015
  11. Wambli

    Wambli

    Joined:
    Feb 14, 2013
    Posts:
    13
    Thanks for the tip, I'll have a look at it. But it seems very opaque to me, it's possible to have transparency?

     
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    There is transparency on that glass... I just used a heavily tiled noise texture... and tweaked the alpha value to fake it
     
  13. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
    I'm trying to use the Transition shader to go from fully opaque to nothing. I'm only using the Main Texture properties. I have set the alpha in the Tint of the Secondary Textures to 0, set the Rendering Mode to Cutout, and with any non-zero Alpha Cutoff, it transitions from opaque to nothing as the Transition Properties Cutoff is adjusted.

    However, even with the smallest possible Alpha Cutoff of 0.001, which is good enough to cutout the Secondary texture completely, I am getting pixels in the Main Texture that are getting cutout as well, which is not desired. I could simply set Alpha Cutoff to 0 just as the Transition Cutoff also reaches zero to get around it, but it just seems like an extra step.

    Is this the correct way to transition from fully opaque to fully transparent with the Transition shader?
     
  14. Deleted User

    Deleted User

    Guest

    @ripridehi
    Why don't you just use our Dissolve effect on a Core shader? That will probably solve your problem and make the shader much more efficient.
     
  15. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
    Yup, that works, thanks.
     
  16. Deleted User

    Deleted User

    Guest

    UPDATE:
    Do not upgrade to Unity 5.2 just yet. The update makes some breaking changes that require us to push out an Alloy update.

    Stay tuned.
     
    KRGraphics likes this.
  17. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    Not having alloy (yet) I just bought
    Alloy Detail Texture Mega Pack
    and I am loving it :D

    My Question:
    Is this also usable without alloy? (till i get around to buy alloy :) )
    Alloy FX Mask Texture Mega Pack
     
  18. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Yes, you can use the textures in the FX Mask Texture pack for darn near anything :p
     
  19. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
    How do I access and modify properties on an Alloy material from a code? Are there any examples anywhere?

    For example, how do get access to the Dissolve Cutoff value to animate a dissolve?
     
  20. ripridehi

    ripridehi

    Joined:
    Mar 27, 2015
    Posts:
    15
  21. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    405
    How goes the 5.2 update?
     
  22. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @punk I'm going to try to get it pushed out today. I've fallen super sick, so I've been sleeping away the past couple days.
     
  23. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    405
    No rush mate I was just curious, i hope you feel better soon
     
  24. xenius

    xenius

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

    Just wanted to let you know that Alloy 3.2.7 for (Unity 5.2 ONLY) will be available on the store this evening. This is a minor release to accommodate the new Deferred Reflection Probes.

    As for what's next, we actually have a more major release, Alloy 3.3, aaaalmost ready, but decided to push this point release so as not to keep those of you already jumping to 5.2 (you brave souls..) waiting.

    With Unite coming up next week we'll have some sweet announcements, awesome pics of whats to come, as well as a sneak peak on another product we're working on (that those of you who follow my twitter might have seen).

    As always, let me know if you run into any issues with 3.2.7 in 5.2. More next week :)
     
  25. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Never looked forward to vapourware so much..
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Looking forward to playing with it
     
  27. Unreal-Vision

    Unreal-Vision

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

    The new Deferred Reflection core shader fixed the Unity reflection probes resolution and smoothness/roughness bug? You share the same issue reported also by Wes (Allegorithmic)?

    Thanks,
     
    KRGraphics likes this.
  28. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
    I'm interested in Alloy as we may buy it to switch from Lux as that has been abandoned. The main thing is that we want to get assets looking as close to 1:1 as Substance Painter/Marmoset. I understand that Alloy uses GGX which is great. Why is a custom shader provided for Painter and how do assets look in comparison to the default Painter shaders?

    I made some comparisons here between those tools and Unity 5 Standard: http://www.polycount.com/forum/showpost.php?p=2351574&postcount=12

    In a production environment we can't afford to have to tweak textures to look right in the engine. We're at a time now in the industry where everything will be automated. Getting art to look almost exactly as it does in Painter/Marmo out of the box would be a god send.
     
  29. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @tynew We provide a custom shader for Designer/Painter as there are a few subtle differences in our implementation. The most visually noticeable one is that we utilize the occlusion channel for a form for specular occlusion/inter-reflection as well (which ensures that when the occlusion channel goes to black, you don't still get bright spec highlights on that spot, even for intense analytic lights).

    That being said, in terms of the brdf and roughness values, things will appear very VERY similar between Substance and Alloy (assuming you are using 256/512 probes, due to the way that the mipping/convolution in Unity is so resolution dependent).
     
    KRGraphics likes this.
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    I was noticing this too...and I had to lower the reflection probes a bit to accommodate this limiation. I ended up correcting the roughness map in Substance Painter to get it as close as possible to the visual quality... in my Alloy/SP/Unity workflow, I ditched the specular map completely (I left the Specular in the Material Packer at .08) and just used levels in SP to fix the issues.

    Without Roughness Correction (It was too shiny for my taste)
    Screenshot 2015-09-16 12.15.01.png
    Screenshot 2015-09-16 12.16.48.png

    With Roughness Correction


    Screenshot 2015-09-16 12.19.30.png

    Screenshot 2015-09-16 12.21.00.png

    Special Note: Unless you are working with Skin, Hair, and Eyes, you will not need a specular map whatsoever unless it is specifically called for... example, for eyebrow hair and cavities in the skin.
     
    Last edited: Sep 17, 2015
    punk and Deleted User like this.
  31. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    405
    So far 3.2.7 is working awesome in 5.2 thankyou
     
  32. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    422
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Hey guys.. just wanted to stop in for a moment and give you guys props for the Alloy Mods Deferred Eye shader... it looks so realistic when you have the settings correct and a good HDR map... I am looking forward to see how you guys tackle deferred skin shading :D. I approve of this Eye Shader...

    Screenshot 2015-09-21 23.49.44.png
     
    Deleted User, chiapet1021 and punk like this.
  34. Misciagno

    Misciagno

    Joined:
    Jul 27, 2013
    Posts:
    88
    Is there a way to show back faces with these shaders? If not are there any plans for them?
     
  35. Deleted User

    Deleted User

    Guest

    @justtime
    Alloy uses the the same G-buffer layout as Unity, so it should be possible to make deferred decals work with it.

    @Misciagno
    We don't do double-sided lighting for most of our materials. This decision was made to cut down the number of shaders in our set. The only exception is for "Transmission DoubleSided" shaders as those tend to have light spilling through when they are extremely thin.

    If you really desperately need double-sided lit surfaces then take a look at the "Transmission DoubleSided" shader for an example of what flags to use and what passes to add to the shader to make it work.
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    You can also model the geometry with two sides... copy the poly faces, paste, and then flip
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    UPDATE: Hey Guys... I don't know if anyone here use Substance Painter, but aside from the fact that they are using importance sampling in their environment maps... I found that if you use a levels node in Substance Painter (or substance designer) you will get about dead on with the look of the roughness maps in Substance Painter, especially with metallic objects... setting the mid range to .4 brings it DEAD ON to the results from Substance Painter...

    If you plan on using your own cubemaps or using reflection probes, doing this levels fix will help. This seems to affect metallic surfaces mostly...
     
    Last edited: Oct 1, 2015
  38. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    This is likely due to the fact that, even for a fairly high resolution reflection probe, the first convolution mip down is significantly blurrier perceptually than the full-sharp top mip. This is due to the fact that it is both blurred AND half the resolution (and as such a quarter of the data).

    The beauty of importance sampling (as SP/SD does) is that you get this wonderfully gradual range of blurring, which is referencing the same density of data, regardless of roughness.

    Just be aware that re-leveling the way you are is basically trying to 'aim' certain values in your roughness map, to a specific mip of the reflection probe, to match what looks good for your given asset (and the range of roughness values that are most perceptible on it).

    You should not assume though, that given a range of assets, and the range of reflection probe resolutions, that this will have the exact same desirable effect. Reflection probes are _incredibly_ coarse from a range-representation standpoint compared to importance sampling. Its like comparing the dumb-interpolation of 6-8 unique values to 255 unique values. On noisy assets you probably won't notice it a ton, but if you have subtle and consistent roughness gradients, or really 'clean' smooth objects, you'll notice this.

    Re-leveling only shifts things around, it doesn't solve any of the underlying problems. I've seen a number of people talk obsessively about re-levelling to match the Unity Standard Shader to SD/SP, not understanding that this is softly equivalent to trying to get a rasterizer to look like a raytracer. It's not going to happen. One is trying to get a _fundamentally_ different set of texture data, and a different way of sampling said data to match another. It will never 'match' perfectly, and even if you attain such a match for a given asset/asset group, it is likely a fragile one.

    Personally, I don't bother trying to do anything special, and just tweak my look in Unity via map updates.
     
    Martin_H and KRGraphics like this.
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    I decided to leave my textures as they are looking really good in painter... Until unity fixes their reflection probes.
     
  40. supaworst

    supaworst

    Joined:
    Mar 26, 2012
    Posts:
    45
    Hello alloy guys,

    first of all thanks for the amazing work behind your framework!

    There is a thing that i can't understand about your PBR implementation. Reading some PBR theory, i've found that there are two workflow: metal/roughness and specular/glossiness (as the starndard unity shader implement).

    I know that alloy adopts a metal/roughness workflow, so why is there also a specularity map/value? Am i missing something regarding PBR?

    Thanks in advance, maybe my question could be stupid but this thing is driving me crazy :)
     
  41. Deleted User

    Deleted User

    Guest

  42. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    Hi all

    I have little problem right know with Emission Properties in Core shader, some kind is missing Intesity Gain for Emissivion. I have Unity 5.1.2 f1 and last version of Alloy that is 3.2.6 for this version of Unity. I unpacked Alloy3_2_6_ShadersAndEditorCore to project.
    Pic:
    https://www.dropbox.com/s/xnfjiy9ont8h4vr/Screenshot 2015-10-06 10.29.37.png?dl=0

    Maybe I missing something or it some workaround for it?

    Thanks for help, because like this emissivity is useless for my project.
     
  43. Deleted User

    Deleted User

    Guest

    @lukas.chrapek
    We switched to Unity's native HDR color picker back in 5.1 because it has better features and is easier to control from scripts. The "Tint" property now stores an HDR color which you can edit directly. Also, the latest version of Alloy is meant for Unity 5.2 since they changed their APIs for reflection probes to make them deferred.
     
  44. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    @n00body
    Thank you for help , I see it now.
    I fought that 3.2.6 is for 5.1.x and from 3.2.7 is for Unity 5.2.x , can I expect some issue on Unity 5.1.2 and Alloy shaders version 3.2.6?
     
  45. Deleted User

    Deleted User

    Guest

    @lukas.chrapek
    3.2.6 was for 5.2, but had some bugs. 3.2.7 was meant to address those bugs. The big problem is that Unity changed several parts of their shader API, so I am surprised it even compiled in Unity 5.1.
     
  46. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    @n00body
    Our programmer is suprised too :) ... either way we plan switch to Unity 5.2 soon, so it should be everything ok, but right now in our project 3.2.6 version of Alloy shaders works ok with 5.1.2f1. Thanks
     
  47. asemenov

    asemenov

    Joined:
    Jan 13, 2014
    Posts:
    11
    Hi all! I have a problem with map chanel packer while migrating my project from unity 5.1.2f1 to 5.2.1f1 and upgrading Alloy from 3.2.5 to 3.2.7. It's mentioned early here http://forum.unity3d.com/threads/al...ion-3-for-unity-5.305178/page-12#post-2247772

    What I do:
    1.Open 5.1.2f1 project in 5.2.1f1 editor
    2. Create blank scene
    3. Delete Alloy directory
    4. Import 3.2.7 (Core and Editor and SM5)
    5. Check that deferred shader is in place in Graphics menu
    There is no any errors durning this process.

    After that Material Map packer looks like this:
    upload_2015-10-8_12-11-13.png
    and all packed maps are broken((

    This package fixed the problem http://forum.unity3d.com/threads/al...ion-3-for-unity-5.305178/page-12#post-2247935

    Just reporting that this problem sometimes stil appears.
     

    Attached Files:

  48. Deleted User

    Deleted User

    Guest

    @asemenov
    Thanks. Yeah, Unity's asset files are proving to be a little unstable and prone to corruption. We need to investigate why this keeps happening. :(
     
  49. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @xenius Do you know if there's been any updates or move towards supporting this in WebGL by Unity or you guys?
     
  50. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Ben BearFish I know that linear support is on their internal roadmap, but they still haven't figured out its prioritization relative to other things. It was obvious at Unite that they are aware of the felt need tho.