A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by jbooth, Aug 9, 2017.
Not sure, but they aren't part of the same sale, so the timelines are likely different..
I am working on a game with tile based Terrain,Terrain Tiles are actually mesh tiles 24 x24 designed in Maya then imported into Unity .
Even though those are styles-ed mesh tiles I still wanted to use terrain tools and features for texturing, and mostly because I need a terrain hole feature that lets me no just punch a hole through the ground itself but also through the terrain's collider that lets me have perfect entrance for my caves!
So I converted My mesh tiles to Unity Terain, then MicroSplat Terrain.
I have been using MicroSplat to texture it and it all looks great, but because my game needs these tiles to be able to rotate, and Terrain tiles can't be rotated I convert my Terrain Tiles to MicroSplat Mesh Terain !
Now tiles still looked great and can be rotated as well which is perfect, but it seems Reconnect / Auto connect feature is missing on Mesh based Terrain and now Terrain's seems are visible and making a very ugly shading!
Can you please let me know is there a way to make MicroSplat Mesh terrain tiles Re-connect/auto-connect !as well if the new Terrain hole available when using Mesh Terrain?
How is this generally solved when using more tiled mesh terrains? I am new to this.
regarding Mega Splat :
If this is not possible with MicroSpalt... is Mega Splat Better Option for what I want to do?
Currious if Mesh Terrain autoconnect is available in MegaSplat as well as New Terrain Hole when using MegaSplat Mesh WorkFlow?
thank you in advance I appreciate any suggestions on how to solve these issues
The idea of connected terrains is a Unity terrain feature. Also, the holes in MicroSplat/MegaSplat are purely visual, except when using the Unity Terrain's hole feature. Before Unity handled that automatically, you'd place a trigger inside the hole and disable collision when the player encountered it.
Perhaps you need to think about your issue another way. Your tiles are very low res, so why not just rotate the data instead of the tiles? In other words, using the standard terrain API, you could cache off the height map and splat map data, then rotate the array and assign it back to the terrain. You could even pre-calculate all the rotations and cache it if memory is not an issue. Then a rotation is simple a matter of assigning the correct data to the terrain..
When importing MicroSplat Terrain Collection, and any other related packages, I get the below error:
Binary to YAML conversion: type UInt16 is unsupported
EDIT: NVM. Found the Unity issue tracker, and of course their response is "Just upgrade to non LTS release 2020.01.x". Not helpful at all on their part, but not surprised.
Hi, I've recently upgraded from 2.6 to 3.4 and I am having an issue with the Tessellation
module, which I am not sure if its being caused by a shader change or parameter mis-configuration.
As you can see below, there's a patch where the terrain will not get tessellated:
Here's the same place with some exaggeration:
And here the same place in 2.6, which was fine:
Do you have any ideas what can be causing this and how to fix?
Thank you for any help
I guess this might be related to some of the comments I saw earlier about things being dark when the camera is near the ground.
Im using mapmagic microsplat integration and I noticed that if I try to use a simple microsplat texture shader with one texture, it looks fine far away:
but when I zoom in with the camera I get this darkening effect:
I dont see this with your demo scenes though.
- linear color space
- the built-in/standard unity rendering pipeline
- unity version: 2019.3.13f1
- microsplat version: 3.462
Is this the SRP nightmare you are talking about in other posts?
Is there a version of unity you reccommend?
I actually just fixed a bug like this, so hopefully it will be fixed when the next patch is released (likely monday). Essentially there is a bug somewhere in Unity's surface shader system or in the cross-compiler chain below it that strips viewDir, and leaves it as a NAN, which causes this. As a fix, you can open the microsplat_terrain_body.txt file in Core/Editor/Fragments, go to the bottom, and replace the block that looks like this with this version:
// HI, this is the section where we hack around various Unity and compiler bugs..
// Unity has a compiler bug with surface shaders where in some situations it will strip/F***up
// i.worldPos or i.viewDir thinking your not using them when you are inside a function. I have
// fought with this bug so many times it's crazy, reported it and provided repros, and nothing has
// been done about it. So, make sure these are used, and look like they could have an effect on the final
// output so the compiler doesn't F*** them up.
// Oh, nice, and it turns out that doing this in the base map shader breaks GI, so only do it in the main
// shader, which is where we're using i.viewDir for parallax. F***ing hell..
// AND if triplanar is on, this needs to be run otherwise the UV scale is F***ed. I feel like I'm just
// pushing compiler errors around at this point.. And this breaks render baking, so not then either.
// And sometimes VD is INF or NAN, so we copy it (make sure the compiler knows we are using) and
// test for a value, and if it's not 1 we make it 1, so it doesn't make albedo black.
// Jusus F***ing christ already..
#if (!_MICROSPLATBASEMAP || _TRIPLANAR) && !_RENDERBAKE
float3 vd = i.viewDir;
if (vd.x != 1)
vd = 1;
l.Albedo *= saturate(vd + i.worldPos + 9999);
// Further, on windows, sometimes the diffuse sampler gets stripped, so we have to do this crap.
// We sample from the lowest mip, so it shouldn't cost much, but still, I hate this, wtf..
l.Albedo *= saturate(UNITY_SAMPLE_TEX2DARRAY_LOD(_Diffuse, config.uv0, 11).r + 2);
// same for the control sampler.
l.Albedo *= saturate(MICROSPLAT_SAMPLE_TEX2D_SAMPLER_LOD(_Control0, _Control0, config.uv, 11).r + 2);
Thanks for the quick reply! That did the trick!
Hi, when I convert a terrain (made in MapMagic) I always get this error:
EndLayoutGroup: BeginLayoutGroup must be called first.
I'm not sure what it does since I just started learning but everything seems to work despite that error.
I'm using 2019.4.2f1 with the newest MicroSplat Terrain Collection.
EndLayoutGroup: BeginLayoutGroup must be called first.
Yeah, this can happen when things take a while to process- it's harmless though..
Since we updated from Unity 2019.2 to 2019.4 we have problems with our terrain that you see in the screenshot. It looks like the lowest mipmap is broken/empty. There are two special things to this problem:
- it only happens when we set QualitySettings.masterTextureLimit = 1 (so the user chose half texture size)
- and we generate the texture array for Microsplat at runtime *after* setting QualitySettings.masterTextureLimit to 1
After tracking it down, it seems to be related with the mipmaps, because there is a fix by setting the terrain textures to RGBA32 (not compressed), putting them into the texture array and call Apply(true, true). Then Unity recalculates the mipmaps on the TA and everything looks fine. But this means: no texture compression and thus too much memory usage, that is a killer for our project.
As said, everything worked fine with U2019.2. I know this is a special case (generating the TA at runtime) but we really don't know how to fix that. It might be a Unity bug...or the way Microsplat handles the access to the mipmaps. Any help is welcome!
(Btw: we use _WORLDUV and _TRIPLANAR. Switching both off will solve the problem, too)
When you are constructing the texture arrays, are you copying all the mip levels when using Graphics.CopyTexture?
Yes, I am using Graphics.CopyTexture(<src texture>, 0, <target texture array>, <slot index>) that copies all mip levels according to the manual into the texture array to <slot index>. When looking at the screenshot, we see that all but the lowest mip level seem to work. As said, the problem happens only
- with Unity 2019.4 (and potentially higher)
- when setting the QualitySettings.masterTextureLimit > 0
- creating the TA in code after the masterTextureLimit was set
- using Triplanar with world UVs
My assumption is that Unity changed something in the internal handling of the mip maps regarding texture arrays and there is a tiny bug in the shader code...but thinking about it, let me try to setup a reproduction case using the example Triplanar scene of Microsplat.
I mean, I don't see how the shader code could affect this. Actual mip selection is done entirely by the hardware, unless you are set to sampler mode LOD, in which case it's computed in the shader but simply passed to the hardware as a numeric value. None of these would prevent selection of the lowest mip from happening, or affect what texture data is in the lowest mip. Can you post your Graphics.CopyTexture code? If you are reading the number of mips from the texture, perhaps that is the issue- perhaps it's returning mips-1 due to the texture size setting.
Hey, I was able to reproduce the problem with a small test script using the Triplaner demo project from Microsplat. Just attach the script from the zip to the "Terrain" GameObject of the Triplanar demo and press Play. The yellow arrow point to the areas with the mip map problems.
Is there a way I could check to see whether the microsplat shader is failing to display on a platform easily so that I could switch out to the default shader in the worst case scenario? Not a huge deal but some users in reporting this pink terrain on old / low power android devices (this is Samsung S5 vs Samsung S8). Modules used: Anti Tile, Streams, Tessellation, WindsAndGlitter
As always, huge fan of microsplat and if there's anywhere we can donate the price of a beer to you let us know, our project wouldn't have come out nearly to the standard it has with any other terrain package.
Fyi, I found what the problem was. The puddle module was somehow effecting that area and making it flat. I erased the puddle from there and the issue was fixed. Regards
The problem with android is that the hardware is such a massive random pile of parts that happened to mate that even if you test, it might not return the correct data. Anyway, the OpenGLES3.0 spec requires support for texture arrays, so you can check for that. You could also modify the fallback code to fall back to a different terrain shader, and in theory it would automatically fall back when the MicroSplat shader doesn't run. However, that assumes everyone up the hardware/software chain is actually doing things correctly.
I'll take a look,
Looking at your code, it only copies the top level mip map. You need to copy all of the mips individually, otherwise you would have to rely on tex.Apply() to do the mip generation for you. You can look into the texture array packing code, and you'll see a loop that loops through each mip doing the copy individually for each mip level.
So according to the Unity manual Graphics.CopyTexture() copies all mipmap levels, if you don't specify the mipmap level directly. I adjusted the sample script to copy each mipmap level exactly as you do in your examples, the problem is still the same :-(
Well if Unity is not copying the mip maps correctly there's not much I can do about that, I can't exactly change Graphics.CopyTexture. You should file a bug with Unity, so at least in 4 years its fixed. You might try testing in newer versions to see if it's a regression they have since fixed or not. I think there's a good chance that they didn't notice this bug, as the combination of things you're doing is rather unique.
I personally do not find that setting useable in actual production, because it also halves the sizes of look up tables and UI images as well, as there's no way to exempt a texture from it. Instead I've always built systems to load different asset bundles for lower end devices, which are resized on a per texture basis. But that's likely a pretty radical departure from where you are.
Another possible fix would be to reset that value before creating your texture, but I'm not sure exactly when unity does this. I'd imagine that it performs this operation on the load of the texture, just not loading top level mips. If this is the case, and setting that value doesn't immediately trigger a reload (which, in the case of asset bundles would be doubtful), then you might be able to set it to 0, create your arrays, then set it back to whatever you wanted. It does mean you would have to load in the full size version of those textures though.
In fact, hmm, the bug might be this. When you set it to 2, it quarters the size of the source textures - if these were 1024, they are now 256. You then blit these into the array, which is hard coded to 1024. So it copies down the mip chain, then stops 2 shy of the lowest mips, because it's copying the 256->1024. So if the setting is 2, you need to half the size of the array twice to match (I'm not sure what texture.width reports here, does it report 256 or 1024? I hope 256).
Thanks Jason for your help. I now also think that's a Unity bug. I will try some older Unity versions to check in what version the problem came in. I think, Unity finally wanted to implement the QualitySettings.masterTextureLimit for texture arrays, too, but failed (or they released a half finished state).
>> I'm not sure what texture.width reports here, does it report 256 or 1024? I hope 256
Sadly it still reportes 1024
so yeah, I think then you want to construct the array at the size the source texture actually is (256) and do the copy to an array of that same size.
Hi, Jason. I'm having trouble while adding new brush to the terrain. The texture is dark and its smooth value is acting strange. I am adding the new brush from the Add New Textures in the MicroSplatConfig.
You should try adding smoothness/height/ao maps instead of relying on the autogenerated ones. If there's not a lot of interesting info in the texture, it can't generate a compelling map from that info.
Alright, but if the problem is the texture generation it should work for basic texturing mode right? Sadly, the problem still persists
Basic texture mode still generates the additional texture data, because it's actually needed by the shader. You can't have a height map blend without a height map, so it generates one from whatever data it has, same as in PBR mode. Please provide your own height/smoothness/ao maps if you want something different than what the generation system provides.
I highly recommend using something like substance designer to create your tiling terrain textures, @Wolderado2.
You can try something free like Materialize for starters, though it suffers from the same limitations any auto-generator does. http://boundingboxsoftware.com/materialize/
Hi, in regards to the terrain blending module, I am using it in a house and the effect looks beautiful in the walls, however it seems to be also affecting the floor, which overrides any textures there and doesn't look acceptable. Is there a way to make the module only affect vertically and not horizontally (the normals), or this is a feature not implemented?
Break the floor into its own mesh or object is the easiest way to fix this.
Hello! This is my first time using Microsplat. I just bought the asset during the tools deal. I have been a Unity user for about 5 years and I usually use Gaia and CTS to produce my terrains. I saw some of the features that microsplat can do and decided to try it out... Well.. started a new terrain added some textures to the microsplat config hit update.. and it turned my terrain completely black in my test scene. Do you have a video of a startup from scratch. I saw the core one, but you had already created a map with mapmagic. I want you start up a project, create a terrain.. then what? Because I went straight to trying to paint and got what you see in the screen shot. Any help would be most appreciated. Thank you!
You should be able to follow the core video- you just add the MicroSplatTerrain component, press convert, then add textures to the texture array config (height maps, etc) and press update. In your screenshot you already have the texture config setup for anti-tile array and clusters, likely features you haven't turned on in the shader yet..
So. I thought it would be easier if I just showed you all my settings. Please, let me know what I am doing wrong. Thank you!
Hello Jason. Thank you for this wonderful asset package. It's working out beautifully this far. I do have a question. I am using models for a cliff face. I am also using the terrain texture blending component on several of the models. Is there a method in which I can either batch or GPU instance these models. I'm trying to keep things neat and optimized as I go and keep the batch and set pass count as low as possible. It's not bad at the moment however when trees and grass are added I predict a problem and would like to do what I can to stay ahead of it. Any suggestions regarding the blended models if any are to be had would be appreciated. There are roughly 30 models total that will comprise the entire cliff.
It looks like all the textures are black in the editor- so I would suspect that there was some error in packing the array data. Did you get any errors in the console? I also notice you're using the specular instead of metallic workflow in your texture packing, but your shader is set to metallic. So your data is not correctly packed for the shader.
There is some GPU instancing code setup in the shader for this (for vegetation studio), however, you would need to have some component or something do the instancing for you - VS doesn't have a concept of terrains, and each object needs some data set on it about the terrain, which is what the component does. So if you wrote some code to set that data and draw them instanced, it should all work.
No errors in the console and I switched it over to spec
You should try disabling shader features to see which one is causing them it to be black. I'm assuming you didn't switch on all those features when it was black and this started at some point?
Yeah.. I just turned on the ones I wanted right away. And almost all at once. I was thinking you turn it on and you plug in your textures and recompile the shader and bam it works... hmm.. I might just start over and see if I can get it to work this time.
Hi, Jason to me again. Still having the same problem. I'm even using one of the example textures. I think this problem occurs after the 4th brush/texture. Every time I've added a 5th brush (or more), it gets grey and a different texture. Btw I'm using substance designer and exporting texture outputs into unity then creating textures from microsplat. Is there a 4 texture limit or something?
You have your max textures set to 4 on your material settings..
Omg I'm an idiot... I saw that setting but somehow I forgot. That totally fixed the problem. Does increasing the limit affect performance noticeably?
Not by much- basically it has to sample the control map and sort more weights, but it's a pretty minor optimization overall.
Can't wait for Tessellation in HDRP, the puddle blending looked soo nice before Puddle and Wetness package with microsplat hdrp.
I just installed Microsplat, and the URP module, all my terrain is pink after adding the Micro Spat terrain script, and running the setup wizard:
What should I look at next to troubleshoot?
Core RP: 7.4.1
Microsplat URP Support: 3.463
Set the "Render Pipeline" in the material's shader generation section to LD..
@jbooth I don't have that option, though i have core and URP installed:
Yes you do, it's right in your screenshot, exactly like it's also pictured in the documentation, second option on the list.
Thanks for fixing my brain disconnect, everything is up and going.