Search Unity

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
  2. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    Alright, sorry Xenius, i was certain that since alloy had some special " Properties " that you toggle on or off, i would have needed a more specialized way to access it. Thanks !
     
  3. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Nope nope. Just be aware that you cannot add/remove property groups via script (as they require shader recompilation). If you want a param/group at runtime, it must already exist on a material.
     
  4. MornFall

    MornFall

    Joined:
    Jan 11, 2013
    Posts:
    160
    I must be something wrong...
    i have that inside a while loop that add 0.01 to the float cutoff every frame :

    Code (CSharp):
    1. partRenderer.material.SetFloat("_Cutoff", cutoff) ;
    Nothing is happening. I tried with "cutoff" , "_cutoff" , "Cutoff" ...

    Gonna dig into the shader code see what i am missing.

    EDIT : Found it. it was "_DissolveCutoff"

    Edit 2 : This dissolve thingy is pure awesomness !
     
    Deleted User and xenius like this.
  5. NegativeZero

    NegativeZero

    Joined:
    Jul 27, 2013
    Posts:
    23
    Thank you, and great job on the fast patch! New version works well ;)
     
    chelnok and xenius like this.
  6. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Does Alloy have a feature to display occluded characters. Like limb's in image below?

    This is from Heathens Occluded shaders which works great. Problem is, I am swapping materials based on the players power up's, if they have a "see through wall" power up, I use a material with Heathens shader, if they don't I swap back to an Alloy shader. As a result the enemy's look different when not occluded depending on which material is currently on them.

    I searched through the Alloy doco, and I think the answer is no. But just wanted to confirm Alloy doesn't have an occluded shader. THx.

    2015-06-28_21-39-11.png
     
  7. Deleted User

    Deleted User

    Guest

    @Zaddo67
    Currently it does not. We have tentative plans to include such functionality but our team's scripting guru is currently occupied with a higher priority project. You're not the first to ask for this feature, so rest assured that we are working on it.
     
    overthere and Zaddo67 like this.
  8. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Hi guys. It is me again, and once again I have to report this error, the same one I always get, plus a new one. :p I encountered it because I updated to Unity 5.1 and realized I would need to update Alloy from 3.0 as well.

    The first one is the same as always, PlayerSettings does not contain a definition for 'colorSpace'. I simply remove your code after = and just say TRUE since I know it is in linear space. My new error is:


    Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/AlloyCustomImportAction.cs(251,48): error CS0117: `PlayerSettings' does not contain a definition for `colorSpace'

    And the code in question is:
    linear = PlayerSettings.colorSpace == ColorSpace.Linear && !texImporter.linearTexture;

    How should I change this so I can compile without error and move on? Thanks! I think maybe a shader or a pack I have doesn't play well for some reason with Alloy. The only two major packs I use are RTP and AdvancedFoilageShader. Then some assorted random ones that come with some of the nature packs we use.
     
    Last edited: Jun 29, 2015
  9. Deleted User

    Deleted User

    Guest

    @Tethys
    You can probably use the same hack as before to fix it in that spot. However the root problem is still that there is something wrong with your settings files since you are missing the colorspace setting. I recommend posting about it in the general help forum and getting Unity to weigh in on it.

    I hope that helps.
     
  10. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Thanks, will do!
     
  11. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    In my quest to get a good sail shader I have been recently shown how to do reversed normals on a second material for a mesh. I have the front side working with the Transmission shader perfectly but now I need the shader to also flip the normals of a material so we can put it on the backside and block out those nasty SSAO problems we are running into. Is there a way someone could show me where that might be in the shaders or possible add a flag for this?
     
  12. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Fixed my issue with the error I was having. The problem was another major asset I am using also uses the PlayerSettings namespace. Fixed the issue by adding UnityEditor in front of PlayerSettings like so: UnityEditor.PlayerSettings.colorSpace .
     
  13. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Jebus. Why on earth would someone use a nomenclature like "PlayerSettings" as their own namespace??? Do people even check these things first?
     
    DennG, Tethys and CaptainMurphy like this.
  14. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
  15. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,371
    1+ for the current examples not showing off the abilities of the shaders.
     
    ThunderTruck and DennG like this.
  16. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Yeaaaaaaaah *grumble grumble* I know :p. I'll see if I can sneak something together quickly over the next week or so. We juggle Alloy with a bunch of other projects, and I've been keeping my eye out for something we've been producing in parallel, but haven't found something convenient to double-dip with for an Alloy example lately.

    Just curious, by examples do you mean stuff that would come with the package (and thus make it a bigger download), or just some cool webplayer examples, maybe a video to show how they're made?
     
  17. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    By new examples I mean :
    • Pictures on the asset store page
    • Webplayer examples
    • Standalone build
    yea.. a howto video would be great, too.

    Just show the different shader variants with realistic looking models/textures.
    For example the skin, eye, hair shaders on a character that doesn't look stylized.
    Car Painter shader on a car...
    Terrain shader on a Terrain... well I think you know what I mean :D
    Just show off the abilities.

    Or just like in the Unreal Engine demos or in your previous Alloy demo.. where you had these spheres.
    Something like that would be awesome too.
     
    Elecman likes this.
  18. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    +1 for How to video that goes into a bit more of an explanation on how to use Alloy and get the most out of it. I don't think you guys realize how confusing the shader lingo is for us shader noob's
     
    Last edited: Jul 2, 2015
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    @Zaddo67 @DennG Hey guys, K.C. here... I am working on a video that will be explaining how to use Alloy to it's fullest potential...especially in the creating of textures and detail. I will be covering the character based shaders since the crash course covers most of everything, using a new character I am working on. If you search back a page or two, you can see one of my characters.
     
    Zaddo67 and DennG like this.
  20. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    Awesome. When will it be released?
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    I'm trying to have all of this done after the 4th of July. And hopefully, I can get the video rendered. Stay tuned.
     
    Deleted User likes this.
  22. Deleted User

    Deleted User

    Guest

    QUICK UPDATE:
    After we managed to get some bugs fixed with our site's CMS I was finally able to update our documentation to account for the changes in Alloy 3.1 & 3.2. So that means it now documents the switch to HDR Color pickers, and the addition of the Directional Blend, Oriented, TriPlanar, and Vertex Blend shaders.
     
    Last edited by a moderator: Jul 5, 2015
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I have some questions about last changes :
    - why Alloy standard PBR shader have in the metal texture :
    - AO (G)
    - specular (B)
    - rought(A)
    Because specular is non sense since you already have metallic and roughness to define the PBR material.

    I made a try and It don't display well in Unity , did i missed something ? (i exported as mentionned above all channels)


    Unity result : Why there is absolutely no reflection at all, even after placing a reflection probe and choosing Alloy deferred rendering ?
     
  24. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden Couple questions:

    The map you've plugged into the Packed Map slot looks like just one channel from Substance Painter. That input is meant to take a packed map containing the Metallic, Occlusion, Spec-for-dielectrics, and roughness map. Please see the section on packed maps in the crash course video here:


    Regarding your question about spec., it does indeed still make sense in a Metal-Rough workflow. Substance calls the map Specular Level, and it is used as a specular intensity for non-metals only, with the range of 0-1 representing the Specular Intensity between Air and Ruby (roughly speaking). If you don't know sensible values to plug in here, middle-grey can be used (which is also the value Unity's Metallic Standard Shader is plugging in behind the scenes).
     
  25. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It could be a substance painter bug ? Or perhaps i need some re install but it's already Painter 1.4.1
    What is strange is no metal or specular shwoing up, perhaps i got some map corruption with Unity ?
    Here is my export settings
     
  26. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden When it comes to that, I don't know how to help you. I don't use Substance Painter. My suggestion would be to pick an export style that gives you seperate black and white maps for Metallic, Occlusion, Specf0 and Roughness (not smoothness), and plug them into the Alloy Material Map Channel Packer.
     
  27. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Thank you, i didn't know it was possible to use separate textures and combien them with Alloy , i will try that also.
     
  28. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Is there anything I can do to flip the vertex normals for an Alloy shader (specifically transmission single sided)? I need to apply a material to the backface by flipping the vertex normals along with it. I thought I could find examples and use those to make a one-off variation but this is a bit more complicated than I want to dig into right now.
     
  29. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @CaptainMurphy There's no easy way to do so. Something like that would require rolling off a custom shader. Question: if you're using a single-sided shader, can't you just flip the vertex normals in your modelling application? I've done so several times in the past for similar effects.
     
  30. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    It is actually to get around the issue of needing to flip the normals in the modeling app. We have tried it pretty much every way possible and what we need is a way to flip the normals in the shader. I have attached an example code that looks very similar to Alloy but is just different enough to confuse me to the point of not getting it to work because I don't know where exactly it is doing the flip. What we are doing is applying the same shader twice to the same mesh, once is on the front, once is on the back with flipped normals. We have tried doing multiple passes but it does not render SSAO correctly when done that way, and this seems to be the only method that works to block SSAO but still get transmission working right. My goal was to make it into a simple flag on the shader to be able to do the flip and not need to change a whole lot else.
     

    Attached Files:

  31. Deleted User

    Deleted User

    Guest

    @CaptainMurphy
    I'm a bit confused. Why can't you use the "Transmission/DoubleSided" shader in Alloy 3.2? It has a toggle to "invert" the backface normals by inverting the XY and my tests seemed to show it working well.
     
  32. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    That only half way works though. If you use the invert backface normals it still shows the SSAO through the backfaces. If you use a separate material with the normals inverted it doesn't. Why? No clue but we have tested it in several different scenarios using the example shaders and Alloy and it seems to only work in the first pass.
     
  33. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It was not needed, Substance Painter handles it very well with it's configurable channels export, but it can be usefull when we use other 3D packages like 3D coat for example.

    I remapped the channels on Substance Painter, there is a subtule choice when you map a map to a channel like saying picking from alpha or grey map. I redone a new project configuration following Alloy Readme and it's all good now, even very good.
    Thanks you for having made Alloy shaders :)
     
    Deleted User likes this.
  34. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The skin shader looks strange when the light is on the back only, many upper areas becomes black like some occlusion.


    I didn't find a way to have the light lot more penetrating like this

    It is possible ? perhaps chanign the LUT ? or it is too much computing heavy ?
     
  35. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden The 2nd shot you have there looks the way it does because 3 lights are active, and the SSS transmission are jacked up. Give me a moment and I'll post a screen.
     
  36. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden Here's an example showing my skin settings for a somewhat similar look. 3 Directional lights used, inspector for the skin settings shown.

    SkinEx.png
     
    KRGraphics, zenGarden and Tethys like this.
  37. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I see a better effect. So that's no chance to increase the effect with one directionnal light only it seems.

    In your screen we also see that less exposed areas tends to quickly turn too dark.
    Do you have some idea about the very dark areas in my picture ? they look almost black while other parts even not exposed to light are more natural and brighter ?
    Could it be some tweaking in the skin shader ? (i'll try reducing AO map to see if i can avoid this downside effect)


    Another subject about documentation or samples ,there is no terrain tutorial explaining how to set up the terrain to work with Alloy terrain shader for example.


    About hair , this is essential for characters, do we have some chance to have a different shader for hair not based on skin shader ?





    There is some infos on how they done it as it is a free shader
    https://forums.unrealengine.com/showthread.php?63555-FREE-Hair-Material
     
  38. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden:

    The character example provided was done in an illustrative style with a very over-emphasized occlusion map, which is why it looks so dark in shadows. This was an intentional aesthetic choice for that project. If you used a high fidelity scan (like in your included picture), it would look more realistic in shaded zones. We actually did a test with that same model back in Alloy 2.0 days with an early version of the skin shader, but did not include it due to that being a liscence violation for that asset.

    Re: Terrain We don't have a setup tutorial for that. I should be able to get around to making one in August.

    Re: Hair We have anisotropic hair shaders. They're just not used on that model due to the hair being modeled solid instead of being modeled in the pelted style that aniso shaders need.
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Even some basic cude shape or a quick metaball modeling could be used to make some tests.
    But you are right , i'll try with no AO or having it very low and see how it turns.

    Or a video tutorial or some explanation in the docs it would help as i didn't understood what to do.

    Solid hair modeling is more used in Moba or distant camera games like TPSn while pelted like hair using alpha is the most used for next gen characters specially when camera comes near.
    We can find some "pelted" hair models or make ones if you need some to make a shader.
    So any chance to see coming such hair shader in Alloy some day ?
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    Also to control the skin scattering, you need to use a transmission map. In your sp settings, your can add that as an alpha of the diffuse. If you have knald, you can bake a transmission map base
     
  41. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It is not becoming too complicated to make the SSS effect ? I thaught the example provided was complete and fully functionnal demonstrating the effect at it's best ?
    Anyway tweaking things i hope i'll get a good effect and i'll post the results here.
     
    Last edited: Jul 7, 2015
  42. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    After changing soem maps and tweaking values i got a result that suited my needs.
    One directionnal light from front to behind.

    Any chances to increase trensluency effect in front and side view allowing stronger values on some parameters ?

    And this is my tweaks that could help some people :


    Changes made :
    - Base color map : Alpha to full transmission
    - Skin map : a white image and alpha to full
    - Scattering parameters have almost no effect
    -Transmission properties :
    Weight = 1 to choose maximum trensluency (could this effect be increased ? )
    Falloff = 1 (or chanegs others sliders and tweak this one from 1 to 10)
    Bump Distortion = 0.5 , change thios value to control how much you want the trensluency effect

    We just need a new hair shader :rolleyes: (I would be happy to quickly made some for the character as an additionnal FBX model)
     
  43. Deleted User

    Deleted User

    Guest

    @zenGarden
    The Scattering Properties control the value in the basemap alpha that is used to sample the Skin LUT for the scattering effect. The scale decreases it, the bias increases it. Since you decided to make it constant for the whole model you won't see much difference.

    The "Bump Distortion" controls how much you want the normal map to distort the light passing through the model. Usually you want this to be a really low value as it will tend to force all the transmitted light towards the model's rim.

    As for the Hair shader, as Anton already stated the shader on the example model's hair is the Skin shader not our actual Hair shader. If you want to see examples of our Hair shader in action please look at the gallery for "Republique Remastered" in our website's Showcase section:
    http://alloy.rustltd.com/showcase/republique-remastered

    The character model was our effort to provide examples, but it is not the best example. Our team is dominated by environment artists rather than character artists, so it is not as complete as it could be. One of our customers, @Neptune_Imaging, will provide more detailed tutorials in the near future. Please be patient until then.

    For any further questions we'd prefer it if you would PM either myself or Anton. Thank you.
     
    overthere likes this.
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You mean you have a shader shader working and ready , why not incorporating it directly in Alloy ?
    I hope we will have some news about it and about using terrain shader also.

    All information provided in this support thread can benefit all Alloy users and show how good the shaders are, but it's ok, i'll PM next time.
     
  45. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden The hair shader is in Alloy dude, look in the shader dropdown. We just didnt use it on the character model in the samples.
     
    zenGarden likes this.
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,466
    @zenGarden hey bud, I will be covering the use of these shaders including how to make the textures for them and best practises for set up. Please be patient :)

    The work required takes a while to compose and finalise. I'm working with base textures as big as 8k.
     
  47. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I have an idea request :
    A basic Vertex coloring tool , to color vertex in the editor, this would bring a new workflow for blending textures directly in Unity and would be as awesome as UE4 vertex painting tool.
    But it could be too much work and i know you guys can't make everything people is asking ,it's impossible.

    Take all your time , i'm not working on terrain but on 3D assets.
     
  48. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @zenGarden You should check the asset store. There are several tools on it for painting vertex color in Unity.
     
  49. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Some are not developed anymore and others still have bugs or need better improvments. I just hope Unity will make a vertex paint tool that will work in any situations.
     
  50. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    I fail to see what vertex coloring tool has to do with shader framework o_O

    Anyway, could it be possible to add mask for paint properties in car paint shader? I have ended up to use car paint pretty much everything, but unfortunately it doesnt work all that nice for example skin parts, some parts on the wall etc