Search Unity

Alloy Physical Shader Framework Version 3 For Unity 5

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

  1. Teosis

    Teosis

    Joined:
    Jan 24, 2018
    Posts:
    20
    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)
     
  2. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    379
    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
     
  3. Teosis

    Teosis

    Joined:
    Jan 24, 2018
    Posts:
    20
    It seems it had to do with the deferred shaders from another package which I'm using to deal with the foliage. There was no conflict with the shaders before, so it never occurred to me they might be the reason. Though I still can't wrap my head around how editing the script which disable Substance could cause the issue with shaders.
    The red error in the console still persists but seemingly cause no trouble no more - I'm able to enter the playmode and building the build seemingly works too. I'm loosing some additional features on the grass though, but that's another story.
    Thank you for pointing out that everything worked without errors on your end, it made me check additional possible causes of the problem.
     
    Last edited: Feb 22, 2019
  4. dersh

    dersh

    Joined:
    Mar 25, 2017
    Posts:
    2
    Hey! I've seen a lot of people having issues with Alloy on Android builds with white splotchy textures and no solution. I've finally found out what is causing it so hopefully this will be helpful to those in need.

    On our end it was caused by two things:
    1) True blacks and true whites in textures. Just nudge the white/black levels by 5% in both directions and this'll fix that.
    2) Alloy's forward rendering shaders require at least one realtime light. You can fix this by jumping into Forward.cginc and checking for the realtime light sections. There do #IFs for GLES and if you're using android ignore the realtime stuff.

    That should do it!
     
  5. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    86
    I presume Alloy is unusable in 2019 HDRP?

    Anyone has suggestions for a good replacement hair shader that works with HDRP?
     
  6. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    379
  7. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    86