Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    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:
    3,718
    No, dynamic streams only works with MicroSplat- there's several explanations for this a ways back in this thread.

    Try clicking update on your texture array config? Perhaps something has gotten out of sync..
     
  2. ajz3d

    ajz3d

    Joined:
    Oct 12, 2015
    Posts:
    25
    Hi Jason.

    I have a problem with puddles which I'm painting on UV3_Y of a tesselated mesh. They cause the terrain surface to displace as I paint them. Do puddles and MegaSplat's tesselation exclude each other?
     

    Attached Files:

    Last edited: Apr 10, 2018
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    No, they interact though. There is only a single polygonal surface- so the mesh must be displaced to become a flat plane where puddles are created (the surface of the water). There is an option in the settings that say weather the puddles should push the terrain down to the puddle surface height, or pull the terrain up to it instead.
     
  4. ajz3d

    ajz3d

    Joined:
    Oct 12, 2015
    Posts:
    25
    Thanks, Jason.
    I found the "Puddles Push Terrain Down" flag but this is not what I need because instead of creating a pond, I want to locally raise the water level to an absolute level only in the cavities of this muddy terrain. What would you suggest I should do in order to achieve that?
    This is the first time when I'm using MegaSplat with tessellation (last project was for mobile) and I can't seem to find a way to create flat puddle planes. :confused:
     
  5. Anydaytv

    Anydaytv

    Joined:
    Feb 28, 2018
    Posts:
    18
    I may code my own extension then, I suppose.

    Worked. Just thought I'd add that I was still testing the example array, so perhaps a decompression issue?
     
  6. Anydaytv

    Anydaytv

    Joined:
    Feb 28, 2018
    Posts:
    18
    Here's what I did:
    Try messing with the Blending option on the shader, as well as the "value" field in the Puddle painter.
    You can achieve all sorts of various looks, but it's a bit dependent on the particular texture's tessellation.
    So I recommend enabling "Per Tex Displacement" and use a texture specifically for puddles, with heavy tessellation displacement.

    I think the mud texture tends to look good out of the box.
     
    Last edited: Apr 10, 2018
  7. ajz3d

    ajz3d

    Joined:
    Oct 12, 2015
    Posts:
    25
    @Anydaytv Thanks. I followed your advice and managed to find a good balance with Blending and Brush Value. I wasn't able to prevent puddles from appearing on slopes though, but I can correct those areas by painting them out.
     
  8. CyberSlime

    CyberSlime

    Joined:
    Jun 24, 2015
    Posts:
    6
    Hi @jbooth
    Is there any news on the tessellate shadow issue?

    I studied the Unity's surface shader generated code and found it uses
    TRANSFER_SHADOW_CASTER_NORMALOFFSET macro to transfer vertex position in the shadow caster pass.
    I changed the shadow caster pass of megaSplat generated shader code to do the same things this macro does (because of the megaSplat shader doesn't use the same vertex parameter name as Unity, I have to write the code which this macro represent directly), it seems work for me.

    However, this is just a temporary solution, I'm looking forward a patch to solve this issue.
     
    WildStyle69 likes this.
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Interesting- mind sending me your change so I can test it?

    Yeah, the macro's in Unity are very annoying as they assume a lot of stuff, like variable names, etc.
     
  10. CyberSlime

    CyberSlime

    Joined:
    Jun 24, 2015
    Posts:
    6
    In ShadowCaster pass,

    origin code:

    VertexOutput vert (TessVertex v)
    {
    ...
    o.pos = UnityObjectToClipPos(v.pos);
    ...
    }

    change to:

    VertexOutput vert (TessVertex v)
    {
    ...
    o.pos = UnityClipSpaceShadowCasterPos(v.pos, v.normal);
    o.pos = UnityApplyLinearShadowBias(o.pos);
    ...
    }

    these two lines are just one case of the
    TRANSFER_SHADOW_CASTER_NORMALOFFSET macro, I think it works on the shadow of directional light.
     
    WildStyle69 and jbooth like this.
  11. ajz3d

    ajz3d

    Joined:
    Oct 12, 2015
    Posts:
    25
    Hi again.
    I'm trying to figure out how to properly blend textured objects with the mesh terrain, so I have a couple of questions:

    1. All of my props use standard shader. Do I need to repack their textures into NSAO if I want to take advantage of MegaSplat's object blending (MegaSplat_ObjectBlend)?
    2. Speaking of textures and packing. Macro textures (which from what I understand are used in object blend "context" to display original textures of an object) allow for feeding-in Diffuse and Normal maps only. What do I do if I also need to use Metallic and AO?
    3. When I pipe in textures of an object to Macro and leave all scales at 1, UVs do not match the texture (as shown on attached images). How to pick the correct scale?
     

    Attached Files:

  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    1. No, you use the macro textures for the standard texturing.
    2. There currently isn't support for metallic and AO textures on the macro textures.
    3. You have to use projected UVs on both objects so that the UVs line up correctly. This could be a top down projection, or triplanar. In the example scene I use triplanar mapping I think..

    In general, if you want really simple, easy to use object blending, that's what MicroSplat does well. MegaSplat can generate the shaders to do this, but it's not designed as such, rather something you can achieve.
     
  13. Skyway-Interactive

    Skyway-Interactive

    Joined:
    Jul 29, 2015
    Posts:
    6
    I'm making some complicated meshes and when I 'convert' the mesh with MegaSplat I seem to lose some UV in some areas of the mesh. Have you seen this before?
    I am also wondering what happens in the converter and if I can do this myself in Houdini by adding the necessary information.
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    No - it simply copies the existing UVs when it generates a new vertex. All the converter does is make sure each face has exactly one red, green and blue vertex color. You could likely do this in Houdini, but I'm betting it might not correctly survive the import or be as optimal.
     
  15. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    396
    Hi, playing with this asset since today, it's really great. I'm following your different youtube videos, playing along with it, so far so good. I'm trying to check the forums to find some answers usually but here maybe it is specific to the material asset I bought so I prefer to ask specifically for this:

    Regarding the "Smoothness" I believe that is what will affect the "Wetness" option in the shader
    Textures_All.jpg

    I'm using (for example) a pavement Substance material (I removed the IF Unity2017.3 condition in the code as I don't care about the warnings) that generate multiple textures including Metallic but not a Smoothness texture. But I'm really an amateur when it comes to textures, I'm learning. The Smoothness is kind of tagged "Metallic" see this screenshot:

    PBR_Asset_output.jpg

    In MegaSplat, should I put this Metallic texture (it's mostly black as you can see) in the Smoothness slot, or just in the Metallic slot and some magic will happen with the Texture packer? Or should I change something in the PBR generation (In Unity, I do not have Substance) to have an actual Smoothness texture to be generated?

    Thanks a lot
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Smoothness and metallic are not the same thing; I would suggest reading unity’s docs on the metallic PBR workflow. For most people’s use cases, you don’t need a metallic texture at all, as metallic is usually 0 or 1 based on if the pixel is metal or not. A proper smoothness map will control how reflective the surface is- most likely your substances are outputting a dpecular map instead..
     
  17. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    396
    Thank you, I will get some learning for those topics.

    The mean reason I'm asking is because of the Wetness effect not working properly. On the substance texture I can chose to "generate all outputs" or not. If I don't, I have my whole texture darkened and the wet effect is homogeneous which is I guess quite good (as I painted it in this way, full flow and opacity):
    30429280_10155523022332934_1038847403_n.png

    But If I generate all outputs then the result is clearly not the same even though I painted it the same to have the whole texture looking wet:
    30184836_10155523022267934_1819739967_n.png
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Wetness primarily interacts with the smoothness value, so if you are not generating proper smoothness, that would have a huge effect on how the wetness effect looks.
     
  19. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    261
    If this works, then man you seriously rock!! :) ... will be testing this later, thanks!

    // WildStyle
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Yeah, it seems to, so I sent a patch in last week which is now live..
     
    WildStyle69 and CyberSlime like this.
  21. jebediahh

    jebediahh

    Joined:
    Feb 20, 2017
    Posts:
    23
    Hello - Do you keep a list of changes/new features when you put out updates? If so, can you point me to where I would find that?
     
  22. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Not since the beginning of time. I put the changes in each update, but I don't think Unity has a way to view the archive of patches..
     
  23. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    261
    This is great news.. thanks guys!
     
  24. Poopaloop

    Poopaloop

    Joined:
    Aug 1, 2013
    Posts:
    20
    Hi, looking into picking up megasplat. I have a question.

    I noticed a while back you and the creator of Tenkoku weather system were looking to add integration between the two. Has this been added yet? Thanks
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    No idea, the weather integrations have all been done by the authors of the weather systems..
     
  26. Poopaloop

    Poopaloop

    Joined:
    Aug 1, 2013
    Posts:
    20
    Looks like it wasn't added via tenkoku creators side (from what I can see). So, I now have megasplat and I've added enviro. I added the integration that is included with enviro. When it rains/snows, the values increase in the megasplat material for rain/snow. However, the MS material isn't updating the wetness/snow laying on the actual terrain unless I go to the material and click on one of the sliders for the related behavior. The same is also true for when the values decrease. I'm not really sure what's going on, since enviro seems to be working with the MS material, as far as the values increasing/decreasing. Just not getting the effects on the terrains. Am I missing a setting something that I have to do on MS side of things?

    Thanks
     
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    MS instances a copy of the material for the actual terrains, most likely Enviro is missing a MegaSplatTerrain.SyncAll() call to push the changes to the material instances..
     
    Tethys likes this.
  28. Poopaloop

    Poopaloop

    Joined:
    Aug 1, 2013
    Posts:
    20
    Thanks. I added it in and it all works ok now.
     
    Tethys likes this.
  29. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    665
    Thanks for posting this as I just integrated Enviro into our project and was looking to do the same thing. ;)
     
  30. Poopaloop

    Poopaloop

    Joined:
    Aug 1, 2013
    Posts:
    20
    Kind of odd it wasn't already in, but I guess it got overlooked maybe by Enviro devs. Luckily J is fast to reply :p
     
    Tethys likes this.
  31. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    651
    I've created a terrain using a heightmap from https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/

    I've gone thru this tutorial (see below) but don't want to paint all this large terrain by hand. I couldn't find any video tutorials to get beyond this step in the video.

    Or, can I start with MicroSplat to generate the painting (the comparison chart seemed to indicate this) and then use MegaSplat to tweak, paint and add other features?

     
  32. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    MicroSplat does not generate a splat map, it simply renders it. In MegaSplat, you could use the Texture Graph to procedurally texture the terrain..
     
    RoyS likes this.
  33. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    72
    Hello,
    I am new to Megasplat.
    I have an issue with Texture array and painting

    After checking the Tutorial for it , I copied the existing MegasplatExample, added new textures to it.
    Clicked on Update
    Then Clicked Auto Generate Clusters every thing seem good new Cluster is also showing in the Terrian Paint.
    But when I select the new clusters as start painting it the paints with the last one before it "wet_mud_diff"
    I tried new Texture array it also paints with one of the random texture that came with MegaSplat
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    You likely forgot to assign the resulting texture arrays to the material, so the material is using the old array, while the painter is using the new one..
     
  35. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    72
    Can you explain it in little more details i am actually confused
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    You copied the texture array config, added a texture and updated it. It spit out two texture arrays- which are the actual textures packed together. But you did not assign them to the material (just like you would assign a texture), so the shader is using the old texture arrays, not the one you created.
     
  37. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    72
    OK so now How do I assign it to the material ?
     
  38. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Just like you would assign any other texture to a material.
     
  39. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    72
    Alright Thank you it's working now
     
  40. SeekingFaith

    SeekingFaith

    Joined:
    Apr 22, 2018
    Posts:
    6
    Hi, I'm playing around with MegaSplat, seems really nice. I am using a third person controller. I attached a 'TessellationPhysicsFloor' to each foot. It detects the tesselation just fine and all.
    I am having one issue though. The physics script is placing my player character quite a distance above the ground. When disabled my player is on the ground correctly, when enabled he floats above.
    I've tried changing settings, placing the script in different ways to attempt to have it lower and such. but nothing seems to help. Is there a way to fix this? The physics for tessellation was pretty much the deciding factor for me on getting MegaSplat.

    I'll include some pictures as examples:






    With script disabled


    As a side note, I have tessellation as low as possible on the current texture the player was positioned on.
    Thanks
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Seems like the character is sitting on the physic box- if you model the physics of the box so it is thinner, or offset, does the character move with it?
     
  42. SeekingFaith

    SeekingFaith

    Joined:
    Apr 22, 2018
    Posts:
    6
    I did make the boxes thinner and the player moved just fine, albeit on top of the boxes. I couldn't change the offset though, it had no effect.

    Edit: I changed the wrong offset. it just made the character move up into the air or fall below the terrain.
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    I think what is happening is that your character is colliding with the boxes, and the boxes are colliding with the ground, so since the boxes have thickness, your character appears to float. Usually a character has a single physics controller, not one for each foot, and that physics controller collides with the box, and is offset the same amount as the box height. If you want individual feet to collide, you would need to setup some kind of IK rig and call the functions to calculate the offsets to adjust the IK rig accordingly..
     
  44. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    62
    Hi Jason, I'm very impressed with Megasplat and Microsplat so far and am trying to find the best way to integrate them into my work. I've got a few questions:

    Terrain blending is a must for how I'm building my maps, a combination of handcrafted models mixed with terrain. I like Microsplat's simpler workflow, but am I wrong in thinking that I can combine Microsplat and Megasplat in the same terrain? For example, texturing a terrain with Megasplat, then applying a Microsplat terrain on top to take advantage of object/terrain blending? Am I just adding a ton of extra drawcalls?

    Secondly, is there no way to procedurally paint with Microsplat (based on elevation, slope normal, etc?) It'd be nice if I could apply a general paint job before fine tuning.

    Is it possible to export/save a terrain's Microsplat/Megasplat, and edit these in an external program? I've found it extremely handy for editing heightmaps in Photoshop.

    Finally, I'm having some issues with Microsplat's terrain blend. I'm creating custom terrains based on heigthmaps matching my hand-crafted geometry (to create ledges and cliffs), so the underlying terrain has incredibly steep slopes hidden from the user. I don't think this agrees with Microsplat because I get the following visual anomalies. For what it's worth it's almost always on the 'north' side of the objects. The right side of the image is missing the mesh so you can see the underlying terrain:

    Edit: Having issues posting image, here's a link: https://www.dropbox.com/s/573xbtktoji4llu/terrain_blend_issue.jpg?dl=0

    Thanks for any helps, and congrats on such a robust set of tools.
     
  45. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    You can only have one terrain shader, so it's one or the other for your terrain. A lot of people only use MegaSplat for terrain, where as MegaSplat was originally designed for meshes and ported to terrains, so part of the reason I created MicroSplat was to focus more on that particular use case (terrain only) and having that restriction allows me to take things much further (auto terrain blending, etc).

    Unity terrains, by default, use a top down projection of the UVs. So vertical surfaces will stretch. Triplanar can be used to fix this, but it requires a more expensive version of the shader.
     
  46. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    62
    Thanks for the info Jason. Unfortunately Triplanar (or Height Blended) doesn't solve the visual anomaly in the terrain-blend. If you look at the image you can see how there's odd banding projecting up into the mesh. It's almost as if the faces being sampled are inverted.
     
  47. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    In your screenshot, you have the black material marked as terrain- terrain blending only changes the rendering on the blended mesh, not the terrain itself. Are your labels reversed?
     
  48. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    62
    Nope that's correct, the black bit is the terrain. The mesh is the green grassy bit, with the blending applied. You can see where the blend happens, some of the faces have this weird inverted mapping thing going on.

    Again, this only happens across the entire northern edge of this blend, it's odd.

    Here's another image to illustrate, first with the blend on, then off:

    https://www.dropbox.com/s/fos61lvlhpp2k2w/terrain_blend_issue2.jpg?dl=0

    Edit: For what it's worth, the mesh in question doesn't seem to matter. I originally spent a lot of time adjusting the mesh only to find the same issue happening with a standard Unity plane (or any other primitive).
     
    Last edited: Apr 23, 2018
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,718
    Doesn't make a lot of sense why this would happen, since terrain blending only affects the mesh, not the terrain, and doesn't adjust vertices or anything that would cause the z-buffer to change between the blended and non-blended versions. Can you break out a repro case for me to look at?
     
  50. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    62
    Hi Jason, sure I'll see if I can figure out how to create a repro for you, although it's not too hard to replicate.

    Create a terrain with vertical pillar of 'land' with a hard edge. Easiest with the paint height brush and a sampled height at 100% opacity. Place a primitive at the top as if it were a ledge-style mesh and observe the blend.

    Like so: https://www.dropbox.com/s/la49rirnf38ts2l/terrain_blend_issue3.jpg?dl=0
     
    Last edited: Apr 24, 2018