Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets [RELEASED] Old Fund

Discussion in 'Works In Progress - Archive' started by ToivoPr, Aug 4, 2017.

  1. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    1.jpg
    Hello. I want to introduce you the "Old Fund" location, which is based on the principles of material layering in Unity.

    View panorama on ArtStaion

    On this work we wanted to check how convenient it is to work with a material layering shader from the Allegorithmic, and the result was impressive.
    Due to these technologies, the work has turned out to be very flexible, convenient and effective, so we were able to achieve acceptable results within a relatively short period of time.

    All materials in the scene were made procedurally in the Substance designer, assigned to the models by the masks in the Substance painter and automatically picked up in Unity.
    This allows you to easily customize individual items in .sbsar materials right in the game engine.This workflow also allows you to make adjustments to .sbsar files and conveniently change these materials for their own needs without changing the model's textures.
    Also, this technology has the ability to generate normal maps from material's blend masks automatically in the Unity engine, and this means that we can re-use one normal map and several masks for each object.
     
    Last edited: Jan 14, 2018
    Mark_01, mephistonight, Mauri and 4 others like this.
  2. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    GCatz, terrapinbear, Hikiko66 and 3 others like this.
  3. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    looks very nice
    would love to see a night scene of this or maybe a video with a FPcontroller walking around in it
    keep at it
     
  4. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    could u explain how the masks are painted in subspainter? is it on a uv map or baked in vertex colors?
     
  5. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    Mister-D, thanks for reply. Everything is done by layering materials using masks (on a uv map). A little later I'll record a video about how it's done
     
  6. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    This is great work! Materials look fab and it's really clean lighting too. I'd love to see a video on the material layering, its something I've been meaning to experiment with - what's the workflow like for that in Painter? Is the composite mask generated from whatever masks you have in the layer stack?

    Great stuff, looking forward to more :)
     
  7. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    tweedie, thank you, I will make a video soon.
     
  8. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    what exactly is dedicated to material layering and what is classic texturing? are there decals used or is this all substance painter and baked?
     
  9. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    Last edited: Nov 28, 2017
    mephistonight likes this.
  10. SmashedAvocado

    SmashedAvocado

    Joined:
    Dec 19, 2013
    Posts:
    45
    Amazing! I can't wait to see the asset store asset and check it out.
     
  11. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    This thread is awesome and deserves way more attention from the Unity community. I've been trying to figure out how best to texture large gameobjects in a unique way without adding huge amounts of draw calls for quite a long time now. This thread gives a fantastic solution to a difficult problem. Thank you for sharing!
     
    jeromeWork likes this.
  12. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
  13. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    409
    Congrats! Can't wait to try it!
     
  14. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Really Awesome !! :) I was wondering if you plan on updating this shader for 2018 and the different Pipes. I would love to be able to use this in the VR Pipeline and HD Pipeline For 2018.

    Also would I be allowed to use the Modified shader to make my own 3D Assets to sell??
     
    Last edited: Feb 17, 2018
    Mark_01 likes this.
  15. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    Thanks, I have plans to make this (or similar) shader works with 2018. And of course you can use it whatever you want ;)
     
  16. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    That's all I needed to hear. Just Bought it. :)
     
    Mark_01 likes this.
  17. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    Thank you, man, it is very motivating
     
    EddieChristian likes this.
  18. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    No Worries. I already did an Oculus VR Build that you can walk around in. The only change I made to your demo scene was to add Colliders on the walls. It did take awhile to load because of the textures.

    But it's running between 83 and 97 FPS and looks Awesome. :)
    I would love to see video tutorials on setup and optimization for this as well.
     
    ToivoPr and shredingskin like this.
  19. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Same, beautiful asset, it'll be interesting seeing how it will work with the high rendering pipeline that already has a layered shader. Would be pretty neat to see it updated.
     
    ToivoPr likes this.
  20. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    Can anyone / or author confirm if the shader used for this asset still works in 2017.3? Loading the Json file fails and the compositing of the masks in to one texture fails for me.
     
  21. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    do you use our patched tools or original? can you sent me your .json file? it must work in 2017.3
    And what version of substance painter did you used?
     
  22. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    Hi @ToivoPr

    Many thanks for your reply. I'm using your patched versions of the shader and .cs file. I downloaded them from your article on 80.lv

    I'm using Substance Painter 2018.1.1

    The error I get is:

    "
    Code (CSharp):
    1. NullReferenceException
    2. AlgLayeredMaterialEditor+MaterialLayeringData.Load (System.String jsonPath, System.String targetPath) (at Assets/Allegorithmic/MaterialLayering/Editor/AlgLayeredMaterialEditor.cs:210)
    3. AlgLayeredMaterialEditor.LoadJson (UnityEngine.Material targetMaterial) (at Assets/Allegorithmic/MaterialLayering/Editor/AlgLayeredMaterialEditor.cs:645)
    4. AlgLayeredMaterialEditor.OnInspectorGUI () (at Assets/Allegorithmic/MaterialLayering/Editor/AlgLayeredMaterialEditor.cs:470)
    5. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1253)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    "

    I'm wondering if it's a Substance Painter thing because I've found a few other people on the Allegorithmic forums talking about their UnityPackage not working anymore too. Can I ask, which version of Painter are you using that definitely still works? I'll try and match versions with you, if it's even possible to downgrade Painter?

    Unity doesn't allow attaching of JSON files so unfortunately I've had to quote the whole file below...

    Thanks,
    M


    Code (JavaScript):
    1. {
    2.     "format": {
    3.         "version": "1.0"
    4.     },
    5.     "shaders": {
    6.         "Main shader": {
    7.             "materials": {
    8.                 "Material1": "//shelf/plastic_wall_reinforced.sbsar/Wall Reinforced Plastic",
    9.                 "Material2": "//shelf/red_paint.sbsar/red_paint",
    10.                 "Material3": "//allegorithmic/steel_painted.sbsar/Steel Painted",
    11.                 "Material4": "//allegorithmic/concrete_dusty.sbsar/Concrete Dusty"
    12.             },
    13.             "parameters": {
    14.                 "Common Parameters": {
    15.                     "ao_intensity": 0.75,
    16.                     "emissive_intensity": 1,
    17.                     "horizonFade": 1.2999999523162842,
    18.                     "nbSamples": 256
    19.                 },
    20.                 "DebugChannel": 0,
    21.                 "DebugMode": false,
    22.                 "Material 1": {
    23.                     "normal_intensity1": 1,
    24.                     "u_coords1": 35
    25.                 },
    26.                 "Material 2": {
    27.                     "mask_normal_intensity1": 0,
    28.                     "mask_normal_offset1": 0.10000000149011612,
    29.                     "normal_intensity2": 1,
    30.                     "u_coords2": 5
    31.                 },
    32.                 "Material 3": {
    33.                     "mask_normal_intensity2": 0,
    34.                     "mask_normal_offset2": 0.10000000149011612,
    35.                     "normal_intensity3": 1,
    36.                     "u_coords3": 5
    37.                 },
    38.                 "Material 4": {
    39.                     "mask_normal_intensity3": 0,
    40.                     "mask_normal_offset3": 0.10000000149011612,
    41.                     "normal_intensity4": 1,
    42.                     "u_coords4": 35
    43.                 },
    44.                 "UseNormalFromMask": false
    45.             },
    46.             "shader": "pbr-material-layering",
    47.             "shaderInstance": "Main shader"
    48.         }
    49.     },
    50.     "texturesets": {
    51.         "Slats": {
    52.             "Mask": {
    53.                 "Blending mask": "Slats_Mask_Blending_mask.png"
    54.             },
    55.             "Mask2": {
    56.                 "Blending mask": "Slats_Mask2_Blending_mask.png"
    57.             },
    58.             "Mask3": {
    59.                 "Blending mask": "Slats_Mask3_Blending_mask.png"
    60.             }
    61.         }
    62.     }
    63. }
    64.  
     
  23. mephistonight

    mephistonight

    Joined:
    Dec 14, 2016
    Posts:
    75
    This appears to be a Substance Painter problem, not a problem with Unity nor the shader. The following will fix it for anyone else if you're having this problem:

    At the bottom of the Json files created by Substance 2018.1.1 there's a Json node called "texturesets". It should read like this:

    Code (JavaScript):
    1.  "texturesets": {
    2.         "YourTxtSetsName": {
    3.         "shader": "Main shader",
    4.         "stacks": {
    5.             "Mask": {
    6.                 "Blending mask": "YourTxtSetsName_Mask_Blending_mask.png"
    7.             },
    8.             "Mask2": {
    9.                 "Blending mask": "YourTxtSetsName_Mask2_Blending_mask.png"
    10.             },
    11.             "Mask3": {
    12.                 "Blending mask": "YourTxtSetsName_Mask3_Blending_mask.png"
    13.             }
    14.             }
    15.         }
    16.     }
    However, in the 2018 version of the Json file that gets exported, the line that specifies the shader and the "stacks" reference is missing. I inserted them manually and the Json loads fine. The SimpleJson plugin is looking for the Stacks KVP, so I'm guessing that's why it fails. This will also fix not being able to reimport the shader settings back in to Painter.

    "YourTxtSetsName" in the code snippet above obviously should be changed to whatever you specified your texture sets as in Painter.

    It does mean manual intervention is needed for now for any new Json file you create but at least it's fixable.

    Hope this helps someone else.

    Cheers,
    M
     
  24. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Is there going to be an update for 2018 with the new hd pipeline workflow ?
    I really hope there is, beautiful asset.
     
  25. hsxtreme

    hsxtreme

    Joined:
    Apr 14, 2017
    Posts:
    55
    Would you like to release a demo to test the performance?
     
  26. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    why did you remove it i was about to buy it
     
  27. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    Hey
    Sorry, asset is not supported with the new Unity version, that was a reason to remove it from the store before the next update
     
  28. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    i m still using unity 2017
     
  29. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    So are you going to update it ?
    The asset was amazing, too bad the substance layer shader has some problems with the new unity (and also SRPs).
    Hope to see another asset this quality.
     
  30. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    hey sharedingskin. Thanks for the attention to the good old asset, sorry for the no support. At the moment we are busy working on the game- but after release, we will share our new material layering shader and some new assets and improved new locations. It is on plans
     
    shredingskin likes this.
  31. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    any chance to bring it back even for 2017
     
  32. ToivoPr

    ToivoPr

    Joined:
    May 17, 2017
    Posts:
    13
    Sorry, as I said before- asset is not supported and needs to update. I have that in the far plans, but at the moment it is unavailable, unfortunately.
     
  33. mikleas

    mikleas

    Joined:
    Dec 31, 2014
    Posts:
    10
    I hope it gets back as it is a great asset! Purchase it a few time ago, and just remember it after see Half Life Alix in VR (Saint Petersburg like environment) . I´m trying to make it work in 2019.3 hdrp , maybe convert the .sbsar to materials?
     
  34. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    You can use the layered lit shader, but I don't really know where to put the mesh normal.