Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Hello,


    I receive this error when creating lights


    NullReferenceException: Object reference not set to an instance of an object
    AlloyLightEditor.GetVal[AnimBool] (System.String valName) (at Assets/Alloy/Scripts/AreaLight/Editor/AlloyLightEditor.cs:70)
    AlloyLightEditor.OnInspectorGUI () (at Assets/Alloy/Scripts/AreaLight/Editor/AlloyLightEditor.cs:219)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1162)

    any idea why this is happening?
     
  2. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    You likely have a mismatched version of Alloy-to-Unity version. What version of each respectively are you using?
     
  3. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    WIP: some delicious 4k tarmac from turbosquid, using Alloy and SE's bloom shader.

    I had to invert the specular map and stick it into the roughness channel though. Is that a valid workflow or a hack on my part?

    tarmac.png

    Edit:
    Turns out I didn't set up the Alloy deferred shader correctly, the normal map was inverted, and I didn't set 4k in the texture import settings. Funny it still looked pretty good. Anyway, here is a screenshot with the proper setup.

    runway.png

    Here is the source of the texture if anyone is interested:
    http://www.turbosquid.com/FullPreview/Index.cfm/ID/639354
    Be sure to invert the green channel of the normal map, and make a second texture based on the spec map, invert it, and call it roughness (not an Alloy approved workflow, but it works in this case).
     
    Last edited: Jun 23, 2015
    KRGraphics, Tethys and xenius like this.
  4. PouletFrit

    PouletFrit

    Joined:
    May 26, 2014
    Posts:
    14
    Theses shaders looks amazing !! Really interested in buying this products.

    But first, I would like to know if these shaders work/give good result in WebGL.

    Unity standard shader are hard coded to use OpenGL ES 2.0 for webGL, which doesn't give great result to say the least...
     
  5. Deleted User

    Deleted User

    Guest

    @PouletFrit
    That's not Unity's fault, that's the standard's fault. At this point in time, WebGL is at the same level as OpenGL ES 2.0 across most browsers. Sadly, that means that we currently can't support either WebGL or mobile with Alloy. Once OpenGL ES 3.0 is more common and Unity has a solution for their mixed gamma-space problem then we can support them.

    I hope that helps.
     
  6. PouletFrit

    PouletFrit

    Joined:
    May 26, 2014
    Posts:
    14
    @n00body
    Oh I see. Thank you for clarifying this point. This is a really sad day...
     
  7. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @PouletFrit I feel you man. Everything about the Webgl stuff has been disappointing. Slower perf, fewer features, massively larger builds than w. webplayer. Though really, it's all Google's fault.
     
  8. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings Alloy crew.

    We need a good shader for leaves, one that supports the new Unity lighting system that is also cutout and double sided. There doesn't seem to be anything like this in Alloy, though I did notice that the Transmission shader has a double sided option. I am setting up like, maybe 30+ different trees and plants that need a double sided cutout shader right now, and opted at first to just use that Transmission shader. However, it doesn't look quite right (as expected). Is there some other viable option, or a suggestion you guys would have for this need? Thanks!
     
  9. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Tethys In general, we've shied away from doing vegetation shaders (for Unity's terrain system), as it's well know that that system is on the list to be replaced in 5.x, so it would be a poor use of our (very limited) time to build something with such a short shelf life (that's also such a nightmare).

    In general for foliage, using a standard alpha-cutout shader is currently the only super-performant approach available in Unity, so that the deferred behavior is retained (otherwise per-light usage on foliage becomes very expensive). Due to unity not having a transmission RT in their deferred setup, we're limited to fully opaque single-sided surfaces (a double sided surface drawn deferred will have incorrect lighting on one side.
     
    Tethys likes this.
  10. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    @xenius - Ok cool, I actually ended up using your Hair/Base DoubleSided shader for my leaves and just turned off the specularity. So far so good, it might not be perfect but at least the lighting affects it so it looks somewhat normal in the environment and its double sided. :p
     
  11. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Tethys Awesome! Just be aware that the hair/transmission shaders are all forward-only, so you need to be careful with your # of unique lights touching them.
     
  12. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    'Been using Alloy for a few month now and its really great and a lot of fun working with!
    I just have a small thingy on my mind: Is it in any way possible to have multiple detail maps per material?
     
  13. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @FreakForFreedom Hi hi. Glad you've been enjoying it! You can't use two detail map sets, but if you absolutely need to blend more texture data in, you could always use weighted blend with a constant blending of .5, and have 2 full material sets + the detail mapping. Just be aware that that brings you up to using 12 texture samplers, so I wouldn't use anything else on it, and you won't be able to have static gi, dynamic gi, and probe blending enabled on the object all at once.
     
  14. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Just imported the latest version of RedLights but as your shaders need to be used as the built-in shader so does theirs.
    Have you had any collaboration with them? I'd like to use both yours and theirs, but will settle for yours if necessary.
    I've moved all the shaders in my project to Alloy, so not planning on going back.
     
  15. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Changing the size of the Alloy area light has no effect. Enabling and disabling the script has no effect on the falloff either. Am I missing something?

    I am trying to make the edge of a spotlight much more smooth.

    Using Unity 5.1
     
  16. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Elecman The edge of the spotlight is not affected by area light size. The area light approximation only effects the volume that the light is coming from. In the case of a spotlight this does not effect the penumbra at all. You will need to use a different spotlight cookie if you want to soften its edge.
     
    Last edited: Jun 18, 2015
    Elecman likes this.
  17. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    Hey just wanted to stop by and show you guys what I am doing with alloy in my latest project, i am using the car paint shader on the hover racer "Afterfaze-ZX"
     
  18. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    The vertex colour influence slider on the shaders is incredibly useful- Great for prototyping look and feel or just breaking up large surfaces, particularly with a little SMAA to smooth out the seams. The weighted blend shader works especially well with it, as you can have the low res blend map respect what the vertex colour is doing. With a little tile texture that fits neatly within each facet, the natural colour variation would be driven by the mesh data and also blend from clean to dirty, this dome could look pretty cool I think.
     

    Attached Files:

    overthere likes this.
  19. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Would it be possible to add an invert option to the roughness channel in the material packer? That way I can use the specular map for both the specular and the roughness channel. That would save quite a lot of texture space.
     
  20. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Another noob question. I am using Allegorithmic substances. I am exporting the Diffuse, Specular, Normal, Bump, Displacement, Height, Gloss textures.

    In the alloy shader I am using the Diffuse, Normal and Height (On parallax properties).

    Can/Should I be using the other textures to improve the look of the material? (Specular, Bump, Displacement, Gloss) e.g. I guess I should use the specular when I create the Material Map channel packer?

    If so, how do you use these other textures.
     
  21. KC1302

    KC1302

    Joined:
    Jan 11, 2014
    Posts:
    94
    In most cases you only need the following 4 maps, especially if you do alot of environment work.


    -roughness (works like inverted smoothness)
    -albedo (diffuse without directional lighting)
    -ambient occlusion (self explanatory) Not needed for very smooth surfaces.
    -normal map (self explanatory) Not needed for very smooth surfaces.

    -Metallic (I use default black and white for majority of my tiling materials)
    -Specular (I use default gray for majority of my tiling materials)

    You can improve the ''look'' by using detail textures. Get this.
    https://www.assetstore.unity3d.com/en/#!/content/30407
    Alloy detail texture maps.
     

    Attached Files:

    Deleted User and Zaddo67 like this.
  22. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Why is it that a plane created with this script ends up entirely white (with no specular highlights, and textures are ignored)? Using the Alloy core shader.
    http://wiki.unity3d.com/index.php?title=CreatePlane

    Weird thing is, this only happens on Mac.

    Edit: I found the problem. That script doesn't add tangents (will modify the wiki). Still weird this causes the entire shader to fail, and only on a mac. Is this a bug?
     
    Last edited: Jun 21, 2015
  23. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Elecman Nope, not a bug per say. Lit shaders require mesh tangents (as calculating tangents in shader is EXPENSIVE). For this reason, you can't use lit shaders on say... Trail Renderers, or most other procedural geo (unless that geo is of a type where a tangent can be cheaply inferred. It's also the reason why things like Terrain require a custom shader.
     
  24. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    I updated both my SciFi packs Dirt and Wear effects among other changes. Below are some of the update results with Alloy3.

    Win02Closeup.jpg
     

    Attached Files:

    Deleted User and xenius like this.
  25. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Got it. One other question:

    Would it be possible to add an invert option to the roughness channel in the material packer? That way I can use the m./ map for both the specular and the roughness channel. That would save quite a lot of texture space.
     
  26. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Elecman It might save you texture space in the project file (ish), but you're not getting any benefit in a final build size-wise. Also, just using a straight invert isn't the most effective usage of that channel, so isn't something that we'd want to encourage via tool design.
     
  27. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Ok, will try to source a proper roughness map.
     
  28. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    @xenius
    Are there any plans for lit particle shaders?
     
    Last edited: Jun 22, 2015
  29. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @DennG Not at the moment. Lit particles tend to look pretty terrible, and mesh particles tend to perform atrociously from my experience.
     
  30. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
  31. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    to be honest DennG why not just purchase the one you linked to? it's really cheap.. I thought the dev would've charged a lot more. seems he is very generous indeed. I'm off to purchase it now. Thanks for the link.
     
  32. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    I'll probably buy it.
    I just wanted to know since I'm very interested in the further development of alloy.

    I was not trying to offend anyone.
     
  33. TechiTech

    TechiTech

    Joined:
    Dec 13, 2014
    Posts:
    212
    lol I know you wasn't trying to offend :) I'm just curious too..
     
  34. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    I was wondering, now that Unity 5 supports pbr, what would be a reason to use Alloy over the standard unity shader?

    Is there better performance and quality? Or the same quality and better performance?

    I also am curious as to if translucent shaders will eventually work in deferred rendering, as I'd like to have the the benefits of deferred rendering such as better performance with lights and light shadows. :)
     
  35. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Anisoft Alloy's featureset (various out of the box options) greatly exceed the standard shader, we're doing a more complex shading, and have a bunch of custom tools. Watch our crash course video linked a page or two back to get a full picture of what the set comes with.

    Re Translucent deferred: Such a thing is impossible. Translucency denotes something drawing after opaque content, deferred shading is fundamentally about drawing all opaque things at once. They're fundamentally incompatible.
     
    Elecman likes this.
  36. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    Really? Impossible? But looking into the tech of Metal Gear Solid 5 I had read they were able to get translucency and deferred rendering working. I am curious as to how they were able to achieve that.

    Does this system have functionality to allow for rain drop shaders? I had watched the crash coarse a couple of times and was wondering if it supported such a feature. Does this also have support for Shaderforge? How does the writing of our own shaders come into play with Alloy?
     
  37. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Thanks, I was wondering this myself as well.
     
  38. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Anisoft I haven't watched/read the latest stuff relating to the Fox engine, but if they're made translucent+deferred work somehow, its due to some low level engine architecture decision that would likely be impossible to replicate in Unity.
    re: raindrop: We don't have a raindrop shader yet (we'll be doing weather stuff at some point).
    re: shaderforge: No, its a completely independent system. You could extend the Alloy framework to your own purposes, but I won't lie that it would be a fairly advanced-user talk to do so (we've done what we could in structuring the framework to allow it, but it still requires the knowledge to parse an api of this complexity).
     
  39. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    When I import Alloy I get Maximum number (128) of shader keywords exceeded error. I really haven't lots of shader in project. I'm still on first level of my game! is there any way to solve this issue?
     
  40. Deleted User

    Deleted User

    Guest

    @ksam2
    Just a few quick questions:
    1. Unity version?
    2. Alloy version?
    3. Did you try restarting the editor?
     
  41. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    1-Unity 5.1
    2-Alloy last version
    3-yes
     
  42. Deleted User

    Deleted User

    Guest

    @ksam2
    Is this a project that has seen a lot of different shaders? The problem is that materials will hold onto keywords from old shaders. So that might be what's causing your problem.
     
  43. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hey guys! SUPER IMPORTANT: Thanks to @NegativeZero, we've found a horrible bug in the map packer that seems to have been introduced by Unity 5.1 (I didn't notice it due to doing so much solid-color texture work lately). Basically, none of the maps being plugged into the packer are being gamma corrected properly. We will have a hotfix soon.
     
  44. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    BOOM
    Alloy 3.2.1 Hotfix is live on the store!

    How's that for turn-around time eh?
    Version 3.2.1
    =====================
    Scripts:
    - Fixed incorrect gamma correction in Map packer (due to 5.1 F***ery)


    Background on the change: Basically, in Unity 5.1, something about the way that ReadPixels() works seems to have changed (we think). Before 5.1, an implicit color-space state we were relying on occurred, which now seems to be gone. We've combed the release notes since 5.0.3 and can't seem to find any other place this change could have come from.


    Who does this effect: Anyone using Alloy 3.2!! If you're using this, please immediately download and install this update. At the moment, all the data stored in your packed maps that's not pure black or white is wrong (it's too dark). Then (so sorry), search for all files ending in _AlloyPM, and tell them to reimport. This... will suck a bit if you have a big project.

    If you have NOT yet installed Alloy 3.2, you should be unaffected, and can safely jump right to this version none-the-wiser.

    Sorry about this one guys. Totally caught us off guard. We usually comb the release notes for possible changes, and didn't see anything listed that might cause issue, so this totally slipped by. But, as we've all come to understand, the release notes don't seem to contain the low-level changes (even if all of them were known when they occur). Le sigh..
     
    chelnok, Don-Gray and Karearea like this.
  45. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    WAIT S*** S***

    Looks like a secondary bug. Don't import yet. Looks like some extra error checking we adding it spewing on itself. We're working on it. Will test, and post an update asap. I'll post here again when it's all set.
     
    Last edited: Jun 24, 2015
  46. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Is the 3.2.2 Hotfix, currently in the asset store, ok as per the update log? I installed by deleted the old directory and reimporting, seems to be missing the weighted blend shader. The definition CG file is there, but not the SM3 shader itself. If it wasn't ready, mea culpa..
     
  47. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Alloy 3.2.2 Hotfix is live on the store!
    How's that for turn-around time eh?
    Version 3.2.2
    =====================
    Scripts:
    - Fixed all the S*** we broke in 3.2.1 (whoops)
     
    Last edited: Jun 24, 2015
  48. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    CRAP! The unity asset store uploader must have garbled things somehow (maybe from rapid updating?) 3.2.3 in process... (what a day)
     
  49. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    ok... finally.....
    Alloy 3.2.3 Hotfix is live on the store!
    Version 3.2.3
    =====================
    Scripts:
    - Re-uploaded after 3.2.2 had a corrupted package (somehow)

    - god I need a drink...
     
    J_Moller, ksam2, Zaddo67 and 3 others like this.
  50. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hey Guys,

    I Have a question. I need to access the Cutoff property of the "Dissolve" properties via script. I have loaded the sample pack that comes with Alloy, but i did not see any example script for it. Can i have an example please ? Thanks !