Search Unity

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
    @Dashiva
    Are you putting an AlloyAreaLight component on a Unity area light? Because they're only supposed to go on Unity Point, Spot, and Directional lights.
     
  2. Dashiva

    Dashiva

    Joined:
    May 15, 2017
    Posts:
    2
    @n00body

    No, i have no additional Component on the Unity area light. Only the Light + transform component
     
  3. Realms_Imagine

    Realms_Imagine

    Joined:
    Jun 12, 2016
    Posts:
    3
    Hello - I have just begun to get into Alloy and really having fun while really giving a professional edge to the project I'm working on. I've searched for a while both in the packages and online now and I apologize if its obvious, but I'm looking for c# api documentation - the docs on the allow website don't seem to have this or I'm looking in the wrong place. I have an immediate need to change a decal base color image at runtime. Any information is much appreciated. Thanks.

    Update: I figured it out...
    sphereRender.material.SetTexture("_DecalTex", Resources.Load("Images/SphereDecal_AlloyAM") as Texture);
     
    Last edited: Jun 9, 2017
    razzraziel likes this.
  4. yohami

    yohami

    Joined:
    Apr 19, 2009
    Posts:
    124
  5. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    65
    Been messing around with Alloy for a while now. Can alloy do a glow effect? I just want to outline the model with a glow with a given thickness , color(s), and fall off. I've tried a couple of different things but nothing gives me the results I want. Rim emission kinda works but doesn't give a distinct outline. Any suggestions?
     
  6. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    Apologies for the late replies. Between the job search, the long commute from my new place to my old job, and the brutal multi-week project they gave me I've been a little burnt out lately.

    @Dashiva
    Okay, we found the source of the problem, and there will be a fix in the next Alloy point release. For now you can just delete the file you mentioned and it won't hurt anything.

    @Realms_Imagine
    Sorry I didn't get to you soon enough. Glad you found the answer yourself.

    @yohami
    Yes. Alloy outputs a Unity-compatible g-buffer, so SEGI works with it out of the box.

    @kloogens
    That's an area I haven't had time to examine yet. Sorry.
     
  7. Realms_Imagine

    Realms_Imagine

    Joined:
    Jun 12, 2016
    Posts:
    3
    No problem, @n00body. For me it's all about the journey and learned more about the product and look forward to using it in production.
     
  8. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    @n00body
    I just bought amplify shader editor to create unreal like shaders, the question I wanna ask is what is the node for the material packer node I could use for ASE?
    Also what does the alloy injection method do?
    Thanks
     
  9. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    1. Do the following:
      • Use the StandardSpecular lighting model.
      • Sample the packed map and base color, and use their channels for the next few steps.
      • Multiply the specularity channel by 0.08 to get a non-metal specular.
      • Use metallic as a Lerp alpha between the non-metal specular and the base color, and output to Specular in lighting model.
      • Use the metallic as a Lerp alpha between the base color and black, and output to Albedo in the lighting model.
      • Apply a Gamma to Linear node to the AO channel, then output to Occlusion in the lighting model.
      • Do 1-roughness, then output to Smoothness in the lighting model.
    2. The injection headers cause the generated Amplify shader to use Alloy's lighting model so that it can use Alloy area lights, falloff, colored cookies, etc.
     
    Last edited: Jun 16, 2017
  10. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    Hi, I saw on the website that both skin and hair works on Deferred rendering pass, but the Hair only works as forward.
    Am I doing something wrong? I like that anisotropic highlights, I know it can be done because I used the Lux Plus and they have it.

    Talkinga bout anisotropic, is there a way to do Anisotropic in regular shaders for metallic stuff?

    Thank you.
     
  11. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @RenOli
    1. Only our Skin and Eye shaders work in deferred mode. The Hair shader is forward-only. My apologies for the confusion
    2. I've tinkered with anisotropic material shaders in the past, but I ultimately abandoned the effort after they didn't play well with our area light implementation.
     
  12. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Seems fairly illegal.
     
  13. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @RenOli
    It will be corrected this weekend. If you are unhappy, then you are free to request a refund.

    @StaffanEk
    It was a mistake of wording that we will soon correct. Please refrain from making a mountain out of a molehill.
     
  14. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @RenOli: Apologies for the confusion with the website image. I must have spaced when I filled out the text and never updated it. Just to help explain why the hair isn't deferred in Alloy, Anisotropism (both faux and ggx) is fundamentally incompatible with the area light approximation we use.
     
  15. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    Hey man, I understand.
    I've been testing alloy and it is great, definitely going to keep using it.

    Just leaving as a wish list some deferred anisotropic and hair (and maybe some anisotropic skin). For creatures horse fur like that has both skin and fur.

    Ohh maybe some color difference per material on the skin shader, I have a game that I have characters and ghost, and I would like to change the sss on the ghosts.

    But this would just to be perfect. I know it is not simple, but maybe keep these stuff in mind for an Alloy 4.

    Bests
     
  16. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @RenOli
    I didn't get a chance to answer your question on VR and Alloy. You can check out what @xenius is doing with Alloy in our own VR game:
     
    RenOli likes this.
  17. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    393
    First off, great product! I've been using it in a project for the best part of a year now and it's really done wonders for the visuals!

    I'm interested in altering the hair shader (or creating a variation) in which the anisotropic highlight colours are driven by texture maps instead of single colours though, as I have characters with hair dyed in places. Is this particularly difficult to do? I've looked into it myself, but the shaders are more complex and broken up than I'm used to dealing with, and I'm not sure where the tex2D sampler stuff would need to go in.

    Cheers!
     
  18. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    364
    Please ...... make skin shader compatible with unity wrinkle map asset! a realistic skin needs wrinkle and alloy skin is cool but It doesn't work with unity wrinke map solution and that's awful for a skin shader.
     
  19. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    It is looking great, I am bringing to many projects and even starting to test on a PS4 dev kit. However I am on unity 2017, there is no support on that yet.

    It would be really cool if there is some plugin for shader forge and/or Aplify shader editor that could have access these bufferes and we can generate our stuff.
     
  20. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
  21. gamedeveloper512

    gamedeveloper512

    Joined:
    Jun 14, 2013
    Posts:
    16
    Hello, does your solution works in Unity 2017 (I tried it in Unity 2017 b9 and Unity doesn't compiles a couple of your scripts/shader)? If not when you plan to upgrade?
     
  22. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    We don't release new Alloy versions during betas, as we rely upon Unity lighting headers, and they tend to change frequently during betas. We'll have something ready shorty after the first RC most likely.
     
  23. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    I am using on 2017, I just commented the error line and everything worked like in other versions I am also using.
     
  24. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    Alloy 3.6.4 for Unity 5.6 is live on the Asset Store

    Try it out and give us feedback. Thanks.

    Changelog:
    Version 3.6.4
    =====================
    Scripts:
    - Fixed issue where Unity static Area Lights' scene GUIs were not appearing after installing Alloy.
    - Fixed intermittent object reference error for Material Inspector.

    Integration:
    - Added HX Volumetric Lighting integration for most particle shaders.
    * Excludes "Multiply (Double)" and "Alpha Blended Premultiply".
     
    Syberam and punk like this.
  25. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    Alloy 4.1.0 for Unity 2017.1 is live on the Asset Store

    Try it out and give us feedback. Thanks.

    Changelog:
    Version 4.1.0
    =====================
    Shaders:
    - Added Unity 2017.1 support.
    - Fixed "SpeedTree*" shaders to have Unity-recommended instancing limit.
    - Removed LOD_FADE_PERCENTAGE crossfade mode.

    Scripts:
    - Added Unity 2017.1 support.
     
    KRGraphics, elbows and punk like this.
  26. TheMoonwalls

    TheMoonwalls

    Joined:
    Nov 18, 2013
    Posts:
    30
    Hi!
    Just wanted to ask if Alloy works on PS4 and Xbox One?

    Thanks a lot!
     
  27. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @TheMoonwalls
    Last I'd checked, yes. Please note, this is based on feedback from our customers who have devkits.
     
  28. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    437
    Hi, just upgraded to 2017.1 and Alloy 4.1. Everything went fine except for the following error in and out of play mode:

    System.NullReferenceException: Object reference not set to an instance of an object
    at UnityEngine.Experimental.UIElements.VisualContainer.LoadStyleSheetsFromPaths () [0x00074] in C:\buildslave\unity\build\Runtime\UIElements\Managed\VisualContainer.cs:302
    at UnityEditor.GUIView.get_panel () [0x0008b] in C:\buildslave\unity\build\Editor\Mono\GUIView.cs:43
    at UnityEditor.GUIView.get_visualTree () [0x00002] in C:\buildslave\unity\build\Editor\Mono\GUIView.cs:53
    at UnityEditor.HostView.RegisterSelectedPane () [0x00023] in C:\buildslave\unity\build\Editor\Mono\HostView.cs:282
    at UnityEditor.HostView.set_actualView (UnityEditor.EditorWindow value) [0x00026] in C:\buildslave\unity\build\Editor\Mono\HostView.cs:34
    at UnityEditor.EditorWindow.ShowWithMode (ShowMode mode) [0x00038] in C:\buildslave\unity\build\Editor\Mono\EditorWindow.cs:425
    at UnityEditor.EditorWindow.ShowUtility () [0x00003] in C:\buildslave\unity\build\Editor\Mono\EditorWindow.cs:393
    at AlloyRequiredActions..cctor () [0x00075] in D:\Unity\Astra\Assets\Alloy\Scripts\Editor\AlloyRequiredActions.cs:22
    UnityEditor.EditorAssemblies:processInitializeOnLoadAttributes()


    It looks like AlloyRequiredActions line 22 calls window.ShowUtility() method, which is the popup window that comes up whenever Alloy is added to the project, but it never came up. Prior to this, I deleted the old Alloy folder and imported the new package and imported Alloy4_1_0_ShadersAndEditorCore.
    Thanks.

    Edit: Changed my scripting backend to the new .NET 4.6, which caused an editor restart. I briefly saw the required actions window and then it disappeared, and the error is no longer there.
     
    Last edited: Jul 14, 2017
  29. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    397
    Hey,

    I'm trying to find the best visual quality achievable in Unity by a single person without caring about frame-rates ... I'm looking into using the new timeline stuff for short films. So far, the Alloy shader pack has been my absolute favorite. You guys have clearly come a long way since you first came out (I've been around from the beginning, and tech supported with you guys a bit over some issues) and I'm very, very impressed. I haven't poked at this in quite a while and the amount you've added is staggering. Bravo!

    Basically, instead of guessing how to use all of your shaders properly, is there any advice you can give for trying to recreate an Adam level of quality using Megascans + Quixel + Alloy? If this is too vague and I need to just play with this a bunch no problem ... just figured I'd see if there's any advice you guys have before I delve in more.

    I'm planning on trying out the 4-splat terrain shader + Unity terrain ... for grass though, I notice you guys have noted that the Transmission shader can be used. I'm guessing that will give nicer results than the built in unity terrain grass. If there are any other tips I'd love to hear them :).
     
  30. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @Syberam: We cannot. However if you need to composite an arbitrary number of decals for a character (like a character creator would need, or blood splats etc.) you are better off setting up an RGBA render texture and combining them in a buffer, and then feeding that buffer to the single decal slot.

    @DGordon: While shaders did play their role in that demo (especially area lights), Adam looks good primarilly because it has world-class assets, and was color graded/post processed by someone who clearly does it for a living. I've seen a couple shots of the demo without all the post and it's significantly less impressive. There's no short-cut to that look.
     
  31. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    397
    Don't get me wrong. I don't expect to be able to replicate Adam, which was most likely a multi-million dollar effort by an entire team over X amount of time. What I meant was exactly as noted in the first line ... the best visual quality I can achieve as a single person using quality assets from Megascans and so forth. My intent was to ask if there is any advice on how to use Alloy shaders (or anything in general) for the best quality if frame-rate isn't an issue (ie: Terrain shader vs Vertex Shader) etc, considering most Alloy users are probably making games, and I was asking about using Alloy in a different context. I'm assuming not though, so I'll just continue to play with it ... no worries. Was just hopeful there was going to be some bit of wisdom I might glean :).
     
  32. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @DGorgon. Gotcha. Well in most cases, scan data is using a fairly simple shader, as you're relying on the scan data itself to look good. The Vertex 4-blend with roughness source set to basecolor alpha (so you only have 2 textures per splat) is likely a good idea. Blending several scanned materials together with vColor will jelp with repetition. Also using the decal shader with mostly transparent noise can help break up evident repeat on other types of materials.

    Beyond that, the next big thing you can do (which I see done wrong so often) is _consistency. Making sure that across an environment/material type, your luminance and saturation levels are consistent. 'Amateurish' looking stuff in Unity frequently feels that way because there's no consistent surface treatment, colors are all over the place, AND surfaces are overcontrasty. This is even more common from folks using texture packs. Most packs, and substances etc. over-drive their contrast levels so they 'pop' in a material preview, but most real world materials aren't even close to that contrasty in RL. If you clamp (using levels' etc.) the luminance range of the basecolor of many materials, it improves their look (if realism is your goal).

    That's it off the top of my head.
     
    DGordon likes this.
  33. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    397
    Thanks, I appreciate the response :).

    Sorry, I know that question probably came across as "tell me how to make your product look like Adam." I've gone through probably close to a thousand dollars worth of shaders, terrain packages, etc. over the past couple of weeks trying to find what seems to work best. My guess is all of them are great if used properly ... but Alloy immediately stood out as what I'm going to use going forward. I figured rather than potentially waste a whole bunch of time approaching this in the wrong way (ie: terrain or mesh?), I would see if there was any immediate advice you had of "do this or don't do that."
     
  34. R0man

    R0man

    Joined:
    Jul 10, 2011
    Posts:
    61
    I noticed that Deferred Decals Advanced do not work in the latest Alloy version. I use Alloy to draw normal maps as decals for my project, since there are no other shaders on the asset store that are able to pull off deferred decals quite like you do.

    Right now the editor script mangles the UI, and the shader is pink. I believe the other Alloy Mods work just fine.
     
  35. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @R0man:
    To fix it, in the file "Alloy Mods/Shaders/Definition/DeferredDecalAdvanced.cginc", replace line 40 with the following:
    Code (CSharp):
    1. aStandardColorShader(color, s);
    It'll be fixed in the next point release. Sorry about the inconvenience. :(

    @Syberam
    We only add brand new features when it benefits the majority of our users, and justifies using up another keyword for it. Even then, we can't rush it out the door since adding a feature on a large scale tends to create a lot of bugs and requires testing.
     
  36. R0man

    R0man

    Joined:
    Jul 10, 2011
    Posts:
    61
    @n00body

    Thank you very much, but now changing the decal blend fields doesn't work. I'm mostly interested in projecting only normals without color tint.
     
  37. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    @Syberam: Can you explain why you need two explicit separate decal layers? What is being put in these textures?
     
  38. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @R0man
    It looks like I never actually implemented those sliders. Originally I couldn't because doing those effects required per-RT blend modes, which weren't available at the time. Now that they are, I will finally implement them. ;)
     
    punk likes this.
  39. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    @n00body

    I have updated to 2017.1.0f3 + the updated alloy 4.1, however i gotten this error
     
  40. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    Can you go to the CHANGELOG file and confirm that you pulled down Alloy 4.1? If so, did you try a full directory blowout before you updated?
     
  41. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    changelog:
    i deleted the entire alloy folder b4 i updated to 2017.1
     
  42. Realms_Imagine

    Realms_Imagine

    Joined:
    Jun 12, 2016
    Posts:
    3
    I'm looking to do a similar thing for optimal character customization without having to bake them into multiple textures

    Layer 1: scars, eyebrows, beauty marks, 'painted' wrinkles, freckles, age spots shadows under the eye
    Layer 2: Makeup, Tattoos
    ideally a Layer 3 for blood, & dirt - but that could be combined with Layer 2.
     
    Last edited: Jul 28, 2017
  43. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    522
    This should _not_ be done at the shader level @Realms_Imagine
    It's burning per-pixel operations for things that aren't changing. These should be composited into a _single_ texture at runtime. This is what _every_ game that has a character creator with layers of information (ala Fallout 4, etc.) do.
     
  44. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @OP3NGL
    For some reason your Unity isn't pulling down Alloy 4.1. You can see right there in the changelog that it says you pulled down Alloy 3.6.4.
     
  45. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    i deleted the entire folder & redownloaded the package, yep its 4.1 now... Sorry, my bad
     
  46. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    364
    Is there any double side shader for clothes? I need double side material for my clothes.
     
  47. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @Crossway
    The best I can think of is the "Transmission TwoSided" shader.
     
  48. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    381
    @n00body just upgraded to 2017.1f3 and Alloy 4.1
    skin scattering doesn't seem to be working I also tried in a blank project, but it could be my fault - do you notice the same?

    @n00body sorry false alarm! seems to be working fine now
     
    Last edited: Aug 3, 2017
  49. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    94
    Hey hey, a while ago I tested the hair shader and I was able to make it dithering, I am trying it again, and I can't find where the dithering option for the hair is anymore.

    I don't know how I did it last time, now it is just a regular cut out.

    Thanks
     
  50. n00body

    n00body

    Joined:
    Dec 17, 2010
    Posts:
    691
    @RenOli
    I think you are referring to the Hair HighQuality shader. It uses multiple passes including an opaque cutout pass, and translucent passes to smooth out the cutout edges.