Search Unity

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

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

  1. MaxKMadiath

    MaxKMadiath

    Joined:
    Dec 10, 2016
    Posts:
    69
    Jbooth. I think No. See the below image while in play mode. Do i miss any setup to get it worked? It looks same when not playing. upload_2020-4-15_20-14-2.png
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This is the stock example scene in CoreHD? You might try toggling an option and see if regenerating the shader will update it. I'll do a test in 7.3.1 soon and see if I can figure out what they've changed. For now, use 7.2.1.
     
  3. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    Hi @jbooth ,

    I am switching my project from microsplat to megasplat. I've imported megasplat but hit a few errors I haven't seen before and don't make sense to me.

    As you can see in the picture, the result is my terrain is going haywire. This is happening right after I select the terrains and then press "convert to megasplat" with the Terrain Paint tool. Unity version is 2019.2.21f1
    upload_2020-4-19_12-28-0.png
    upload_2020-4-19_12-30-41.png
    upload_2020-4-19_12-37-50.png


    additional note: example scenes are working normally
     
    Last edited: Apr 19, 2020
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Try installing each into a fresh project, then copy them into your main project.
     
    BIGTIMEMASTER likes this.
  5. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    will do. it seems like its actually an issue with these terrains. i tested on a new terrain and your tools are working normally. I generated these terrains from a mesh using another third party tool, so likley just something out of the ordinary going on.


    edit for resolution: no need to reinstall, just some compatibility issue with the output from Infinity Code Mesh to Terrain conversion. I just set up new terrains and transfer the heightmaps and Megasplat is working fine.
     
    Last edited: Apr 19, 2020
  6. leon49

    leon49

    Joined:
    Oct 19, 2017
    Posts:
    2
    Why my comments about this plugin was deleted???
    I wanna a refund!!!
    It doesn't work with URP !!
     
  7. leon49

    leon49

    Joined:
    Oct 19, 2017
    Posts:
    2
    Don't make me leaving an One Star.
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No one deleted your comment, it's directly above your comment saying someone deleted it- supporting SRP pipelines requires a 100% rewrite of all shaders, and no where does it say it supports URP on the asset store description. Maybe you should read asset descriptions before you buy them?
     
    R0man, Seneral and blacksun666 like this.
  9. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    I'm keep finding issues with this asset from converting to copying existing microsplat scenes. I hate asking for support on any asset as I just feel like a pest, but this is becoming one of the worst headache in my project. I really need it, as everything looks so much better with it. Perhaps you can find the time to help.

    Anyways, my first issue is converting old unity terrain painted details to microsplat with 16 or more textures. Anything beyond 16 total textures it excludes. Swapping to 32 does not bring the art, painted areas or any of that design back. It appears when you convert the default shader count of 16 is applied. Perhaps make it 32 and this would be fixed.

    Second height, smooth and other PBR attachments are lost when you click grab from scene on the texture array object located in the microsplat folder for your scene. Not sure if this was intended. There is no reference to existing array data that is unchanged. So it basically cleans it out if you use heightmaps, smoothing etc.

    Third copying scenes. I stated a few weeks back about my issues with it. I went back to see every scene that I've worked on are all retaining the initial converted scene shader in some way. I don't see any issues but it seems to trigger some sort of update to them.

    See example:


    Can you explain to me why this is happening. I've already replaced the 2 array images(textures/normals), and the keywords objects in debug.

    Thanks
     
    Last edited: Apr 22, 2020
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    1. You should just have to change the texture count to a higher value than 16 in the max texture count property. MicroSplat does not edit the terrain, except to keep the terrain layers in sync with the texture array. If this is not happening and you can create a repro I'd like to check that out.
    2. That's because Unity has no concept of those textures, at least until recently when the mask map was added. Once converted to MicroSplat, you should use the texture array config to edit your textures instead of the Unity terrain, and there should be no need to use Grab From Terrain anymore. I was actually thinking of removing it, because there really isn't a need for having that button anymore, and now that MicroSplat works on more than terrains it seems a bit strange.
    3. MicroSplat will lookup other objects in the MicroSplatData directory via the template materials path. So if you are going to copy a MicroSplatData folder and scene, you need to make sure you copy the entire MicroSplatData directory, your terrain data, and the scene to a new location and make sure the meta files are unique so that the old scene does not point to the new data. When you load a scene into Unity and there is a meta file conflict, Unity will leave all references pointing to one of the metafiles and change the meta ID in the other. Usually it managed to leave everything pointed to the old ones, but not always. Then on the MicroSplat side you need to make sure that all the pointers go to the correct objects (in the debug section), and then make sure unity actually saves the data, because I've seen it not correctly mark data as changed and not save the terrain component before. Finally, you might want to change the name of the shader in the materials shader name field, such that you don't have multiple shaders with the same shader name field.
     
  11. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    1. Simply create a new scene add 18 textures and paint the entire terrain with textures 17 and 18 and poof! Where do I change this texture count? I see in your shader code there is a else statement defaulting to 16. I suppose I could swap the 32 and 16 around but I'm no shader expert...
    2. Ok will do.
    3. I'll give that a go and see if I'm able to trigger this fix.
    Thanks
     
  12. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    Nope 3 did not work. What I ended up doing was.
    • I renamed the shader(creates new meta files)
    • Tested by making one change to cleaned out shader. Other scene still showing as updating something.
    • Delete those meta files
    • renamed prop data that has info on it to the newly named shader
    • renamed keywords as above
    • renamed config as above
    • Terrain automatically updates these files to link in the debug.
    Edit:
    I duplicated another scene to test things out and what it's refering too is the shader file as you pointed out should be renamed. However renaming doesn't relink. How do I link up the shader inside the duplicated scenes microsplat folder to the mat?

    I can see some sort of reference in the picture below located in MicroSplat_Base.shader. I'm going to assume that MS is simply ignoring the folder shaders and finding the old reference which I can't find where to update.
     
    Last edited: Apr 22, 2020
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'll have to look at source to verify, but I think the base shader name is constructed from a hash on the features list- which means if the features match, the shader might too. But it shouldn't matter in that case because it would be the same code. But again, I'll have to check the code when I get a chance to verify that.
     
  14. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    Ok thanks so much. Please let me know!
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, it's a hash of the keywords, so if they have the same code, they will end up with the same name. However, the base shader is written via path, so it should only write to the file next to the material/shader being edited.
     
  16. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    Why create new shaders if they all carry the same code? I've made several scenes and all of those have a shader dedicated to them in the scene folder. But any copied scenes does not. Now with that being said, making a large change wouldn't that alter the shader and cause lost information? If I copy dozens of scenes I could lose massive amounts of work with this bug in my design workflow.

    Can you please let me know if it's possible for me to link to the shader in the folder and retain my data?

    I've made a small video to explain my issue.

     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    So I think what's happening here is that you are copying all the files, but you haven't assigned the copied shader to the copied material. So it's still pointing back to the old shader, not the new one. So when it regenerates the shader, it regenerates the old one.

    Basically, you have one reference back to the old data via the shader assigned to the material. If, after copying the scene, you drag the shader onto the material it will be linked to the new one. If I'm correct, you'll also be able to use the select shader function (on the little gear at the top of the inspector) on the material and it will bring you back to the old directory.

    As for why I regenerate the shader even if the files might be the same, well, I don't know if the other shaders have the same code in them or not, unless I was to search through the project and find them or something. It also means if someone copies the MicroSplatData folder into a new project, or checks it in without copying some other folder some where, things would break. When setting up a MicroSplatData directory, the system generates everything it needs in that folder and doesn't create references outside of it. But since you have copied that folder and not quite fixed all the references, you're having issues.
     
  18. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    YES! Thank you!!! You're right dragging the shader to the mat fixed it. Also the data is retained too, so this is a perfect solution to my problem. As for how you generate the shader it's not a concern anymore :)

    Thanks again.
     
  19. PesadeloDoEspantalho

    PesadeloDoEspantalho

    Joined:
    May 26, 2017
    Posts:
    45
    Hi everyone,
    Just a question, this asset has a option look like "microsplat trax"?
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    nope
     
  21. PesadeloDoEspantalho

    PesadeloDoEspantalho

    Joined:
    May 26, 2017
    Posts:
    45
    Ok thanks but with :
    "- Components for getting surface information from collisions and ray casts at runtime."

    And:
    "- Examples of how to paint meshes or terrains at runtime efficiently, and have physics interact with tessellated terrains."

    I can make a similar effect?
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not really, Trax uses the buffer of the actual object to leave a physical impression, it's not just changing splat map weights..
     
  23. nausicaa

    nausicaa

    Joined:
    Dec 8, 2014
    Posts:
    16
    Hi,

    I'm working since weeks on this solution.
    I have something correct from my point of view in the editor but when I build the game, the material are broken (pink texture).
    I replicated the paint code and in fact I only call existing code from PaintJob and VertexInstanceStream :

    PrepBrushMode
    then all the PaintMeshVertex needed
    and the Apply to finish.

    I just getting completly nuts with this. At first I had issues with non-readable mesh but I got rid of this message, the material are still broken in build mode.

    Do you have any idea on this, something obvious or any specificity on build mode (maybe player settings) ?
     

    Attached Files:

    Last edited: May 5, 2020
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Look in the build log to see if you have any errors, and make sure the shader is getting included into the build.
     
  25. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    hi tried reaching out to you for support via email but unfortunately no answer. I'm experiencing a terrible issue here which is a total show stopper.
    Basically I have a terrain created with Gaia and textured with it as well. I'm trying to have it to megasplat format. I selected all my terrain tiles at once and press the button. After doing so, the terrain pretty much disappear , becomes a black geometric mess pretty much like the other user has reported in that page converting from micro to mega or the other way.
    My version of Megasplat is the latest (1.75), i know it works because when I set up another terrain created without gaia it works. So the question is, have you heard of something like this before? Do I need to contact the gaia people to know if they do something to the terrain that is completely incompatible with MegaSplat?
    This really doesn't make sense to me and it's very frustrating since I know your tool is amazing and it should work.
    Thanks
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I haven't heard of that- maybe try removing any components and such that Gaia leaves on the terrain, and make sure Draw Instanced is off, because MegaSplat doesn't support that currently.
     
  27. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    That was it! Thanks
     
  28. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    If you copy a scene, and go check out the paint section on the terrain object you can see the old reference to another scene. When you do this same behavior with unity it's quite different as reference is in a nice neat folder. This route things are stuffed in folders in your scene. Once I do this and try to copy scenes this reference resides in that scene forever and it's super hard to spot and trigger to grab the new scene folder. ( no the debug section, or dragging the shader on the mat file does not fix this). I've just found about 10 more scenes all messed up with and it's costing me weeks of time to fix. In all cases I've had to destroy and redo all my work on the terrain.

    The way this asset works is great, but I'm growing tired of having my work destroyed by my workflow design. Copying scenes may not be a concern for you, but it's a huge savings to my workflow and I'm sure others too. The debug section IMO is missing some very important syncing options.

    I know it's possible to sync the terrain layers MS makes to be found by the paint section in unity on a copied scene, but I can't make it happen all of the time.

    A couple other things I noticed and had questions about:

    What is the _terrainAutoUpgrade folder for? I see a pile of stuff. Can we safely delete these?

    Grab from terrain purges height maps and anything else outside of albedo and normal. Is that intended?

    Adding new layers should it be done by the paint section then grab scene or by data asset then click update? It does not always add the new layer to the terrain paint section via the asset file.

    If I duplicate the MicroSplatConfig and try to use that going forward, it does not sync. The reference does not send an update to unity terrain paint area and causes the index go out of order.

    Lastly, the wait time per click is on the shader is beyond frustrating. I know you mentioned it may affect your review with some unfamiliar customers as to why nothing is happening, but it's also making me want to toss in a 1 star too lol. I know it may sound over the top, but it takes like 20 minutes to fulfill these settings. Could you consider adding in simple bool check and make it a behavior I can turn off?

    Some MS terrain layers in the project view go white and look like a document icon, some show a grey square. You have to click and see the details to see which image it is. Any idea why this happens?
     
    Last edited: May 12, 2020
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    1. The terrain auto upgrade folder is what Unity creates when it upgrades a project to the new terrain layers system. It is not a microsplat thing.
    2. Grab from terrain grabs the data from the terrain. Since Unity's terrain doesn't have height maps, it can't grab them.
    3. No, you cannot add new layers via the paint section- you have to use the texture array config. Unity's layers cannot be extended with the information that the shader needs, like height maps, anti-tile array maps, etc. It's hard coded to Unity's shader. If I could use this interface it would be a lot nicer, but they made it non extensible.

    If you are going to copy a scene, you need to repoint all of the references. Most people end up missing some of them, but they are all exposed on the components. The most common one people miss is not assigning the copied shader to the copied material, or not reassigning the references on the material (texture arrays, etc) or component (propData, etc).
     
  30. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    138
    Hi Jason, Thanks for the response.
    It seems my issue with the terrain layers was caused by having the old terrain in my scene even if it was disabled seemed to cause the update array to grab the other old terrain details and apply to my enabled terrain. Sorry for the trouble!
     
    Last edited: May 16, 2020
  31. ccardinal

    ccardinal

    Joined:
    Dec 7, 2017
    Posts:
    1
    Hey Jason, just installed MegaSplat and running through the quick start. It seems setting my vertex painter to active doesn't seem to enable the painting brush. Any thoughts on what I might have missed?
    upload_2020-5-21_11-35-36.png
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    That should pretty much do it. Does the visible brush not show up? Does it paint? Does fill work?
     
  33. MaxKMadiath

    MaxKMadiath

    Joined:
    Dec 10, 2016
    Posts:
    69
    After converting terrain using microsplat HDRp scene when i play the terrain and player looks wired i am using enviro as well with it . Please help and render loop i changed to Unity HD as the terrain was in pink color.also getting more than 80fps.
    upload_2020-5-22_19-16-10.png
    upload_2020-5-22_19-17-15.png
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not much to debug on here, I have no idea what the terrain is supposed to look like. You might want to try turning off features, like wetness/enviro/etc until you can isolate the issue.
     
  35. viceca

    viceca

    Joined:
    Nov 10, 2016
    Posts:
    14
    Hey @jbooth, I've been using Megasplat for a while on PC, but now that I'm starting to explore a bit on Android I've found an small issue where the splats are quite off as in the image below (both are the exact same view), I'm fully up to date.
    Any ideas how to tackle this?
    Megasplat Version issue.png
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Odd, there's no device specific code in MicroSplat's shaders. I can't think of any reason splats would be significantly different on different platforms, unless your using external splat maps or something like that and they are gamma space in one and linear in the other.
     
  37. viceca

    viceca

    Joined:
    Nov 10, 2016
    Posts:
    14
    I'm still using Megasplat on the Android, would that be bad? How hard is it to convert from mega splat into Micro Splat?
     
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    a bit expensive but should work fine. There’s no conversion from mega to micro, the formats are really different.
     
  39. unity_1drewbug12345

    unity_1drewbug12345

    Joined:
    May 1, 2020
    Posts:
    3
    Hello @jbooth

    I've been using Megasplat for a few weeks now. We recently upgraded our project to URP and I'm having issues being able to use a Megasplat material with URP. The mesh we're using for the terrain is using the megasplat_procedural material, and I am unsure how to get working in the new pipeline. Any guidance or tips would be greatly appreciated, thanks!
     
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You have to rewrite the shader from scratch- which is why MegaSplat doesn't support HDRP or URP, unity made 3 incompatible pipelines, and it's simply insane to support more than one of them for more than one asset, so all of my focus is on MicroSplat..
     
  41. viceca

    viceca

    Joined:
    Nov 10, 2016
    Posts:
    14
    @jbooth I've managed to find out what was the issue with my Android application, I just had run a script to set a platform override on all texture importers to max 512 on Android and this "broke" the splat texture.
    After removing the limit it's all working fine, but I intend on looking into Microsplat.
    Thanks for the help, oh and I just happened to find your TWD presentation video (
    ), which is great, one of the best Unite talks I saw!!!
     
  42. unityafise

    unityafise

    Joined:
    Mar 3, 2020
    Posts:
    2
    hey @jbooth, i very recently purchased MegaSplat for primary purpose to paint a texture at runtime. I am having difficulty for find control on controlling the size on texture in meters, and painting a single piece of texture around the point of collision as demonstrated in demo scene. Also i need to control the deformation of terrain as big or small blast as in a war game.

    Attached an image for clear understanding

    I Explored, Material > Texture Setting Editor > UV scale, but only scale texture between its normal and double the texture size via slider.
    megaSplat.png
     
    Last edited: Jun 4, 2020
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    First, you can't just arbitrarily place a circle wherever you want, as you're adjusting pixels on a splat map. If you change a pixel on the splat map, and each pixel is 1 meter of coverage (ie: 1024 terrain with 1024 splat map), then the minimum spacing of your area will be 1 meter in size. Deformation would require changing the terrain height map via the terrain API, which is not handled my MegaSplat.

    Second, this seems like something much easier to do with Digger Pro + MicroSplat, as Digger Pro can cut arbitrary shapes into a terrain at runtime and texture them with MicroSplat. In the MicroSplat features demo on YouTube, you can see explosions blowing holes into the terrain and a tank driving through them.
     
  44. Karokendo

    Karokendo

    Joined:
    Mar 3, 2018
    Posts:
    1
    Hello, I am getting this weird texture blending when painting multiple textures (example texture array). I think it's pretty common bug but I can't find a way to fix it. Can I get some support?



    upload_2020-6-24_22-15-0.png

    upload_2020-6-24_22-15-50.png
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Read the docs, it will show you how to process the mesh to avoid this.
     
  46. CharlieDolphin

    CharlieDolphin

    Joined:
    Mar 24, 2019
    Posts:
    2
    Hello, I'm really enjoying Megasplat - thanks for all the hard work you've put in.
    I'm seeing a visual artifact when using the Tessellation feature. It appears as though the tessellated geometry is transparent, even though my material is set to opaque. I'm not using any alpha cutout.
    TessellationBug2.PNG TessellationBug1.PNG

    Hopefully you can see what I mean. This effect happens with any mesh that is partially intersecting with the terrain, and it happens even if the skybox is the only thing being obscured by the tessellated geometry. I'm on Unity 2019.2.4f1.
    Posting my material settings as well, if that helps: MegasplatSettings.PNG
    Any help is appreciated. Thanks!
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Kinda looks like draw order/zorder- are you in forward or deferred rendering?
     
  48. CharlieDolphin

    CharlieDolphin

    Joined:
    Mar 24, 2019
    Posts:
    2
    Ah, I switched to forward rendering a while back and that is definitely what caused the z-order issue. I'm switching back to deferred for now, and that solves my issue. I wish Unity's z-index system was a little more intuitive. Thanks for the fast reply!
     
  49. mig91

    mig91

    Joined:
    May 14, 2013
    Posts:
    6
    low poly look still doesnt work with ultimate terrains, no ambient lighting. using 2019.4.2f1, built-in render pipeline
     

    Attached Files:

    • 123.png
      123.png
      File size:
      2 MB
      Views:
      333
    Last edited: Jul 8, 2020
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Oh, this is MicroSplat, not MegaSplat. In MicroSplat there is no lighting code- it's all handled by Unity's surface shader framework, so any lack of ambient is either a setup issue or a Unity bug..