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. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    284
    Cool thanks man, will pull the latest and test that as well. :)
     
  2. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    284
    Confirming the same result with latest git version of MegaSplat and Unity 2017.3.0p1 (64-bit).

    Can any other Windows users please check if they are getting the same issue with 'Tessellate Shadow Pass' enabled, or view the demo scene for 'UnityTerrainTessellation'. If you uncheck/check you should see the difference in shadows when looking closely... also it's more visible from certain angles of light with shadows cast.

    GB-IMG-Mega-Splat-Shadow-Issue-2017-3-0p1-04-Janu-2018-1.png
     
    jbooth likes this.
  3. Gread72

    Gread72

    Joined:
    Jun 5, 2013
    Posts:
    5
    No problem. Thanks for the quick response.
     
  4. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    22
    We are upgrading our project to unity 2017.3 and the terrain shader stopped taking in ambient light. We noticed the same thing with one of our own custom shaders. I was wondering if anyone else has had similar issues?
     
  5. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    240
    I'm having a small issue regarding MegaSplat - The UV Scale slider doesn't seem to work, or am I doing something wrong?

    The Metalic, Porosity works but UV Scaling does not (per Texture).

    Any ideas?
     
  6. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    16
    So, i'm using a macro texture which maps exactly to the whole terrain, its set as a tint map. This works nicely. However i'm looking to paint in some areas with a specific texture and for that I don't want the tint to apply. Mainly because the tint is black, and none of the colours of the texture come through.

    I was wondering if there was a way to mask the tint map out, so the texture/cluster applies as it would normally.

    I'm trying all the different options out. Essentially i want the macro as a base texture with the ability to paint in clusters where needed. I haven't found a combination of settings that work.

    Wondering what my options are?
     
  7. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Should just work - I'll re-test it next time I working on MegaSplat (sick with a fever right now, and it's the snowpocolypse here as well).

    I can't remember if this is taken into account or not, but try painting into the alpha of the tint map and see if that acts as a strength..
     
  8. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    51
    Hello again.. so I finally got around to using Texture Graph approach instead. This appears to work across an entire terrain that has been split into 64 chunks. However, the min,mid,max logic doesn't seem to be behaving as
    I would expect.

    The first image shows that in principle the three clusters have been applied across the chunks.
    The second image shows the TextureGraph settings.
    The third shows that the bands don't seem to correlate with the min,mid,max settings.

    I would expect the grey cluster to occupy 1/10 of the total height at the top with an 80% brown area and 10% green at the bottom. Have I misunderstood how these parameters should work?

    Thanks

    Screen Shot 2018-01-04 at 21.13.32.png Screen Shot 2018-01-04 at 21.14.30.png Screen Shot 2018-01-04 at 21.13.51.png
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    I would expect 10% texture0, 80% texture1 and 10% texture2, assuming your terrain uses 100% of the possible height values. If it was only in the top 90% of height values, then I would expect the bottom stripe to not show.

    However, I cannot recall if the height parameter takes the height of the current terrain into account or all terrains selected.
     
  10. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    51
    OK so it looks like what I expected to see is correct, and that the whole terrain is not accounted for when using height node. If I select only a single mesh chunk and apply via Texture Graph it looks like the bands are in the correct place.

    So a few weeks back, when I tried to apply a height mode cluster across an entire chunked terrain, using fill in vertex painter, I edited TextureArrayConfig_Brush.cs and just hardcoded the total terrain height, could you please point me in direction of where I might be able to apply same logic when using TextureGraph height node..?

    Thanks
     
  11. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    There's a CaptureObject's function in MegaSplatTextureGraph window that calls Init on the NodeMegaSplatOutput. But it looks like it already totals up the bounds for all terrains or meshes by calling Bounds.Encapsulate(), so it looks like this should be based on the total bounds of all selected terrains.. Hmm..
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Ah, looks like the local bounds is what's used in the job though. What you can do is loop through the jobs after the currentBounds is set and set the job's bounds value to the currentBounds value.
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    So the bottom of the CaptureObjects function should look like this:

    Code (CSharp):
    1.  
    2. currentBounds = b;
    3. foreach (var j in jobs)
    4. {
    5.    j.bounds = currentBounds;
    6. }
    7.  
    Seems like that wants to be the case all the time, right?
     
  14. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    51
    Thanks for the investigation. The copy/paste alone hasn’t resolved issue - it has adjusted bands though so obviously in the right place.. I will try stepping through logic and see what i can come up with.

    As a small aside, is there any hard reason why the limit of height bands is 4 in texturegraph..? I would like to add 5 or 6 clusters based on height so before I dig into extending existing objects , thought I would check.

    Thanks
     
  15. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    51
    It looks like the Encapsulation of each chunks bounds never happens as it is depending on 'found' bool that is never set to true. So although I can retrospectively set the job's bounds to the total bounds, the total bounds is never truly a total.

    If I ignore the found bool and encapsulate based on VertexInstranceStream presence only, it all works perfectly!
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Thanks for looking into this, I'll integrate the fix for this into the next patch..
     
  17. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    51
    Great stuff, thanks
     
  18. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    805
    Hello jbooth,

    I have all your microsplat assets, but I was wondering if you have a shader that allows me to to mix textures on a regular 3d model like the one you have in macrosplat asset with the example of the house roof you have in a youtube video?



    Regards,
    Carlos
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    There's a set of shaders that come with my free vertex painter that let you splatmap up to 5 textures you could use..
     
  20. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    805
    Where is your free vertex painting? I can't find it in the asset store...

    Regards,
    Carlos
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Link is in my signature (open source tools)..
     
  22. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    805
    Thank you so much Jason, I really love how fast your microsplat is. Let me download this and see if it works with Unity 2017
     
  23. Thenumberfly

    Thenumberfly

    Joined:
    Mar 20, 2017
    Posts:
    5
    Hey Jason,

    I have multiple large meshes being shaded via MegaSplat and I was hoping to be able to combine them via the new 32bit mesh indices supported by 2017.3. I tried to combine the meshes together, but it looks like MegaSplat treated all the vertices after the previous limit as zero. Is there a constant somewhere that I can change to allow support for the new mesh indices?

    Thank you for any help you can provide,

    Nick

    *EDIT* Nevermind, MegaSplat works just fine! I'm just an idiot, haha. I didn't set the Mesh to use the 32bit indexes until after I combined the meshes so the 'extra' vertices were being truncated.
     
    Last edited: Jan 10, 2018
    WildStyle69 likes this.
  24. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    462
    I'm getting the same lines with shadow pass on.

    Is there a fix yet?

    Tesselation with show pass is not usable like this, I turned off shadow pass and the terrain looks correct again.
     
    WildStyle69 likes this.
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Not yet, still trying to figure out what's causing it..
     
  26. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    306
    I know you generally try to steer clear of Unity betas, but 2018.1 beta just dropped, with dx11 tessellation for metal included in the release notes....
     
  27. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @jbooth Have you tried painting with Vector Displacement maps? I'm thinking that there might be some interesting results if a Vector mapped mushroom for example was painted on a top layer and regular grey mapped forest floor displacement material was painted on a lower layer. The texture baking would have to be vector based in this case as well.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Yeah, and SRP support, which will likely be the death of 90% of the shaders in the asset store.

    It's actually not going to be possible to get an asset approved which supports SRP given the current state of what they are doing. In 2018.1, they are going to ship an LD pipeline based on SRP (with an HD to follow shortly after that). Shaders written for previous versions of Unity will not work with the LD pipeline and vice versa. So all shaders will need to be rewritten from the ground up to support each new render pipeline.

    Lets say I have a small asset with a custom shader, and I want to support all versions of Unity. Now I need to have at least 3 versions of that shader (one for LD, one for HD, and one for the previous pipelines). There is no 'surface shader' equivalent which compiles across all of these pipelines - nor is there a way to have one shader file which contains all these different shaders in it.

    So you have to have 3 different versions of the shaders. Which means you have to have 3 different versions of your materials, so they can point to 3 different shaders. Which means you have to have 3 versions of the prefabs, which point to the materials, and three different copies of the scenes which point to the prefabs.

    Oh, and the other two versions of those shaders? They're going to throw compile errors on install, and show up pink if you select an asset which uses them, because they only compile and work for the pipeline you are using.

    The current asset store guidelines state that you cannot ship an asset with compile errors or warnings, and that you must ship a demo scene. It will be impossible to support SRP and do this under the current model.

    I have a 3 star rating on one of my assets because Unity threw a warning when the user installed it; unrelated to my actual asset. I get support requests from people who don't know how to assign a texture to a material. And they expect this to fly? Clearly the right hand is not talking to the left hand over there..

    Now, lets say this gets dealt with somehow and I can write all of these shaders into a single file. No more duplicated data, yay! 3 times as many shaders to write, sure. Lets consider the practicality- When SRP ships, there are no longer surface shaders in Unity. Surface shaders allowed you to write one shader, and have it transformed into a bunch of different variants for different rendering pipelines (deferred, forward, light pre-pass). I ran into limitations with surface shaders in MegaSplat, and was forced to use vertex/fragment shaders instead. This wasn't so bad, I have to write all the pass semantics out myself and call into Unity's lighting functions.

    Unity has managed to break this system on every single point release since MegaSplat was released. 5.4, 5.5, 5.6, 2017.1, 2017.2, 2017.3. Without fail, they have changed something in the low level lighting system on every release that has caused an issue. They have zero documentation of this pipeline, and every time I ask they say things like "Oh, it changes too fast to document". So every other month or so, I spend 20+ hours diffing their changes to the standard shader and figuring out what changed, then trying to apply that back to MegaSplat so it runs on all of those versions of Unity without regression issues. It has basically stopped all forward progress on MegaSplat, because all my time is spent looking into what they broke this month.

    This is the pipeline that everyone will be forced down soon - if you want to support SRP, you will need to use a vertex/fragment pathway and handle all the lighting yourself. And while the new lighting pathways are a lot cleaner than the old ones, I see no sign that they will be properly documented or not break on nearly every release.

    I'm currently in the process of seeing if I can get MicroSplat to cross compile to an LD render loop. There's no working examples of a LD render loop shader that wasn't written in their new graph tool (the ones in their public SRP repository don't compile). The new shader graph tool will cross compile to multiple render loops, but you will never get me to try to write complex shaders in a graph. It's limiting, inefficient, and quickly becomes a visual mess for anything complex. Further, there is no way you could write something as complex as my stuff in a graph without tanking efficiency (and right now you couldn't even do it anyway).

    So yeah, metal tessellation? Unlikely I'll look at that any time soon. Metal's tessellation pathway is very different than DX11/OpenGL style, and Unity passed the buck on actually abstracting that by killing off surface shaders completely. Metal Tessellation requires the new SRPs, which require every shader you have to be rewritten.
     
    Baraff, Akshara and iddqd like this.
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    I played around with the technique in 2012 or so, but the authoring and tool support for such things is really lacking. It also requires very high tessellation rates to look good, so ends up being prohibitively expensive.
     
  30. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    As Megasplat stands today it can't use Vector could it? I mean if the depth channel was compatible with either displacement map types it would be worth it to try - well for me anyways working with textures from scanned models that had Vector maps exported.

    When landscapes are generated with Voxeland and painted with Megasplat with Vector maps, it can be exported eventually to FBX and be imported into other 3D modelling and animation suites where tessellation levels can be pushed higher.
     
  31. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    284
    Bloody hell man, it's insane how difficult they are making it for people... and I thought we had it bad dealing with all the constant bugs, but for you guys trying to release stable assets... the amount of work sounds crazy, and like you say they keep changing and breaking things ... just wow!

    Thanks for the insightful details here, interesting stuff.
     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    No, Vector Displacement Maps require 3 channels of 16bit uncompressed texture data to look good. MegaSplat packs into a single 8 bit height channel, which is compressed with the albedo. So VDM would require 36 times as much memory to use vs. a traditional displacement map, and require that the VDM's be in their own texture array.
     
  33. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Ah.. thanks for straightening me out! lol well maybe in another 5-10 years Magasplat V20 ;) Well I'd still use it for film, next gen video cards are now getting double the memory.. Unity seems to be promoting Unity for film such as the Adam tech demo.
     
  34. aetfi

    aetfi

    Unity Technologies

    Joined:
    Jun 5, 2014
    Posts:
    42
    As far as Unity implementation goes, Metal Tessellation is the same as other platforms, DX11/HLSL through domain/hull shaders.
    The internal implementation of tessellation on Metal is different from, say OpenGL and DX11 itself, but the cross-compiler is aiming to do the compatibility for you by transforming your vertex/hull shader into a compute kernel etc.

    No new SRP stuff required, although I've seen it working on SRP/HD pipeline too. :)
     
    Last edited: Jan 10, 2018
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    That's pretty sweet, actually. I figured with the timing being what it was that you were just going to skip trying to make that work since SRP essentially forces everything into a vertex/frag shader anyway..
     
  36. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    462
    Thanks Jason. Hope you can figure it out. :)
     
  37. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Back again with a solution. I forgot I would be using texture streaming like Graphine or Amplify Texture which also supports EXR format. I know for you to add that Vector channel compatibility would be for a smaller market but if people see what is achievable then it might open up things in a big way. We would have less need to create and add models -again like what displacement/tessellation helps to eliminate the need for and tessellation performance maybe equal or less than what it might be from mesh draw calls, additional textures and colliders etc on heavily detailed scenes.

    Additionally I'd be using World Streamer.
     
    Last edited: Jan 11, 2018
  38. DeadlyAccurate

    DeadlyAccurate

    Joined:
    Apr 2, 2013
    Posts:
    178
    Is there a way to add stamp brushes to the Terrain Painter to stamp specific patterns onto the terrain? (Like stamping a square of asphalt onto the terrain to look like the remains of a parking lot).
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Not right now, they are all falloff brushes..
     
  40. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    423
    Hi @jbooth

    I would really like to use MegaSplat on Models created with Archimatix (https://assetstore.unity.com/packages/tools/modeling/archimatix-pro-59733) - but i need to keep it all in the the runtime domain.

    Must Models be converted "offline" with the MegaSplat converter or is there a runtime possibility for conversion and then have the MegaSplat graph applied to it?

    I know Map Magic can paint terrains at runtime with MegaSplat - but I don't know about Meshes.

    Many thanks!
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    Meshes have a requirement that each triangle have exactly one red, one blue and one green vertices. If they do not, the data will not blend correctly between the textures. This is what the mesh conversion does, but if you can prepare your mesh to this requirement another way, then it will work fine as well. Note that there is an option to do this process in the geometry shader- but I prefer the preprocessing because invoking the geometry shader makes the shader significantly more expensive.
     
    Akshara and iddqd like this.
  42. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    423
    That's great information! Many thanks!
     
  43. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    306
    Ouch, sorry to have hit on a sore point. Sorry I brought it up...
     
  44. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    With all the noise effects for anti-tiling, and detail and distance, would it be possible to have the noise colour pick up some of the underlying colour, or have some means to tint it? Noise effects are invariably black on the terrain, with almost any asset, which often looks fine, but some more control over the noise colour would be great, if such a thing is possible. The included image looks alright, but sometimes that black is just too much, as in the foreground on the left, and I was thinking this would look a lot better with the noise shading a deeper brown, say.

    This is MicroSplat, by the way, though I do also have MegaSplat. I love the complexity of MegaSplat, but can't deny that MicroSplat really hits the spot on many projects.

    DistanceNoise.JPG
     
  45. Ken-Cummings

    Ken-Cummings

    Joined:
    Dec 6, 2015
    Posts:
    5
     
  46. Ken-Cummings

    Ken-Cummings

    Joined:
    Dec 6, 2015
    Posts:
    5
    Hi Jason,

    Just bought MS (and running 5.6.1pt2) . I have gone though the tutorials (mainly interested in the vertex mesh painting),
    but when you select your shader (you show 2), I don't have either of these options... many others but not these. Anyway, I have a land mass mesh terrain with UVW mapped texture I want to use as a "base" so I can paint in high detail textures using it as a template.... My mesh has the textures on it (like you show on your bridge) but when I choose any of the available shaders, it just turns the mesh all gray.... can you point me in the right direction? So excited to try this tool as I hate using substance painter! Thanks!!
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    I think you are likely looking at very outdated videos. The documentation is always kept up to date, but re-shooting 20+ hours of video every time the UI changes is just not possible.

    There are two ways in which a macro texture can be combined with splat maps in MegaSplat; the first is to turn on one of the Macro Texture options and blend in a texture with the splat map painting (multiple blend modes are available). This is generally used to blend in a macro texture at a specific amount over a whole terrain, or cross-fade to it. The second is to change the shader's layer mode to 'Alpha Layer'. This treats the macro texture as the regular texturing of the object, the bottom layer of the splat maps as transparent, and the top layer as splat maps, letting you paint splat maps on specific sections of the model.
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,190
    This is an interesting idea- I can think of two ways to potentially do something like this. The first would be to provide a color tint for the white and black of the noise, such that the noise could tint from blue to red based on it's noise value. This would require 2 color values in the per-texture array (Which is basically full and needs expanding to add more slots) The second is to derive a tint for the noise from the lower mip of the texture being splat mapped, and tint towards that color instead of tinting towards black. This would require resampling the splat textures, but at very low cost since you'd use the lowest mip, and likely only need a 'strength' in the per-texture properties.

    The advantage of the first technique is you could do whatever you want with it- but it would likely require you to get the colors just right to give the effect you want. The advantage of the second technique is that it would be more automatic, but maybe less control..

    Both interesting ideas..
     
    JBT27 likes this.
  49. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Of the two, I think the first technique, would be the most usable because it still leaves the choice to the user. And actually, choosing the right colour with the colour picker and decent feedback in the editor, makes the job that much easier; you can see what you're getting and what works. After writing the note, I remembered that Amplify Ambient Occlusion offers something similar: the ambient occlusion can be tinted from the surround textures, which is really very effective, and takes away that sometimes overbearing black AO.
     
  50. JellyfishUmbrella

    JellyfishUmbrella

    Joined:
    May 6, 2015
    Posts:
    5
    Hi,

    I started reading through all these posts to see if what I want to do is possible, but 73 pages is a bit much...

    I would like to be able to do bit-masking for mesh tiles where, for instance, I have a tile with a seamless rock texture applied. The tile next to it has a seamless grass texture. I want to use an alpha channel (or a greyscale image of some sort, doesn't have to be in the alpha channel) on the first tile to reveal a little bit of a grass texture so there's not a hard edge between the two tiles. i'm sure you know what I mean, but here's a link just in case I'm not being as clear as i think I am - wouldn't be the first time.

    Basically, I don't want to have to pre-render all the various ways my tiles could blend together. If it was just rock and grass, no big deal. But every additional landscape texture you add, means lots more variations on edge cases. I'd rather be able to do something closer to photoshop layers. Add a new texture, give it a layer bask of some sort, and the computer figures the rest out.

    Thanks,
    -Rich
     
unityunity