Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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

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

  1. maccoy

    maccoy

    Joined:
    Mar 4, 2015
    Posts:
    12
    yes, you can go alt+enter to have stuff getting wierd as it enters and exits fullscreen or, as i did when i discovered the strangeness, starting it in fullscreen, alt+tab out to do stuff and when tabbed back it was all wierd.

    i stopped questioning what unity is up to a long time ago, i just shrug ¯\_(ツ)_/¯
     
  2. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    0 to 5 i believe.
    I successfully did a lot of that by editing the color index numbers in the control texture. It was a bit fiddly, and would be nice to have a tool for that!

    (Edit: I mentioned it once before - it might be a nice tool to demonstrate the power of your graph designer - if you can expose the needed objects)

    I was referred to your microsplat add-on (Terrain Blending), which as I undertand it is a simple way to extend / paint terrain on to objects. I hope thats supported in megasplat? (being the rolls-royce product)

    The method I saw a while back in a video of a bridge - basically having to convert each mesh manually using the vertex app is too destructive for built scenes. One doesn't know up front which objects one wants to blend, and once objects are placed and carefully transformed to suit a scene the last thing one wants to do it mess with all that.
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    The technique used in MicroSplat for terrain blending cannot be ported to MegaSplat. MegaSplat is not actually the "upgrade of MicroSplat", but an entirely different technique, which as such has very different capabilities and performance characteristics. MegaSplat can work with 256 textures and work on meshes as well as terrains, but MicroSplat can actually have more features enabled with better performance, but only works on Unity Terrains and is limited to 16 textures..
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Well, looks like MegaSplat 1.5 was approved and is now available.
     
    m4d likes this.
  5. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    All right, Mr Booth! Looking forward~
     
  6. ForgedChaos

    ForgedChaos

    Joined:
    Jan 31, 2014
    Posts:
    49
    Does that include the improvements to alpha/holes you mentioned awhile back? I looked in the changelog and didn't see anything so just confirming.
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    yeah, it's in there..
     
    ForgedChaos likes this.
  8. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    I mentioned on the Microsplat thread that I was getting a crash on loading a new scene with Microsplat on the landscape. I finally got around to setting up the landscape with a quick Megasplat arrangement using the included arrays and am having the same crash. This is with the latest 1.5 version. So I guess there's no way around this now, I must start looking for the problem.
     
  9. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, Mr Booth~I just updated MegaSplat to 1.5 version, and seems that I can still not adjust the smoothness value.. Here's the texture configuration and the result material property:
    upload_2017-9-20_16-50-52.png
    upload_2017-9-20_16-51-46.png
    I did not give the smoothness map and still didn't get the smoothness slider.. I mean, even when we get a smoothness map, this slider could still be useful, right? MicroSplat has got this one,though:
    upload_2017-9-20_17-0-43.png
    Would appreciate that if it's not technically hard to achieve..
     
  10. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Another question, Mr Booth, I've got this error when I tried to drag metallic slider:
    upload_2017-9-20_17-6-14.png
    And the slider didn't work.. I used Unity 2017 and got this error, when I used 5.6, I didn't get that.. Is that a version problem?
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    The texture packer generates a smoothness texture even if one is not provided, so you always have a smoothness texture in the new model, which is the same as in MicroSplat. What MicroSplat does have is a per-texture property for smoothness strength, which multiplies whatever value is in the texture by the value given in the per-texture property.

    I was originally planning to move the per-texture controls from MicroSplat back to MegaSplat, however - there is a bug in Unity preventing me from doing that. Long tech explanation: MegaSplat uses a small texture to store the values, and that texture is stored as an 8bit texture (which means it's limited to 0-1 values, which is annoying). When I wrote MicroSplat, I switched it to use a 16 bit texture so I could get a greater range of values. However, when you save and load this texture to disk as an EXR file, Unity always applies a Gamma curve to it, destroying the values. So, for MicroSplat, I switched the system to save things in a small scriptable object and generate the texture at startup, avoiding the disk save/load. But I can't really do that for MegaSplat, because MegaSplat can be used on meshes with no component to run that code at startup. Further, while having one material per-terrain is fine, having one material per mesh is totally unacceptable, as it would break batching. So due to supporting meshes, MegaSplat needs to be able to write that data into a texture that can be referenced as an asset, and the gamma issue prevents me from doing that.

    Anyway, long story short, I can do a pass to add more per-texture controls to MegaSplat at some point, but they can't be as nice as MicroSplat's. And in your case, you just need to provide an adjusted smoothness map.
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Do you have asset importers? You can fix this by selecting the _proptex texture and setting the format to ARGB32. I checked the code and everything saves it as such, but if you have an asset importing script that could interfere with it, or it's possibly something in 2017 is changing the format since your not the first person to have this issue.
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Let me know what you find. While not a crash, a user did have an issue a while back with text-based serialization in Unity where it would take an exceedingly long time to load - our theory is that Unity saves the texture arrays as YAML and parses it all in, which is incredibly dumb if that's the case - but we haven't heard back from Unity on if this is actually the case or not. Maybe worth a check to see if it's related?
     
  14. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I think they probably do when "Force Text" is set. I got the same issue with some lists of structs saved in an scriptable object the other day. huge files and memory when saving the scriptable object.
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Yeah, but saving texture data this way seem a little crazy, IMO. Given how unfinished the TextureArray support is, it wouldn't surprise me though.
     
  16. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @jbooth I went back to an older project version which had the problem and pulled in Microsplat to test with due to quick setup. I was able to get a build to run without crashing, which was just confusing to begin with. I then noticed that even though it did run it was messed up somehow. The landscape textures were all showing extremely low res, like it was not actually texturing at all and was just applying an overall landscape bake. So I turned all textures down to 256 and can see that compared to the editor where it all works fine, that yes it seems that in the build it is not actually texturing. I can't see any errors logged unfortunately.
    The search continues.

    I should also point out that for some reason when I select PBR mode and update, it does not generate the other missing textures.
     
    Last edited: Sep 20, 2017
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    It does- they are generated directly into the texture arrays, not written to disk or shown in the UI.
     
    Baraff likes this.
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    So, I've started the process of porting some core level optimizations back from MicroSplat to MegaSplat. Today, my stress test case (on my MacBookPro) went from 28fps to 43fps.

    There's more to do, but I'm going to run my unit tests and get this submitted very soon.
     
    WildStyle69, m4d and Baraff like this.
  19. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @jbooth So the previous post was a bit of a red herring. It turns out I still had script only compilation set from last time I looked at this project. Consequently nothing new really was being built. With that setting removed I am now back to the crash on scene change. At least it is consistent and less confusing now.
     
  20. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @jbooth I am seeing this in the log:
    <i>WindowsPlayer(win8pc)</i> Shader 'MicroSplat/Terrain_0_0-20170807-175933': dependency 'AddPassShader' shader 'Hidden/MicroSplat/AddPass' not found

    Does that help?
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    No, that is just a fallback to a NOOP shader- not sure why it's not finding it, but Unity internally falls back to it's own shader when this happens..
     
  22. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    Hello, Is it possible to convert current standart unity terrain with a ton of work on them, to megasplat and preserve all work that's already done at it? I'm convert terrain just by using Terrain Painter menu. But suddenly I lost all my work.
    It's looks like megasplat can't read unity terrain splat maps? Or wha
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    You have to use the Terrain Converter, which is in the Utilities panel of the Terrain Painter. It will let you map the splat map choices in the Unity Terrain to Texture Clusters in MegaSplat.
     
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    1.51 was submitted tonight, which increases frame rate in my stress test scene from 28fps to 43fps, which is a 50% increase in speed. It's the only change in this patch, but it's a good one!
     
    WildStyle69, ZoneOfTanks, m4d and 3 others like this.
  25. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @jbooth I have managed to strip it down to a single landscape and a loader scene with the crash. I will send an email link when I get it uploaded. Included is a build also just in case.
     
    jbooth likes this.
  26. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    I've basically got your point, Mr Booth. I think it's up to Unity to solve this problem. I'll try to adjust the smoothness map to see if I can get the desired result, which doesn't cost much~
     
  27. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    I'll try that, Mr Booth. I used 2017 because my previous version was 5.6.0 and it could break Texture Arrays according to your documentation, right?
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Unity broken texture arrays in 5.6, but fixed them in 5.6.1p2, so any version after that will work.
     
  29. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @jbooth Were you able to see the crash in action in the test proj I sent you via email?
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Haven't had a chance to open it yet- I shipped updates for 9 MicroSplat modules and 1.51 of MegaSplat last night, so I was a bit busy. I'll take a look soon..
     
  31. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    It' all good. Was really just checking that you received it.
     
  32. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Just downloaded the latest version in 2017.1, Unity fails to auto-upgrade the code and leaves the files with several of these errors:

    Assets/Plugins/MegaSplat/Scripts/Editor/MegaSplatMeshProcessor.cs(217,15): error CS0619: `UnityEngine.Mesh.Optimize()' is obsolete: `This method is no longer supported (UnityUpgradable)'

    Assets/Plugins/MegaSplat/Scripts/Editor/SplatArrayShaderGUI.cs(1360,10): error CS0103: The name `Profiler' does not exist in the current context

    I can probably fix this myself but figured you'd want to know.
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Oh, that's annoying. Just delete those lines- I'll delete them on my end as well and update. Thanks!
     
  34. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Oddly enough, it fixed itself when I reimported a second time on top of the existing files... maybe it was just a fluke? I think sometimes the Unity editor likes to mess with me just to make sure I'm paying attention. You know how it is. ;)
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    It was likely the script updater running and stripping that line..
     
  36. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    @ jbooth I have Mega Splats and alot of MicroSplats...we are making a large game, mostly using Unity terrains, I like the vertex painter in Mega Splats, alot, but having a hard time deciding what to use. for our game, our maps are fairly large...

    We have terrain holes etc, which I seen you add to Micro module , one..
    anyways, do you have any suggestion, which one, would be better for larger terrains, using Multi Tile. with terrain holes, etc.. I like both programs for different reasons.. but performance is like anyone, a huge importance.
     
  37. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I'm using Megasplat and SEGI. For some reason, during SEGI's voxelization of the scene, it sees all the megasplatted meshes as completely white instead of picking up the actual color. Any idea why that might be?
     
  38. magic9cube

    magic9cube

    Joined:
    Jan 30, 2014
    Posts:
    58
    Hi Jason & fellow Megasplatians,

    I'm messing around with texture flow on my marching cubes / iso-surface project. As soon as i turn on flow, it seems to disable Triplanar UV. Any ideas? Did i miss something?
     

    Attached Files:

  39. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    Hello I found that you're update packing array system, so I actually adjust texture for NormSAO packing, what me do now when you re chanfe the way pacvking? I need rollback or I can explain to megapacker which every texture keeps?
    or it can't calculate blue normal map channel?
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    On Unity Terrains, MicroSplat is definitely faster than MegaSplat. The latest 1.51 patch of MegaSplat applied some of those optimizations back to MegaSplat to great success, but the raw technique used is just fundamentally faster. Note that in 1.51 I also added the paintable holes from MicroSplat to MegaSplat - these don't require you to draw your terrain as AlphaTest, and therefor run much faster.

    No, I haven't used SEGI, so I'm not sure where it gets it's color data from.

    Flow is not compatible with triplanar UVs directly, because you have to flow map vs. a UV direction, and triplanar has three. If you have actual UVs for your mesh, it's possible to use them, but I'm assuming in this case you are using triplanar because your mesh has no UVs.

    If your textures are named _nsao, it will pick this up and pull the correct channels. If not, you can set the texture importer to use the same extension for normal, smoothness, and ao textures, then set the channel selector to pull from the appropriate channel.
     
  41. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    ok, so maybe I will stick with Mega Splats then as I like that I can paint. and I can use more textures. by the sounds of it, sounds like Mega Splats is way faster then before. Which is good news. Thanks for info.
     
  42. magic9cube

    magic9cube

    Joined:
    Jan 30, 2014
    Posts:
    58
    As per response; This is as close as i've managed using Triplanar with a different material on submesh for the lava. I guess i'll need to get the UV's sorted for this iso-surface to get it any better.
     

    Attached Files:

  43. hdxpmc

    hdxpmc

    Joined:
    May 1, 2016
    Posts:
    50
    Hello Mr JBooth,

    We have converted all painter in editor to runtime with mouse/touch and it run succesfully. With MegaSplat, we have some question:
    1. Which channel free to store data color for gradient (6 color). (UV1.xy free ?), In order to blend those color gradient in post pipeline custom code.
      1. Example: the grass have green color, we want it have yellow or red tint, is it possible ?
    2. How can we set macro texture or update texture slot in runtime ? In order to put photo runtime and allow user to paint/flow/… on that photo
    3. Is it possible to apply flow to MacroTexture layer, and have flow effect on each layer ?
    Best regards
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    1. It really depends on your lighting code, since unity uses various UV channels for lighting UVs, etc. The documentation has the full layout of what MegaSplat uses in it.

    If you want to paint a vertex color onto a MegaSplat shader, you'd likely have to pack the RGB values into a single UV channel- functions to compress and uncompress a color to a float are available in Unity's CGInc files. You would also need to write a custom brush to paint a color in this packed format for the vertex painter. There just aren't three available vertex channels available to paint in, unless you make sure not to use certain effects that those channels use (IE: no streams, etc).

    2. You can set any of the textures like any other texture on a material, with material.SetTexture("_MacroDiff", myMacroTexture).

    3. Flow mapping only works on the splat map layers.
     
  45. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    Why _nsao? isn't NormSAO hah, funny, ok then i just rename texture by total commander macros renamer.
     
  46. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    Also I setup terrain for megasplat but i can't draw on them. In terrain painter tick at Active is true, Brush flow normal, texture picked but when i draw on it draw nothing. no changes what me do?
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Assuming this was all fine before?

    Check for:
    - Compile errors
    - Are the texture arrays assigned to the material?
    - Is the control texture assigned to the material correctly?
    - Restart Unity?
     
  48. Julhelm

    Julhelm

    Joined:
    May 18, 2015
    Posts:
    4
    I just bought this asset but get several compiler errors on Unity 5.4.0f3. Updating Unity to 5.5 or beyond is not an option for us as that would break some core assets we rely on. The asset store page states the requirement as 5.4.0 so what gives?
     
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    Try reimporting? I use 5.4.0f3 to develop the it, so it definitely works..
     
  50. Julhelm

    Julhelm

    Joined:
    May 18, 2015
    Posts:
    4
    It works when imported into a clean project, but when imported into my game project gives the following compile error: