Search Unity

[RELEASED] InTerra - Object-Terrain Blending, Hiding Texture repetition & More

Discussion in 'Assets and Asset Store' started by IneffabilisArcanum, Jun 17, 2021.

  1. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Hi there !

    I'm really happy to introduce you my first asset InTerra after spending months on it and I really hope that everything is ok and if not that I will be able to fix the issue as soon as possible :)

    If anyone is interested in trying it and writing a review, I will send you a free voucher :)


     
    Last edited: Jul 6, 2021
  2. clobo

    clobo

    Joined:
    Mar 9, 2015
    Posts:
    6
    I would like one voucher! Thank you!

    this asset looks amazing with powerful features!
     
  3. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Thanks :) .... you should have the voucher code in Inbox! :)
     
  4. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,461
    I would also like one voucher, please :)

    Looks cool! Is SRP support planned for the future or is this going to be solely Built-in only?
     
  5. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    You should have voucher code in Inbox ;)

    Well, I already started working on URP :) ...but have to work in 2021.2 alpha.... it is because without the Custom Interpolators in Shader Graph some functions cannot work properly and it is not available in current version.... so I'm planning to add URP shaders after 2021.2 release and it sadly will not work in any previous version....

    HDRP version would be nice too, but for now... I'm still not sure about it... :)
     
    Last edited: Jun 18, 2021
  6. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    I just bought this asset, and it's exactly what I wanted it for, which is having the Standard Unity terrain shader (and all of it's capabilities like the basemap functionality) but with some things like Triplanar mapping. All the extra features are just a bonus.

    So far it's been great for that. I did notice, however that it appears that neither the Specular color nor the smoothness value from the texture terrain layer change the rendered results.
     
  7. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Another thing. I'm not sure how the base-map is calculated, but it appears that InTerra is using only the textures before the "Hide Tiling" is applied. I would imagine in most cases it the basemap would look better if it took HideTiling into account...in some cases, it can look pretty bad if you have tiling set pretty low (so it looks good up close), and then relying on Hide Tiling to remove tiling from a distance. Here is a video showcasing what I'm referring to.

    Thanks!
     
  8. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    I see, I guess I should have paid more attention to basemap - but that should not be the problem for me to fix and I will do the update within few days. Thanks for mention it !

    EDIT:
    The Terrain Base Map was improved in version 1.2.0 :)
     
    Last edited: Jul 6, 2021
    Lipoly likes this.
  9. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    The Specular color is not used in standard shader - so I did not use that either, but I definitely have to check the smoothness values.... it probably would be because I added the possibility of remapping the smoothness values in mask map channel remapping - and alpha channel values are affecting the smoothness even if it is taken from the alpha channel of Albedo... I should have stated it in the documentation more clearly - sorry about that.

    ...it also may be confusing because of this https://issuetracker.unity3d.com/issues/terrain-smoothness-does-not-work-on-some-terrain-layers

    EDIT:
    It was changed in 1.1.1 update - the mask remapping now affects the smoothness value only if it is taken from the Mask map to avoid confusion.
     
    Last edited: Jun 27, 2021
    Lipoly likes this.
  10. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Sweet, thanks!


    You are right. InTerra is working exacly like Unity's Shader in this case. We had one particular texture with a really strange alpha channel, and after removing it, it looked fine, and then I could use the smoothness slider in InTerra to adjust. The reason I wasn't seeing it before is we were using Unity's legacy diffuse shader, which didn't use the alpha channel. Thanks!
     
    Last edited: Jun 22, 2021
    IneffabilisArcanum likes this.
  11. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    It would be awesome to have a way to enable tri-planar for only specific textures. It is quite heavy on mobile devices, and in our case, we only really need it on very steep surfaces, which are always dominated by a single rock texture.
     
  12. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    You are right, and I was thinking about that feature a while ago too... and it would solve one thing - I just realized, as I'm working on that base map - that to add the Hide Tiling as you suggested is no problem(and it is basically finished) - but Triplanar is, because if you do the front/side projection, and you have some tall mountain (like in your video), it will project the base map on the steep slopes as you see it from top-down with all that surrounding grass and there is not much what to do with it (maybe just some heavy solution with 3D texture).... but if the triplanar for the base map would be allowed only for one texture, there would not be this problem....
     
    Last edited: Jun 22, 2021
    Lipoly likes this.
  13. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    I decided to add that feature - Triplanar for one layer only - and I will update the package after that - so I hope you don't mind to wait for the base map improvement a little longer, I hope in two weeks it could be done...
    Also, if you are not using normal maps nor the mask maps as I saw in video, then the shader could be compiled as pragma target 2.0 and it could be better for mobile... if you wanted to experiment with it, I can show you how, it is super easy…
     
  14. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Thanks for all of your help!
    That's awesome, and yeah we can wait a couple weeks :)

    That would be great info to have! Even with all the features of InTerra turned off, I was seeing about a %40 increase in GPU usage on a Quest 1 vs the Standard Shader. At any rate, any optimization tips would be helpful :)
     
  15. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    I'm not 100% sure I'm understanding what you're saying, but in my opinion, tri-planar probably doesn't impact the base-map visuals nearly as much as the Hide Tiling feature does. Tri-planar mostly impacts the look of the terrain up close, and probably wouldn't be all that noticeable from far away, where the basemap is visible (unlike HideTiling whose main purpose is to impact visuals from far away).
     
  16. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    That's unusual, I would swear that with all features off it is exactly like Standard... the only thing that could cause it is that Unity is seting on the keyword _NORMALMAP even if there are no normal maps - it happened to me too and I was thinking it might be better to let the user to set it manually - just some toggle field "Disable Normal map" ...

    But you can simply test it - if you open the file - InTerra/Data/Shader/InTerra_Standard-FirstPass
    - then on line 30 is #pragma multi_compile_local __ _NORMALMAP and you can put it into comment...

    Then you can also do it with line 29 (if you don't use the terrain holes), 35 and 38... and then you can change the #pragma target 3.0 to 2.0 .... I hope it will help :)
     
    Lipoly likes this.
  17. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Well, without triplanar the base map on steep slopes would look similary as if you turn of triplanar and watching those mountain from distance...so it would be stretched... and I thought that it would be nice if the transition would be as unnoticable as posible... :) ...but it would be slightly heavier.....so I will see....
     
    Lipoly likes this.
  18. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Sounds good! As an aside...is the basemap texture one "large" texture which covers the entire terrain and generated before the terrain loads? Or, do chunks need to be dynamically generated as you move across a terrain?

    I did a more precise test, and you are correct. It is undetectable from the (new) Standard Shader. I was comparing it to the old diffuse terrain shader from way back, which does appear to be faster, but you can't really do anything about that I'd imagine. Sorry for the confusion.

    I did all that, but I couldn't get shader model 2.0 working due to too many interpolators. I don't believe simply switching to SM3 to SM2 would help performance, though, correct? If that's the case, then using SM2 isn't something we'd personally need.

    Also, I do not believe I was having the issue where the _NORMALMAP keyword was being defined...assuming it would show up on the material.

    Thanks again for your replies and for looking into the other suggestions I've asked about :)

    TLDR: It does appear that InTerra performance is the same as the Standard Terrain Shader when all features are disabled.
     
  19. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    It is the first case - one texture of the size setted in Terrain settings...

    I just remembered someone was complaining about framerate drop on mobile just by switching from SM2 to SM3 (but it was probably some older discussion)... and I was curious if it will compile as 2.0 - so I tried it as I suggested and it worked - so I thought it could be interesting for you to test it too... but now I realised I tested the 2.0 compilation on the working version where I did some slight change and removed one interpolator - sorry about that... :)

    You are welcomed! ... I do not have much feedback yet so I'm glad for any :)
     
    Last edited: Jun 24, 2021
    Lipoly likes this.
  20. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Another suggestion would be to include a version of the shader which is based off of the Nature->Terrain->Diffuse shader for super low-end devices, if possible :)
     
  21. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    It would be nice, but it would take a while... so maybe in future... now I will be focused on the current one and the URP...

    I guess that you could also try microsplat - the basic is free so you can test if it is performant enough for you and then possibly buy needed additional modules...
     
    Lipoly likes this.
  22. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Yeah, I have MicroSplat Ultimate, lol. It is very performant for what it does, but it doesn't support basemaps, so it isn't the best at targeting really low-end devices.

    That's understandable for sure. I was able to hack in simple Lambert diffuse lighting to InTerra. It was pretty painless, and does yield substantial gains. Again, I'm really splitting hairs to get it working on a Quest 1...wouldn't be an issue on most devices.

    *edit* Ok, I didn't fully hack diffuse in...I can see the basemap generation is still using the Standard lighting model to generate...maybe I can figure that out as well.
     
    Last edited: Jun 24, 2021
  23. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    I'm just uploading a quick update to version 1.1.1, because I found a bug and had to fix it as soon as possible.... there are no new features added - just fixed the bug - the smoothness values were also affecting normal scales values… I can't believe I overlooked it - it happened when I decided to add "Two Layers Only" at the very end when everything was tested - then I carefully tested "Two Layers Only" and everything was fine and unaffected by that bug… but yes, I should have check everything else again more carefully…
    I’m very sorry about that…

    I hope Unity will approve it quickly and it will be available on the Asset store tomorrow..
     
  24. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    It is because in current version I'm using the standard base map, but in the version I'm currently working on there will be file InTerra_Base where you can change it too...
     
    Lipoly likes this.
  25. Lipoly

    Lipoly

    Joined:
    Feb 11, 2014
    Posts:
    37
    Yeah, I changed the basemap shaders to Diffuse-XYZ in InTerra_Standard-FirstPass to get it going...seems to be working so far.
     
    IneffabilisArcanum likes this.
  26. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Fantastic! :)
     
  27. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Also big thanks for writing this up - I started working with shaders at the end of 2019 and I've always been using Standard and didn't know much about the other older lighting method - and it made me to look at diffuse shader and found out that it may not be a problem at all to create also Diffuse shader - I was worried there will be some tricky part, when you mentioned it at first :)
     
    Last edited: Jun 28, 2021
    Lipoly likes this.
  28. airop

    airop

    Joined:
    Sep 4, 2012
    Posts:
    15
    Would love to see this on URP. waiting for that before i purchase.
     
    IneffabilisArcanum likes this.
  29. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Update 1.2.0 now available!
    ~ Added possibility for triplanar mapping to be calculated only for one Terrain Layer (for performance reason) with possibility to automatically apply that Layer to all steep slopes & Terrain Base Map improved.
     
  30. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    49
    This looks very impressive! Possibly just what I need~
    One question though, can what's shown in the video, be applied to a mesh as well instead of Unity terrain, efectively blending one mesh onto another (or multiple other)?

    I have a custom procedural terrain generator for 2.5D caves (like 3D caves underground cut in half) which outputs a mesh with normals and some plain UV coordinates.
    It's this mesh I'd like to use as a base to blend other meshes/objects into/onto. The objects would be "sticking out" of the "terrain" mesh similar to your showcase, so there is not more than one intersection pane per object etc.

    Unfortunately I haven't found a way to use Unity's terrain on my mesh. The solutions I found for that require a conversion process which is not really suited for procedurally generating at runtime, so I'm stuck with a regular mesh.

    Huge thanks in advance :)
     
    Last edited: Jul 10, 2021
  31. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Unfortunately it only works with Terrain because the mesh is receiving the Terrain Data as Height Map, Terrain Layers Data etc....
     
  32. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    49
    Thank you kindly for the fast answer!
    Unfortunate, but would it be possible to inject that information somehow? I do internally use sort of a height map in the terrain generator and same with the layers.
     
  33. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Then it seems like it could work with few little changes... but cannot know for sure... I will send you PM... :)
     
  34. Farlandsky

    Farlandsky

    Joined:
    Feb 15, 2015
    Posts:
    2
    Can this shader be used with Gaia tools?
     
  35. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Sadly, I do not have any experience with Gaia... but if Gaia is using Unity Standard shaders I think it should work fine… just in case you are using multiple Terrains there will be the need to do unique copies of Materials for Objects on different Terrains… actually, I was thinking about writing some script that would do these copies if needed, so maybe in some future update… :)
     
  36. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    Update 1.3.0 now available!
    ~ Added diffuse shaders!
     
  37. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    5
    This looks promising!
    If it ever recieve Tessellation/Deformation on tessellated materials, i'd gladly say good bye to Microsplat
     
  38. IneffabilisArcanum

    IneffabilisArcanum

    Joined:
    Jun 1, 2020
    Posts:
    21
    So far I experimented just with a parallax occlusion but I’m planning to do some in depth research about tessellation and then I will see… :)
     
unityunity