Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Highly recommend Blender and a (very cheap) plugin called Weightlifter

    Of course it's not quite the same as painting in-engine, and Blender infuriatingly ignores vertex alpha. But might be helpful.
     
    zenGarden likes this.
  2. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Thank you , but you can already paint vertex colors in Blender without needing to buy a plugin, the issue is you won't control and see in realtime texture blending on your model as you paint.
    Perhaps i will just keep vertex painting outside of Unity prototypes and keep that feature for UE4 as vertex painting and using it with shaders is a very common task.

    It's complementary tool as you will use vertex colors in your shaders.
    And i agree with you a vertex paiting tool would be more at it's place with shader forge for example or directly inside Unity instead of Alloy shaders.
     
    Last edited: Jul 8, 2015
  3. Deleted User

    Deleted User

    Guest

    @chelnok
    I don't understand your question. Our CarPaint shader offers a mask in the alpha channel for controlling where the effect is applied. Do you mean alpha blending and/or cutouts?
     
  4. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    No i dont mean any blending or cutouts. Just being stupid here :rolleyes: That is exactly what i wanted. Thanks!
     
  5. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    No directions for terrain shaders? I thought I would try them but can find no instructions at all. I spent an hour and a half watching the crash course video and while the narrator said he would talk about them later, they were never mentioned again.

    Do we really have to wait until August?! :)
     
  6. Deleted User

    Deleted User

    Guest

    @Teila
    To use the terrain shaders you just need to create a material, set it to our terrain shader, then assign that material in the terrain inspector. It may require an editor restart to fully take effect, as Unity's terrain as been a bit unreliable lately. At this point, you can paint splats like normal using the terrain tools, and set global parameters on the material.

    Our terrain uses the "Terrain" mode in our map packer for the base color splat texture. This allows you to put color in the RGB and roughness in the Alpha. Unfortunately I don't have enough time to go into the terrain smooth blending parameters for hiding the ugly seam that occurs with Unity's base map shader system.

    Hopefully that helped.
     
    xenius likes this.
  7. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    It did...but will it work with terrains that are already colored or must we redo the terrain? If just replace the material in the terrain inspector, I am assuming that will just add the shader to what is already on the terrain. Am I wrong about that?
     
  8. Deleted User

    Deleted User

    Guest

    @Teila
    As I understand it, yes. The splats should be unaffected.

    Just be aware that Unity's terrain shader uses smoothness while we use roughness. Also, you will probably want to repack your maps using our packer tool so you can get specular AA.
     
  9. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    I think I will wait until we get a little more documentation. :)
     
  10. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    I actually kept getting this whenever I tried to change the shader to Alloy. Not sure what it is, but I it was easily repeatable. All I did was create the material, change to Alloy and then add the textures, etc. Not sure what that white spot is.

     
  11. Deleted User

    Deleted User

    Guest

    @Teila
    The inspector preview is a little wonky because of how Unity handles tangents in their terrain shaders. It is working just fine, but it won't ever look right in the inspector.
     
  12. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    Ahh, okay, thanks.
     
  13. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
  14. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,929
    Really neat, DennG!

    By the way, I did get Alloy to work on my terrain. I love using it on models too. It really makes them shine..and I don't mean literally. :)
     
  15. KC1302

    KC1302

    Joined:
    Jan 11, 2014
    Posts:
    94
    xenius likes this.
  16. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hey guys. I just wanted to quickly post some shots of something I've been working on (an environment kit for Null Operator). It's using our beta Weathered Blend shader (which will likely go main-line in our next update).

    A question for you guys: thus far the videos I've put together have been broad general information oriented. Would it be useful to see something more focused on a specific content pipeline, like say doing a ruined kit like in the pictures here? I have a whole bunch more 'sets' of objects to make for this kit, so I could conceivably doing some recording while doing one, and show a model->uv->bake->substance->alloy process for how these are made. Let me know here if that would be of interest/use.

    ConcreteFloorsIn1.png
    MetalBeamsIn2.png
    RuinedKitDay.png
     
    bartm4n, chelnok, Zaddo67 and 3 others like this.
  17. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Model , UV i think is not needed as this is general 3D art skills already covered by thousand s of videos, shile substance paiting and export wouls be usefull as Alloy shader setup in Unity.
     
  18. KC1302

    KC1302

    Joined:
    Jan 11, 2014
    Posts:
    94
    Not sure if the settings are still relevant but few months ago they worked fine.
    I haven't used painter in months.
     

    Attached Files:

  19. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    I am hobbyist with a programming background. The Graphics Artist side of things is like a dark art to me. Training video's like this would be invaluable. Especially as it would be completely focused on getting the results with Alloy.

    I agree with zenGarden that if there are good resources that already provide this training, a reference to these would suffice.
    Eg:
    Step 1. http://www.cs.washington.edu/research/ap/tutorials/uvtut/uvtexture.htm
    Step 2. https://www.youtube.com/watch?t=32&v=JKrfaD3_rng
    Step 3. Alloy training video

    This would give noob's like myself a great starting place for learning. Half the battle is just knowing what keywords to search for in google so you find the appropriate resources needed to learn.
     
    bartm4n and xenius like this.
  20. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hello,

    I'am a bit confused about the Main Phisical Properties in the core shader. I'am working with Allegorithmic Painter, which exactly produce the 3 Textures (RGBA for base, RGBA for the second and DirectX normal map). The problem is, that, when i set up the textures with the Unity 5 shader, then it looks like similar to the Painter, but if I setup the textures with Alloy shader, it looks like not even similar to the Painter. I guess it has somewhat to do with the bad settings of the Main Phisical Properties (Metallic, Spec, Rough.).

    How should I set them to get a similar look to the Substance Painter or in the Unity 5 PBR shader?
     
  21. Deleted User

    Deleted User

    Guest

    @mkgame
    The "Main Physical Properties" are mostly for tinkering with seeing how certain values look for a material. If you are using textures then you will typically want them all to be set to 1.0 since they get multiplied against the values sampled from the texture. As for Substance Painter, you need to export Base Color, Metallic, Occlusion, Specular Level, Roughness, and OpenGL Normals to work with Alloy. Then you will need to use our material map channel packer tool to generate packed maps for our shaders:
    http://alloy.rustltd.com/blog/index.php/2014/02/24/alloy-workflow-how-to-packed-material-maps/

    To get the best visual match, I strongly recommend using our provided Substance Painter custom shader:
    http://alloy.rustltd.com/documentation/substance-painter-shader
     
    KRGraphics likes this.
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    @mkgame If you like a Pro Tip when creating surfaces for Alloy, what I usually do is create my Material ID textures and in photoshop, I choose the colours that will correspond to the material I am emulating, and name the layer with the values I will be using.

    example, I want to create rubber shoe soles... I also create a quick pack map setting the AO to white while I decide the value of the rubber. So if I choose Metallic = 0, Specular = ,04 (i usually wing this until I like the way it looks), roughness = .89, then in my notes I write down the values and set them up in Substance Painter. Sounds tedious, but this is how I work with my texturing in Unity with ALL of the bells and whistles enabled (usually HDR Reflection Probes, SSR, and Enlighten. I also use the game without any Postprocessing except for Tonemapping (The filmic one looks very perty) while I tweak. Also try not to have dark portions of your AO map too dark...

    Hope this helps.
     
    Zaddo67 likes this.
  23. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Thanks for the answer. The "Main Physical Properties" is clear now. But, the Painter already pack all layer together for the metalic layer. Do you pack the layer in another way, or can I just use the already packed Substance Painter metalic texture? I try to avoid the overhead with your packer, because its not fun for over 70 materials for one game component.

    To assign about 70*3 textures for the shaders is already a stupid work, but then pack the textures for 70 material is a more extensive nonsense time consuming work. At this point, I would recommend you to speak with Allegorithmic and add your own layer mixer to the Painter exporter. The shader configuration shouldn't be much more painful, as with the Unity 5 standard shader. The time which would be consumed by the packer, would me drive to accept the else looking materials, instead of packing 1-2 hours long for one game component...

    However, is the Painter layer packer for metalic texture not good enough for you (But good enough for Unity5...)?
     
  24. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    I do not have enough time for so much things, because I develop a game alone. And if things, which can be automated must be done by hand over hours, then I'am sad... Mostly I need it for an RTS game, where I want to use the blending functions of the Alloy shaders and more, but how exactly well the units looks is not so important. They will be never in close view. And if they are in close view, then I (for demo scenes, detailed units) pack the textures with Alloy without crying around, because it makes sense here. And if I have to pack the textures, then I will try to extend the Unity5 PBR shader for my needs. Unity 5 PBR shaders looks good and are simple to use.

    I'am also don't know how stable the shader works, because in my Alloy version the Alloy glass shader cause black screen, if I move to far with the camera from the glass material...
     
  25. Deleted User

    Deleted User

    Guest

    @mkgame
    You only have to do it by hand the first time. When setting the textures for the packed map just be sure to check the "Auto Regenerate" option. Then whenever you save a change to one of the input maps, the packed map will automatically refresh its contents and recalculate its Specular AA.

    Now if you want the simplest approach and don't care about Specular AA, then just follow Substance Painter's tutorials to get their channels into the packed map format we use (R=Metallic, G=Ambient Occlusion, B=Specular Level, A=Roughness). Just make sure the map is set to "Advanced" and that "Bypass sRGB Sampling" is checked.

    As for the glass shader, you are likely running into problems with the fact that it uses screen information for the distortion effect. Unfortunately all we currently have to work with is Unity's GrabPass system, which has quite a few limitations.
     
    chelnok and KRGraphics like this.
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Can you elaborate on this? I have my copy of substance painter which DOES allow me to create the Packed Map for alloy quite easily... you can configure this in the export options, which I will be showing how to do.
     
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    This. It is pretty easy to do...

    And good morning, @n00body
     
  28. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hello,

    I did it. But still not so good as the Unity 5 PBR and looks quite else as it does in the Substance Painter. However, I have a result... The third one is Alloy, the second one is Unity 5 PBR and the first one is Substance Painter (The directional light looks not in the same direction) with Alloy shader.

    I set the metalic channels as described (metalic RBGA, all in grayscale), but it looks like darker and a bit more metalic would be better. The chimney is def. too dark. Probably you have some ideas to improve the result? Or is it okay, more realistic than the Painters one or Unity 5 PBR...?

    (Chimney updated, textures were not assigned...)

    However, thanks for the help, these are small issues (missing some specular or metalic). At all, I don't have to spend time for setting the channels in Alloy, because Substance Painter already does it for me. And i would say, the chimney (black part) top is closer to the Painter, than Unity 5 PBR shader.
     

    Attached Files:

    Last edited: Jul 13, 2015
  29. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    You need four images metallic in R, AO in G, Speculat in B, and roughness in Alpha. The Alloy pack map needs Bypass Srgb to be checked for it to work properly
     
  30. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    This is my export in Substance Painter:

    1. Texture(Albedo): RGB (Base Color, RGB), A (Opacity, grayscale)
    2. Texture(Metalic): R (metalic, grayscale), G (Ambient occlusion, grayscale), B (Specular, grayscale), A (Roughness, grayscale)
    3. Texture(Normal): RGB (Normal OpenGL)

    Am I need to setup somewhere additionally to baypass the Alloy pack map?
     
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    In Unity, select the packed map and make sure Bypass sRGB is checked. This will make the map render as linear
     
    Last edited: Jul 13, 2015
  32. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    I got it, change each metalic texture attribue "pass sRGB" to true in the Unity inspector, in "advance mode" (at clicking on the texture), which is done by the Alloy packer automatically, if we use it, I guess, but not when we go over the Substance Painter workflow. The 'metalic' look is available now, bumpines reflects light, color of the material is now also more correct, metal reflects light better.

    I would recommend to put this information in the readme, how to set the Substance Painter exporter and how and that to set the metalic texture sRGB.

    Very much thanks to @Neptune_Imaging and @n00body!

    @n00body Sorry for not fully reading your post, where you explained exactly how to setup "Bypass sRGB"...
     
    Last edited: Jul 14, 2015
  33. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    The metalic looks good, but sometimes the normal map (OpenGL normal map from Substance Painter) data are inverted. I guess it is a known issue and will be fixed, or am I have to change the normal map settings?
     

    Attached Files:

  34. MalcolmWashington

    MalcolmWashington

    Joined:
    Jul 16, 2015
    Posts:
    12
    WHAT CAN ı DO , WHAT I download from assetstore , it gives me this error !

     
  35. Deleted User

    Deleted User

    Guest

    @MalcolmWashington
    That screenshot doesn't really give me much information to diagnose your problem. Can you tell me your version of Unity? Also, can you check the CHANGELOG file in the Alloy directory and tell me what the listed Alloy version is?

    Thanks.
     
  36. KC1302

    KC1302

    Joined:
    Jan 11, 2014
    Posts:
    94
    Hey, I wanted to post some work of mine featuring Alloy 3 with Alloy 3 detail textures.



    the mouse cursor not supposed to show up.

    99% = alloy 3 core shader with emission, rim emission, parallax, detail.
    1% = alloy 3 glass shader
     
    xenius and Deleted User like this.
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    I will go over this in my detailed character tutorial
     
  38. MalcolmWashington

    MalcolmWashington

    Joined:
    Jul 16, 2015
    Posts:
    12
    hi , Alloy Team

    my previous post , I solved, I updated unity to 5.2.0b2 version.

    I wasn't have any problem ! until I add any light into the scene.

    I put pictures
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      659.3 KB
      Views:
      828
    • 2.jpg
      2.jpg
      File size:
      518.5 KB
      Views:
      862
  39. Deleted User

    Deleted User

    Guest

    @MalcolmWashington
    Okay, you need to re-download Alloy from the store now that you've updated Unity. You currently have Alloy 3.1, but you need Alloy 3.2 to work with the latest version of Unity.
     
  40. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Regarding the grabpass - on mobile we just dumped the render to a texture, and then did a final composite pass, rendering a quad + any transparent objects. It required Z buffer in a texture in memory but seemed to be the fastest way to do glassy stuff. Do you think a similar approach would be preferable to grabpass? I've never actually used it, coming from a background where speed matters.
     
  41. Deleted User

    Deleted User

    Guest

    @hippocoder
    I never really gave it much thought since we don't target mobile. I mostly went with the GrabPass system because it was simple to include in our shaders as Unity does all the heavy lifting behind the scenes to make it work. Also, I found out I could easily configure the shaders to only do one GrabPass and share the buffer. That solved most of my performance concerns for our target hardware.
     
  42. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    What are your thoughts on cavity maps? I see it is not supported. Any particular reason for this?
     
  43. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Elecman There's no 'standard' way to use a cavity map in a PBR shader (if what you're talking about is the same as say.. curvature (ie. mid-grey for flat, black for concave, white for convex)). I use cavity/curvature data constantly, it just finds its way into my texture sets as intermediary steps, as having that data 'raw' doesn't tend to be useful (as we already have a an occlusion map, that should typically use representing micro-cavities itself).
     
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    A PBR shader package can't bring all users wishes, it's impossible, like Unity can't bring any users wishes or needs :rolleyes:
     
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    usually for things like cavity maps, I would usually blend them in with my ambient occlusion map, setting it to overlay or screen. In the case of skin shaders, I bake out the map and change the levels so the white parts are 50% grey and blend them into my specular map.

    For the albedo map, I just overlay the cavity map set to either overlay or colour burn

    For the roughness channel, I just invert the tweaked cavity map and multiply that too... adds an extra layer of detail.
     
    chelnok and overthere like this.
  46. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Ok, thanks. Baking the cavity map into the occlusion map makes sense.
     
  47. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    Yep... it gives me that extra level of detail
     
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,436
    @Elecman here are some images of cavity maps used for skin texturing.

    In the albedo map, the cavity map is used for adding variation to the detail. I keep this low opacity for subtlety.

    Screenshot 2015-07-17 23.50.30.png

    Specular. Skin pores don't have specular values which will make the skin more interesting at different angles. For the teeth, it makes the rendering of them very realistic and natural.

    Screenshot 2015-07-17 23.50.19.png

    And the roughness map.

    Screenshot 2015-07-17 23.50.43.png
     
    chelnok likes this.
  49. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Thanks for the writeup!
     
  50. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    @Neptune_Imaging, hope the tutorial is coming along well, waiting patiently for it.

    @xenius and other users, I was wondering if there is a possibility of creating a quick start tutorial that would cover only the primary aspects of alloy. For example -- a simple model, lets say a door. It would be great to show how one can use the core alloy shader with it. Very small 3-4 minute videos would be great at showing how one can use either b2m (substances), substance designer or substance painter or a combination of them to quickly generate materials for the door (in what conditions would one need to use alloy packer and some quick tips that you usually use when working with alloy). I really like the crash course video but I found it quite extensive and I think users would benefit more from quick tutorials that will get them setup quickly so that they can then play with advanced features if needed.