Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    Hi all

    I come to one issue with glass shader, more about it in video(link below), basically I have two glass materials on cylinders (different sizes) one is smooth acting as glass and second have is liquid normal map on it. As you can see in video in some camera position are both materials visible but mostly is visible only one glass material upper one. It is bug? or I'm doing something wrong or is some other materials what I can use to achieve this kind of look, container with water or liquid in it? Thanks for help.
    Btw: Unity 5.4.0f3, lastest version of Alloy shaders and this issue is also in editor and build for PC.

    https://dl.dropboxusercontent.com/u/52623513/AlloyGlassShader.mp4
     
  2. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    387
    @n00body not sure if you've seen this before, but it look's like glass ain't working in single pass VR mode. Top pic is non VR mode, bottom is VR mode, looks like the coordinates are wrong - Its latest alloy version, unity 5.4.2, low quality glass, badly need to sort out my characters sausage fingers

     
  3. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @Alexarah
    The main strengths of Alloy over UBER are its support for realtime area lights, colored light cookies, specular occlusion, specular AA, and sheer variety of shaders and toggleable options. Now UBER has some advantages in terms of translucency options, TriPlanar options, POM, and a few other things. Both can be used together, to some extent. We even offer a special deferred override shader to try to mix some Alloy lighting features with UBER's.
     
    Alexarah likes this.
  4. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    Did you do a full directory blowout before upgrading? Also, did you run the "Material Migrator" and "Light Converter" tools? Also, what version of Unity are you running?
     
  5. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @lukas-chrapek
    Are you using the "LowQuality" version of the Glass shader? If so, then they are sharing the same scene capture, so depth sorting issues with cause one to overwrite the other. Try the "HighQuality" version in this case.

    EDIT: Also, that shader doesn't update the depth buffer due to pass order. So interpenetrating translucent objects can pop randomly.
     
    Last edited: Nov 22, 2016
  6. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @punk
    I would have to check, but I believe that this is a known issue with this rendering mode when mixed with GrabPass-based shaders like Alloy's Glass shader.
     
    punk likes this.
  7. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    yes, i did a full directory blowout as required.. even after the material migration & light conversion, saw the sea of pink, deleting & redownloading of the alloy folder too.

    me: 5.4.0 f3
    my colleague: 5.4.2 f2

    both of us have the same problem, we are nearing our early access release dateline of releasing our game

    also i like to point out that the alloy high quality glass shader is taking a hit in our VR game

    Steam VR plugin need to use forward lighting rather than the usual deferred for alloy.. how do i do so?

    EDIT: we fixed our normal map problems, but lighting is still an issue
     
    Last edited: Nov 22, 2016
  8. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    I tried both shaders, low and high. With both Low shaders it is visible only upper one, like you wrote, but when I start combine or put both shaders on higt this kind of popup start happening, like in video. It is some solution for this or it is not possible create this kind of effect.
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Good morning guys... I have a few questions that I would like to ask... the first one being... is there a way to turn off the Specular AA on things like hair? When I pull the camera back, you see the mip mapping acting rather aggressively and it is causing issues with the details.

    And also, will we see some kind of update with the shader itselt?
     
  10. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    hello n00body.. you have not my answered any of my questions till now...

    * alloy high quality glass shader performance issues
    * animated scrolling UVs no longer works in editor mode after 3.4.5 update
    * supposedly using deferred lighting but steamVR need to use forward
    * lighting on my colleague's side still dark, however its normal on my end.
    again:
    me: 5.4.0 f3
    my colleague: 5.4.2 f2
     
  11. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @OP3NGL:

    1. The alloy glass high quality shader uses a grab-pass effect PER renderer. This is expensive relative to the complexity of your scene. In general it is best not to have more than 2-3 renderers with it in view. It should generally not be used with VR at all due to redraw costs. There is no way around this.

    2. Are you sure that you have the 'Toggle Skybox, Fog, other effects button engaged in the top menu of your edit view window'? This button also toggles edit-view preview of animated scrolling of materials.

    3. SteamVR recommends Forward Lighting due to the overhead in deferred rendering for VR. This has nothing to do with Alloy. It is up to you if you wish to pay for the overhead and pixel cost of deferred rendering in VR. I personally don't for my own project (H3VR) as I don't feel the advantages are worth it compared to MSAA.

    4. One of you likely have settings that differ. Also, using two different versions of Unity on the same project is a recipe for disaster/scene corruption.
     
    n00body likes this.
  12. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    This was a holiday week in America, so I was refraining from work-related activities. Please be more patient from now on.

    @lukas-chrapek
    I don't think this effect is going to work the way you want. Due to how transparent materials are rendered in Unity they aren't receiving per-pixel depth testing against other transparent materials. As such, popping will always be an issue, since their render order is based on their distance to the camera.

    @KRGraphics
    Specular AA happens in the packed maps, not the shaders. To "turn it off" just don't assign a normal map in the packer.
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Happy Thanksgiving to you guys...hope all is well.
     
    n00body and xenius like this.
  14. ixikos

    ixikos

    Joined:
    Jun 21, 2013
    Posts:
    19
    Hey guys, great framework. I really am in love with this project and have used it on numerous projects. I have an issue where every once in a while I get a lot of very bright flickering for a second or so. I have been unable to track down the cause of this and unable to find if this has already been answered. I've noticed it on multiple projects though. I can post a video if it would be helpful. I am also working in VR
     
  15. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @ixikos
    You're probably referring to specular aliasing, which is a problem for extremely smooth materials with noisy normal maps. This is a problem for all PBR shaders, not just Alloy's. The only solutions thus far are TXAA, SSAA, or using our provided map packer tool with a normal map assigned so that the output packed map has Specular AA baked into it.
     
  16. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @ixikos Another simple solution is to simply not have your materials go all the way to 'smooth' on your microsurface maps. Lots of folks make their maps waaaaaaaaay too smooth when very few real-world materials are actually such.
     
    KRGraphics likes this.
  17. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    @n00body
    sorry about that....
    how do one create blood splatter with wetness on decal?
     
  18. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    Can you be more specific? Do you mean using our deferred decal shaders, or using the optional Decal feature on any of our shaders?
     
  19. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    Alloy 3.5.0 for Unity 5.5 is live on the Store

    Please try it out and let me know what you think. Cheers!

    Changelog:
    Version 3.5.0
    =====================
    Shaders:
    - Added Unity 5.5 suppport.
    - Fixed shadow wind animations on SpeedTree and foliage shaders.
    - Fixed "Transmission/TwoSided" shaders' compiler error when they are set to Fade or Transparent mode.
    - Optimized the deferred Skin and Transmission effects.
    * Added new config flag A_USE_DEFERRED_MATERIAL_TYPE_BRANCHING to toggle optimizations.

    Known Issues:
    - Glass shader distortion is much weaker than expected.
     
    KRGraphics and punk like this.
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Can't wait to play... the new HDR tools should make Alloy shine
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Hey, all...

    Just wanted to drop in for a second and really show off Alloy's hair shader in a full environment...


    I must say, I am still impressed with this, though I have some depth sorting issues when hair crosses hair.

    Now, since Unity 5.5 is out, and I am about to jump on to it, I was going to ask if the hair shader will be getting updates, such as translucency and moved into PBR. After seeing the hair done in paragon, I was very impressed and I would love to see this appear in Alloy. Hope you like the hair... it is all hand painted.
     
    punk likes this.
  22. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    your deferred decal shaders, also explain on how to use the wetness shader. thanks
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976

    The wetness shader is pretty straightforward to set up... here is an example of how it is used with Alloy

    Screenshot 2016-12-05 03.04.10.png

    In the screenshot, I am using a quincunx texture with an inverted alpha channel. The first parameter, the Mask Source, determines what part of your model is wet or dry. White being wet, and black being dry... you will most likely use a texture map to control this...

    The next parameter is the Mask Strength. I would advise leaving this at 1 since the texture is controlling the wetness. You can also tint the wetness... such as for blood, though this isn't working for me.

    For normals, if you want your character to be wet and use an existing normal map, plug in a texture, or whatever texture you want as long as it is a normal map. If you model already has a normal map, you can leave this blank.

    And the roughness parameter is pretty self explanatory... I hope this helps a bit.





     
  24. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    thanks KGR
     
  25. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    387
    @n00body @xenius I believe there's a problem in the latest version of Alloy with the deferred skin shader and single pass VR, in the image below the SSS is offset. It looks like the same problem as the glass shader. Are you guys seeing that?

     
  26. PsyDev

    PsyDev

    Joined:
    Sep 30, 2015
    Posts:
    31
    I just updated to Unity 5.4.3p2 and Alloy 3.5.0, and now I get a compile error in Alloy/Human/Hair/LowQuality TwoSided from Shadow.cginc:

    Code (CSharp):
    1. Shader error in 'Alloy/Human/Hair/LowQuality TwoSided': Non system-generated input signature parameter (SV_Position) cannot appear after a system generated value. at Assets/Alloy/Shaders/Passes/Shadow.cginc(69) (on d3d11)
    2.  
    3. Compiling Fragment program with SHADOWS_DEPTH _ALPHABLEND_ON
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING
    The line in Shadow.gcinc is the VPOS line below:
    Code (CSharp):
    1.  
    2. half4 aFragmentShader(
    3. #ifndef A_VERTEX_TO_FRAGMENT_OFF
    4.     AVertexToFragment i
    5.     A_FACING_TYPE
    6. #endif
    7. #ifdef UNITY_STANDARD_USE_DITHER_MASK
    8.     , UNITY_VPOS_TYPE vpos : VPOS
    9.  
    10. #endif
    11.     ) : SV_Target
    I deleted all the Alloy folders from my project, then imported all 4 packages: ShadersAndEditorCore, TessellationShaders, Legacy, and Mods. I ran the Material Migrator.

    One small point that might not be related, but although my Unity asset store downloads says Alloy is 3.5.0, the packages that are imported are all labelled xx_3_4_5_xx, and the release notes in the package are only up to 3.4.5. So I can't tell for sure if I actually do have 3.5.0 installed.

    Is this a known compile error? Am I doing something wrong?
     
  27. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    Sorry for the delayed responses. I've had the Flu for the past few days.

    @OP3NGL
    The deferred decal system currently relies on custom meshes, which normally have to be authored by hand. However, I believe one of our customers has been able to use our shaders with Easy Decal, so you could give that a try.

    @punk
    I must admit, we haven't tested that combination since we've only ever used the forward renderer for VR. I will need to investigate it to see what the deal is. Our next release will have a fix for our Glass shaders, but I don't know when this issue will be fixed.

    @PsyDev
    We've addressed that issue in Alloy 3.5.0, but you can only download it for Unity 5.5. I recommend you upgrade when you have the opportunity.
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Just downloaded Unity 5.5 and I am extremely impressed with the visual jump in quality. I hope you guys will eventually create shaders for Sky Rendering and Atmospheric Scattering... I currently have to use particles to fake this
     
  29. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    387
  30. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @punk
    Okay, so it looks like Unity added a special call to their post-process shader API that I now need to include in our deferred Skin and Transmission code. I'll try to have that in for the next release.
     
  31. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    387
    Awesome thanks bro ;)
     
  32. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    387
    @n00body 3.5.1 Glass working beautifully in single pass VR - awesome work thanks
     
  33. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    Hi

    We just start using HX VOLUMETRIC LIGHTNING, thas there is little problem with transparent mateirals, they have also guide how to adjust custom shaders to support they volumtric lighning, it will be possible add support to Alloy shaders?
    Here is their documentation: http://hitboxteam.com/HxVolumetricLighting/#custom-transparency

    Or it will better to add this support be our own.
    Thanks for answer or PM

    Here is screen:
     
  34. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @lukas-chrapek
    Funny that you should mention that. We already added HX integration for NVYVE Studios for their game PAMELA. Just do the following:
    1. In "Alloy/Shaders/Config.cginc" in the "THIRD PARTY" section, un-comment "#include "Assets/Plugins/HxVolumetricLighting/BuiltIn-Replacement/HxVolumetricCore.cginc"".
    2. In all our "*.shader" files, do a mass replace of "//#pragma multi_compile __ VTRANSPARENCY_ON" with "#pragma multi_compile __ VTRANSPARENCY_ON" to uncomment it.
     
    KRGraphics likes this.
  35. lukas-chrapek

    lukas-chrapek

    Joined:
    Sep 13, 2015
    Posts:
    31
    Thanks very much... sorry for double post, it wont show me that first one,
    I done what you wrote and right now it reimporting shaders.

    EDIT: Everything work as should for now... thanks for quick answer Joshua.
     
    Last edited: Dec 9, 2016
  36. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @lukas-chrapek
    Glad it worked out. Let me know if you encounter any problems, and I will try to fix them as best I can. We're always looking to improve third party integration when it is within our power to do so. ;)
     
    Last edited: Dec 9, 2016
    punk likes this.
  37. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    @n00body

    TL;DR: Does the glass shader in 3.5.1 work with single-pass stereo in VR?


    I'm starting a new SteamVR project that's going to involve lots of glass objects. I know, I should just stop myself right there. :)

    I'm doing some art tests to determine if I can/should go for realism with the Alloy glass shader, or if I should abandon that and go for a stylized approach. However, I noticed that in the latest release (3.5.1) there's a release note stating single-pass stereo now works with the glass shader. I just tried this and it doesn't seem to work. Is there some trick to this I'm missing?
     
  38. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @nickpettit
    We've had other users test and confirm that it works. So two questions:
    1. Are you using Unity 5.5? Alloy 3.5.1 will only work with that version or later.
    2. Did you do a full Alloy directory blowout and re-import?
     
  39. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    @n00body

    Fixed. It was just a matter of closing Unity and reopening the project.
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Hey guys... I have a question in regards to the lighting in Alloy. I am trying to create an effect in game where a flash of lightning fills up the scene, but at current, it is nearly impossible to go past an intensity value of 1 with the Area light script on. My question is, how could I achieve this overly bright lightning flash effect without modifying the script?

    EDIT: Got it... just had to change the light range
     
  41. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    451
    so now unity supports valkan
    5.6 beta
    alloy doesn't work, can the ally devs get this working in the first beta?
    because full version wont be out until march
    but I would llke valkan support now
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Good morning, guys...

    I am about to paint some mesh grass, and I was wondering if Alloy is set up for GPU instancing. Such as if I paint the grass on a mesh, will it dynamically combine at runtime. These are important questions as I am in the process of setting up grass and trees.

    Thank you.
     
  43. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @AlteredPlanet
    I can take a preliminary look, but it could prove to be too complicated. Our policy of delayed beta updates is there for a reason.

    @KRGraphics
    We ship with the ability for all our shaders to use instancing, but we have it disabled by default to shorten compile times.
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    How could I enable it? I'm using a series of grass chunks and want to use instances of it
     
  45. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @KRGraphics
    You must open the code editor and do a mass replace on all our "*.shader" files to replace "//#pragma multi_compile_instancing" with "#pragma multi_compile_instancing".
     
    KRGraphics likes this.
  46. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    @n00body

    Sorry to disturb you but looks like i got another problem.
    Both my colleague & i updated to Unity5.5, reloaded alloy 3.5.1, deleted the alloy folder & did the migration setup all over again...

    We saw that our roughness/glossiness no longer work... now the glossiness looks flat with no reflections

    EDIT: when unity "packed" the alloypm.asset, evrything turns blue... do i need to regenerate everything again?
     
    Last edited: Dec 20, 2016
  47. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    In the Project hierarchy, do a search for "_Alloy", select all the files, right click, and select "Reimport". That should re-pack all your packed maps.
     
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976

    Groovy! And I look forward to what you are gonna bring to Unity 5.6...
     
  49. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    @n00body
    Great! Everything works now Thanks!

    Can anyone have a tutorial on how to create dissolve in alloy?
    Example: when enemy dies he dissolves away..
     
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,976
    Hey guys, I don't know if this has anything to do with Alloy or Unity but I have discovered something strange with the light probes. I am working on lighting my characters and I have seen that if I am using LPV for skinned meshes, the textures are much darker than they are supposed to be.

    Light Probes Disabled: Notice how you can see the textures clearly on the character as they are supposed to.

    Screenshot 2016-12-27 16.37.54.png

    Light Probes Enabled: The textures are so much darker than they are authored.
    Screenshot 2016-12-27 16.38.17.png

    What do you guys make of this? Thanks.
     
unityunity