Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    @n00body
    Sorry for the multiples here but I have one more question.

    In the Elemental Sword Demo video, it is mentioned that color grading is applied, but not converting the output into sRGB.
    I was under the impression that the unity framebuffer operated in linear space (provided you have the project in linear and HDR). And so, one should, to keep it physically correct, convert the framebuffer to 2.2 gamma after color correction.
    Does the materials in itself contain any sort of gamma corrections, or gamma curves on the textures?
     
  2. Deleted User

    Deleted User

    Guest

    @Kemonono
    You should be asking that question in the Amplify Color product thread, as that is what we used.

    If you have further questions about Alloy then please PM me instead. Thank you.
     
  3. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hello People from the Allow team !

    My game is almost to the "Content Add" step, In other words, i have it at the point where i have one level, all the items, the sounds, ect ... What needs to be done now is add more level ( It is an FPS Tower defense ).

    My question is : Would one of you in the team could do some consulting ? I show you my project and you tell me what i could do to make it look better ( I am using Alloy shaders, uSky, and NeoOCean, with a bunch of screen effects ).
    I am pretty sure that there are some tricks and tips, simple things that i should set up, or materials that i should use differently. So i am looking for an "Expert" advice, for may be an hour or two. ( not sure i can afford more than that ). The game really is simple, and i have may be 3 materials, with a max of 10 Textures. So it really would not be a long overview process.

    You can check the little screenshot of my "prep Scene here", it s showing only the basic environment without all the turrets and units though...

    Thanks in advance !
     

    Attached Files:

  4. Deleted User

    Deleted User

    Guest

    @Feydwin
    PM me, then we can continue this conversation. Thank you.
     
  5. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi Guys,
    After @Feydwin 's inquiry on the thread, I figured it would be worth mentioning that we are available for hire for in-depth consulting on your projects using Alloy (for workflow, aesthetics, technical issues, perf. concerns, custom shaders, etc.) If you're ever in need of such a thing, feel free to pm me here to start the discussion.
     
    KRGraphics and 2dchaos like this.
  6. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I bought Alloy a year ago and haven't looked at it much until now. I pulled the latest version down in Unity 5 and it looks great! It took me a little while to figure out that I needed to re-import the textures for both examples to get them to work properly. I'm considering switching my current project over to Alloy, maybe after I convert to Unity 5. I'm currently using SkyShop, mostly just to get some decent ambient lighting from colorful space skyboxes.

    Had some possibly noobish questions:

    1) Does Alloy work on PS4?
    2) What is the preferred way to use IBL with Alloy? Would I use the Unity 5 skybox stuff or is there a way to integrate with SkyShop (or something else?)
    3) I currently use several LDR space skyboxes (stars and nebula). Will I be limited much by not having HDR skyboxes? If so, is there some way to create HDR skyboxes outside of photography? I'm kind of limited, since I can't exactly go into space for those. :)
     
  7. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Steve Tack Hi Hi!

    1. We thought it did, but it looks like we have to do some deeper investigations here. PSSL seems stricter than I was aware of.
    2. Preferred IBL is now to use the Unity stock skybox/reflection probe stuff
    3. You can still use LDR skyboxes. They're just not going to create blinding hot-points (which is fine. Its space, the light is super distant actually). As for making things yourself in HDR, there's a problem called HDRShop I know some folks use. You could also always set up a unity scene, make an actual star-field out of emissive spheres of various colors and intensities, then capture a manual custom reflection probe for it. I do such things all the time!
     
    KRGraphics likes this.
  8. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    So do you predict that you'll be able to get Alloy to work on PS4 at some point? Sounds like it's at least something you're looking into.

    I like that answer. The reflection probes in Unity 5 seem solid. I've run into flakiness with the Skybox equivalent ("trigger volumes" or whatever they call them).

    Ah, that's a good idea with the starfield thing, though I'm guessing I'll be OK with LDR skyboxes. The only truly bright objects in the scenes are the local sun(s), so I could play around with putting high emissive values on spheres along with bloom (I do have SE Natural Bloom, so that could be a good fit). Right now, I'm using lens flares to give the idea of a bright sun, but that does seem a bit dated.

    Thanks for the reply!
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm 100% sure it will work on PS4 since I use Alloy and I have PS4 dev kits, so I'll be able to help don't worry Steve :)
     
    Steve-Tack, Deleted User and xenius like this.
  10. Deleted User

    Deleted User

    Guest

    @Steve Tack
    PS4 support is on the way, and merely requires some testing and code cleanup. We've already confirmed that it works on the Xbox One. At this point it is mostly going through and making sure we use the headers and guidelines that Unity provides for hiding platform differences.
     
    Steve-Tack likes this.
  11. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Awesome-awesome-awesome. I haven't ordered a dev kit yet (might as well finish the game first...), but it's so great to know that Alloy is an option. I just tried one of my assets with my various skyboxes in a test project and I really like what I see. Thanks!!!
     
  12. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    That is great to hear! I'm not in the Xbox One developer thing, but I'd love to push to that platform at some point too if I get the opportunity.
     
  13. grimmgames

    grimmgames

    Joined:
    Jan 11, 2011
    Posts:
    50
    I am currently using Heathen Engineering's Occluded Render shaders and was wondering if there was a way either integrate their solution with Alloy, or if there is a way to produce this effect with Alloy alone.
     
  14. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    Hi,

    So I'm trying out Alloy for the first time (on OSX with Unity 5) and all the sample scenes have graphical glitches with a flood of GLSL errors to the console. Anyone have a pointer for me on what could be going wrong here? Screenshot attached below.

    Thanks,

     
  15. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @DarkArts Studios And All OSX Users: The glitching you're seeing there is due to an issue with a difference between GLSL and CG/HLSL. We have a hotfix and It'll be available tomorrow. Super apologies for the inconvenience! I'll post here the moment the update can be pulled down from the store.
     
  16. DarkArts-Studios

    DarkArts-Studios

    Joined:
    May 2, 2013
    Posts:
    389
    Thanks @xenius very happy this will be corrected. Bought a few new assets recently and all of them having OSX issues so I was feeling rather bleak. Good to know at least one will be working soon.
     
    xenius likes this.
  17. Deleted User

    Deleted User

    Guest

    @grimmgames
    By default, no. However Alloy can easily be modified to support this effect, as Camouflaj did with Republique Remastered.
     
  18. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Out of curiosity, hows it done?
     
  19. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hey Guys.

    Alloy 3.1.1 is on the store
    Version 3.1.1 Release Notes
    =====================
    Shaders:
    - Added a new "Combined" tessellation mode that combines Phong and Displacement.
    - Fixed the GI code that caused weird noisy glitching artifacts on some MacOSX platforms.
    - Fixed the Parallax code that was causing it to fail to compile on the PS4.
    - Fixed the Detail feature code that caused it to fail to compile on some MacOSX platforms.
    - Fixed the Substance Designer preview shaders' code that caused them to fail to compile on AMD GPUs.


    We've fixed all the things we've been able to find thus far that might cause issue on OSX/PS4. Note that this may still be an ongoing process as we don't have a PS4 devkit of our own, and the OSX machine we have (running yosemite with an nvidia mobile gpu) isn't exhibiting any of the bugs other's are experiencing, so repro-ing these issues has been difficult.

    I want to thank you all for your patience through this process, and though I'm sure it's been an inconvenience to you, I hope we're demonstrating to you guys our commitment to hammer out these issues as rapidly as possible so you can get back to shiny-alloy-pbr-funtimes. :)

    Remember, if you have any sort of buggy behavior, always do a Alloy-directory blowout, then clean install first to confirm that the issue persists. If it does, shoot @n00body and/or me a PM on the forum here.

    Cheers
     
    mkgm, Don-Gray and blueivy like this.
  20. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey guys,

    Whats the status on some skin / other-stuff tutorials? I know you guys said you were a bit busy a while back but that they were coming. I'm getting great results already, but I'm fairly certain a tutorial or two on how to properly use things would still be a huge benefit.

    Thanks!
     
  21. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi @DGordon
    KC will be doing a skin tutorial once he has both of his characters finished. As for other topics, I'm going to do a ramble-ee broad overview video very soon (have been slammed with contract work recently). As a quick q for you, other than character stuff, are there specific parts of the set that you'd like to see highlighted in tut/theory videos?
     
    John-G, KRGraphics and ThunderTruck like this.
  22. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Anything that shows you guys working through creating textures for the different shader params would be great. I don't have anything specific in mind besides the character stuff now because I haven't messed with most of it, but it will all end up coming in useful to take the guesswork out of what everything does and how to use it properly.

    Thanks!
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hello @DGordon

    I will be doing an in depth tutorial on the character based shaders of Alloy, along with the creation of textures, explaining the do's and don'ts of the skin, eyes, and hair shaders. It's coming. Like @xenius and @n00body, I am doing other work on top of this, including the tutorial for this. It is more of a production tutorial in video form, so you can see everything I am doing.
     
  24. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    That's great :). No rush on my part ... just excited.
     
  25. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I am as well. It's a lot of work and fun
     
  26. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I would like a simple tutorial on how to use Alloy shaders with Substance Painter :( (Alloy Site documentation is empty about that).
    I dezipped the substance Painter files, but i don't know where to put them and how to tell Substance Painter to use them ?
     
  27. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    So I recently converted my project to Unity 5 and switched from SkyShop shaders to Alloy + Unity IBL. It went well, but there's one feature I miss from SkyShop. With that you could boost the ambient lighting quite a bit. I used that in my space game to make sure that objects would be visible from their dark sides. It's not realistic, but I'd like ships and things to be more visible than the realistic approach.

    I don't suppose there's a way in Alloy to boost the ambient light from the skybox?

    I've got the Ambient Intensity set to the max in the Unity light settings in each scene, but I want more. I'm guessing the real solution would be to make alternative HDR skyboxes to use for ambient lighting that are brighter than the ones visible in the scene, but I don't know how to brighten/convert my LDR skyboxes like that.

    @xenius suggested checking out HDRShop, but that's $200 and I don't even know if it can do that.

    EDIT: OK, I'm dumb. It never even occurred to me to look at the file type that Unity generates for reflection probes. They're EXR files, which Photoshop can read and write. So I think I can generate an HDR probe from my scene, then just boost the exposure in Photoshop.

    EDIT #2: OK, that works, you CAN boost the exposure of EXR files in Photoshop and Unity appears to be happy with the output. However, while you can override the Reflection Source with a custom cubemap, you can't override the Ambient Source. So my original question stands.
     
    Last edited: May 13, 2015
    chelnok likes this.
  28. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Steve Tack Question for you: what happens when you just boost the exposure in the skybox material's properties?
     
  29. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    @xenius I almost did an EDIT #3 a minute later when I saw there was a simple exposure setting right on the skybox materials. So yeah, good question. Even going from 1 to 2 on the exposure has a dramatic effect, even with an LDR skybox, so that's cool. I could see going even higher in some scenes.

    It washes out the visible skybox though. It so happens that I recently added color grading with a good amount of contrast boost, which does make up for it some, but it's probably not the look I want. I guess ideally there'd be a way to amp up the received IBL values independent of the visible skybox.

    I could go back to a geometry-based skybox I suppose. That way I could separate the two things.
     
  30. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Steve Tack. Goootcha. In general, I tend to be against adding in overrides that diverge so tremendously from the energy conserving PBR model (at least with such core inputs as ambient/IBL).

    Its preposterous that the slider for ambient light intensity is clamped at 1.0 though. Weird question, have you tried setting RenderSettings.ambientIntensity to a value higher than 1.0? A lot of the clamping in Unity occurs purely in-editor and can be circumvented by script calls. Worth trying.
    http://docs.unity3d.com/ScriptReference/RenderSettings-ambientIntensity.html
     
  31. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    @xenius Oh wow, that totally works! It never would have occurred to me that it was the UI that was the limitation.

    Thank you! I know this wasn't really Alloy-related as it turns out, so thanks for the help. That is the perfect solution.
     
    xenius likes this.
  32. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    What's strange is that setting RenderSettings.reflectionIntensity seems to have no effect. Metallic objects are still a bit dark, but at least the Reflection Source can be overridden with a custom cubemap.
     
    xenius likes this.
  33. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi guys! I'm happy to present to you, at long last, the
    Alloy 3 Crash Course Video

    Video Table of Contents

    Alloy Framework Overviews
    0:03 Intro
    0:38 Setup/Upgrade Guide
    5:40 Playing around Intro
    6:15 Alloy Shader Inspector
    11:01 Alloy Packed Maps
    18:28 Lighting with Alloy

    Property Group Overviews
    23:38 Property Groups Intro
    24:32 Parallax Properties
    27:15 AO2 Properties
    28:12 Detail Properties
    33:06 TeamColor Properties
    35:52 Decal Properties
    37:42 Emission Properties
    41:00 Rim Emission Properties
    42:34 Dissolve Properties

    Alloy Shader Types Overviews
    45:48 Shader Types Intro
    46:10 Prototyping Shader
    46:54 CarPaint Shader
    50:54 Directional Blend Shaders
    55:52 Glass Shaders
    1:00:18 Oriented Blend Shaders
    1:05:52 Transmission Shaders
    1:11:50 Weighted Blend Shader
    1:16:21 Vertex Blend 4Splat Shader
    1:17:32 Character Shaders
    1:24:18 Unlit & Particle Shaders

    1:28:00 Setting Up Post FX for Alloy


    Enjoy!
     
    chelnok, DennG, Ghosthowl and 8 others like this.
  34. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Stupid Question: Will alloy work on mobile. I did read the top post. I think.

    Doh...

    "We're not explicitly supporting mobile at this time. We're waiting for OpenGL ES 3.0 and Metal hardware to become more commonplace, and for Unity to figure out how to support linear-space on mobile. Currently a lot of mobile devices won't let you switch from gamma to linear and vice versa at runtime, and Unity still needs gamma for their UI even when in Linear mode for everything else."

    Aight. never mind...
     
  35. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Heya,

    Way back I had asked if this is working with RTP and you guys said no ... any idea if thats changed with Alloy 3.0 and Unity 5?
     
  36. Deleted User

    Deleted User

    Guest

    @DGordon
    The answer is "it's complicated". In forward mode, it's still "no". In deferred mode, we use the same gbuffer layout as Unity. So as long as the RTP shaders output the same gbuffer layout then our deferred override shader will read it.

    Does that make sense?
     
  37. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Thanks :).
     
  38. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    On your webpage it says that:
    I wasted a couple of hours looking for the example script in the Alloy package or the video to no avail. Could you write here what the more complex function call is?
     
  39. Deleted User

    Deleted User

    Guest

    @StaffanEk
    We provide a static class called AlloyUtils that contains a method for calculating the HDR intensity using our curve. If you have the values from the shader properties, you can use it like so:
    Code (CSharp):
    1. hdrColor = color * weight * AlloyUtils.IntensityGain(gain);
     
  40. Deleted User

    Deleted User

    Guest

    @zenGarden
    My memory is a bit fuzzy, but I believe it goes like this:
    1. On Windows, go to your "Documents" directory and find the "Substance Painter" folder.
    2. Go to "Substance Painter/shelf/shaders/"
    3. Drop the Alloy preview shader files in there.
    4. Then in your project, you will be able to find it among the other shader options in your shelf.

    Hope that helps.
     
    zenGarden likes this.
  41. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    New Alloy user here, confirming it works great with RTPv3 in the Deferred path with override shader.
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'll cover that too
     
    John-G likes this.
  43. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Could you point me to the example that you advertized on your webpage. If there is no example. Please write "We will include an example in the future" instead.

    This is how to change emission with Unity standard shaders:

    Code (CSharp):
    1. material.SetColor ("_EmissionColor", customColor);
    How would I need to do it with Alloy?
     
  44. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi @StaffanEk

    How you change the emission color in practice depends a little bit on how to you want to specify it.

    Let's first look at the list of emission related shader params:
    EmissionText.png

    Anytime you see a parameter that ends with UI, this means that in editor mode, this value is used to feed some final data into the shader, but when changing things via script, setting it to something else will NOT automatically change anything in shader. This is to keep unneeded calculations out of the shader code for efficiency reasons.

    So in the case of emission, what's happening here is:
    _EmissionColor = _EmissionTintUI * _EmissionWeightUI * AlloyUtils.IntensityGain(_EmissionGainUI)

    So lets say, you by script want to change JUST the color of your emission, but keep the intensity as you have it setup in the editor. You would go

    float currentGain = material.GetFloat("_EmissionGainUI");
    float currentWeight = material.GetFloat("_EmissionWeightUI");
    Color newColor = WhateverYouWant;

    material.SetColor("_EmissionColor", newColor * currentWeight * AlloyUtils.IntensityGain(currentGain));

    What if you want to change the intensity but not change the tint?

    float newGain = whatever you want between 0 and 1
    float currentWeight = material.GetFloat("_EmissionWeightUI"); (or something manually specified between 0,1)
    Color currentColor = material.GetColor("_EmissionTintUI");

    material.SetColor("_EmissionColor", currentColor* currentWeight * AlloyUtils.IntensityGain(newGain));

    This setup works the same for Rim Emission, and Dissolve's emission effects. If you ever need to see what the parameter names are, just click this button on your material, and hit select shader. You will then see a list of param names in the inspector.

    SelectShader.png
    Cheers!
     
  45. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Thank you very much.
     
    xenius likes this.
  46. ThunderTruck

    ThunderTruck

    Joined:
    Sep 25, 2013
    Posts:
    61
    Hi, I have notice that in Unity 5.1.0f1 RC there is the following error:

    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)


    and the lights property aren't displayed...

    Alloy shaders 3.1.1
     
  47. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    The current release version of Alloy DOES NOT work in the 5.1 beta. There are a bunch of breaking changes.

    When Alloy 3.2 is released (soon) it will be Unity 5.1 and up ONLY. This is to accomodate:
    - Light inspector changes they made
    - The new HDR color picker (we will be dropping our intensity gain system)
     
    ThunderTruck likes this.
  48. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    First, great job on the video. It answered a lot of questions, especially with the non-core shaders.

    I've got a weirdly specific question. With the zillions of permutations of the Alloy shaders, is there anything that would help me get a glass canopy "scratches" effect? Something like this:
    http://www.google.com/imgres?imgurl...aVfaxFceyogT_nIGICg&tbm=isch&ved=0CD0QMygWMBY

    Or anything else that subtly implies that there's glass between the pilot and the vacuum of space (yes, it's a space game).

    I've played with the glass shader and the transmission shader, and the transmission shader in particular looks promising. I think my problem is that my glass canopy is fully modeled with polygons facing both directions, so it's picking up a lot of specular from the inside. But before I mess with it any more (it's by no means required in my game), I thought I'd see if you guys had any thoughts.

    On an even less Alloy-relevant side note, I suppose if the interior of the glass was a separate mesh, some SSR could be applied to catch interior reflections? I don't really know what I'm talking about. :D I've seen the interior reflection thing on windshields in games like Forza 5.
     
  49. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Steve Tack I've actually fought with such a thing myself (space game cockpits), and I haven't ever found a solution I really loved. The issues are such:

    1. A transparent object doesn't receive shadows, so if your glass shield would be logically blocked from say.. the sun, it'll still show.

    2. That scratches optical effect in the upper right image is caused in RL by a fairly complex phenomena, where light bouncing inside the glass is then bouncing back towards the eye, essentially like light going through multiple prisms. I've never been able to get that to look right through fakery in a way that wasn't aliased as S***. (I imagine one could if one rendered a 2-8x supersampled buffer of it, then downsampled to smooth it out). At 1080p, there's just not enough pixels for a pixel shader to get that sort of result.

    This is also why the.. lens dirt/scratches post effect usually works by having an already smooth, nicely rendered/photographed image of glass inperfections, then just attenuates the visibility of it using bloom intensity. This is also why moving the camera around with such a effect enabled kinda breaks its illusion.

    Sorry I don't have a better answer/direction to fire you at for this. I will keep thinking on it however.
     
  50. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Steve Tack
    Update for you, I just tried a crazy experiment and got something fairly cool. This is a camera view through a plane with its normals pushed backwards, and a REALLY intense scratches normal map. The downside is that light on the 'front' side of the plane now no longer effects it.

    Sooooo what this is telling me is that this effect would really only be holistically possible with a custom shader that took a forward and rear pass, and merged them together, probably some other trickery would be needed on top of it.

    GlassScratches.png
     
    KRGraphics and Karearea like this.