Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. sk8terboy4

    sk8terboy4

    Joined:
    Mar 29, 2013
    Posts:
    29
    Did anyone try to setup this framework with Usky? For some reason alloy shaders are not updating when the Usky skybox is dynamically changed.
     
  2. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    140
    Dunno, if this feature request was already suggested. Is it possible to add some blend mode functionality? Would be nice, for some scrolling textures, multiply for example and more. Would be a really powerful feature.
     
  3. Deleted User

    Deleted User

    Guest

    @sk8terboy4
    Did you try it on the Standard shader to make sure the problem was Alloy-specific?

    @Zyblade
    Blend mode on what? You need to give us more context for that statement.
     
  4. sk8terboy4

    sk8terboy4

    Joined:
    Mar 29, 2013
    Posts:
    29
    @n00body
    Just tried it. It seems it is a Usky, problem thanks for the help!
     
  5. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    140
    @n00body
    I will send you a pm with an example link, cuz it containts content of another asset slidely.
    This feature is integrated into a shader and not a script, so I can't use alloy with it together.
    These are blend modes like in PS, where you blend the object infront so it reacts on the colors behind it. There are different blend modes, like lighten, darken, multiply. It will be useful with the alloy fx mask texture on the assetstore and scrolling textures feature of alloy pack itself for example, and that only one use.
     
  6. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    140
    @n00body
    Hm, I've been playing around with alloy and found out, I could already almost achieve what I need with a combination of emission, rim emission, decal and dissolve. With a little more trial and error, it might look exactly look like what I wanted to achieve with blend modes. So I pretty much underestimated alloys possibilities with these ones again^^.

    Another question what comes up now. There's a shader keyword limit, that comes up, if I use too many shader combinations or shader variants?

    So if I have a multiplayer game now, where certain armor parts has some glow and scrolling effects and, let's say, 20 player are in the same zone, relatively close to each other. There's no way I can foresee when that limit is reached. For example, if they'd wear all different armor that hit the unity shader keyword limit. Or does this keyword limit only'd occure in unity self and not on runtime? I'm still not sure if I understand the whole thing right.

    Thanks again.

    edit: not that I wanna use that many effects for my armor, just to know some edge case and would happen. But I think the answer is, unity calculates those keywords already before I hit play, so even if I had 200 player at the same place, all armor combinations with its shaders(and so keywords too) won't and can't exceed any limit anymore.
     
    Last edited: May 18, 2016
  7. Deleted User

    Deleted User

    Guest

    @Zyblade
    The keyword limit has always been a tricky issue. The count is only increased when a given keyword is used by at least one material in a scene, but only for that scene. Removing them is a huge pain, since Unity keeps the keywords on the material even if you switch shaders. Usually you end up having to create new materials and manually copying over settings to clear away lingering keywords.

    In Alloy we have one shader keyword per optional shader feature, and a couple for modifying said features (eg. Parallax vs POM, Displacement vs Phong). For example, if you have a shader with Rim, Detail+Rim, and Detail+AO2 that's 3 keywords being used since the Rim, Detail, and AO2 features are enabled on at least one material in your scene.
     
  8. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Hi n00body,

    I have a big issue with latest b4 and unity 5.4.0b18. I m not able to build the app

    upload_2016-5-21_22-4-17.png

    Hope for a quick support since we are under submission :p
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Is it possible to detect so we can at least replace those materials? Seems to me a fundamental flaw in Unity if we can't.
     
  10. Deleted User

    Deleted User

    Guest

    @Unreal Vision
    We've been made aware of the issue, and will be submitting a fix soon. Please stay tuned.

    @hippocoder
    Unity alleviated the worst of the issues by increasing the keyword limit to 128, but it's not a true fix. This is actually the reason why we so rarely add new keyword-based features to Alloy. I'm also looking into reusing keywords from official Unity shaders, since those are going to be present anyway.
     
  11. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    We fixed temporaly using Built-In Unity deferred buffer instead of Alloy. Quality a bit less beauty but we are able to build :)
     
  12. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    I'm facing a rather strange issue using the latest beta of Alloy (can be it was already present in a previous version though) and Unity 5.4 beta 17. For some reason the muzzleflashes of my guns (using UFPS) don't show up at runtime while they are displayed perfectly within the editor scene view.
    Scene view:
    muzzlefalsh_scene.png
    Game view
    muzzleflash_play.png
    Anyone any idea on how to fix this?
     
  13. Unreal-Vision

    Unreal-Vision

    Joined:
    May 6, 2013
    Posts:
    58
    Tested b4 with unity 5.40b18 and works fine :)
    Thanks!
     
  14. Deleted User

    Deleted User

    Guest

    @cygnusprojects
    Not sure how this would be caused by Alloy. Have you tried swapping out our stuff for the standard shaders to confirm that it is Alloy-specific?
     
  15. Deleted User

    Deleted User

    Guest

    Alloy 3.4.0 beta 4 is Released!
    Version 3.4.0 b4
    =====================
    Shaders:
    - Changed "Mode" to "Roughness Source", "Full" to "Packed Map Alpha", and "Lite" to "Base Color Alpha".
    - Fixed issue where deferred override shaders failed to compile while creating a build.

    Tools:
    - Fixed issue where Deferred Skin was getting blocky artifacts when the editor viewports were resized.
    - Optimized Deferred Skin to use less bandwidth and VRAM at runtime.
     
    punk and KRGraphics like this.
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Aw, man... it is going to be a very painful wait to play around with the latest alloy shaders... specifically the skin
     
  17. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
    Hello,
    I have just purchased Alloy and I do like it a lot! It will be my bread and butter shader framework for windows projects.
    However I do want to build some of my own shaders.

    My question is:
    Do shaders made with shader forge work well with alloy? Would I still be able to make custom lighting paths with shader forge while using alloy in my project settings? Thank you for any help!

    --Joshua
     
  18. Deleted User

    Deleted User

    Guest

    @jammer42777
    Unfortunately no. There is no clean way for us to inject Alloy code into ShaderForge shaders, since they use a custom framework. Now you can still sort of apply Alloy lighting to it for opaque and cutout shaders in deferred mode, but that's it.

    We do however have a simple method for injecting code into Unity surface shaders that use either the Standard or StandardSpecular lighting models:
    https://alloy.rustltd.com/documentation/injection-headers
     
  19. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
    Oh i wouldn't want to inject alloy into these shaders. I would simply want to use these shaders in the same scene alongside alloy shaders, where the project settings are setup for alloy.

    For example, lets say I have a starship scene setup using alloy shaders mostly (and the project settings are setup for alloy) But lets say I want to use a hologram shader that I had built in shader forge. Or even a custom metal shader made in shaderforge (with a custom light path) Would there be undesirable results because of the alloy project settings?

    Thanks! (hopefully this clears things up)
    --Joshua
     
  20. Deleted User

    Deleted User

    Guest

    @jammer42777
    Unlit shaders would be fine, since they wouldn't care. Any kind of lit shader, like the "custom metal shader" you mentioned, would run into the problem I mentioned in my prior post. Light settings for Alloy don't work with other shaders that don't use our lighting model since we use area lights and custom attenuation.
     
  21. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    You are indeed correct, while setting up a small repo project I noticed the layer of the muzzleflash object was changed at runtime. Although everything works in the repo, the actual project must have special clear layers on the camera.
     
  22. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Is it possible to use one of the existing Alloy shaders to do emissive night lights only on the dark side of a planet?

    Edit: Preferably as a separate input than the emissive map. For example, you could have lava on a planet be emissive in the lit and dark sides of the planet, but city lights only showing on the dark side. I'm able to create an extended standard shader which uses 2 emissive maps, but I'm not sure how to customize the lighting function to do what I want, and then after that how to use Alloy's lighting.

    Edit2: After much mucking around in other shaders and ShaderForge, I rewatched the Alloy Crash Course and got an idea to try out the Directional Blend shader.

    My theory was to have 2 materials on the planet: one Alloy Core shader with all the textures and the emissive which lights up the planet on the light and dark side, and one Alloy Directional Blend shader set to transparent just for the night lights. In the directional blend shader, I thought I could blend a main emissive set to black with a secondary emissive with the city lights, and set the blend mode to World with the rotation set according to the directional light (sun).

    I then noticed that there is no secondary emission for the directional blend, which kind of dashed my hopes. The shaders that do have secondary emission don't allow setting the world rotation.

    May I request a planet shader with options for a secondary emissive input just for night lights which responds to the directional light with color options and blending options (weight, cutoff, blend), or, a directional blend shader with options for a secondary emission in addition to the other secondary textures? Thank you.
     
    Last edited: May 25, 2016
  23. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    140
    I would control the emissive via script. Then, there are many ways, to check, if the object is lit or not.
    If the planet is centered no 0,0,0, you could check, if an object is at x positive or x negative(as long as the day/night circle is linear). Or you make a giant collision cube(made up of 8 vertices) that's enough and position it exactly in the one half of the earth and set the collider to "trigger". Then check the trigger via script.
     
  24. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Thanks for the suggestions. Even if I control the emissive map via script, it would control the map as a whole, which would mean even on the lit side as the planet is longitude/latitude UV'd. The way it should work is that specific areas of the city lights map (where the dot product of the light direction and planet normal is less than 0 I think) should be lit.

    There are many non-PBR shaders on the asset store which handle this in the shader code. I was hoping the Alloy guys could implement this as another extension of the core shader (a secondary emissive map which responds to light direction or at least some rotation vector, with blending at the edges), or at least with a secondary emission option in the directional blend.

    Edit: It doesn't look like a transparent second material will work, with or without blend directional blending. On the second material I thought I could just have completely transparent main maps with just an emission mask showing lights, but that's not possible, as the main alpha color controls the opacity of even the emission map and the albedo color. This happens even on other transparent emissive maps I experimented with. Best I'm able to do is get semi transparent lights on a second material over the whole planet, but when I try use custom lighting to mask the lights on the lit side, I lose transparency. Shader programming is tough, don't know how you guys do it.
     
    Last edited: May 26, 2016
  25. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    140
    Ah yea, you're right.
    Another question for the Alloy Team:

    If I wanna use the alloy 4splat terrain shader, I put a material, which is using the shader in the custom material slot of a unity terrain? Then put a Alloy packet terrain map along with a normal, in both slots.
    The docs says, "Uses the terrain UVs for each splat", I'm not sure if I understood this one and how to access the uv's of the terrain and modify and use them effectively for each splat. Can I use a 4splat texture map in general without further assets in Unity 5? I have slider for each splat slot in the material, but I don't know how to use the other 3 slots, so they actual getting affected by their respective slider. A small tutorial, video or pdf would be really helpful, showing how to use the terrain shader of alloy. Because the video long tutorial on youtube(which is really nice) doesn't cover this one yet.
    The 4splat vertex shader is really easy to understand, just using vertex rgba values to control the texture flow.

    Well, thanks for your support.
     
  26. IDreamofIndie

    IDreamofIndie

    Joined:
    Dec 24, 2014
    Posts:
    38
    Could somebody post the proper Substance Painter export configuration for Alloy? I am using the Alloy Substance Templates KRGraphics Posted on page 17(which are incredibly useful!) and the Config shows as: Unity(Alloy Expanded)(from cache) but the textures don't export correctly. I thought I seen a post with the proper export settings before but cant seem to find them now.
    Thanks for any help.
     
  27. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Zyblade I'll try to put together a couple minute vid on how to setup a terrain in the next couple days. It's a little non obvious :).

    @IDreamofIndie I'm not sure what the appropriate setting is as I don't use painter. I will ask around if someone doesn't chime in sooner

    @Korindian You're right in that there's no out-of-the-box way of handling directional masking of emissive property group. :-/ We're limited in creating more permutations of things due to Unity's preposterous system of limited Shader Keywords, or there'd be a lot more useful variations.
     
  28. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Korindian Actually, just gave it some more thought. The two-layer approach does work. You need an alpha mask for the main material that matches the emissive mask. Using the fade mode and making Mat2 100% transparent also kills the emission. Example:

    upload_2016-5-27_22-33-28.png
     
  29. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Thanks for responding.

    After much fiddling, I was able to get it working using the above method you posted but only with the same Core shader textures set as the Secondary textures in the Directional Blend shader. In essence, because the red area in your picture above cannot be transparent to allow the planet textures to show through, I have to relayer the planet textures in the red area. This is a pretty hacky workaround, and I hope it doesn't use too many resources, but at least its working

    However, the Directional Blend shader was then having z-fighting problems with my transparent cloud textures. I had to fix this by creating a custom transparent shader for the clouds with "Queu" = "Transparent+1" to change the rendering order.

    Hopefully if Unity raises the number of keywords you can consider a planet/cloud shader as a feature request.
     
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Hey guys... I have an odd question for you... for those of you using the transmission shaders, have anyone of you encounter an issue like this? Screenshot-2016-05-28-23.38.32.png

    I am using the transmission shader for the shoji screens and the top most screens have this weird issue where it is brighter on one part and darker on the perpendicular faces.... while the bottom screens have the correct attentuation... the light is a directional light located outsdie and it i am using real time GI with Double Sided Transmission Legacy (not on the beta yet)

    Perhaps you guys can pinpoint what is going on... thanks
     
  31. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hey Alloy devs, just a friendly reminder that I sent a couple of emails over the past weekend. I know you guys are busy with Hot Dogs, Horseshoes & Hand Grenades and other things though.
     
  32. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Korindian: I'm not answering email right now, as I'm in bed with a horrendous cold (have been since Saturday).
     
  33. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hope you get well and feel better!
     
  34. Deleted User

    Deleted User

    Guest

    @All
    Apologies for the radio silence. My day job has been especially brutal lately, so I've been taking a break from game development to actually play games for a change
     
    Tinjaw, elbows, punk and 1 other person like this.
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    And you should... take a load off... game on!
     
    punk likes this.
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Hey guys... just gave the new Alloy beta a whirl and while I love how easy the setup is... on things like the skin shader, as a character artist, I would love to see more control... such as an override for transmissive materials on a per material basis (example I want to make a jade statue or Yoda from star wars) and it is currently impossible with the camera effect controlling everything. That would be the only thing missing... I also like that you made the metal effect working again, for stuff like metallic face paint...
     
  37. Deleted User

    Deleted User

    Guest

    @KRGraphics
    If you need per-material control, then you will have to use the forward-only version of the skin shader for those cases. As we have said many times before, the deferred skin is unable to have that level of flexibility due to G-Buffer storage limitations.
     
    punk likes this.
  38. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    @n00body are you still planning to add a projective decal shader?
     
    chelnok likes this.
  39. Deleted User

    Deleted User

    Guest

    @punk
    Yes, we've been working on it off-and-on for a while now. I have the shader framework code changes in place to support them, but now I need to get the scripts working.
     
    chelnok likes this.
  40. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    awesome that is great to know :)
     
  41. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    I did a fresh install of a project and I keep getting "This custom render path shader needs to have at least 2 passes." I tried it on 5.4 beta, 5.3.4f1 and 5.3.5. The error keeps repeating and capping out at 999+. I installed the latest Alloy 3.4.0b4. Any thoughts?
     
  42. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Any news on this?
     
  43. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @adamz The version you downloaded should only work on 5.4b15+. Do you get the error spam the moment it's finished importing?
     
  44. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    I'm not getting the error anymore when creating a new scene. Maybe I needed to reboot after I installed Unity before I imported Alloy. Thanks anyways.
     
  45. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    I'm getting the following error when importing shaders and editor core into an empty scene with Unity 5.3.5f1 (64-bit).


    Assets/Alloy/Scripts/DeferredRendererPlus/AlloyDeferredRendererPlus.cs(14,2): error CS0246: The type or namespace name `ImageEffectAllowedInSceneViewAttribute' could not be found. Are you missing a using directive or an assembly reference?
     
  46. Deleted User

    Deleted User

    Guest

    @Skolstvo
    The asset store gave you the Alloy beta for Unity 5.4 by mistake. We'll need to update our page to encompass the new "normal" Unity versions so it will send you the correct Alloy version.

    Sorry about the inconvenience.
     
  47. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
  48. Deleted User

    Deleted User

    Guest

    @Skolstvo
    Okay, I've PMed you with a solution.
     
  49. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @Alloy,

    I have a solid grayscale color assigned in the red channel for the skin translucency. If I choose 113 for the RGB, I get no scattering. As soon as I choose 114, I get scattering. Because of this, I can't get a nice falloff if I use a thickness map for example. What would be the reason of that?

    Also, is there a way I can integrate Metallic using the skin shader? I'd like to be able to show torn away skin to reveal a metallic android underneath.
     
    Last edited: Jun 16, 2016
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Do you have a picture of this? Right now the new Alloy beta for Unity 5.4 now has the metallic channel back in... so there is no more skin masking... and how are you baking your thickness map? I found out that if I have a completely closed mesh I get a very nice transmission map