Search Unity

Alloy Physical Shader Framework by RUST LTD.

Discussion in 'Assets and Asset Store' started by xenius, Nov 20, 2013.

Thread Status:
Not open for further replies.
  1. Deleted User

    Deleted User

    Guest

    Hi,

    I just realized that even using the tiny minimum height value for the Parallax and POM effect, yields a too deep extrusion, especially for the POM.
    I then tried lowering the minimum height value of the slider in the shader code, but that didn't change anything. Is there any way to lower the extrusion amount further than the standard minimum height value?

    Thanks!
     
  2. Deleted User

    Deleted User

    Guest

    Also, I'm still not able to drag Bitmap2Material output maps into the Alloy Material Map Channel Packer. Any workaround for this? Can this functionality be added?
     
  3. Deleted User

    Deleted User

    Guest

    @SeanM3D
    Are you using Alloy 2.1, or are you one of the testers for the Alloy 3 pre-alpha?
     
  4. Deleted User

    Deleted User

    Guest

    @DGordon
    Sorry about the delayed response, again. At this point, it would be best if we could start a private conversation and exchange contact info to diagnose the problem. I will also need a repro scene so that I can test the assets on a PC and see if the problem is tied to the platform or not.
     
  5. Deleted User

    Deleted User

    Guest

    I'm using Alloy 2.1.
     
  6. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi @SeanM3D: The BTM outputs can't be dragged into the channel packer because they aren't -actually- textures. They're procedural textures that are only cached. They don't exist on disk.

    In good news though, for Unity5/Alloy3 we've actually been working with Allegorithmic to have a custom version of the BTM3 sbar setup to work with Alloy! Its in its final testing stages now :)
     
    KRGraphics likes this.
  7. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Perfect timing.
     
  8. Deleted User

    Deleted User

    Guest

    @SeanM3D
    Apologies for the delay. I've sent you a PM with a patch and instructions on how to apply it. Hopefully it will address your problem.
     
  9. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Hello I'm currently working on a tessellation+Alloy PBR shader and I found that the custom vertex output trick used in Alloy vertex shader is not supported in tessellation vertex modifier. here's my vertex modifier

    void SrVert(inout appdata_sr v, out Input o)
    {
    float4 uv = float4(v.texcoord.xy,0,0);
    float d = tex2Dlod(_SR_BaseHgtCur,uv).r * _SR_DetalHeightMax;
    v.vertex.xyz += v.normal * d;
    UNITY_INITIALIZE_OUTPUT(Input, o);
    o.texcoords.xy = v.texcoord;
    #if defined(_UV1AO2_ON)
    o.texcoords.zw = v.texcoord1;
    #endif
    }

    But in unity generated shader file custom vertex output is not supported

    [UNITY_domain("tri")]
    v2f_SrSurf ds_SrSurf (UnityTessellationFactors tessFactors, const OutputPatch<InternalTessInterp_appdata_sr,3> vi, float3 bary : SV_DomainLocation) {
    appdata_sr v;
    v.vertex = vi[0].vertex*bary.x + vi[1].vertex*bary.y + vi[2].vertex*bary.z;
    float3 pp[3];
    for (int i = 0; i < 3; ++i)
    pp = v.vertex.xyz - vi.normal * (dot(v.vertex.xyz, vi.normal) - dot(vi.vertex.xyz, vi.normal));
    v.vertex.xyz = _SR_tessPhong * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-_SR_tessPhong) * v.vertex.xyz;
    v.tangent = vi[0].tangent*bary.x + vi[1].tangent*bary.y + vi[2].tangent*bary.z;
    v.normal = vi[0].normal*bary.x + vi[1].normal*bary.y + vi[2].normal*bary.z;
    v.texcoord = vi[0].texcoord*bary.x + vi[1].texcoord*bary.y + vi[2].texcoord*bary.z;
    v.texcoord1 = vi[0].texcoord1*bary.x + vi[1].texcoord1*bary.y + vi[2].texcoord1*bary.z;
    SrVert (v);
    v2f_SrSurf o = vert_SrSurf (v);
    return o;
    }

    as unity shader-lab generated code cannot call this vertex modifier function with to parameter.
    Does any one know any work around?
     
  10. Deleted User

    Deleted User

    Guest

    @Lieene Guo
    Sadly I ran into that same problem while developing the Alloy 3 alpha. It was one of the many reasons why I had to abandon surface shaders. Unfortunately, as near as I can tell there is no way around it.

    Now UV1 and vertex colors are basically dead in the water, but there is a REALLY hacky way to get UV0 back. Basically, for tessellation mode you need to replace the "texcoords" field in the Input struct with something like "uv_DummyTex", then have a property defined for it. As long as that property never has any transforms applied, it will basically be a drop in replacement for UV0.

    That's the best I can offer you. Sorry.
     
  11. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi everyone :)

    I know I've been a bit radio-silence lately. We've been hauling away on Alloy 3, and are almost ready to start releasing some cool demos and tutorial information for our new system.

    As a little tease, I thought I'd share a shot from a demo I've speed-modeled out the past 3 days, that I've been using to performance-test large numbers of real-time lights/shadow casters.

    The demo proper should drop sometime in the next week or two.

    Alloy3_Accelerator_Day3.jpg
     
  12. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Okay I see. that's why Shader Forge don't generate shader-lab shaders too...
    Thank you! I am using this uv_MainTex thing now. but sadly can't out put and thing from vertex modifier.

    Here's another question.
    Now I am able to tessellate a alloy based material as in this picture
    A.png
    and without wireframe
    B.png
    The lighting is good as expected.( The wired extruded to the right is because i'm using trail version of b2m.)
    But when I put the exactly same shader on terrain.
    It comes with strange lighting effect, the dark and bright edge of object become very sharp. as in here:
    C.png
    I am multiplexing uv scale 100-1000 times to achieve tiling. I was guessing this is the reason. Because i'm using float uv coord and the floating number precision is the reason I lost those detail. but it is still the same even after I added this to the code.
    Code (CSharp):
    1.  
    2.        float2 uvScale(float2 base, float scale)
    3.         {
    4.             double2 uv = base;
    5.             uv*=scale;
    6.             uv=uv-floor(uv);
    7.             return uv;
    8.         }
    And sample texture with:
    Code (CSharp):
    1.  
    2.             float4 control = tex2D(_SR_Control,baseUv);
    3.             float4x4 uva=0;
    4.             uva[0].xy=uvScale(baseUv,_SR_SplatScaleA.r);
    5.             uva[1].xy=uvScale(baseUv,_SR_SplatScaleA.g);
    6.             //uva[2].xy=baseUv*_SR_SplatScaleA.b;
    7.             //uva[3].xy=baseUv*_SR_SplatScaleA.a;
    8.             float4x4 spa = 0;
    9.             spa[0] = tex2D(_SR_Splat00,uva[0].xy);
    10.             spa[1] = tex2D(_SR_Splat01,uva[1].xy);
    11.             //spa[2] = tex2D(_SR_Splat02,uva[2].xy);
    12.             //spa[3] = tex2D(_SR_Splat03,uva[3].xy);
    13.             spa[0].a = pow(spa[0].a*control.r,_SR_HeightBlendPower);
    14.             spa[1].a = pow(spa[1].a*control.g,_SR_HeightBlendPower);
    15.             //spa[2].a = pow(spa[2].a*control.b,_SR_HeightBlendPower);
    16.             //spa[3].a = pow(spa[3].a*control.a,_SR_HeightBlendPower);
    17.             heightWeight+=spa[0].a;
    18.             heightWeight+=spa[1].a;
    19.             //heightWeight+=spa[2].a;
    20.             //heightWeight+=spa[3].a;
    21.             spa[0].a /= heightWeight;
    22.             spa[1].a /= heightWeight;
    23.             //spa[2].a /= heightWeight;
    24.             //spa[3].a /= heightWeight;
    25.             base.rgb += spa[0].rgb*spa[0].a;
    26.             base.rgb += spa[1].rgb*spa[1].a;
    27.             //base.rgb += spa[2].rgb*spa[2].a;
    28.             //base.rgb += spa[3].rgb*spa[3].a;
    29.             material += tex2D(_SR_MASRMap00, uva[0].xy)*spa[0].a;
    30.             material += tex2D(_SR_MASRMap01, uva[1].xy)*spa[1].a;
    31.             //material += tex2D(_SR_MASRMap02, uva[2].xy)*spa[2].a;
    32.             //material += tex2D(_SR_MASRMap03, uva[3].xy)*spa[3].a;
    33.             normalTs += UnpackNormal(tex2D(_SR_Normal00, uva[0].xy))*spa[0].a;
    34.             normalTs += UnpackNormal(tex2D(_SR_Normal01, uva[1].xy))*spa[1].a;
    35.  
    The adding and dividing is because I'm trying to merg texture splat control and texture height.
    The effect is the same even if I sample only one splat texture.

    Do you have any idea why is this happening? And how can I make it nice and smooth again?
    Thanks!

     
    Last edited: Dec 5, 2014
  13. Deleted User

    Deleted User

    Guest

    @Lieene Guo To be honest, I have no idea. My knowledge of tessellation is pretty limited beyond how to use Unity's offerings to add it to our shaders. Sorry. :(

    EDIT: Scratch that, I remember now. Unity's terrain meshes don't have all the needed vertex data to calculate normal-mapped per-pixel lighting. They usually have it be a constant in their shaders. I don't remember which one it is off the top of my head, but I am sure you could look at Unity's built-in shaders to find it.
     
    Last edited by a moderator: Dec 5, 2014
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    tangent is missing. so you have to calculate it in the vertex shader.
     
  15. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    Thanks you guys, Tangent it is. I was guessing it's about tangent in the first place but in the wrong way. I was thinking that tangent space is rotated as I apply texture based vertex extrusion. And I should use tessellated triangle tangent space. but that was wrong too, cause normal map is generated in original mesh tangent space. So I was stuck there and start search for other solutions... Never think about vertex input...
     
  16. Wambli

    Wambli

    Joined:
    Feb 14, 2013
    Posts:
    13
    Hi,
    I've got some problems in visualizing Skyshop environment map after player building.
    I'm using Unity 4.6.1 and the latest version of both Alloy and Skyshop.
    In the application I've created a set of materials with Skyshop reflection that the user can istantiate and assign to variuos parts of a procedural generated mesh. In the editor everything works well, but after I build and launch the application, the reflection of the istantiated materials disappears (like it doesn't find Skyshop maps)
    Any idea on how to solve this problem?
    Thanks
     
  17. Deleted User

    Deleted User

    Guest

    @Wambli
    Unfortunately Alloy 2.1 lacks support for the current version of Skyshop. I need to examine the latest version of Marmoset's product and make the necessary changes to support it.
     
  18. Wambli

    Wambli

    Joined:
    Feb 14, 2013
    Posts:
    13
    @n00body
    I see. Please let me know as soon as you have any news about it
    Thanks
     
  19. Deleted User

    Deleted User

    Guest

    @Wambli
    Okay. We've updated to the latest Skyshop code, and tested it against their included demo content. We'll be pushing an update after the holidays.
     
  20. Wambli

    Wambli

    Joined:
    Feb 14, 2013
    Posts:
    13
    Ok. Thank you so much!
     
  21. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Does it work with Unity5 b17?
     
  22. Deleted User

    Deleted User

    Guest

    @ksam2
    It should. Though if you REALLY want to use Unity 5 I strongly recommend getting in on the Alloy 3 alpha. PM @xenius with your Alloy 2 invoice number and he'll hook you up.
     
  23. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    When can I see the Alloy 3?
     
  24. Deleted User

    Deleted User

    Guest

    @ksam2
    Do you mean when will he get back to you with your copy, or when will you see examples of Alloy 3 in action?
     
    ksam2 likes this.
  25. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    examples of Alloy 3 in action
     
  26. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    There's nothing here. :p
     
  27. xenius

    xenius

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

    Hope you haven't all minded the radio-silence too much. We haven't put out any preview images yet, mainly because I don't like to tease too far out from an actual release, as I know first-hand how irritating that can be. Plus it seems its taking a bit longer for Unity5 to be beaten into shape than I initially expected, and we don't have any sort of official release timeline for that.

    News update for you though: We're working on the new site, documentation, and sample content that will be shipping with Alloy3 which is much more robust than the previous version. We'll be putting out the first public info on the set mid January, as well as some demo builds.

    IMPORTANT QUESTION for you folks though.

    As Alloy3 is a full-system-replacement for Alloy2, we will be slowly sun-setting development/support for the latter over time. For I imagine at least a few months though following the release, the asset store download will contain the packages for both of the sets (though you will _not_ be able to have them both active in a project at the same time). We will at some point however remove the Alloy2 package from within it.

    What I'd like to know from you guys is how long you plan to be sticking with Unity 4.x, and as such would prefer to be able to grab the Alloy2 package from the assetstore?
     
    ksam2 likes this.
  28. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Does alloy have any skin shader for the Unity5?
     
  29. Deleted User

    Deleted User

    Guest

    @ksam2
    Skin, Hair, and Eyes. ;)
     
    ksam2 and KRGraphics like this.
  30. Yakukopo

    Yakukopo

    Joined:
    Jan 4, 2015
    Posts:
    1
    Is there any documentation for the skin shader? Because I couldn't find any.
     
  31. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Yakykopo : We're working on a new documentation framework right now. It will simul-launch with Alloy 3.0 and will include per-shader/per-property type breakdowns, pictures examples, and be closer in structure to something like the unity api docs.
     
  32. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Is there any demo or video or something?
     
  33. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @ksam2 Not yet. We're getting ready to go from Alpha to Beta, at which point we'll be releasing info/pics/video etc.
     
    ksam2 likes this.
  34. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Hi alloy team,

    Can you explain me why in your doc:
    I need to byPass sRGB Sampling using my original maps? Using PBR we need sRGB alogn with linear color space ...

    Thanks,
     
  35. xenius

    xenius

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

    The reason you need to use byPass sRGB on the packed map so that the metallic, occlusion and specf0 map are interpreted linearly (rather than on a curve).

    Note that the other maps do NOT need this checked, and the Alloy channel packer will automatically set this for you when you pack a map. The source maps that you plug into the packer do NOT need to be set to this. The packer configures everything properly automatically.

    We include that line in the documentation in case you don't use the packer, and combine things in photoshop yourself for the packed map, so you know to set it up equivalently in the texture import settings.

    As for linear color space, without it, lighting is not summed correctly, and textures are not sampled in the correct color space. In short: all the math is wrong unless you're in linear.
     
  36. Deleted User

    Deleted User

    Guest

    @kaz2057
    Yeah, what @xenius said. Also, we strongly encourage you to use our map packer tool, as that's how we pre-calculate and store specular antialiasing information so that it has no runtime cost.

    EDIT:
    Oh I see, you thought we meant setting "Bypass sRGB" on your input textures that you feed to the map packer.
     
  37. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Excuse me for my stupid question but ....

    Following Sebastian Lagard guideline, the metalness value is based on linear value ....

    If we use linear scale, why we don't degamma e regamma texture using sRGB buffer?

    This is the chart for example using Quixel: http://www.marmoset.co/wp-content/uploads/materialref01.png

    Albedo and Metalness are sRGB

    It is the same setup for UE4 pbr shader? alloy = UE4?

    Thanks for clarification :)
     
    Last edited: Jan 7, 2015
  38. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @kaz2057 That chart is not showing the metallic value of a surface. M stands for 'microsurface' in that chart, which is their confusing word for 'smoothness'. You would use the inverse of that value for the roughness of the surface in Alloy.

    The charts shown there are for Spec-Gloss style PBR, namely using an SRGB Albedo and Specular Color, along with a smoothness value.

    Alloy's inputs are Metal-Rough style, which is an SRGB BaseColor, and Linear input values for Metallic, Occlusion, Specf0 (0-0.08 range) and Roughness.

    edit: Yes, Alloy's setup is akin to Unreal 4's (assuming you are using one of their material graphs that takes a Specf0 value for dieletrics.
     
  39. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey,

    How does Alloy 3.0 compare to the new Unity 5.0 PBS? What are the pros/cons of using it over the built in? I'm absolutely loving the workflow between Algorithimic's Bitmap2Material and substances with the standard shaders ... do you have an easy workflow with Allgorithmic's products / substances? With that said, Alloy 2.0 already offers many more shader variants (skin shaders, etc) than the 5.0 Standard shader ... so I'm very much hoping I can return to you and continue my same workflow.

    Also, the error that I was getting for so long with the deferred rendering artifacts on the mac with transparent shaders was apparently around since before 4.0. I found someone else discussing it on a forum somewhere (wish I remembered where) and someone claimed 5.0 was finally fixing that bug. I'm not going to pretend to understand it, but hopefully that should be knocked out without you guys having to do anything (and thus allowing me to use Alloy again if I wish) ... I can say that I'm NOT having that bug with transparency in 5.0 Unity shaders ... so it seems like it may all be okay if I understood what I read. Thanks for going back and forth so many times about it.

    Looking forward to hearing a bit about 3.0 so I can make an informed decision about which shader set I'm going to use for my current project.

    Thanks!,
    Dale
     
  40. Deleted User

    Deleted User

    Guest

    @DGordon
    If you'd like, we can hook you up with an alpha copy of Alloy 3 and you can see for yourself. Just PM a request to @xenius and include your Alloy 2 purchase invoice number.
     
  41. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @DGordon Hi hi! As n00b said, shoot me your invoice number (or ping me on skype, PM your sn) and I'll be happy to give you a tour.

    Re: Substance stuff: We're working with allegorithmic to make sure Alloy has a first-class integration with the Substance tools. On top of our shader for SD4 (that's getting an upgrade at the moment), we've got a custom B2M3 version setup for Alloy that almost done, and are working with them to add the last element (srgb override for procedural textures) that's needed for sbars to fully work with Alloy3. I don't have an ETA from them on when those two things will be 100%, but I'll be chilling with them at GDC, and its definitely in the pipeline (and super critical to me, as my entire personal pipeline revolves around substance).

    Re: Features of Alloy: I'm keeping mums on things publicly for the most part, but I'll put it this way. The set's flexibility has grown immensely (think its like at ~1.2 million permutations if my wolfram alpha math isn't off, YAY shaderfeature in Unity5!).

    I'm still on holiday break with family on the other side of the country from my main work machine, soon as I'm back I'll be putting together the videos to show off the new shiny!
     
  42. ThunderTruck

    ThunderTruck

    Joined:
    Sep 25, 2013
    Posts:
    61
    @xenius
    Hi,
    I would try Alloy3 alpha for Unity5 , and of course I have the invoice number. But really I do not find how to send you a PM in the forum
     
  43. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    I didn't buy and test alloy 2 but I'm going to buy Alloy3! Can't I test Alloy3 alpha?
     
  44. Deleted User

    Deleted User

    Guest

    @ThunderTruck
    Go to @xenius profile by clicking his image, or the name links in any of these posts. Once there, you then need to find and click the link "Start a conversation".

    @ksam2
    If you purchase Alloy 2, then you will automatically receive the upgrade to Alloy 3 when it officially comes out. It will not be a separate product, nor will it require a separate purchase. So that's why we require you to purchase Alloy 2 and have an invoice number to get in on the alpha.
     
    ThunderTruck and ksam2 like this.
  45. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    So I don't know if I like Alloy or not! I just want to test first
     
  46. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @ksam2 I'm sorry, but there's no way for us to create a demo or 'try before you buy' version of the framework without actually just giving out the framework. We'll have a bunch of demo builds, videos, and documentation however, which should give you enough information to make an informed decision.
     
  47. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Do you guys have any video tutorials on how to get a few different materials looking AAA? Even in 2.0 there were a few different skin shaders, and I don't know enough to use them optimally yet. A tutorial going from start to finish on one character would be super helpful ... I wouldn't mind seeing what your workflow is on something like a sword or armor as well. I get the theory, but theres a big difference between that and seeing someone use it correctly.

    Thanks!
     
  48. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @DGordon We'll be producing a bunch of vids, as well as having some friends on here like @Neptune_Imaging do some that fall outside our production specialization (his characters are crazy-gorgeous, and he has the skin/hair/eye workflow down pat).
     
    KRGraphics likes this.
  49. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Wow thats fantastic. Its really a huge help for anyone who isn't well versed in using PBR ... giving me a load of features is great, but if I only know how to use a few of them, the rest only do so much ;). Keep up the good work!!
     
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    That is correct... so far the hair is the hardest to do but I am powering through this... and the video is in planning.
     
Thread Status:
Not open for further replies.