Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    The glass shader seems buggy, or i am doing something wrong. I have some cars in my scene with extra material for the windows. If i use unity standard shader or alloy core for the glass all seems fine. If i use alloy glass high or low quality shader my camera (UFPS) stutters and stops working.
     
  2. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @unicat: Is there a spike in the profiler? Also, does this occur with both the glass high-quality and glass-low quality shaders?
     
  3. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Yes, there is a spike after starting the game and yes, both high and low Quality.
     
  4. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @unicat: May i ask what type of GPU you're running on. Also, us UFPS doing any sort of render-to-texture compositing? Generally unity grab-pass based effects (like those used in the glass shader) don't play well with multi-camera compositing, as the grab-pass means the frame is being redrawn x(grabpass#)*y(camerapasses) times.

    For this reason, its also best to avoid using them in VR
     
  5. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    I`m running a Geforce 670. But no problem, i am using another shader. Maybe the problem is with UFPS. If i use the normal Unity fps Controller there is no problem.
     
  6. BabyDinoHerd

    BabyDinoHerd

    Joined:
    Mar 27, 2014
    Posts:
    21
    I'm also having the same issue ... but really looking forward to trying out the new update!
     
  7. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Anglerteam Games : Do you have a repro project you can send me (just 1/2 assets + alloy) showing the problem. I've been using enlighten quite extensively and haven't had any issues with shaders not absorbing reflecting light.

    Do you have continuous baking on/made sure that the scene actually regenerated the ambient from the skybox?

    PM me a dropbox link to a repro project zip when you get a chance and I'll take a quick look.
     
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Is your ambient color set to skybox? Also do you have a reflection probe in your scene?
     
  9. BabyDinoHerd

    BabyDinoHerd

    Joined:
    Mar 27, 2014
    Posts:
    21
    My fault - the issue was that I'd messed up my substances so the AO in the packed map was black. Fixed now, everything's working as expected.

    Two more questions have come up, though:

    1. In Substance Designer 5, loading either alloy.glslfx or alloy_packed.glslfx shaders causes an error popup saying only "Unknown error".
    2. Is there any provision like Wang Tiles to break up large-scale patterns?
      1. I'm using a combination of Alloy, Substance, and ProBuilder, so there's options in all three places to try to help this.
      2. If I'm going for a panelled look then I could lay out the UVs myself and just combine the different panel types into one material, or use separate meshes & materials.
      3. If I'm not, would the Terrain shader be suitable for this?
    Thanks for the help!
     
  10. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Anglerteam Games Heheh waaang.. (im 4 years old)... anyway:

    1. We've had a couple intermittent reports of this, but been unable to confirm. It seems to be erroring on a random 1-in-50 computers or so. Can you plz PM me your _full_ hardware specs, OS, etc. so I can ping allegorithmic about this?

    2. In general, large-scale repeat is best broken up using the weighted blend shader. Basically you have the Main Material, and a 2nd Material (with different UV repeats). Have the weighted blend mask use its own repeats. So you end up having 3 repeating elements total operating at different frequencies. If you need some further sub-variation that effects the main material, you can also add detail mapping with a mask.
     
  11. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @ShadowK We don't have any plans currently for per-layer POM, or further terrain enhancements atm because:
    - POM would require going multipass and as such losing deferred (due to texture sampler limits)
    - POM on 50% of the screen at a sample-count high enough that you don't get view-angle artifacts is crazy expensive
    - The unity terrain system is garbage, and they're already said they're working on a replacement. Putting a ton of effort into something that will be replaced in 5.x is likely a bad resource/time allotment for us atm.
     
  12. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hey guys,

    Alloy 3.0.1 Update is Live
    Shaders:
    - Added support for tinting the base color with vertex colors.
    - Added a Mode dropdown to the Team Color feature to support explicitly turning off the alpha mask.
    - Modified the Weighted Blend shader to control the influence of the vertex alpha on the weight.
    - Modified the vertex lighting fallback to use Alloy's attenuation function.
    - Modified the config header options.
    - Fixed a compilation issue with the terrain shaders.
    - Fixed a bug in the AlloyVertex() callback where it wouldn't properly handle vertex position modification.

    Tools:
    - Fixed a potential bug on the AreaLight component where it wouldn't let you change the light intensity or color if the light was disabled.

    Features:
    - Modified the Decal feature:
    * Added a Weight property to allow smoothly turning decals on and off from scripts without modifying the tint color.
    * Added a property for controlling how much the vertex color alpha weights the Decals.

    Integration:
    - Substance Painter
    * Updated the preview shader to support SP1.3.
    * Added Alpha translucency and cutout variants of the preview shader.

    Vcolors.png
     
  13. Deleted User

    Deleted User

    Guest

    Well there's plenty of ways to skin a cat, relaxed cone map stepping using parallax information etc. But on the whole I agree with you and it might not be worth your time.

    I'm going to get alloy for other things, thought it might be worth a mention.
     
  14. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    This looks and works great, and it is far easier to use than Alloy 2 in Unity 4. It was a great job to begin with in v1 anyway :)
     
  15. jimhug

    jimhug

    Joined:
    Nov 14, 2014
    Posts:
    7
    I recently tried using the Alloy 5 Skin and Hair shaders with Daz Studio's Genesis 2 Female character.

    I was pretty happy with how the skin turned out on this model and wanted to thank the alloy developer's for an excellent shader. Almost all of the work was time spent in substance designer "porting" the materials from daz studio to alloy's formats. This porting took a surprisingly large amount of time but that could be due to the fact that I'm a programmer rather than an artist.

    All of the images are rendered in ~1msec in Unity 5.

    SmileDay.JPG


    I also did a scene in the "dark" using the skybox and candle from the alloy lootbox demo to see how the character would look under very different lighting. I'm not quite as happy with how well this one turned out, but am still pretty impressed with how well the same shader holds up to widely different lighting.
    SmileCandle.JPG
    The darker image helps point out the two weakest parts that I notice in these images.

    First, the shadows cast by the hair are too sharp even after I've reduced the shadow strength (to about .6) from the candle light. I think this has to do with the transparency on the hair not having enough of an impact on the shadows. In general, the hair lacks softness that it should have due to using a cut-out shader rather than alpha blending. I have some OIT transparency code I wrote for some past hair experiments that I think I'll try out to see if it improves things here.

    The second issue for me is the eyes particularly in this dark image. I'm not using Alloy's eye shader because it didn't map very well onto the UVs and geometry in my model's eyes. I'll need to do more work before I can say more about the eyes.

    Any suggestions on improving the quality of the skin or the overall image would be appreciated.
     
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    On the eyes, you have to model a high res version with a concave iris with a soft edge, and then model the low res with a sphere. I'll be doing a tutorial on setting up eyes.

    Also the skin in both shots look too dry. Make sure you use .35 as a specular and .7 for roughness (as a baseline). Also lower the diffuse tint a bit, especially on the teeth.

    For hair, you can try using the translucent hair shader and see if that changes anything. For the albedo, try not to have black showing and make sure you have Ao and a noise map
     
  17. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Thought I'd post something here that I've been working on personally. I'm working on a game called Rollgue, in which I've been planning to add a full RPG item system (ala Diablo). Items here will be represented as POM'd reliefs on 'stickers' of the side of the D6 (6 sides, 6 inventory slots, etc.)

    The challenge obviously is.. how does 1 person efficiently generate high fidelity content for 1000s of items, in a way thats interesting. I decided to build a bespoke Substance Designer mega-graph that takes in a light amount of bake data (mask, normal, height) and outputs a full stack of textures for Alloy Core using Teamcolor (eventually some fx stuff to).

    I wanted to share this in part to show that you can use SD to output alloy-specific maps that go beyond the Core 3, and to show how the whole workflow can be incredible for generating a TON of content, when you're a lone artist.

    Itworks.png

    The graph in SD5 is massive, and has a number of equally massive sub-graphs. Here's the top-level parent:

    IconCompositor.png
     
    reaper7, Deleted User and KRGraphics like this.
  18. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467

    This is quite awesome Anton... I wonder if I could do this for creation of damage textures using substances. You have done a great job with this
     
  19. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi everyone. IMPORTANT ANNOUNCEMENT TIME

    For Alloy 3.0.2, we're thinking of pushing two feature changes, one minor, one major. I wanted to post it here before we do so, so you guys know they're coming, and have a chance to comment.

    1. We're changing the way teamcolor functions. Basically the old behavior blends based on a normalized combination of the 3/4 teamcolor channels. Basically every pixel has to be tinted by one of the 4 input colors.

    The new behavior allows for having un-tinted regions (simply leaving them black on all 4 channels). This should affect aaaalmost no-one, but if you're currently relying on the auto-normalization, the behavior will change (though you will be able to toggle back to it in a config file).

    2. We're going to change the IBL BRDF to a slightly more accurate one (which should help calm down the Fresnel intensity down to sanity.) Basically our old IBL BRDF was from the folks who did Remember Me, and was quite hacky. This new ibl fresnel function is by Treyarch (Black ops 2) and we feel its a much better behavior, especially for naturalistic objects in the lower 25% of the roughness range.

    IBLBRDF.png

    If you don't like any of these changes, just so you know, they will be togglable via flags in the config file (simple swap 0 for 1, reimport SM3/SM5 folders), so you can always go back if you wish.

    Cheers :)
     
    KRGraphics and Deleted User like this.
  20. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    xenius and Cynicat like this.
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I am definitely love the new BRDF... at times the fresnel is too crazy at times.
     
  22. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    I do have a question.
    How does emission properties work? I Global Illumination to Realtime with my parameters in hope it would give some light tint to objects around, but it doesn't work that way. Is it different?
     
  23. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @TanselAltinel: Do you have GI on, all objects set to static, and the emission gain turned up a bit?

    Emission.png
     
  24. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    EDIT: Okay, forgot all the steps thought the shaders were scene files not packages to import. My bad, due to frustration.

    Seems some strange goings on with Unity lately, relating to third party packages being imported into projects (even an empty one), the one that I am trying to under strand now is the Alloy package.
    When importing Alloy into an empty project, I get no search results when following this line in the read me file.

    "3. Next, go to the "Project" inspector and use the search box to search for "_Alloy" assets."

    Also there is no Alloy deferred shader in the project or an Alloy reference in the shader type list.
    No idea why, even though I've downloaded and imported the 3.0.1 package from the Asset Store multiple times,
    why I am not getting all the files.


     
    Last edited: Mar 25, 2015
  25. Deleted User

    Deleted User

    Guest

    @Don Gray
    You need to import the sub-packages in the Alloy/Packages folder.
     
  26. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Yep, forgot that step, thanks.
    Well, kept reading it "import" but forgot I had to import from inside of the Unity project, not outside.
     
  27. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    EDIT: Apparently, this is a bug in another package creating this (somehow).


    Getting this compile error:
     
    Last edited: Mar 25, 2015
  28. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    Nope, what I especially need a dynamic object with emission set to real time to cast real time GI on another dynamic object. Since I'm at work I cannot post a screen, but I'll try to provide one.
    I set some computer screens to emissive for baked GI, and they cast a very nice GI around, much like how it would be with a single monitor at night, enlighting keyboard.
    As an example, I want a gun with emission on one side to cast GI on characters hands. In my example, it is a phone with bright screen. Since Unity cannot handle real time area lights and point lights don't cut it, my only option is to have an emissive surface. I'm not sure if I expect something a shader does not provide though.
     
  29. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @TanselAltinel You cannot have a dynamic object cast GI illumination with Enlighten. Only static objects can. This is by design, and not something that a shader can overcome.
     
  30. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    @xenius
    Wow, it all makes sense now. Sorry, I was over my head expecting some wizardry. I found another way to imitate both GI and emission at a low performance cost. Still, Alloy is doing its magic.
     
    xenius likes this.
  31. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Haaai everyone,

    Just wanted to make a quick announcement. I just got another one of our helper/starter/utility texture packs up onto the Asset Store, built especially for use with Alloy: https://www.assetstore.unity3d.com/en/#!/content/30407



    It's a Detail Texture Megapack, which started initially as a directory I had assembled for my own work, which I then filled out a touch more to put up onto the store. Basically, its 12 categories of common normal+occlusion+color(sometimes) combos that I found myself using over and over again to give my models extra micro-texture. You might notice in the Alloy Loot Demo scene that there's Detail Mapping enabled on.. just about everything. Its probably the most common property group that I add to materials, especially anything with a roughness of ~0.7-0.0, as the extra faux-topological information generates more complex specular behavior across a surface.

    Also, to save you some time, the pack already has the occlusion+roughness-variance-from-normal _AlloyDMs packed up, so you should be able to drop them, and a normal map right onto an object to see a result. This pack was actually used extensively throughout Republique Remastered (i passed them a copy before I finished packing it up for the store). If you're trying to generate a lot of great looking scenes quickly, and don't have a ton of time for per-mesh detail, or want to use smaller main textures, detail mapping is a great 'cheat', that can be applied liberally quite fast.

    Enjoy!
    -Anton
     
  32. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    Can you give us an update on the status of the documentation for 3.0? I'm a fairly new user trying to implement Alloy 3 using the very sparse docs for 3.0 on the site and the 2.0 PDF and finding a lot of gaps.
     
  33. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi @Axelieus Sorry about the sad state of the docs. It got pushed to the side due to GDC/Post-GDC stuff. It's my mission this week to start aggressively filling things in finally.

    Anything I can quickly answer for ya right now so you're not held up?
     
  34. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    Most of my frustration at the moment is with baking and emissive maps. So there's really 2 questions.

    When adding an emission element to a material, I get the color map and what purpose it serves, but I'm not real clear on the effect one. Is it like an emissive mask or detail?

    Also, what effect does the GI setting have?
    When I leave the GI setting to real time, things look like I expect them to, but if I set it to baked, it's almost like the emissive components are ignored completely.

    All of my objects are marked as static.



    Keep in mind I'm new to PBR and IBL so I'm learning that as I go as well.

    Thanks for the quick response!
     
  35. xenius

    xenius

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

    Basically both the color/effect maps are both RGB inputs (though you can of course use a BW mask in them). The core idea is to give you the flexibility to do masked emission however you need. If you open up the Loot demo scene included with alloy, you can see an example of it being used on the potion contents, where a mask is used to control where a scrolling map(caustic) appears. This essentially allows you to scroll/animate/etc. emission on the UV plane, while still controlling where it shows up.

    Re: GI settings, the setting you pick determines which type of enlighten GI that effects. If you're finding it goes away when you set it to baked, you probably have dynamic GI enabled vs. baked?

    Truthfully all of the enlighten stuff is a touch counter-intuitive, and I haven't yet played around with the static lightmapping stuff much due to its unfinished state and long compute times. Will be doing a video on it once I'm sure what the 'best practice' for i is (assuming there is one).
     
  36. Axelieus

    Axelieus

    Joined:
    Nov 11, 2013
    Posts:
    11
    Thanks for the info! I will look at the demo again and see how things are configured there. If I still have questions, I'll post again. I really appreciate the quick responses!!
     
    KRGraphics likes this.
  37. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Axelieus My pleasure! The Alloy set has soooooo many different options, pretty much all of which I'm so used to using at this point, that its quite hard to tell what reads intuitively or not to a new users. Hopefully the vids I have planned for April will help things :)
     
    KRGraphics likes this.
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey guys...

    Just stopping by to show some more Alloy in action, this time hair (which is most difficult f**king thing in game development next to skin and eyes). I will be going over the design and process of creating the hairs for Alloy and things to avoid:

    Screenshot 2015-04-01 19.46.54.png Screenshot 2015-04-01 19.46.35.png

    Screenshot 2015-04-01 19.31.32.png
     
    artzfx and xenius like this.
  39. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Just finished the video clip for my PBR SciFi Panel Vol2 pack using Alloy 3.

     
    xenius likes this.
  40. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Lookin great @artzfx ! Now that you have a these packs set, I think it would be great to see how sections of them look used for the little simple kit-building (even if you don't distro it). Like.. have a wall that isnt dead-straight, but with a few angles. Maybe make a couple air ducts/pipes from the substances, etc. I think it would be useful to see the way the lighting brings out some of your wonderful texture data when its on a more complex topology.
     
  41. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Remember those are coming in vol3 ;). Pipes, stairs, ramps, handrails, reactors, roof supports, plus panels to connect to.
     
    xenius likes this.
  42. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Hello !

    For some reasons, i can't access the documentation on the website. http://alloy.rustltd.com/documentation gives my just a blankpage.

    In any events : I would like to change the weight of the emission property tab via script, Would you have the command that allow me to do that ?
     
  43. wrstscrnnm6

    wrstscrnnm6

    Joined:
    Jan 31, 2011
    Posts:
    20
    Sorry about that @Feydwin a database update screwed things up. We should have the Alloy site up in a few.
     
  44. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Feydwin We're performing a bunch of in-editor math to assemble a final HDR color for the emission tint, so you can't just change the weight via script. If you want to modify anything that uses weight + intensity gain, you basically will need the following:

    Color inputTint - (non HDR color)
    float inputGain - (0-1)
    float weight - (0-1)

    From there, you basically just do:

    Color finalColor = weight * inputTint * AlloyUtils.IntensityGain(inputGain);
    whatEverMaterial.SetColor("_EmissionColor", finalColor);

    Lemme know if ya need any other help :)
     
  45. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    quick question: is there LOD dithering support now that unity exposes that stuff to shaders?
     
  46. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Cynicat The only reference to LOD dithering I've seen is speed-tree specific.
     
  47. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    @xenius http://prntscr.com/6qedj8 its passed to shaders and you add dithering yourself. which while not amazing is a start at least. i'm not really experienced with unity's shaders so i could be horribly wrong.
     
  48. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hmm, so basically all Unity is doing is passing a factor term, and leaving it all up to you to use. That's helpful... Though realistically, there's probably no such thing as a good 'generalized' technique to use on all systems. Also considering the dithering on the speed tree stuff is.. not super good looking, a standard dither prob. isn't a great approach.
     
    Cynicat likes this.
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey guys... I have a question and it is regarding the use of the detail maps for normal maps. For the skin shader, I was thinking about using blurry normal maps for the main normals and using the sharpened version for the detail, but I notice there is no blending for overlay. How does this work exactly?
     
  50. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    I bought Alloy a while ago, but am just using it for the first time today, so please forgive my ignorance.

    In terms of using the core shader for providing modding capability, how would that work with the packer? For example, I can use the core shader and pack the textures using the Alloy packer for my own models, but if I allow users to create the same texture maps, there's no way to use the packer at runtime, is there?

    Would I just have them create the Metal/AO/Specular/Roughness in a map themselves? In the Alloy docs, it was recommended not to do this, but I'm not sure why.

    Would another alternative be to use the Prototype shader and just load the user created textures into that?

    Also, along with one of the posters above, although I don't have any other questions for now, I'd really appreciate some fleshed out documentation. Whatever information that was in the docs was very useful, so more of that would be helpful in understanding how to use Alloy to its fullest. I'm about to start learning Substance Painter, and will be looking into the workflow between the two.

    Thanks for your time, and thanks for the product!