Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[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:
    4,192
    MicroSplat has nothing to do with tree rendering. I suggest Vegetation Studio for vegetation needs.
     
  2. Jolinah

    Jolinah

    Joined:
    Jul 6, 2012
    Posts:
    2
    Ok, thank you for your answer and the suggestion. Maybe I will still buy the HDRP and some other modules for improved terrain rendering. Nice work :)
     
  3. nausicaa

    nausicaa

    Joined:
    Dec 8, 2014
    Posts:
    9
    Hello,

    I just downloaded microsplat and microsplat mesh workflow.
    I'm working on a civ-like game on spherical maps. Spheres are composed of hexagons (and 12 pentagons). Each hexagon is a mesh procedurally generated. I made a little shader to display textures on ground based on height (this shader is far from perfect but it's another story ;) ).
    I'd plan to use your asset to display rivers and fields on the ground. But as everything is procedurally generated I don't want to paint anything, I'd like to compute everything. Is it possible to use your asset this way ? Can I generate everything from code ?

    Kind regards
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    Yeah, you can do it either by painting data on the vertices (with the vertex workflow) or putting weights into the pixels of the backing textures. If your using textures, then each channel of the texture corresponds to a texture in the array (so, the 1st texture is the R channel of the first texture, the next is the G channel, etc, through how ever many textures you require). For the vertex workflow, data is packed into the colors and UV1 and UV2 zw components. It's packed as 4 weights for each value (so first four in color.r), and you'll need to find the packing functions from the painting code to see how to pack them. All weights need to be normalized across the values (totaling 1). If you plan to use the FX features (lava, wetness, streams, etc) then an additional texture is used for them, or they are stored in UV2.w in the vertex workflow.

    The other option is you can use the runtime procedural module to assign this data based on height/slope or texture data using curves and such. This will give you nice curves and control for these things, which you could also access via code.
     
  5. nausicaa

    nausicaa

    Joined:
    Dec 8, 2014
    Posts:
    9
    Thanks for your quick answer.
    I'd lie telling I understood everything :p...
    I have to re-read that many time and test things to undertand what you meant.
    Maybe there's and example somewhere :oops:?
    Anyway I'll try yo do that.

    Thanks again
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    The only examples would be the painting code..
     
  7. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    581
    Hi @jbooth !!

    I have updated a project (where I had MegaSplat) to Unity 2019.3.0f6 at Standard Pipeline.
    When updating, I got several errors related to MegaSplat and I had to delete Megasplat from the project in order to finish updating it.

    I have downloaded the latest version of MegaSplat from the store and imported it into the project, but I get these errors by console and MegaSplat does not finish importing ...
    MegaSplat.jpg

    How can I solve that?

    Cheers
     
  8. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Hi Jason, it's been a while, have you been working on a new MegaSplat upgrade to support the HDRP and if possible either DX12 or Vulkan? Thank you.
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    If you open those files and change keyDown to KeyDown it should compile. I'll issue a patch soon.
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    I have no plans to support any SRPs in any product other than MicroSplat. SRP's are a total support nightmare, requiring you to constantly rewrite tons of shader code to match undocumented changes Unity makes with no notification or even warnings when they change things, what they changed, or why. If I spent the time I spent on supporting LWRP/URP/HDRP on MicroSplat contracting, I'd earn more money than I earn from my entire asset store catalog. SRP's are a disaster, and Unity is broken.

    DX12/Vulcan should, in theory, just work though.
     
    Seneral and Ascensi like this.
  11. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Thanks for the heads up! I did write Unity that many developers are becoming overly frustrated with their constant back and forth trying to keep up and that personally I'm thinking about canceling all my subscriptions with them if we can't get a focused on a stable direction and have many assets across the store get the updates they need. -No fault of your own. I tried Vulkan with the last update, it created serious errors that wouldn't allow it to compile - I wrote to this thread about this long ago and DX12 was in beta. I might use Microsplat for Meshes with Triplanar & displacement if it supports HDRP but I think I recall you saying it's not yet supported.
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    It supports HDRP with some exceptions- right now the vertex workflow doesn't work for HDRP, along with tessellation/displacement. I managed to add support for pretty much everything in URP, but they added a bunch of new abstraction that makes it hard to add that stuff to HDRP without having to own a lot more of the pipeline..
     
  13. Crowvyn

    Crowvyn

    Joined:
    Sep 7, 2014
    Posts:
    6
    I suddenly have those weird colors after a build (works fine in editor play mode). I tried everything from disabling all reflection probes to deactivating HDR and deactivating all post processing. Nothing helps, only getting rid of Microsplat. I am using Unity standard shader.
    Any idea how to fix it?
    WEIRDCOLORS2.png
     
  14. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    581
    Thanks, the update is already in the store
    Cheers
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    Looks like the textures are corrupted in the library- delete your library folder and let it reimport everything..
     
  16. AlexV03

    AlexV03

    Joined:
    Nov 28, 2019
    Posts:
    2
    i downloaded Microsplat but when i import it to unity version 2019.3.6f1 i get 128 errors saying: Binary to YAML conversion: type UInt16 is unsupported. why is that but on unity store it says it supports unity versions 2017.1.0 or higher. please help me.
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    You can ignore those, they will clear and don't have any effect- they are some kind of Unity issue with difference between serialization options- you have yours set to forced text, while mine are set to mixed. I don't use any UInt16's in my code, so there's not really anything I can do about it.
     
  18. nausicaa

    nausicaa

    Joined:
    Dec 8, 2014
    Posts:
    9
    I'm currently trying to implement some layer above your code to allow scripts to draw textures. Clearly this is not really easy from my point of view. I think i could be a good idea for you to provide some entry points to allow that natively. I'd be surprised to be the only one trying to do that.

    Kind regards
     
  19. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    4,772
    jbooth likes this.
  20. Captaingerbear

    Captaingerbear

    Joined:
    Mar 6, 2013
    Posts:
    24
    Having an odd issue and I don't know if it's related to Megasplat or not. I'm using generated UV coordinates to project textures onto arbitrary shapes, and the negative axis facing surfaces appear to have their lighting reversed.

    EDIT - Upon closer inspection it seems that the lighting is only vertically reversed. The horizontal direction of the lighting seems correct, as does the depth direction.

    Sample render, with the central panel flipped over to demonstrate. You can see that it appears to be lit from below, unlike its neighbors.
    https://imgur.com/a/fLkKg7d

    The issue persists whether I let Megasplat generate a triplanar map or I generate the UVs mathematically on my own (which I would prefer to do in this case). I've made certain that the surface normals of my geometry are consistent (and indeed, flipping them, or just attempting to flip them on the problem side makes the problem considerably worse)

    Parallax does not appear to be inverted on the bad side, so I'm not sure what that indicates.

    It's entirely possible that I'm doing something boneheaded and missing an obvious fix, but I've been tweaking this for a full day, and maybe someone has some insight or suggestion for me. Thanks.

    -G
     
    Last edited: Apr 5, 2020
  21. Captaingerbear

    Captaingerbear

    Joined:
    Mar 6, 2013
    Posts:
    24
    After further experimentation the issue seems to have something to do with binormal directions, and though I've made some improvements by blindly tweaking the vertex tangents, I'm afraid I'm not well versed enough on this particular topic to definitively solve the issue on my own.
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    It's a complex topic:

    https://medium.com/@bgolus/normal-mapping-for-a-triplanar-shader-10bf39dca05a

    The real, long term, good answer is to switch to derivative maps.
     
  23. Captaingerbear

    Captaingerbear

    Joined:
    Mar 6, 2013
    Posts:
    24
  24. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    I mean, if you rewrite most of the code, sure..
     
  25. Captaingerbear

    Captaingerbear

    Joined:
    Mar 6, 2013
    Posts:
    24
    "Good enough" it is.
     
    jbooth likes this.
  26. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    jbooth , I can download microsplat quickly,i think it‘’s so useful for terrain rainder。I need mesh work flow,so i pay for the mesh work flow,but I found that I couldn't download it.it's always in 0%. My unity version is 2019.3.2


    upload_2020-4-11_14-59-48.png
     
    Last edited: Apr 11, 2020
  27. MaxKMadiath

    MaxKMadiath

    Joined:
    Dec 10, 2016
    Posts:
    27
    I am using unity 2019.3.9f1 HDRP Scene i Have imported Microsplat and microsplat HDRP asset and addedmicrosplat terrain to my terrain.When i convert to microsplat the scene becomes dark please help.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    Try going through the asset store? Or restarting Unity? Not much I can do about the package managers downloading mechanism.

    Which version of the HDRP are you using? It's written for 7.2.1. Try loading the example scene in CoreHD/Examples first.
     
  29. MaxKMadiath

    MaxKMadiath

    Joined:
    Dec 10, 2016
    Posts:
    27
    Latest Unity version the default HDRp is 7.3.1 is there any method to work on that. Sorry i am not a programmer. :)
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    People have told me that it works on 7.3.1 fine, but I develop it for 7.2.1. Does loading the example scene work?
     
  31. KimDenmark

    KimDenmark

    Joined:
    Oct 9, 2016
    Posts:
    7
    Hey jbooth. Fantastic tool you have created :)

    I have been playing around with it for about a week and I have a couple of questions - Im sorry if they are already answered somewhere, but I cant seem to find the answers here or in the google docs

    So Im procedurally generating a terrain (mesh) and I have managed to paint the vertices, in code and blend between 2 textures (top-layer and bottom-layer). I seem to have trouble with blending more than 2 textures (for example in corner cases where more that 2 voxels meet)
    - So, is it possible to blend more than 2 textures, at the same area?
    - Is it possible to paint with Texture Clusters instead of plain textures?

    And once again, I can not stretch enough how awesome I find this product :D
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    So each vertex can only have 2 indexes and a blend weight between them. However, each pixel, therefor, will blend up to 6 texture sets (3 vertices * 2 layers). Texture clusters in MegaSplat are actually just an editor time construct, they simply use procedural functions to decide which index to paint on each vertex of the layer. You can easily do the same at runtime, using noise or whatever function you want to select from a selection of possible textures.
     
  33. KimDenmark

    KimDenmark

    Joined:
    Oct 9, 2016
    Posts:
    7
    This makes sense :)
    Thank you so much for your quick reply!
     
  34. KimDenmark

    KimDenmark

    Joined:
    Oct 9, 2016
    Posts:
    7
    Another question; The documentation say, under "Integration with other vertex painters or procedural geometry":

    Color RGB = Vertex Weights

    Does each color-channel represent each corner vertex of an triangle?
    And what is the expected sum of the the three channels? Do they have to add up to 1f?
    Also, this is intended to blend between 3 textures of the same layer (top and bottom), correct?

    Once again, I apologize if these things has been answered :)
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    The vertex colors need to be stamped with special data so the textures can blend correctly across the triangle face. Each triangle must have exactly 1 red, 1 blue, and 1 green vertex. Alternatively there is an option to do this in the geometry shader instead, but geometry shaders are slower than doing it in preprocessing or in your case doing it at mesh generation time. This is what the mesh converter does, and you can use the vertex painter to look at the data on the color channels and see what this looks like. Without this data, if you have a texture index of 1 on one vertex, and 7 on the next, it will interpolate from 1 to 7 across the triangle face.
     
  36. KimDenmark

    KimDenmark

    Joined:
    Oct 9, 2016
    Posts:
    7
    Ahh, I see - That did the job for me! Thank you so much for your help
    Im sure Im gonna find other things I need explaining, but thanks for now :D
     
  37. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    The reason I can't download Is the unity account of Browser is different from the account of unity hub. I fixed it now。 I have another question, I want to transform terrain to mesh,but I found a Little vedio about it。 I dont know how to use it。
     
  38. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    53
    @KimDahl I am glad somebody is using and enjoying megasplat too after long time period. :D
     
    dsilverthorn likes this.
  39. KimDenmark

    KimDenmark

    Joined:
    Oct 9, 2016
    Posts:
    7
    Yeah, it is really great - I have only ever had the need for this kind of textures, starting last month, so Megasplat is totally new for me :)
     
  40. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    jbooth:
    I use the demo of microsplat to run in a low level phone such as oppo r9s plus,ram 6g, cpu MSM8976 pro 8 core, gpu Adreno510. The fps is about 22。No difference, even if i use gpu instance. How to increase the fps of demo in this phone。
     
  41. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    @jbooth :
    when i use the shader type of unity terrain,the display is normal,but when i use the shader type of mesh or vertex mesh,the display is too abnormal。
    terrain upload_2020-4-13_17-16-9.png
    mesh upload_2020-4-13_17-17-51.png
    vertex mesh upload_2020-4-13_17-18-12.png
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    Read the optimization guide. Can't help with specifics of a particular android device, as I don't own it and there are about 15,000 unique android devices. However, the optimization guide points out a lot of things you can adjust.

    That's because those types are not for terrains- they are for meshes and vertex meshes. You should read the manual.
     
  43. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    @jbooth
    Can I transform the micro terrain to mesh for Improving performance by mesh workflow?
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    Mesh Workflow will convert a terrain into a mesh or meshes, keeping the same shader running on it. If that's a performance gain or not depends on a ton of factors.
     
  45. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    @jbooth
    how to convert into a mesh or meshes ?do you have vedio or Introduction?
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    It's all in the documentation, which is included with every module, and available in Core/Documentation as well.
     
  47. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    @jbooth
    I don't have The MicroSplat Mesh Terrain module, Where to find it?
    upload_2020-4-14_13-40-12.png
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    On the asset store.
     
    blacksun666 likes this.
  49. jason10240

    jason10240

    Joined:
    Apr 1, 2020
    Posts:
    8
    thank you. Why don't you put it on the instruction list?
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,192
    Put what" That I sell modules on the store? Isn't that obvious?
     
    dsilverthorn likes this.
unityunity