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

[Released] MegaSplat, a 256 texture splat mapping system..

Discussion in 'Assets and Asset Store' started by jbooth, Nov 16, 2016.

  1. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    Thanks for the reply. Would some form of AA nullify the artifacts to some extent?
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, not really - temporal might a bit. It’s not an aliasing issue; rather like trying to enlarge a low resolution image.
     
  3. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    Ascensi likes this.
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Humm..

    When I work with multiple terrain, It all seems to work correctly and then when I load the scene again, only one of the terrain has the modification I have made. All other terrains has returned into the default state. I did set up the terrains by following the video. Everything while I was working with the painting seemed to work... it is just that only one of the terrain gets the modification saved and others not.. lots a lot of work and time because of this.. any ideas?
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Select the terrains or a parent object and press the save button on the painting tool.
     
  6. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Arh.... darn.. got it.

    I am also experimenting with individual normal strength options, but it doesn't change anything even if I set it to 0 or 1. There are no visual difference in the game view... humm..when I change slider value for the normal, the material preview setting does show the difference, but the actual game view doesn't change no matter what the light setting is or normal strength setting is. The material shader type is standard pbr with default packing.

    As matter of fact, no individual settings are being affected in the game view. Metallic, AO strenght , nothing... weird..
    I must be doing something wrong, but it's hard to tell...

    -- Edit -- I found that I had to fill in or paint the same texture again in order to see the difference.. very weird.
     
  7. mbrglt

    mbrglt

    Joined:
    Jun 11, 2016
    Posts:
    6
    Hello Jason, I'm having some trouble with the mesh import stage. I've followed the documentation.

    First of all, when I process the mesh, it doesn't have the RGB vertices when I tick "Show Vertex Data," leading me to believe there has been an error with my meshes. I have tried .blend, .fbx, and .obj formats.

    I am applying the material "MegaSplat_Example_Mesh" after processing the mesh.

    Could this have something to do with ngons or geometry problems?

    megasplat.PNG
    the second problem (which I think is caused by the first) is when I can manage to paint, there are thin bands of other textures surrounding each "painted area." I can paint normally with some textures on the top layer, but I think something is wrong.

    megasplat2.PNG


    Do you know where I went wrong? I've been trying to fix this for a few days but figured I may as well ask.
     
    Last edited: Jan 23, 2019
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The converter writes a copy of the mesh with the _splat extension on it; I’m betting you never switched to that mesh and are using the original. That’s also the cause of the blending issue.
     
  9. mbrglt

    mbrglt

    Joined:
    Jun 11, 2016
    Posts:
    6
    Yes, you are correct!

    I dragged the _splat mesh in, however it is missing Vertex Instance Stream, Mesh Collider, Mega Splat Collision Info, and also a material. It is bright pink. Did I miss something else?
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can replace the mesh in the mesh renderer object you already had in the scene with the output version. Easier than setting it all up again.
     
  11. mbrglt

    mbrglt

    Joined:
    Jun 11, 2016
    Posts:
    6
    Thank you! I was able to get it working in the example scene, it looks great. We recently updated our project to 2018.3.0f2 with the Lightweight Render Pipeline, which is still in beta. Should I wait, or is MegaSplat compatible with this versioning?
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It’s not; LWRP is still in preview. I’ve ported MicroSplat to it, and it continues to be a support issue because there are no docs on the shaders, multiple versions, and no way to maintain compatibility between them. As such, I’m not going to port to more SRPs until things get better.
     
  13. mbrglt

    mbrglt

    Joined:
    Jun 11, 2016
    Posts:
    6
    Sounds good, thank you.
     
  14. Zeroxgaming84

    Zeroxgaming84

    Joined:
    Oct 14, 2017
    Posts:
    6
    Hello Just purchased tessellation module. I'm running unity 2018.2.20f1, when importing module i have a shader error in MicroSplat/Example_Tessellation Invalid subscript 'insatnceID' at line 924 (on d3d11) along with TerrainData is missing splat texture3. any help will be appreciated.
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Change an option on the top section of the shader to regenerate it and it will add the required code.
     
  16. Zeroxgaming84

    Zeroxgaming84

    Joined:
    Oct 14, 2017
    Posts:
    6
    that worked, thank you so much for your assistance.
     
  17. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    @jbooth -- will there be any changes for the updated Unity terrain system, any further optimizations that MegaSplat can benefit from there?

    // WildStyle
     
  18. ErisArcana

    ErisArcana

    Joined:
    May 18, 2015
    Posts:
    26
    Hi! I've been enjoying Megasplat very much, and pleased with the results, but I have encountered a couple of problems.

    The issue is with the Alpha Mode options in the shader, more specifically the transparent, and the cutout option.

    With the transparent option, it creates a subtle tint in the transparent areas, I can't seem to get rid of it.


    transparent_problem.PNG and with the cutout option, it shades the model in a weird way. If you look closely, it looks more faceted than smoothly shaded.


    cutout_shading.PNG
    Also I noticed that the transparent and cutout shaders lower the detail of the texture with the alpha channel. Here's a comparison of a standard shader with alpha (top), and the megasplat one (bottom).

    trim.PNG


    Also maybe I should mention, the way I built this mesh, is I have two seperate meshes, the top part is for the grass, and I paint with the main texture on it, as well as a texture that is completely transparent to blend the top object to the trim object below it to get rid of the seam (I couldn't figure out if there was a way to cover up seams in 1 object if it had parts of the mesh with its vertices not connected to the other part in the UVs). and then below it I have a trim that is seperately unwrapped, and it has a partially transparent texture on it that wraps around the object.

    Thank you :)
     
  19. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    172
    Are we still waiting for Unity to fix whatever is holding up the instancing support for the new terrain system - 2018.3?
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, haven’t heard back from them yet..
     
  21. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    111
    Sorry for this question, I know I'm late, but I've just discovered MegaSplat.
    1- How is the performance on mobile? my target device is Oculus Go, Gear Vr.
    2- MegaSpalt is like a shader on its own, that use an array of texture right? because I have some nice shaders that are giving me great AAA look even on mobile, and I won't miss them, but of course, since my target is mobile VR I need always to watch the draw calls. So can I use my shaders with MegaSplat?
    3- can I use it with Mesh Baker?
    4- not related to MegaSplat, but One Batch but same question as above
     
    Last edited: Jan 30, 2019
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MegaSplat wasn't really designed with mobile in mind, but I know some people use it on mobile. If terrain work is your thing, MicroSplat is faster in most use cases.

    It's a shader generator, so it writes custom shaders based on the options you want. A given mesh usually only has one shader on it, because usually you only want one material, so I'm not sure exactly what your asking here.

    I don't know much about Mesh Baker. Meshes have to be run through a converter before use with MegaSplat, but assuming the output of mesh baker is just a mesh, then it should be fine.

    Same answer.
     
  23. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    132
    Hi @jbooth, I'm finally discovering the power of Megasplat for my mesh/terrain workflow, but am having a bit of trouble with the Texturegraph.

    1) First off, the background of the graph is very bright so it's a bit harder to make out text. Interestingly it is nice and dark in another project, so I was wondering if there's a setting I'm missing?

    2) Secondly, whenever I create or duplicate a node, it creates two copies on top of eachother. Not a big deal since I can delete one, but still odd.

    3) Third, I'm enjoying the functionality of the tool, but am having a bit of trouble understanding how it handles texture clusters. For example, I'm able to get an acceptable setting for vertex painting by adjusting the frequency/amplitude/blend in the textureArray/Cluster Library. But I can't figure out how (or if) these settings apply to the texture cluster within the texture graph.

    I would assume that vertexPainter/Fill should create the exact same result as a simple texture graph with a textureCluster pointed directly into the output?

    Edit: My goal is basically to procedurally paint the world with the same results as the fill tool within the vertex painter.

    4) Finally, is the texture graph editor meant to be closed whenever entering play mode? My performance is drained and I keep getting a 'Current Canvas is not saved as the temporary cache' error, despite having just saved the canvas.

    Thanks for your time.
     
    Last edited: Feb 6, 2019
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No setting - I believe it's supposed to adapt based on the unity pro/free skin.

    The texture cluster itself is just a reference to a list of indices to choose from. If I recall, it has a cluster noise input that is filled with noise by default, but you can plug whatever equation you want into it.

    If you have the weight and noise parameters setup the same I would expect the same, though there may be reasons I can't think of right now why the noise might be different.

    Yes, for some reason leaving it open was crashing unity on some versions of Unity, so it closes itself on play mode to prevent this.
     
    Noogy likes this.
  25. AssetTest

    AssetTest

    Joined:
    Mar 20, 2018
    Posts:
    4
    @jbooth I want to work with MicroSpalt and the extensions Anti Tiling and Tessellation. I bought the two and updated the assets to version 2.4. However, Anti Tiling is only at 2.3 and I get an error message. When can I expect the release of 2.4 for Anti Tiling module so that I can start working with that? Thank you.
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It was submitted at the same time, so I expect unity will release it on Monday..
     
  27. AssetTest

    AssetTest

    Joined:
    Mar 20, 2018
    Posts:
    4
    Thanks for your reply, I hope for the release today then. I did some testing with the Tessellation module so far and stumbled upon a couple of problems. First of all, the required workflow is not really clear to me. I created a new Terrain, painted it and then added the Microsplat Terrain Script to it. When I add Tessellation the result is quite weird because the entire Terrain is lifted and I do not get a fine tessellation. I then used your example Terrain and added my Texture to it and the result was much better. However if I want to create a prefab of the Terrain to integrate it into my own Scene, I get erros of missing reference and the terrain is actually invisble and the MicroSplat Terrain script auto diables. Some problem with the synching. Is creation of prefabs form MicroSplat Terrains impossible? You have some cool videos on YT but they show settings on an existing and ready Terrain, a complete guide form scratch to Terrain with alle your modules would be extremley helpful for people that do not have that much time to learn it themself by Trial and error. Overall I think your tools allow for really great Terrains and I know that its actually just a couple of steps involved but so far I had to many problems with it. I will keep trying and hope for some clarification. Thank you!
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Did you add height maps for your textures?
     
  29. AssetTest

    AssetTest

    Joined:
    Mar 20, 2018
    Posts:
    4
    Yep. I also used your heighmaps simply to see if it works. Only with your example Terrains its working, when I create one from scratch actually most things do not work. Im sure I do something wrong but I do not have a clue what could be wrong in my setup. I am fine with adapting your example to my needs and then using it, however I then stumble upon the prefab problem. Thank your for returning to my question.
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    All you really need to do is setup a terrain with textures like you normally would, apply the MicroSplatTerrain component, press convert, then add additional textures and such through the TextureArrayConfig as the Unity settings are no longer used. I have not personally tried creating prefabs from terrains, but I know a lot of people do that, so I don't think it should pose any issue. The only thing I can think of with your tessellation issue is that you have the UV scale on the textures extremely large or something? You said you were getting errors, in the future it's much easier to help you if you post the actual errors your getting- saying "Most things do not work" doesn't really make it easier to know exactly what issue you are having.
     
  31. AlenH

    AlenH

    Joined:
    Jun 30, 2015
    Posts:
    42
    Hi, loving the results and workflow. However, I have a simple problem and can not get a solution. When I add wetness in shader all went wet than I fill UV3 - Wetness with 0 value to remove it so I can paint wetness where needed. When I do that all my paint go dark as no color is going through only normals are displayed and losing my paint as it seems I can not get it back. Anyone experienced that or maybe I am doing something wrong? Any help much appreciated...
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    That's very odd- can you send me a repro project?
     
  33. AlenH

    AlenH

    Joined:
    Jun 30, 2015
    Posts:
    42
    Large scene/project..maybe I can cook some video? Will that work?
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    hard to say..
     
  35. AlenH

    AlenH

    Joined:
    Jun 30, 2015
    Posts:
    42
    Hmm...can´t repro it...all ok ..it was probably something i was doing
     
    Last edited: Feb 13, 2019
  36. CYM

    CYM

    Joined:
    Aug 5, 2013
    Posts:
    20
    Brush size is too small to paint. How to fix that problem?
    Please Look gif:
     

    Attached Files:

    • GIF.gif
      GIF.gif
      File size:
      3.1 MB
      Views:
      655
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Change the brush size to be bigger in the painting tool..
     
  38. CYM

    CYM

    Joined:
    Aug 5, 2013
    Posts:
    20
    I know that, But I need the brush to be small, cause I don't want the banks to be wide.
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Then you need to use a higher resolution control texture on your terrain.
     
  40. CYM

    CYM

    Joined:
    Aug 5, 2013
    Posts:
    20
    Hi you said: "MicroSplat is not a subset of MegaSplat- a comparison of the two products is available at MegaSplat.com"
    But I was not found any a comparison of the two products at MegaSplat.com
    http://megasplat.com/
     
  41. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    56
  42. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @jbooth Hi Jason a few of us here have been inquiring if you would be willing to add direct support for @winning11123's SSDM Although maybe not a lot of people know about it yet but looks to be a Megasplat MegaBooster for displacement! but also because of Voxeland's current architecture it doesn't allow us to retain painted wetness, puddles etc but SSDM sounds like there will be a feature soon (if I'm not mistaken) to keep wetness etc through his tools. Winning11123 did post what he said was the bare essentials on his forum that he thinks will work to plug in to Megsplat.
     
    Bodyclock likes this.
  43. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    @jbooth Hi there, I like both MicroSplat & MegaSplat. Please give more love for MegaSplat. Recently, MicroSplat gets all updates :)

    1) I have a question on Runtime Painting of MegaSplat. I want a smooth erase effect. But, my code just erases all paints immediately, no smooth erase effects at all. Is there a way to erase paints one by one, or reduce it size smoothly before removing it.

    Code (CSharp):
    1.     private IEnumerator WaitAndErasePaints(float waitTime)
    2.     {
    3.         for (int i = 0; i < generatedData.Count; ++i)
    4.         {
    5.             generatedData[i].mat.SetTexture(splatControlId, generatedData[i].srcTex);
    6.             Destroy(generatedData[i].texCopy);
    7.             yield return new WaitForSeconds(waitTime);
    8.         }
    9.  
    10.         generatedData.Clear();
    11.     }
    12.  
    2) Your comment mentioned that " We also store off any textures we collide with at runtime, so we can revert them when we exit play mode. I haven't found a wonderful way to do this, so I copy the texture off before any modifications happen, then restore on application quit. This isn't needed in the real game.". Did you find a better way? I do not know if we keep copying the texture before any modifications. In a long run, will I encounter with GC calls, that kill the game performance?

    Many thanks.
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Just copy the texture once, not every modification. As for smooth painting, check out the code for the auto mode of the brush- it basically selects the lowest weighted layer and paints on that layer.
     
  45. Harjawalda

    Harjawalda

    Joined:
    Sep 1, 2018
    Posts:
    15
    I'm getting a lot of errors from microsplat code and buggy behavior, terrain turns invisible, the base map distance resets and turns terrain invisible on zooming in although that may not be related. Reinstalled all microsplat parts as well as made new projects.

    Shader error in 'MicroSplat/Terrain': 'disp': output parameter 'i' not completely initialized at line 1784 (on d3d11)

    Compiling Domain program with UNITY_PASS_SHADOWCASTER SHADOWS_DEPTH INSTANCING_ON
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR

    Shader error in 'MicroSplat/Terrain': 'disp': output parameter 'i' not completely initialized at line 2110 (on d3d11)

    Compiling Domain program with UNITY_PASS_SHADOWCASTER SHADOWS_DEPTH INSTANCING_ON
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Your trying to use terrain instancing and tesselation. When unity added instancing support they didn’t make it work correctly with surface shader tessellation. I filled a bug on this, but haven’t heard a response yet. For now, either turn off instancing or tessellation.
     
  47. Selosoft

    Selosoft

    Joined:
    Jun 22, 2012
    Posts:
    69
    Microsplat is a great asset, but in one version of our game the performance is too much of a hit it must be removed. Yet when I remove it from the terrain assets my textures are completely missing and I can't seem to edit the terrain anymore. Is there a proper way to remove Microsplat from the terrain once it's been converted?
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Set the base map size back to a reasonable value. Do you have profiler evidence that MicroSplat is slower than the built in terrain? In any case with greater than 4 textures I’ve only ever seen it render faster, and with 4 textures it’s very similar. Assuming feature parity, that is.
     
  49. Selosoft

    Selosoft

    Joined:
    Jun 22, 2012
    Posts:
    69
    Due to NDA, I can only say it's specific to one particular platform. On PC, there is no performance hit. But thanks, I'll try adjusting the base map size
     
  50. Selosoft

    Selosoft

    Joined:
    Jun 22, 2012
    Posts:
    69
    yup, worked. thanks simple solution :)