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
    Mesh mode has a procedural triplanar projection system that's not available in terrain mode, mainly because it would be very, very slow on Unity Terrains. Otherwise, they have all the same features. The mesh mode, however, is faster than the terrain mode. This is because it can send the needed data from the vertex shader instead of having to sample a splat control texture to get that data.

    You can likely get the Mesh shader working by turning on the "Preproccess in Shader" option - however, I would not recommend using this in production as it uses the geometry shader to do the preprocessing, which is much slower than doing the preprocessing function in the mesh generation step.
     
    boysenberry likes this.
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Awesome! Please post a review on the asset store, I'm being one star'd by a guy that can't seem to read directions, and it'd be nice to get some new reviews on there..
     
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I see 1.09 went live. What are the recommended upgrade instructions?
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Download, install?
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I guess what I mean is can I install over top of an existing project safely? And should I be concerned about overwriting anything that's specific to my project? Some asset authors recommend completely removing the previous install, which I'm hoping I don't have to do.
     
    Tethys likes this.
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I mean, if you have changed data in the example folder it will get overwritten, but otherwise you should be fine..
     
  7. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Perfect. Thanks.
     
  8. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Haha, now i feel stupid : D
    The same thing happens in the node editor, should i sue the same save button then as well?
     
  9. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright Thanks Jason some good points to consider.. I hope it will be easy enough for Denis to setup mesh mode on Voxeland rather than Terrain mode.
     
    Tethys likes this.
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yup- you're not the first to miss it, and other than going all Geocities/Myspace on the button, I'm not sure what to do about it. The reason it doesn't autosave is that saving takes a significant portion of time, since it triggers Unity reimporting the texture, which is a blocking operation (sadly) in Unity..
     
  11. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Np, now i know it : )
    Sadly i still have a bunch of different issues using the latest 1.09 version : /
    Seems to still be some issue with the Height node, even though it kind of looks better then before : p
    https://dl.dropboxusercontent.com/s/jfb51vsbqg5h3sl/shot_170607_140945.jpg

    As soon as i change some numeric value in the node editor, like mid point, everything reverts back to a mucky brown texture and i have to change the textures on my sliders to something else and back to get it to update as it should.

    There are a 9 deprication warnings on 5.6, would be great if you could get rid of them in the next patch ; )
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you send me a repro? Yeah, I'll look at the warnings before the next patch- 5.6 wasn't working for so long I wasn't paying attention to it. I really wish they'd just make the script updater handle warnings like those, because they just mean I have to litter my code with extra #if checks, which then need to be tested across multiple versions, which is kind of the whole point of having the script updater in the first place..
     
    Tethys likes this.
  13. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Its the same terrain as before, let me make you a small example project, will contact you on p, when im done.
     
  14. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Wow, thanks for bringing this up, we have the same issue heh. Not using Voxeland but using TerrainEngine with Voxel terrain - with the shader set to mesh the terrain mesh turns black (if tessellation is on). DOH - I just saw Jbooths response. I was already leaning towards not using tessellation anyway for performance reasons so its not the end of the world if we don't use it.
     
  15. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Turning black is not what I would have expected though - I would have expected it to smear between textures at each texture choice. I wouldn't mind taking a look if one of you can set this up and send me a repro..
     
  16. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @jbooth I tried mesh mode on Voxeland with preprocess mesh but it was slower and it still produced black terrain. @Wright but I imagine that it probably would be faster if like you say Jason that if preprocessing function was added to the mesh generation step rather than the geometry shader to do the preprocessing.
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, geometry shaders are kind of a mistake. Apple's new Metal API won't even support them, because basically you should never use them. That's why I suggest preprocessing the mesh in the generation step, or with my preprocessor, and make users suffer through the process of converting all the meshes to MegaSplat format. Pain in the arse, but ultimately better for your game.
     
  18. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    But for realtime Voxel based terrain it may take a big performance hit in game to generate new chunks? I know @Wright had Voxeland setup to automatically generate chunks on camera distance but there had been a fair amount of performance drop but if chunks were slowly able to be generated (not suck up a lot of resources at one time) although this was Voxeland 4.. I have't tried runtime creation yet. I'm just thinking that if it has to go through preprocessing it may take another performance hit during runtime? but if the chunks were forced to slowly be created as needed then there may not be any bottlenecks.
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, if you're generating the geometry already, then it's really, really simple to do the preprocessing in the same code. You basically just need to assign one red, green, and blue color to each vertex of the face. A couple of people with homebrew voxel engines (and an off-asset store one) jumped on MegaSplat when I released it and had it running in no time.
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This is fixed if anyone needs a patch- I missed porting something back from a Unity 5.6 project I was debugging this in and the full fix didn't actually make it into 1.09.
     
  21. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    I think that for new version support of Unity 5.4 & 5.5 can be dropped.
    Anyway since MegaSplat works ok with 5.6 now there is no reason to support old Unity versions anymore.
     
  22. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    I cannot agree here. For production games you cannot always risk upgrading to latest unity version. So it's often desired to stay version or two behind. For example I was on 5.3 month back. Now upgraded to 5.5 with some risks.
     
    Tethys likes this.
  23. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    So what stops you to upgrade to 5.6?
    It has much better graphics performance and better uNet.

    In our tests big open world level now renders almost twice faster in 5.6 than in 5.5 :)
    So it is huge speed improvement!

    I see no reason to keep old versions as soon as new works ok.
     
  24. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Well usually tons of regression or new bugs from my experience. (for example megasplats wasn't working in that time because of texture arrays bug)

    And I'm really not so brave enough to say that 5.6 is working for everyone just from testing my game. :)
     
    trilobyteme and malkere like this.
  25. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi @jbooth,

    Any way to detect puddles with the Megasplat Collision Info? No problem at all with normal textures, but for puddles, rivers, etc... how can i get that?

    Thanks a lot!
     
    SyGem likes this.
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'm planning on adding that soon. Most likely, I will split the system into two sets of functions, one for highly accurate queries where things are resolved on a pixel level (like the physics offset does), and one for rough queries, where highest weighted texture vs. snow vs. puddle is used.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Excuse me? I happen to need this to work on 5.5.

    For me, 5.5 could be the last version that Unity supports for the Wii U and I have a game to be released on that platform.

    That would be nice, but alas...no can do.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I see you are new to Unity..
     
  29. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Thanks a lot! This is going bigger and bigger.... just one question more. What is on each channel of the water foam texture? Just in case i need to chenge it. The flow distorts a bit the foam in some places, so all info could be of help.

    Cheers!
     
  30. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The first two channels are the normal map, the third channel is the foam texture. Distortions in the flow mapping usually come from the flow direction, which is very course and should be painted with a wide brush, IMO. The water refraction is controlled by the normals. The foam is more complex, it takes the depth of the water and the terrain underneith it into account, and uses the normals and foam from the previous sample to modify the actual foam lookup. In essence, a whiter area in the foam texture will have more foam and more distortion on the foam itself.
     
  31. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Very cool! Thanks. I'm going to play a bit with the textures to see what i get. Indeed it is better to use bigger brush sizes to give i realistic flow. I saw it before.

    Thanks a lot! ;)
     
  32. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    Hello,

    I bought your asset a couple of days ago and I'm super happy with it. I've got a problem creating my own textures though.

    This is a texture I created in Substance Designer: http://imgur.com/gnCUyIV

    I have it set to output diffuse, roughness, ambient Occlusion and normal in .tga format at 2k resolution.

    I use channel packer to create a nsao map. The result is this: http://imgur.com/6gh1ytj

    This looks very different from the nsao maps that come with megasplat.

    The ingame result is this: http://imgur.com/KeG577a

    If I turn Tesselation on it looks slightly better: http://imgur.com/oZbmATp

    The Terrain is hardly being Tesselated at all, using the displacement slider only raises the whole Terrain not any individual features and the other sliders have almost no noticeable effect.

    I'm almost certain the problem is in the conversion with channel packer. Here are some screenshots of my settings: http://imgur.com/al2nsQ3 http://imgur.com/aKlUP6E
     
  33. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    What is the best way to use this for toon style textures?
    So no normal, detail, ... using. Just use MegaSplat for using more textures in a toon level on the terrain.
     
  34. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
  35. StevenP94

    StevenP94

    Joined:
    Jun 3, 2013
    Posts:
    143
    Hello @Grendelbiter,
    Please contact me to check if there is some wrong setting in the Channel Packer.
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    So, Substance works with roughness - which is not the same as smoothness, but rather the inverse of smoothness. So if you're outputting roughness data, you need to invert it before packing into the NormalSAO map.

    Did you pack height values into the diffuse alpha? Because that's what's used for displacement.
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There is a packing mode which turns off normals and specular functions, and there's a ramp lighting mode you can use if you want to posterize the lighting or go for something more NdotL than a full PBR workflow.
     
    neoshaman likes this.
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Is this a single texture cluster? If so, what you want to do is raise your cluster noise scale. See how your image has the same texture repeated a bunch of times, then switches to another one occasionally? If the cluster noise scale is higher, it will switch between texture more often. Basically, you want to use a noise scale which gets the texture to change often enough to not see any tiling, but not so often that you never see full chunks of the texture (it will begin to look like a synthesis of all the textures when this happens).


    Yes, you can use the Macro texture for a global texture, or you can use the near/far detail noise options if you just want to add some noise to the normals.
     
  39. TalkieTalkie

    TalkieTalkie

    Joined:
    Jul 5, 2012
    Posts:
    123

    Yeah, I upgraded to 5.6.1 as well cause of improvements to lights especially.

    Got some deprecated warnings with MegaSplat, like with some other assets. Probably not a big deal.

    EDIT: On the side note, as usual, new version breaks a lot of assets. Going back until all of them are updated. Same old drama with Unity.
     
    Last edited: Jun 8, 2017
    ZoneOfTanks likes this.
  40. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    I did try setting the invert option in channel packer for the roughness channel but it made the whole terrain really shiny. The nsao map looked right though.

    I didn't know you could pack the height into the diffuse alpha. That's awesome!
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, height in alpha of the Albedo map is required for all packing modes- it's how MegaSplat does it's blending, displacement, foam for water, etc.
     
  42. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Ok, im just using the default Megasplat texture arrays atm, will try that.
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    An adjustment is available right on the brush when you paint..
     
  44. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    I got it. I had the smoothness channel set to alpha in channel packer. Setting it back to red made the nsao look right and inverting smoothness also worked. I made a heightmap and packed that and this is the result: http://imgur.com/eS3MUUP
    Very happy with that.
     
  45. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
  46. maccoy

    maccoy

    Joined:
    Mar 4, 2015
    Posts:
    12
    goodevening, love megasplat btw... is there any way of changing the normal direction to world space....

    i'm using megasplat on a bunch of tiles with UV Project Axis on so the texture is always the same direction even when i rotate tiles....
    BUT.....the normal direction is based on the object/tangent.... the shading gets all wierd and it looks like the light source is on the other side.
    any idea on how to fix?


     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Your using different cluster scales- they're adjustable in the node editor as well, though I'm not sure if I added a global value for it..
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, that's because it's still using the vertex normal/tangents, and for normal mapping tangents are based on UVs. If you send me a small repro, I can likely figure something out.
     
  49. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    I wish it was that easy, but they are both set to 0.05, thats why i find it strange.
    "Noise scale" in the Texture Graph, and "Cluster Noise Scale" in the paint window.
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Really? I'll have to see why that is- I would expect the same cluster scales to produce the exact same result. I'm assuming this is on a Unity terrain, right?