Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    But alloy already free. :eek:
     
    ceebeee likes this.
  2. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    I guess he bought it before it went free.
     
  3. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    can you tell me what to be added or modify?


    EDIT:
    is there anyway when exporting my scene to a package (i selected dependencies) that will unity search the packed maps as well as the alloypm settings out? cuz i need to remove unused assets to make the project folder smaller for git
     
    Last edited: Mar 22, 2018
  4. Teosis

    Teosis

    Joined:
    Jan 24, 2018
    Posts:
    22
    Thanks for the reply. Got the problem resolved by re-importing Alloy. I suspect I've moved the Alloy folder from the root and although moved back shortly after the errors might've persisted, I think.
    _
    and

    I believe there were plenty of additional maps and textures in the package, some caustics for example and some other goodies which could be seen in the Alloy crash-course video, any chance to see those uploaded somewhere, or included in the Alloy package itself? I gather there were a lot of stuff apart from a possibly out-dated example scenes and what not, would be a pity to loose it all.
    _
    P.s.
    I know your time is very limited, but is there any chance to see Alloy integration with this beast one day?
    https://assetstore.unity.com/packages/3d/characters/granite-for-unity-indie-51026
    http://graphinesoftware.com/products/granite-for-unity
     
    Last edited: Apr 8, 2018
  5. ore0

    ore0

    Joined:
    Feb 12, 2017
    Posts:
    3
    Hi,

    I'm getting errors that @n00body seems to have fixed in 3.6.1 for Unity 5.6 but I'm still on Unity 5.5.5f1 and the asset store is pulling in Alloy 3.5.2 for me.

    Any chance Alloy could be updated for 5.5.5f1 or tell me how I may fix these two problems myself please?

    Thanks

    Immediately after import:


    NullReferenceException: Object reference not set to an instance of an object
    Alloy.MaterialMapChannelPackerDefinition.IsPackedMap (System.String path) (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/MaterialMapChannelPackerDefinition.cs:232)
    Alloy.AlloyCustomImportAction.IsAlloyPackedMapPath (System.String path) (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/AlloyCustomImportAction.cs:19)
    Alloy.AlloyCustomImportAction.OnAlloyImport (UnityEngine.Texture2D texture, Alloy.OnAlloyImportFunc onImport) (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/AlloyCustomImportAction.cs:44)
    Alloy.AlloyCustomImportAction.OnPreprocessTexture () (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/AlloyCustomImportAction.cs:144)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.AttributeHelper.InvokeMemberIfAvailable (System.Object target, System.String methodName, System.Object[] args) (at C:/buildslave/unity/build/Editor/Mono/AttributeHelper.cs:342)
    UnityEditor.AssetPostprocessingInternal.PreprocessTexture (System.String pathName) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:293)


    When starting Material Packer:


    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[Alloy.PackedMapDefinition].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    Alloy.MaterialMapChannelPackerDefinition.get_PackedPack () (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/MaterialMapChannelPackerDefinition.cs:219)
    Alloy.AlloyCustomImportObject.get_PackMode () (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/AlloyCustomImportObject.cs:59)
    AlloyMaterialMapChannelPacker.OnGUI () (at Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/AlloyMaterialMapChannelPacker.cs:221)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  6. ore0

    ore0

    Joined:
    Feb 12, 2017
    Posts:
    3
    Update: I managed to fix the above by replacing the content under Assets\Alloy\Scripts\MaterialMapChannelPacker with the update from the github repo.
     
  7. Deleted User

    Deleted User

    Guest

    @OP3NGL
    Unfortunately, that's just a symptom of how we had to have asset files paired to textures that aren't referenced by them. You have to manually add those to packages.

    @Teosis
    Probably not at this point on both counts.

    @ore0
    Yeah, 5.5 was before we started keeping versions of Alloy that mapped to specific Unity releases. The best I can offer you is a link to the "unity-5-6" branch in the Alloy GitHub repo:
    https://github.com/Josh015/Alloy/tree/unity-5-6
     
  8. ore0

    ore0

    Joined:
    Feb 12, 2017
    Posts:
    3
    no worries, I actually used the master (Alloy 4.2.0 instead of 3.6.4), seems to work fine so far (by just replacing Assets\Alloy\Scripts\MaterialMapChannelPacker, lot of breaks if I used the whole repository as a lot of API changes in Unity), thanks a lot for your response.
     
    Last edited: May 6, 2018
  9. EricWilliams

    EricWilliams

    Joined:
    Jun 23, 2017
    Posts:
    40
    So I edited my first shader and I'm surpised it came out as well as it did, I really have no idea what I'm doing.

    I combine Anamaria Todor's blur shader with Alloy's glass shader to have a refraction blur option and the result isn't too bad. The blur does fall apart when it's maxed and there's small, high contrast areas like lights (the light box I have setup) but otherwise it does pretty well. I don't know if anyone would be interested but I could share the modified code?

    Here's a youtube clip of me fiddling around, I tried to speed it up and cut it so it didn't drag on too long.
     
    Last edited: May 9, 2018
    ceebeee and chelnok like this.
  10. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    I wouldn't mind seeing how you did this. Please share :)
     
  11. EricWilliams

    EricWilliams

    Joined:
    Jun 23, 2017
    Posts:
    40
    Here's a package, contains a modified distort and a modified high quality glass. To try it out it's listed in the Alloy shader menu under glass as "HighQaulity Modified"

    It requires Alloy, the includes in the modified shaders point to Alloy shaders. I added a refraction brightness slider, this will allow you to go above default brightest color value in the color picker. Although, it's almost certainly not the way to try for a frosted glass look as more light out than in doesn't make sense.

    Only thing new to the glass hq modified.shader are the sliders to adjust the values, and the include to point to the new distort. Most of the new code is in the distort modified.cginc, everything below the first "//return aForwardColor(s, s.baseColor * refr);" is slightly modified code from Ana's blur shader.

    edit - just a reminder, I'm new to editing shaders and I wouldn't even attempt to write one yet, so go easy on me :p I may come back to this and try a different blur algorithm at some point to see if I can get it to blur a lot more without artifacting.
     

    Attached Files:

    Last edited: May 9, 2018
    ksam2 and chelnok like this.
  12. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello guys, Will be there version of alloy for unity 2018.1 I have problem with substance (exceptions about that)
     
  13. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Substance has been deprecated by unity, it's not alloy's problem
     
  14. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Yes and no. It's not built in anymore, but it's still supported through Allegorithmic's Substance in Unity plugin which is free. https://www.assetstore.unity3d.com/en/#!/content/110555

    Just install that into 2018, and then everything works again.
     
  15. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    is there any wayss to convert the alloy packed into a usable packed map ?
     
  16. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    Did anybody ever mentioned alloy changes the way point lights looks like? It reduce intensity and range of a point light, I can't get similar result as standard defered shading.
     
  17. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Thanks you for this. It looks better now.
     
    EricWilliams likes this.
  18. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Yes but actual version of alloy shows exception about substance, so it is n way to use it in 2018.1
     
  19. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Like I said, use the Substance feature off the asset store.
     
  20. EricWilliams

    EricWilliams

    Joined:
    Jun 23, 2017
    Posts:
    40
    Ceebeee, that doesn't fix the error. As far as I can tell the only way to fix it is to modify the code yourself.

    In AlloyCustomImportAction.cs
    Comment out line 310:
    var proceduralTexture = tex as ProceduralTexture;

    Right below that comment out the entire 3rd else if statement, so the condition:
    "else if (proceduralTexture != null)" Make sure to not accidentally comment out the curly braces for the previous if else statement. All the way to right before but not including "return count;"
     
  21. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey,

    I know you guys aren't doing any more work on this besides maintainence (thanks, btw, I picked this up pretty early on), but maybe you can tell me if there's a way to accomplish something or not. Note that I'm working in Unity 2017.

    Is there any way to use an oriented blend shader to achieve cohesion between my moss on the Y axis as well as the x/z? It works well on the x/z axis, but when it runs up and down the y axis, it just stretches the same texture. It obviously is ignoring the y for the orientation, which is why its stretching. What I would ideally like is to have the y taken into account as well, so the moss creeps up along the walls and up the walls in a way which keeps it all connected. If not, I'll just use the weighted blend shader which is good enough for my purposes, even though this would be nicer ... or see if I can figure it out using ASE with Alloy.

    Notice the stretched moss on the vertical walls.

    delete my account page
     
    Last edited: Jul 12, 2018
  22. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I have no idea if it matters whatsoever but I believe they flipped the Y in '17 - it is likely a clamp messing up being given inverted data?

    Total guess
     
  23. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @DGordon: The entire point of the oriented shaders is that they're projective on a single plane. If you want to project on all 3 axes, the Triplanar shaders are the type you want.
     
  24. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Any chance we can get this working in 2018? Just made the jump and alloy is broken. Our entire game uses Alloy... Sad moment. Any advice to fix quick? Obviously substance is no longer supported hence one of the issues.
     
  25. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    Might I recommend just looking a couple of posts up? ;) Alloy works with Unity 2018.X and substance if you install the official plugin from Allegorithmic.
     
  26. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Corvwyn, it is not working at all. So not sure. I will dig through.
     
  27. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
  28. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Ok, substance is finally fixed, but now the following error.

    upload_2018-7-14_12-43-35.png
     
    Crossway likes this.
  29. Adam_Starcaster

    Adam_Starcaster

    Joined:
    Dec 7, 2012
    Posts:
    37
    Can you share your scripts that got it to work?
     
  30. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    I confirm It doesn't work with Unity 2018.2.1f1.

    I don't use Alloy anymore but I use its channel packer tool that is really useful!
    Please fix it for Unity 2018.2.1f1. I've spend 125$ to buy this that was a lot of money for me! so let me have channel packer at least.
     
    Last edited: Aug 2, 2018
  31. BroVodo

    BroVodo

    Joined:
    Oct 2, 2012
    Posts:
    52
    So did we ever get those extra tutorials about character shading mentioned in the crash course? It would be really cool if there was just a little info on the eye shader and how to go about making texture maps for it.
     
  32. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hi,

    I am using the high quality hair shader and there is a problem when the character is facing the sun, basically if the hair is blonde I will see another layer of brown hair depending on the angle Im looking at, do you know how to fix this?

    I think what Im seeing is the bottom of the hair where the sun couldnt light it up but it looks weird.
     
  33. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    389
    @Crossway maybe they could open source the channel packer tools on github?
     
    Crossway likes this.
  34. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    I paid 125$ but they not even going to do this!!!!
     
  35. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    If you have access to substance designer, just create a simple substance that combines 4 textures into rgba channels on a single texture, or whatever other channel packers you need. I also was using the Alloy channel packer, but I decided to remove the dependence on their code and just use that.
     
    Crossway likes this.
  36. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Just going to note I got that working in 2018 as well. Even if you don't own SD, I believe there is a free trial.
     
    twobob likes this.
  37. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    You mean Alloy channel packer works for you in 2018 too? Can you please share with us too?
    Thanks a lot.
     
  38. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    No, I'm sorry for the confusion. I meant creating a substance with SD for this works in 2018 with the assetstore download.
     
    Crossway likes this.
  39. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    I see so much about this channel importer being broken in 2018 I decided to look. it's just a C# script, easy to modify. It's only broken because they removed substance support from 2018:


    Comment out those two sections as marked, and it works again. (of course without substance support)
     
    Teosis, KarelA, Crossway and 2 others like this.
  40. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    Thannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnk you. :)
     
    twobob likes this.
  41. Deleted User

    Deleted User

    Guest

    @skinwalker
    Unfortunately that shader has always had problems due to the layering trick it uses. Sadly, you just have to tweak the settings until it looks good enough.

    Sorry for the late reply. My day job is sucking up all my time and energy lately.
     
  42. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Is there chance to get Alloy shader be updated to 2018 version of unity?
     
  43. Deleted User

    Deleted User

    Guest

    @Jakub_Machowski
    Short answer: Nope. We're in maintenance mode for the Unity versions we currently support. I just don't have the time or the energy for this project like I used to, and it seems like Unity is starting to have comparable offerings by default.
     
  44. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    if you read through the recent thread you can see it can be made to work on 2018, for the most part, you just need to do the edits yourself. (assuming you mean legacy pipeline of course, if you're asking for LWRP or HDRP support, that's a whole other thing and probably not happening)
     
  45. Corvwyn

    Corvwyn

    Joined:
    Nov 15, 2013
    Posts:
    114
    @Jakub_Machowski I'm using Alloy with 2018.2, and there are no problems if you install the new Substance plugin, or comment out that part. See previous comments.

    If you're starting a new Unity project, and you want to use the High Definition Render Pipe (HDRP), then you've got something similar to Alloy. It's not really finished yet, but if your project isn't going to be released in a while, then you should be good to go. Seems like it won't be finished with decent documentation before 2019, but it should be quite usable in 2018.3.
     
  46. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    WE dont use HDPR for now we use defeault render pipeline, HDPR is too young, not to well optimized. We are going to buy amplify shader :) And do thing with that :) Thanks for info
     
  47. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Hey, fellow alloyers! As I understand there is no regular way to add fade transparency to a skin shader, but I wonder is it technically possible at all? And how hard this task could be? Should I try to find a freelancer who can code shaders to add this for me or it's a dead end?

    upd. I found the guy and he modify the shader pretty well, if someone need it.
     
    Last edited: Nov 17, 2018
  48. fildax

    fildax

    Joined:
    Apr 7, 2017
    Posts:
    37
    Anyone got displacement to work? Looking for tips how to bake displacement map to be used in alloy. As there is no "bias" option I understand it uses .5 value? Any tips appreciated.
     
  49. Teosis

    Teosis

    Joined:
    Jan 24, 2018
    Posts:
    22
    Good day every one,
    Was quite happy to get Alloy up and running on unity 2018 thanks to Ceebeee's post above but soon enough I've stumbled upon another issue (Unity 2018.3.5f1) -- trying to change the Tint on any object with Alloy material on it would produce red error in the console which says: "can't read Float value from token!"
    Seems like it's Alloy debug log message from AlloyFieldLexer.cs script, but it's all greek to me. Could someone help with it?
    The part of the script which Unity references is:

    Code (CSharp):
    1. private void ExpectType(ValueTypeEnum type) {
    2.         if (ValueType != type) {
    3.             Debug.LogError("Cant read " + type + " value from token!")
    the actual Error message:
    Cant read Float value from token!
    UnityEngine.Debug:LogError(Object)
    AlloyValueToken:ExpectType(ValueTypeEnum) (at Assets/Alloy/Scripts/MaterialInspectors/Editor/FieldBased/AlloyFieldLexer.cs:93)
    AlloyValueToken:get_FloatValue() (at Assets/Alloy/Scripts/MaterialInspectors/Editor/FieldBased/AlloyFieldLexer.cs:79)
    AlloyFloatParser:GenerateDrawer(AlloyInspectorBase) (at Assets/Alloy/Scripts/MaterialInspectors/Editor/FieldBased/Drawers/AlloyFloatDrawers.cs:36)
    AlloyFieldParser:GetDrawer(AlloyInspectorBase) (at Assets/Alloy/Scripts/MaterialInspectors/Editor/FieldBased/AlloyFieldParser.cs:49)
    AlloyFieldDrawerFactory:GetFieldDrawer(AlloyInspectorBase, MaterialProperty) (at Assets/Alloy/Scripts/MaterialInspectors/Editor/FieldBased/Drawers/AlloyFieldDrawerFactory.cs:35)
    AlloyFieldBasedEditor:OnAlloyShaderGUI(MaterialProperty[]) (at Assets/Alloy/Scripts/MaterialInspectors/Editor/FieldBased/AlloyFieldBasedEditor.cs:87)
    AlloyInspectorBase:OnGUI(MaterialEditor, MaterialProperty[]) (at Assets/Alloy/Scripts/MaterialInspectors/Editor/AlloyInspectorBase.cs:201)
    UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)
     
  50. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Really the editor needs completely rewritten for newer unity. I see all kinds of problems with it. But nothing that causes a red error. Setting tint worked fine for me on 2018.3.6f1