Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview 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. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Korindian Regarding mod support, that's an interesting challenge, as to my knowledge one can't invoke things like texture-compression options and such outside the editor. In what way do you intend to support modding of assets exactly (like just dropping textures into directories, or having your user build an asset-bundle in the unity editor).

    The other option would be to have them do everything as substances, might be easier to get the content in. hrrmmmm

    Regarding the packed map setup, the reason hand-packing isn't recommended is precisely because for any other shader than the prototyping shader, the packed map MUST be setup as 'bypass srgb sampling', which means it needs to be set to 'advanced' for its texture import type. Truthfully, I really don't know whats all involved/possible for doing any of that at runtime for an asset that wasn't built in.
     
  2. Deleted User

    Deleted User

    Guest

    @Neptune_Imaging
    In order to avoid complicating the Detail feature, it has no awareness of mipmap blurring. In the case of the skin shader, we just have it interpolate between the combined sharp base+detail normals and the blurred base normals since the details would just get blurred out anyway.

    Does that answer your question?
     
  3. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    @xenius Actually the two ways you described were the only options I'd thought of. I'll look into substances as well. I also don't know yet what's involved completely, but will be exploring the various options once I learn Substance Painter and actually create some maps for a test model.

    If going the "texture as png files in a directory" route, I'm guessing that I can just create a texture, set the linear bool (for the sRGB sampling bypass) according to the docs, and then try to load the image from file into that texture, but that might change the settings.

    I'm leaning towards the asset bundle route (I've read up on it but haven't actually used it yet), but since the user won't have the Alloy shaders, they'll have to create an asset bundle with the texture maps packed by themselves after applying the various settings, right? Theoretically, I'll be able to just load them into the core shader. I guess I'll find out soon.

    I was able to get the Alloy shader loaded into Substance Painter. I was switching between it and the default Allegorithmic PBR metal-rough shader using their Hans model sample and noticed there is a slight difference in darkness (occlusion?) in some areas, with Alloy being a little lighter. If I author the assets using the Alloy shader in Painter, it should look exactly the same in Unity, correct?
     
    KRGraphics and xenius like this.
  4. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    @rustLTD. team... great asset, thanks!!!

    I purchased Alloy 3 and I would like to know:
    1) Is Alloy compatible with "Physically Based Area Lights - redLights 2.0"?
    2) If I have Alloy, do I need redLights?

    FYI: I'm working in a Sci-Fi project with great lights.

    Thanks.
     
  5. Deleted User

    Deleted User

    Guest

    @mkgm
    We're currently working with redPlant to make redLights and Alloy 3 compatible. By default, Alloy 3 only has a spherical Area Light type, but it integrates with Unity. Once integrated, redLights will bring support for unshadowed spheres, planes, capsules, etc.
     
    ThunderTruck and mkgm like this.
  6. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Can Alloy render physically based fog (rayleigh scattering) on objects? Fog in the real world does not have one color but the color changes over distance. This makes distant objects appear blue-ish, especially dark areas. This effect is even there if very little fog is present.

    Like this:

    mountains.jpg
     
  7. Deleted User

    Deleted User

    Guest

    @Elecman
    We currently use Unity's standard forward and post-fog. Higher quality fog hasn't come up on our todo list thus far.
     
  8. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Elecman This sort of effect in general isn't done in-shader, as it would lock one in to representing a specific thing (ie rayleigh scattering makes sense on earth at 1:1 scales, doesn't make sense in many other gamic contexts). HOWEVER, we're going to have a.. shall we say related product announcement soon. (Yes i know I'm a tease, but we're not quite ready to spill the beans yet). So do stay tuned to this thread :)
     
    blueivy, hippocoder and KRGraphics like this.
  9. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    No problem. I'm excited :)
     
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,470
    Same... you guys just keep taking Alloy to greater levels... and yes I can't wait until you spill the beans :D
     
    xenius likes this.
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You'll be the toast of the community once you do spill the beans.
    Toast.jpg
     
    Deleted User, xenius and KRGraphics like this.
  12. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    I recently upgraded to Unity5 and downloaded the new alloy, I noticed a lot of the shaders included in the previous release of alloy are missing. Especially the reflection shaders, any tips on how to get the reflections working again? The new import really messed everything up unfortunately :(

    I am using Candela in my scene, in case that helps.
     
  13. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @dizzymediainc Alloy 3 was a full system replacement, as Unity 5's functionality allowed us to do a tremendous amount of things not possible in U4. Nothing functionality wise has been removed, but things have been heavily recategorized to accommodate new shader features.
    By reflections may I ask what you mean exactly?
     
  14. Deleted User

    Deleted User

    Guest

  15. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    To be specific about what is missing are these options here:


    Bump is no longer an option and reflection properties is not in the drop down menu for add tab.

    Reflections such as in the images. Here's screenshot comparisons of versions:

    Old version:


    New Version:


    Same room, same setup for everything except the alloy update, it seems to not detect candela as well.

    The scene and my entire game is using "Legacy Deferred (light prepass)" rendering path and "gamma" coloring space, both images are using these settings. I did try to set it to "Deferred" and "Linear" but the results were not better.



    Taking a look at the video and page linked above it still doesn't explain the drastic change.
     
    Last edited: Apr 13, 2015
  16. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @DissyMediaInc : Ok, it looks like several things are awry. It would be tremendously faster if you could pm me your skype sn. Will take far less time to resolve than half-a-dozen back-and-forths via text. :)
     
    dizzymediainc likes this.
  17. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    Done, thanks ^_^
     
    xenius likes this.
  18. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    @rustLTD: Can we (Alloy 3 owners) achieve similar results that "Character Physically-Based Shaders" offers for character PBS?

    PD: sorry for my bad/deficient english.. It's not my primary language.


    ** Updating the link :)
     
    Last edited: Apr 13, 2015
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,470
    If you are referring to hair, skin, and eyes, then yes, all of these are possible with Alloy. I will be putting together a production reel that shows how the character based shaders work and how to create them.
     
    mkgm likes this.
  20. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @mkgm Despite Neptune's enthusiasm for our character set, I should mention that from a cursory look at the asset you mention (i believe by EISKO?) their system appears to have a more comprehensive system for complex facial morphs using multi-normal map blending. Regarding the core rendering functionality we appear to be about on parity. Hope that helps!
     
    mkgm likes this.
  21. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
  22. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi Everyone!

    Just wanted to let you know (if you haven't already downloaded it) that:

    Alloy 3.0.2 is on the store
    Version 3.02 Release Notes
    =====================
    Shaders:
    - Changed to an optimized BRDF visibility function.
    * Toggle legacy behavior in the config header.
    - Changed our higher quality Environment BRDF to use a formulation that maps correctly to linear roughness.
    - Changed the Environment BRDF to use our new formulation by default.
    * Required some small changes to the lighting API.
    * Toggle legacy behavior in the config header.
    - Fixed a bug in the Weighted Blend shaders where the vertex tint control was not doing anything.

    Features:
    - Changed the TeamColor module to use our new formulation by default.
    * Toggle legacy behavior in the config header.

    Tools:
    - Fixed a possible bug in the Material Map Channel Packer where it would error if any of the input textures didn't have mipmaps enabled.

    Integration:
    - Substance Designer
    * Changed visibility function to match Unity shaders.
    * Removed the Specular AA feature as it was never really working properly due to the lack of mipmap generation.

     
    Deleted User likes this.
  23. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Also, for a little goofy fun (if you don't spend way too much time on reddit, this might not make sense):

    DerpMander.png

    Decided to do a little Alloy Normal-mapped Pixel Art test. (yes, that's SE Natural Bloom on it too). :p
     
    KRGraphics likes this.
  24. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Hi, can you show a car paint render example?
     
  25. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    One thought I had about this was with Amplify Texture. Currently Alloy is supported, however only 3 textures. I figured to factor in tessellation one might want to use the alpha channel of albedo for other maps be it POM or Tesellation. This gets around the limitation of 3 textures and extends the functionality. It also might save a texture read (or ram) and generally be more optimised?

    I just wondered about it since albedo.a is often neglected and perfectly feasible for use.
     
  26. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @hippocoder : If you were trying to get the most out of Amp Texture, and say.. wanted to use that one extra channel, considering you're using an Amp Texture forked Alloy shader, you could easily reassign the usage of that channel yourself. We tend not to do such things in the core, as everyone has their own ideas about what should use it :).
     
    hippocoder likes this.
  27. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    I am using substance with alloy Version 3.02 on unity 5.0.1 f1

    5.0.1 f1 has alot of substance fixes, but Alloy is causing memory problems .
    scenes take a long time to load or crash the editor. The more sbars with alloy mats. in a scene or prefab
    the more memory it takes.

    this does not happen when I am using the sbar with the standard shader.
     
  28. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Howdy guys, wanted to give you a little preview of something. We're working on a new prototype shader for Alloy 3.0.3 called Weathered Blend. I'll be writing a blog post in detail about it soon, but in short, it's (what I feel) a new and better way to approach melding repeating materials and per-mesh information. The asset you see here is using components from a unique-space atlas (comprising about 80 pieces or so). It uses 2 sets of repeating materials, and a special type of packed map for the mesh data. I think this shader will be most useful for generic-material atlases, large constructs (architecture, huge rocks, etc.), and enormous sci-fi objects. You guys, I hope, will find uses for it beyond the scope of my imagination.
    BotTest1b.png
     
  29. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Can this be used to reduce repetitive patterns on terrain, viewed at high altitude?
     
  30. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Elecman As long as you mean 'terrain made out of regular geo' yes most certainly, though you would still be limited in this case to two 'main' inputs.

    The more I see people grappling with terrain though, the more I feel a virtual-texturing approach using unique-texture-data-across surface painted in Mari is the ideal solution for that.

    This shader would be absolutely prime for large naturalistic details on terrain (cliff faces, cave geo, huge rocks, etc.).
     
  31. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Little fun update for you guys. Got my robit walking :)
     
    ksam2 likes this.
  32. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
  33. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Hi there, first thanks for this awesome asset and second how can I combine (Skin،AO،Spec،Rough) maps to create that "RGBA" map Alloy need for its shaders?
     
  34. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Exeneva: Your guess is as good as mine. Your screenshot doesn't include even close to enough information to diagnose what is going on, nor does it tell me what it 'should' look like. If you're having a problem, in general its best to send an email to alloy@rustltd.com with a detailed description of whats going wrong, reference images if something 'should' look differently than it is, and a dropbox link to a _small_ project with just the relevant asset(s).

    @ksam2 This post is slightly out of date, but shows you how to use the packer: http://alloy.rustltd.com/blog/index.php/2014/02/24/alloy-workflow-how-to-packed-material-maps/
     
    ksam2 likes this.
  35. Deleted User

    Deleted User

    Guest

    @hippocoder Amplify Texture 2 actually provides a channel for doing displacement tessellation, which Alloy will automatically use. As for POM, that one is a little more tricky. POM involves sampling the input map multiple times along a ray, and may result in weird behavior with a virtual texture. Also, I would have to find a way to cleanly expose this information in our Parallax module.

    Though I may have to anyway, since our Eye shader uses the _MainTex alpha for parallax. We'll see if I can get to that in the next revision.
     
  36. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks for the heads up. We're currently not using Amplify Texture because the tools that surround it (dealing with uvs for megatextures) don't seem to be available. We might want to use it as an optimised texture streaming system if it's still fast in that respect though. It seems like laying out all those uvs and packing them into tiles is the main headache at the moment.

    Regarding Alloy, I wondered if you guys had any plans to include a 4 texture splat shader where the texture blending is handled by vertex colour RGBA? This seems awfully common as a technique so I was surprised to see it missing.
     
  37. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @hippocoder At the moment, we dont have it, as blending 4 full PBR materials would be 12 texture samplers (ouuuuch), but I'm working on the drawing board to design something more sane, that still accomplishes the sort of aesthetic goals one wants for terrain.
     
    ksam2 likes this.
  38. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds good - I also realised the 12 texture sample thing. But we no longer use Unity terrain, as it's not that good, but meshes instead so if you do realise a solution I would probably ask you to consider vertex colours as a suitable blend control as it saves yet another sample and so on (the splat texture) and is easy for in-unity editing ie a vert painter, easy to throw together :)

    Regarding sanity I guess it could be some sort of uberpacking going on, what were you thinking?
     
  39. Deleted User

    Deleted User

    Guest

    @hippocoder
    We're probably going to use a setup similar to what we use for terrain splats, where we have a packed (RGB: color, A: Roughness) and a normal map for four splats. We already have a mode for this in our packer tool, and it covers the most important data.
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I wonder if your texture packer could pack the normal map so there's a channel (A) there that could be used for something in this case, or if its possible just use normal r,g, and that gives you two greyscale channels per normal map. But I guess that's stuff you've already considered to be too out there!
     
  41. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Hippcoder: The alpha channel is being used. Take a peek at now DXTNM compression works. For that, and a number of unity'engine reasons, its a baaaad idea to stuff an alpha channel into a normal map.
     
    hippocoder likes this.
  42. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    I think i can make refractive shaders with this but will they work with Unity 5?
    I saw the glasses in the picture but there i can not see the refraction.
    Is there a little demo or a video about that?

    Also can i make shaders with alloy that i then give/sell to others?
     
  43. Deleted User

    Deleted User

    Guest

    @RandAlThor
    We provide a Glass shader that uses Unity's GrabPass system to sample the scene, and then uses geo and per-pixel normals to distort it. Unfortunately our current example images and videos only show the glass shader being used for subtle distortion.

    As for custom shaders, yes you can give them away if you like. However, I would recommend against selling them as they would be non-functional if the user didn't already have Alloy. I would like to emphasize that you may not redistribute any part of Alloy's framework.

    Please note that we're currently overhauling our surface shader API for version 3.03. The changes will make it much simpler to redistribute custom shaders as they will remove a lot of code from the individual surface shader definitions. I'll be posting examples soon, so stay tuned.
     
  44. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    Thank you for the information.
    Also i mit sure in the glass schadet is of the kind i want.
    Would like to see something before handle out the money.
     
  45. Deleted User

    Deleted User

    Guest

    @RandAlThor
    Well it's not the best video, but here's a link to a segment from Republique Remastered where they used our Glass shader for their water effects. I recommend fullscreen, 1080p resolution, then scroll to timestamp 1:01 to see the fountain in the center of the room:
     
  46. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    Hmm, ok. Thank you.
     
  47. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @RandAlThor To follow-up on Josh's comments, the two things that are different about the glass shader are:

    - Refractive Distortion: This uses both the geo normal, and a normal map is present to distort what's behind the glass. It can be a bit expensive, so we have 2 version of the shader, one which uses a grabpass 'capture' per-object, and one that uses a shared grab.

    - Color Tint multiplication: Because the shader is multi-pass, the color tint of the glass shader multiplies on top of the refraction behind it, so its reeeeally useful in getting a very.. 'solid' feeling glass, as though dye/pigment/inclusion was used. I love it very much, and you can see it in use on the potion bottles in the Alloy Loot demo scene shot at the beginning of this thread.
     
  48. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    My post just got lost :( I can't see an example of the car paint shader. Can you show an example of it in use?
     
  49. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @hakankaraduman Gimme a bit. I dont have a good car model to use. I might have a crappy one somewhere..
     
  50. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    Hey! Don't know if you remember me but I wanted to let you know after much tinkering I have gotten things close to how I had them/wanted them with Alloy for Unity5



    I noticed one thing and that is all the spec. textures were being placed in the metal texture area for Alloy shaders, once I went though and removed them, reversed the settings for each material (metal, spec, etc.) and placed Candela on LAST everything worked. I tried reflection probes but candela actually runs better surprisingly so sticking with it :)

    Just thought i'd let you know I got things working.
     
    KRGraphics and xenius like this.