Search Unity

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

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

  1. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, Mr Booth! I just updated MegaSplat and got this weird blend effect.. Does this mean the texture array has been broken by Unity? I am using Unity 5.6.3p2,by the way..
    upload_2017-9-26_11-24-7.png
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, if that's a mesh, it looks like you painted on the vertex colors, which is where the mesh preprocessor puts data MegaSplat uses to make the blending look correct. Clear the RGB channels with the vertex painter.
     
  3. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Seems that I've forgotten to process the plane mesh:D.. Anyway, problem is solved~ And after this struggle I seem to understand MegaSplat better:)
     

    Attached Files:

  4. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Please ignore the attached files, Mr Booth~ That problem has been solved.
     
  5. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    Hi Jason,

    We are having issues with our UV Scale values not being retained when we close unity. The material is triplanar and we need to have different scales set up for certain textures. We have already painted the terrain so would like some how to retain our UV scales per texture.

    What are we doing wrong? :)
     

    Attached Files:

  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Those values are written into a texture next to your material (with _propData on it), which should get saved every time you edit one of those materials. Can you verify if that file is different on disk when you change those values? Does changing one of the other values cause it to save?
     
  7. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    I don't have _propData but do have the pngs created when we setup the materials which are named with _properties instead. I don't see those pngs updating when we change settings. When we edit the material the only change that is logged by SourceTree is the .mat, but this doesn't record any changes to UV Scale.

    UPDATE: looks like the relationship between the material and the _properties is not correct. I have created a new megasplat material via a new terrain and its recording the values fine.

    We have put quite a bit of time into painting these, anyway we can repair/replace our materials and keep out paint job?
     
    Last edited: Sep 26, 2017
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can either copy the old control textures over your new ones, or fix the reference to the properties texture on your old one.
     
  9. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    Thanks, yes just experimented with copying over control texture with success! However I have three different terrain setups so fixing the reference would be preferred, how can I do this?
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The material has a rollup which is closed by default just below the shader settings that has pointers to the properties texture data. Or terrains, the MegaSplatTerrainManager component has a pointer to the unique control texture for each terrain.
     
  11. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    Oh can't see either of those. Going to update Megasplats perhaps my version doesn't include these (1.07)?

    Either way, if I have to I will setup three new materials and overwrite the controls.
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    1.07, man, you way out of date- updating to 1.52 will mean repacking your textures, as the new texture packing stuff is in. Might not want to do that if your in a rush. In 1.07, all the data for the textures should be in the rollout, as I don't think the Multi-Terrain workflow had shipped then.
     
  13. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    Yeah, discovered just now how different! :)

    Happy to put a bit of work into this if its worth the update vs the cost on project time right now:

    - Any significant performance improvements since 1.07?
    - With regards to repacking the textures what is involved? (my artists created these so far so haven't been through this yet.)
    - Will we loose our paint work so far?

    Thanks for your help Jason, your quick responses have been super helpful.
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, about 50% to 60% faster in my stress test scene, and a ton of new features added since then.

    Your artist had to do this all manually. Now there's a texture packer and importer, where you can put substances or textures in and it'll do all this for you. There's a video log for just about every update in MegaSplat on YouTube, so you can chase those backwards and see all the changes.

    No, the underlying format hasn't changed, though I would backup the textures and re-setup your terrains with the new multi-terrain system. It will make everything much easier, as you can have one material/shader/properties which is shared by all of your terrains. Once it's setup, you can paste the old textures over the new one and it should all be updated. Also note that the data is stored as an index into the texture array, so you'll need to have your textures setup in the same order as they were in the original config.
     
    Last edited: Sep 27, 2017
  15. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    Thanks Jason, we'll give this a go.

    It sounds like a bit of work, but for the performance and features I suspect its worth it. To confirm we currently have three different terrains, with three different control textures, we'll be able to combine those into one multi-terrain material?
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, you'd still have 3 control textures- but they could all use the same material/shader in the new system. There's basically a component that goes on the terrain which synchronizes everything..
     
  17. curiscope_kidd

    curiscope_kidd

    Joined:
    Jan 10, 2017
    Posts:
    10
    I see, sounds awesome.

    Anyway, fixed 1.07 for now (so artists can continue), and will update to latest next week :)

    Will benchmark before and after.

    Thanks Jason!

    Ben.
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Sounds better than cramming it in quickly. Let me know how it goes!
     
  19. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Hi, Just purchased your Megasplat product. Looks great. Started with the Mesh tutorial and I cannot find the diffuse brush. These are all the brushes I have. This is a new project (5.6.3p2) with ONLY Megasplat in it.

    Only brushes available:


    Log file looks like:


    Please help :)
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Ah, need to update the docs- it's the MegaSplat_Example brush you want..
     
  21. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    OK. Thanks a bunch :) Another question if you don't mind. Consider this quick ground mesh I just completed with Megasplat. I just used the default Clusters and the "Auto" fill mode and just kept painting one texture on top of another. I'm assuming this results in an efficient map?



    This will be an AR mobile app and I would like your advice on how best to save out the Splat Mesh and texture. Is there any specific 'packing' I need to do, or can I just export this mesh as a package and import it into my scene file and all should be good?
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There's not really a way to 'export' a resulting mesh in MegaSplat- it's a shader and texture array system, so those elements all need to be included in your build as the blending is all completed on the GPU at runtime. Given a unique set of UVs, it can 'render bake' the resulting texture data for each of the PBR terms using the render baking utility's in the painters, which could be useful if you want to bake out small scale stuff to unique textures. But for most use cases, you just run the shader and do the work at runtime, as you would quickly run out of texture resolution if you were to bake it all out to unique texture data for a large level.

    In terms of efficiency, the shader itself does the same amount of work no matter how you paint the textures. It keeps a consistent sample count regardless of if you use 200 textures or 1 - the same work is performed for every pixel. The only thing that is different is the memory bandwidth required to access more or less texture data. The shader itself is rewritten when you change shader options, optimizing out features you aren't using.
     
  23. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Just so I understand. If I select the Mesh and choose to export with dependencies, it will not create a package which I can then load into another project? If that is the case, is there anyway to move a splat mesh from one project to another?
     
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It might- but if MegaSplat is not installed in that project, then things like the texture arrays won't be able to be updated if you switch platforms, the vertex instance stream component that holds the paint job won't exist, etc. Basically, unity has no pipeline for texture arrays, vertex painting, etc, so I had to build all of that myself.
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
     
  26. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    What if I just baked it on to the terrain. Would that then convert it to something which could be exported? I'm not looking to update it later-- once setup, I just want to be able to have it available in another project. I'm sorry if I'm being dense :)
     
  27. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    Perhaps a better question would be what is the minimum Megasplat install I need for the 'other' project?
     
  28. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi Jason!
    Is there any plan to integrate MegaSplat with Vegetation Studio?
    I saw the new MicroSplat update with an integration, wondering if you are also making one for Mega :)
     
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Pretty sure there's already one available to place Vegetation based on MegaSplat's terrain texturing. The feature we were doing in MicroSplat was to a) allow render baking of the resulting splat data, so you can use it to tint vegetation to match the terrain and b) Setup a module for MicroSplat, so vegetation can be drawn into the terrain shader at a distance. You can already do both of these things in MegaSplat, though it's not one click like it is in MicroSplat.
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Basically everything except the examples folder. If you wanted to trim it more you could do stuff like delete the texture graph, etc, and some of the editor files, but none of that exists at runtime. Any reason you don't want the stuff in the other project?
     
  31. YHS

    YHS

    Joined:
    Aug 10, 2014
    Posts:
    31
    Yes it's happen to me too. unity 2017.0.1f3 on windows
     
    jbooth likes this.
  32. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    518
    [SOLVED]
    Forward rendering pipeline will only manage 1 main light. Using deffered solved our issue.

    [QUESTION WAS]
    2017.1.1f1 for myself, good to know I'm not the only one facing the issue
     
    Last edited: Sep 27, 2017
    jbooth likes this.
  33. chippwalters

    chippwalters

    Joined:
    Jan 25, 2017
    Posts:
    68
    It's just that I'm sharing it on Collab with a some others and I'm not looking to create too big a feature creep. Still, it's not that big a deal.

    Couple more questions if it's ok.
    1. Does it really make sense to use this for such a small terrain? I'm not looking for a refund as I'm sure I'll use Megasplat in the future, just want to know if you think it makes sense?
    2. I could possible create a shader with a few color choices and a couple 2K bitmaps which might get me there. Would that be a better performance option than Megasplat on Mobile (just your expert opinion)?
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    If you are only using a few textures, then you could use the shaders I include with the Vertex Painter instead. These are part of the vertex painting package, which I host for free on GitHub. Anyway, they're in the vertex painting folder in a zip file, as they take a long time to import (you can delete the variations your not using to speed it up). Those don't use texture arrays and don't require the MegaSplat framework (just the shader), and you could bake out the paint job to a separate mesh using the Bake option in the Utilities panel of the vertex painter to remove the need to have the vertex painter installed as well. If you are only using a few textures, this might be more performant and easier to export between projects.
     
  35. NKdefiance

    NKdefiance

    Joined:
    Jan 4, 2017
    Posts:
    15
    Not sure if this is a bug or not, but global fog is only working if tessellation is enabled for some reason.
     
  36. NKdefiance

    NKdefiance

    Joined:
    Jan 4, 2017
    Posts:
    15
    Feature Request: Button to update cluster library. As opposed to having to Update everything because takes a long time with substances as it re-exports all the substance maps.
     
  37. mikesawicki64

    mikesawicki64

    Joined:
    May 12, 2014
    Posts:
    33
    @jbooth - Hi, awesome work man, this is very impressive. I was wondering if megasplat could be used with non pbr based textures. IE, im developing a mobile, cartoony style game. I'd like to use megasplat to paint the environment (roads, trails, different seasonal areas, etc) on a NON deformed (flat) terrain or quad plane: I have no need for normal maps, ao maps, or really any of the great textures that are included with MegaSplat. Is this possible? Thank you!
     
    Last edited: Sep 28, 2017
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, there's modes to shut off normal and specular texture samples.

    The cluster library doesn't require updating the array at all- you can do whatever edits you want, or generate teh automatic clusters again without hitting update.

    I'll take a look; I believe Unity changed something with this in 5.6.
     
    mikesawicki64 likes this.
  39. mikesawicki64

    mikesawicki64

    Joined:
    May 12, 2014
    Posts:
    33
  40. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I just tested this in 5.4, 5.6.1p2, and 2017.1.p4 and fog is working in all of the example scenes..
     
  41. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    I've tried to blend a MegaSplat plane with a MicroSplat terrain
    I've been manually setting the textures in the example tex array to RGB 24 bit like this, then apply the changes and update the tex array, I still got this error when I just wanted to adjust the per tex scale.. Now I'm using Unity 5.6.3p2
    upload_2017-9-28_16-0-42.png
     
  42. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Reassigning the textures is a punishment, creating maso textures was a big effort... However, this is the right way, and I understand that you did not have the time for a packer in the releases before.
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It doesn't matter what format the textures in the array are- it's the properties texture that seems to be getting set to something other than ARGB32 on newer versions of Unity (it looks like Unity removed the format from the inspector GUI).

    Taking a look at this in 2017.1p4, they removed the GUI option for ARGB32 and it shows as RGBA32 in my inspector, and seems to work fine. What format does it show for you? It's the texture called _properties next to your material that holds the settings..

     
    Last edited: Sep 28, 2017
  44. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey after the latest update i get the following errors:

    upload_2017-9-28_14-34-0.png

    Does anyone know how to solve this?
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Run the script updater, it should remove the Mesh.Optimize() calls. It should also include the Profiler namespace- if it doesn't, you can just add it to the top of the file that is throwing the error:

    Code (CSharp):
    1. using UnityEngine.Profiler;
    The script updater is supposed to handle this, but your the second person to hit it, so I guess in some cases it's not running or not doing the update correctly.
     
  46. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Where is the script updater located?
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You can run it manually at Assets/Script API Updater

    It's unity's system to automatically update scripts, which usually runs whenever you import something and gives you that "Should I upgrade this? have you made a backup?" prompt..
     
  48. NKdefiance

    NKdefiance

    Joined:
    Jan 4, 2017
    Posts:
    15
    Both Shaders are the same, only difference is Tesselation vs no Tesselation.

    Forward Rendering, Gamma Space. (Tested Linear Deffered with same results tho)



     
  49. NKdefiance

    NKdefiance

    Joined:
    Jan 4, 2017
    Posts:
    15
    Then there is a bug, cluster changes make no effect for me at all until I update.

    For instance, if I make a change to the name or textures in a cluster, it is not updated in the texlist, nor is it updated in the vertex painter.

    If I then hit update, it will update in the texlist but still not in the vertex painter. If I close the vertex painter and reopen it, still not updated.

    If I close Unity Editor and reopen, finally its updated in the vertex painter.

     
  50. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hey,

    does microsplat work with TC2?any guide?
    thanks