Search Unity

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

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

  1. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ideally I'd like to make it work and get some verification that is does, but if it doesn't, sure.. Note you might want to test MicroSplat first, since it's free, and see if that works..
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I consider using MegaSplat to reduce draw calls a somewhat experimental thing. I have more that a few customers who are doing this and love it, but haven't used it in that way myself. Note that texture arrays have some restrictions- all textures in the array need to be the same size and format, for instance, and none of it was designed as an atlasing solution. I did add an option to disable the texture blending on the bottom layer, which allows you to draw this kind of stuff much faster (because usually you are not blending textures in this case), but nothing much beyond that.
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks for reply, can you have multiple arrays with different settings?
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, you can have as many as you want, so you could put all your 512's in one, 1024 in another, etc.. But each material only uses one set of arrays, so you'd end up with several draw calls instead of just one, which is likely fine for static stuff.
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Yeah I mean one draw call for each size is fine. Lets say we have 5 sizes that means five draw calls I guess?
     
  6. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Hey Jason do you remember when I was suggesting the ability to paint between terrains and deform in between terrains without creating seams?
    Well this gem called terrain former can do that and do it well! I think I have finally begun to leave the arbitrary mesh world since your Microsplat should work very well with it and supports mesh blending as well!

    A great day for game development my workflow is finally almost complete!

    I also bought the RAM River Auto Material and I believe it will work well with it as well.
    I am going to start experimentation soon.

     
  7. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    186
    I watched the tutorial and tested it out. Looks like it's exactly what I needed. Thanks!
     
  8. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    72
    I'm trying out Megasplat in a multi-terrain setup and as soon as Play is clicked it loses all the material settings and the config for texture painter and then I have to go click on Config and reload it. I've tried clicking SAVE as well. I am updating to your latest version now. I am running Unity 2017.2.0f3.

    Updating did not resolve the problem. I've taken a bunch of screenshots to illustrate the issue and hopefully you can help with this.

    Here is before the problem. I have all of the different textures painted with a specific cluster. These are essentially biomes I haven't gone in and built yet.

    They are all nested terrains under a 0,0,0 empty game object.

    The AG1112Terrain is the one it stuck the shader on.

    Here is what the terrain painter shows when everything looks correct.



    I click play and everything goes white...




    Suddenly the terrains no longer say they are setup with Terrain Paint.



    I click setup and it is quick and the Config (Texture Array Config) is missing...



    So I load the config again and instantly all the terrains have textures again until I click play.




    Here are the assets installed if they may or may not be the cause.



    Any help would be appreciated.
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I have not seen or heard about anything like this happening. After the setup, each terrain should have a MegaSplatTerrainManager component on it, and the template material property should all point to the same material (assuming you want to treat these as one large terrain, which I'm assuming you do). It should also create a _splatcontrol texture for each terrain, though in your picture it looks as if you only have one set of control textures? Do any of these get removed or changed when you press play?
     
  10. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Hello.
    Does Mega Splat Terrain Shader use a different approach to painting the terrain textures? I have a texture of 128*128 resolution for a terrain. The terrain is very big (500m x 500m) thus when I paint the terrain, it looks very bad. Since splat maps are uncompressed and huge, I don't want to use a resolution bigger than 128. So I was wondering if the asset has a different method of painting the terrain or not.

    Thanks.
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It uses it's own format for the control data, and height map blends all results. MegaSplat uses a single control texture for splat map data (instead of 1 for every 4 textures used in Unity's system), and one to hold effects data (streams, lava, etc- though if these are not used this texture is not loaded). If you are working with > 4 textures, then this can be a memory savings. Height map resolves are used in the blending, which basically means you don't get large blurry blends as each texture transitions into the next, but rather sand goes into the rocks before covering, etc, based on the height maps.
     
    imDanOush likes this.
  12. tmarsh

    tmarsh

    Joined:
    Nov 30, 2017
    Posts:
    2
    Hello, we are having an issue with MegaSplat, all static meshes are getting combined, and receiving the flowing error. MegaSplat appears to be combining meshes that do not have MegaSplat on them. Those meshes are marked as static and that's where the error is coming from.

    Not allowed to access vertices on mesh 'Combined Mesh (root: scene) 4' (isReadable is false; Read/Write must be enabled in import settings)
    UnityEngine.Mesh:get_vertices()
    JBooth.VertexPainterPro.VertexInstanceStream:Apply(Boolean) (at Assets/MegaSplat/VertexPaint/VertexInstanceStream.cs:481)
    JBooth.VertexPainterPro.VertexInstanceStream:Start() (at Assets/MegaSplat/VertexPaint/VertexInstanceStream.cs:216)
     
    Last edited: Nov 30, 2017
  13. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Clever!! Does that mean that I can paint the terrain with a reasonable resolution, but with using less RAM? And can I use this asset with Word Streamer?
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    If you want to combine your meshes via static batching, you need to bake out the mesh data to unique assets first, because Unity requires that all static meshes not be read/write, so all the data of your paint job needs to be baked into your actual mesh instead of held in the VertexInstanceStream component. You can do this individually from the Utilities menu when your done painting a mesh, or use the batch version which will write out a single asset for all MegaSplat meshes in your scene and replace the data in your scene with the baked out meshes. You can also script this into a build pipeline to happen automatically for builds..
     
    tmarsh likes this.
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I have no knowledge of World Streamer, but as long as it will load all the files required it will likely work.
     
    imDanOush likes this.
  16. tmarsh

    tmarsh

    Joined:
    Nov 30, 2017
    Posts:
    2
    This is happening to meshes that do no have a MegaSplat material on them, simply all meshes that are marked static in the scene.
     
  17. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    35
    I can't find anything in search, but my materials appear much lighter when painted on the terrain than when i created them in substance. I will try and post an example image. (unity just crashed). Just wondering if this is something others have experienced?

    The first image is a macro texture, its the source for the terrain. I'm manually painting in textures and will ultimately cross fade as i transition from a wide angle of the landscape to a close up. The issue i'm seeing is that the materials in the library appear much darker than they appear on the landscape. The _flats_whites_a should be near on pitch black, as it appears in substance painter and the cluster thumbnail.
    Painted on the landscape however and you can see its much much lighter, a dark grey.


    This is the pallet i'm using, colour go from a-e dark to light. Now it maybe the black isn't as black as i think it is, but still i wouldn't expect to see such a massive difference between the cluster material swatch and what i end up with on when painted on the terrain.

    What am i missing? I've even tried playing around with the post processing to see if theres anything there i can do do darken the blacks. nada.

    Ps. My current theory is that everything is as it should be and that its my eyes playing tricks. But wanted to check before I begin re-editing all 100+ variations of the materials.
     

    Attached Files:

    Last edited: Nov 30, 2017
  18. madboybamnenim

    madboybamnenim

    Joined:
    Mar 30, 2017
    Posts:
    1
    Hi jbooth
    I'm having fatal error issue on just following Quick Start guide on Document.
    This happens when i try to change Brush of Vertex Painter pro to "MegaSplat_Example".
    I'm using Unity 2017.2.0f3.

    Error Message image below.
    https://imgur.com/a/N1iTr
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Most likely you have accidentally added the VertexInstanceStream component to them. This can happen if you have those objects selected while your painting and the brush moves over them. Where possible, I like to setup a hierarchy for painted and non-painted objects to help prevent this.
     
    IgorAherne and tmarsh like this.
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I wouldn't use the cluster swatch as a preview of color, as it's rendered under it's own lighting and Unity's UI does not handle linear data correctly (it only renders gamma). Also, you should likely make sure your gamma/linear settings for your textures are set correctly. MegaSplat's lighting should match unity's standard shader, as they use the same lighting pathways..
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Strange that RenderSettings would be null- that's a static class Unity uses to hold the settings in the editor. Things to try:

    - Do this in a new project
    - Make sure your project settings are saved? I would expect RenderSetting to be their either way.

    Anyway, I'll see if I can repro this tonight..
     
  22. pixlweaver

    pixlweaver

    Joined:
    Dec 21, 2012
    Posts:
    92
    Hello! I'm curious about the ramp lighting feature for a toon shaded look - would tessellation shadows work with ramp lighting too?
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Unity's shadows don't really know anything about how you are shading the light, so sure.
     
    pixlweaver likes this.
  24. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    72
    Yes that was still present... but the material was gone... I ACTUALLY found the cause and will share that but, I'll answer your question first.




    After telling it to setup again...




    Yet here is what I realized. I had dragged each of these terrains into a sub-folder at one point to create prefabs. I don't know that I ever updated those prefabs.

    When I deleted the prefabs from the folder the problem went away. So somehow when pressing PLAY it was somehow getting confused by the reference to prefabs even though these were all pre-existing and should be able to be modified beyond the prefab.

    When I updated the prefabs in their respective folder the problem went away as well. So add that one to your bag of tricks and knowledge base for strange things.
     
    jbooth likes this.
  25. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Good evening! Quick question from a prospective buyer: I watched the tutorials for Megasplat, and I think I'm clear on how to import and convert an existing terrain that was created in World Creator or Terrain Composer. My question is, what is the workflow if I later *change* the terrain in the upstream procedural tool?

    Also, how does this play out if I'm using WC or TC2 to make a multi-terrain array and/or infinite procedural landscape?

    I'm not asking for a detailed step-by-step pre-purchase, just a general overview of the workflow steps so I can make a better decision about whether I'd like the workflow or not. Thanks!
     
  26. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    35
    Ok, so i think i'm slowly getting there. I've been reading up on gamma/linear space editing etc and how unity works. its not 100% clear yet, but I have noticed one thing.

    I'm using substance files, which MegaSplat kindly exports the bitmaps for, now when it does this, it doesn't set sRGB option on the exported textures. Now as i understand it so far, the sRGB effectively says, hey the data is stored in gamma space, which i'm assuming it is when substances are exported by unity. (or rather in your export script).

    When i check this option and update the texture array, the texture appears much closer to what i'm expecting.

    Few, getting there. So the next question is, do i need to set the sRGB option on all of textures exported from the substance?
     
  27. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    35
    I had a conflict with Forge3D a camera tool i use to keep the game camera and preview window in sync. I couldn't quite workout why the terrain painter brush kept changing size as i was moving around the landscape, until i realised you were using shift+mouseX and some other combinations to adjust the brush size. Pretty useful feature to have, but unfortunately not in my case. As such i added the following to the Terrain Painter classes.

    TerrainPainter_GUI.cs
    line 688
    mouseAdjustmentEnabled = EditorGUILayout.Toggle ("Enable Mouse Adjustments", mouseAdjustmentEnabled);

    TerrainPainter_Painting.cs
    line 132
    if (mouseAdjustmentEnabled == true) {
    ... Brush adjustment code.
    }
    ...
    EndStroke();

    Note, the EndStroke() if statement sat between the brush adjustment code so i had to make sure that wasn't in the MouseAdjustmentEnabled condition.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Here's a quick form of the rules:

    If the texture is not color data, turn off sRGB.

    If the texture is color data and you are in linear rendering and your tools author in Linear space, turn off sRGB
     
  29. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    35
    Thanks.
     
  30. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Does Megasplat and Microsplat support Terrain Former?
    Terrain former has the ability to paint deform and paint texture on multiple terrains at once as if they were perfectly stiched together so I want to know if there are any issues I should be aware of?
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MegaSplat's brushes all work across multiple terrains at once, but MegaSplat's painters only paint texturing information, not height. MicroSplat uses Unity's tools and backing data, so if Terra Former just paints into that data it should work fine - you can download MicroSplat core for free, so it's easy to check.
     
  32. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    35
    I was just wondering if it was possible to infer and subsequently select the cluster/texture from the terrain/splat data, i.e. like an eye dropper as a quick way of selecting the material from the terrain. I was going to see if it was worth investigating adding that in myself, but figure i won't bother if its not actually possible.
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You could do it for individual textures, but for clusters it would be buggy at best. The problem is that multiple clusters can technically have the same textures in them, so there's no way to map back from a texture index to a cluster. And in most cases, what you have on terrain is actually 6 textures being blended, with 2 textures at each vertex of the triangle..
     
  34. SamSpain

    SamSpain

    Joined:
    Oct 31, 2014
    Posts:
    13
    Hi, MicroSplat user here. I'm interested in the MicroSplat modules and would intend to buy many if not all of them.

    Should I just be looking at buying MegaSplat instead?
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    They are different, and more so each day. I would recommend MicroSplat if your primary workflow is about Unity Terrains, and MegaSplat if your goal is mesh based workflows. MegaSplat will work on both meshes and terrains, and supports up to 256 textures on each, but is limited in other ways compared to some of MicroSplat's modules (lava or streams, not both, no automatic terrain blending, etc).
     
  36. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Hmmm....Now, that's something to think about. @jbooth, can I ask that you consider my workflow question from yesterday in light of both Mega- and Micro-? My main "thing" is the ability to have *Splat able to iterate designs smoothly with TC2 and WC2. Voxeland is also in my plans, but not as my primary terrain tool. I'll be using it for specific rock formations that need tunnels, concave ledges, and so forth that can't be done with terrains.

    I had assumed Megasplat was a mathematical superset of Microsplat; I'm glad you clarified that this is not the case. :)
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Yeah, maybe not the best name, but at the time I wasn't exactly sure how any of this was going to evolve. I found a few things surprising when creating MicroSplat - one, that having to work on meshes excluded a lot of techniques that would be available on terrains. I would have thought that terrains would have been more limiting because of the way Unity prevents you from doing certain things with them that are trivial with a mesh. Two, that the optimization technique I came up with for MicroSplat was going to make it so blazingly fast - I mean, it just dusts everything.
     
    syscrusher likes this.
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ah, sorry, I somehow missed that post.

    Currently there is not a VoxelLand integration for MegaSplat- I know Dennis was working on it, and he has a really amazing one for Map Magic which works with his infinite terrain stuff (no converter necessary). TC2 and WC all need to go through a conversion step any time you make changes in those programs. Since the data so different, there really isn't a way to move back and forth in some kind of non-destructive manner.

    In MicroSplat, everything just uses the standard way of choosing textures that Unity's terrains use, which makes interop with most other programs completely seamless with no conversion necessary. Infinite terrain systems usually need a small bit of tinkering for them to work, but usually not something too hard. I pinged Dennis about a MicroSplat/MapMagic integration today, actually.
     
    boysenberry likes this.
  39. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    No problem, and thanks for the two replies. I've got a lot to consider here. :)
     
  40. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    For holes and caves I would recommend Cubiquity for Unity.
    Sadly it is depreciated but it is a voxel program on a whole other level.
     
  41. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    Hi, Im planning to develop a procedural terrain generator that works a little bit differently than normal to achieve a voxel like effect, it occurs to me that i could build it to use your megasplat format natively if i become familiar with it, would is there anything that you think would conflict with this? Also, There are a few features im unsure of, if they can work together.

    Does Megasplat support River flows, lava flows, paintable wetness and snow at the same time?

    I intend to have the generator control these things, having them completely global wont work too well. Also, if river and lava flows cant be supported at the same time i don't want the same restriction to be applied to this generator. Is it possible to work around this by having water colour or material properties paintable to be coloured differently in different areas and seem like lava and at the same time support many different liquids?
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The format required by the mesh is described in the docs (I'm, assuming your using a mesh workflow here), so I'd check that out. The converter will do the changes needed an edit time, but if you are constructing meshes at runtime it's best to construct them with this data as you build the mesh.

    No, MicroSplat allows this, but MegaSplat uses the same data pathway for stream/lava/puddles so you select one of them for each material. If you can break your areas into multiple meshes, each one could have a different effect. Wetness is available separately.

    Each material can have one of these effects, so as long as you break things into multiple meshes you can do whatever you want..
     
  43. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi there!

    I've just bought all Micro/Macro assets, I'm going to be using them pretty soon :)

    Is there any chance you could add horizon fading to the Microsplat glitter module? It's a bit too eye-catching and intense in the distance in my opinion.
    Or, at least, I'd love it to gracefully fade and blend with distance, it definitely adds too much contrast for the use I'd love to make of it :)

    I'd really appreciate if you could add an extra flag/slider for that :)
     
    Last edited: Dec 4, 2017
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Do you mean fading based on distance, or based on some other factor?
     
  45. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Blazing fast reply! :)

    I meant distance fading, from the camera, or whatever solution is more performant. I guess a single "far distance" float would suffice, if you believe it's not going to impact performance too much. Of course having full control (like distance fog: near, far, exponent, etc.) would be nice but I guess it could have a performance hit for those not needing it, depending on the implementation.
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Well, everything not in use in Mega/Micro Splat gets compiled out, and doing things based on distance is pretty cheap, so no real issues there..
     
    NeatWolf likes this.
  47. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Sounds great!

    Could the request find some space in your roadmap? :)
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    sure. Shouldn't take long.
     
    NeatWolf likes this.
  49. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Woa, that was fast!

    Thanks Jason! :)
     
  50. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    Interesting, So i could build the generator to break it up into multiple meshes, that will be fine. Ill just need to do some investigation into the way megasplat blends between textures before deciding.

    I just found the specific video showcasing texture painting, with the top and bottom layers i an do everything that i want to. So ill be making a procedural generator specifically for megasplat :D

    Its going to be similar to a voxel system but only record the depths at which different materials change or stop existing to hopefully be a bit more efficient and allow precise changes in elevation.

    Is there a feature for tinting the colour of the terrain? It would be really handy in reusing some textures as different kinds of stone.
     
    Last edited: Dec 4, 2017