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, Nov 16, 2016.
thanks for the suggestions I'll investigate
thanks mate, yeah I am using the wetness and snow as grunge layers with single layer mode, like so
which is 9 array samplers and 5 regular
after playing around I think that a second layer would suit my needs and add a lot of flexibility although it will double the array samplers.
I'm really interested in the 'disable the bottom layers blending' option cos I'm doing a VR game, so anything I can do to save performance is interesting, when I turn it on it does this
which seems odd is that what you'd expect?
If your using a single layer shader, it should look exactly the same. What it does is change the shader from sampling a texture for each vertex on a triangle and blending it, to just sampling one of them and skipping the blending, making the assumption that all three vertices are set to the same texture (which is usually true in hard edged stuff like buildings).
it might be broke, in your mesh demo scene change it to single layer and it looks like this
turn on that option and it looks like this using 2017.2.f3
No, that's correct - if you turn this feature on, you are saying that every vertex on a given triangle will have the same texture on it and not to blend across the face. This means that each triangle only displays a single texture, which on something like a building wall is usually what you want. However, if you are blending textures across the wall, then you wouldn't want to turn on this optimization.. Though it looks like it's picking up some blackness that doesn't look correct, so I'll check that out..
yeah sorry it was the blackness that I was getting at, it kinda looks like the normal is wrong
in the wall example on the house above there is no blending at all. I made the model in separate pieces filled each piece with a different texture using the single custom section in the painter and then combined them all using your utility
My name is Alberto and I'm hyped about your work on MegaSplat.
I work on a top down racing game and I have a unique use-case scenario I believe, so I'd like to ask a couple of questions before I decide to incorporate this asset into my project.
1 - Can I create the splatmap in photoshop or any other image editing software, and import it to use with megasplat?
2 - In case I can create splatmaps in an image editing software, is there a way that I could know which colors correspond to each texture before hand? Right now I'm using the default terrain shader and that is easy to know since it is just RGBA, so I want to know if there is a way for me to know that as well with the 256 possibilities. Or even better, but obviously feature creep, if I could somehow choose which colors correspond to each texture. Say, grass goes with a certain green, tarmac with a certain grey etc.
3 - Can I read data from the splatmap with a raycast, and get returned which texture slot it is? I currently do this by reading the Terrain Data and SplatPrototypes, and get returned how much opacity each surface has. Then I compare the values and find which texture is the dominant one and pass that info to the cars, so they can behave accordingly. Would I be able to still do this?
I currently I use mesh splines to create my tracks. I'm using EasyRoads3D, which is a great tool, but I want more freedom. Freedom to texture my ground by hand and be able to paint lines on the ground, traffic indicators, and blend between nature and tarmac easier for tracks that have mixed surfaces or just for added diversity.
I considered painting the tracks on Photoshop and just use a 4k texture on the ground, but they look pixelated. So I'm thinking that with the height blending of MegaSplat and its huge amount of texture capacity, it could give me a better result. One that has all the painted details I want, but doesn't show pixelation, and instead blends with higher resolution with the use of heightmaps.
Here is a clip of the game on a test area to work on physics.
Technically yes, but practically not really. Basically the format in the texture is (R) Texture index for bottom layer (G) Texture index for top layer (B) blend between layers. Which means you'd have to paint values really, really close to each other to choose textures, which isn't super practical. For meshes, this data is stored in vertex data, not a control texture, so it would be even harder. That said, there are some tools to project a traditional splat map onto a terrain or onto the vertices.
Yes, there is a component you can add to a mesh or terrain to get this data back.
Putting things like road lines, or even roads, into the terrain texture usually doesn't work out to well due to resolution issues. A decal system might be a better bet for this, and to save memory, you could likely use Signed Distance Fields for the traffic indicator textures, which can be very low res and still remain crisp.
Thank you for your quick reply!
Fair enough. One way I could go around the fact that textures are very close in values, would be to get a reference of each color, author the map with my own colors, and then replace the color of each layer with its appropriate color and then export.
Would a 4K splatmap resolution have performance issues for PC or Console? My terrains are quite small, no more than 200 square meters. Most times below that, so the resolution could potentially be enough, and the texture blending could add some nice noise to the road lines and make them feel a bit more natural. I'm not looking for super sharp lines, so I'll consider the option anyway, even if not ideal on paper.
Let me know if 4k splatmaps are way too much though!
I personally find the blending in MegaSplat looks best with lower resolution control maps, so 4k seems a bit extreme- but it will handle it as well as anything else will. Remember that terrain control maps, in MegaSplat or elsewhere, are uncompressed, so a 4k uncompressed texture is going to be a ton of data (But at least it's only 1 texture, unlike Unity terrains which are 1 texture for every 4 textures you use).
I am interested in using this asset, I am currently using FinalIK and have created footstep sound effects for when the character walks on floors vs. terrains.
I was wondering if it would be possible to use this asset on a terrain and raycast from the character to the ground and detect which terrain texture was hit so I can set the corresponding footstep sound effect (eg. if player stepped on gavel vs stepped in mud)???
Yes, there’s a component for this included.
I am now getting megasplat into my work and I am having big troubles.
I don't know why, but when I add it into the terrain, my computer crawls. The editor takes several seconds to respond, and when I enter play my FPS drops from 30 without megasplat to 1 with megasplat added. See pictures.
I know from the forums that others have had great results, but I have been trying for several weeks to get this to work, because I love all of the features. But once I add it, I can't work anything because of the extreme lag.
Please let me know what to do. I've been watching all of you devlogs and reading the manual, just to understand it so I can add it. Now I begin adding it and I can't work with it in my project.
Please let me know what info you need to help me. If you want to side bar to discuss in email, I can do that as well or send you video or whatever. I just hate that I have bought something to help my art and I can't use it.
I even tried to add microsplat textures in and that slowed my computer down, but not as bad.When I reset the material to builtin shaders from microsplat, I lost several textures and it left me with only 3 textures in the scene out of the 6 that were there. It did show 4 texture boxes, three had textures (not the original ones) and the 4th was empty and now I just have black lines where it used to be paths. I added a 5th texture, but it didn't change the black lines back to a texture.
I'm at a loss on what to do now. Looking forward to your suggestions.
I'd need a lot more info about what you are running this on (hardware, target platform, etc), the scene you are rendering (is it 100 4k terrains?), and with which settings (shader generation settings, tessellation settings, etc), etc.
I can tell from those two shots that, for whatever reason, you have twice as many draw calls and vertices in one than the other, so that's likely the first place I'd look. Then there are the settings- if you are running with tessellation, triplanar, etc, then you should expect it to run slower than Unity's shader, which doesn't do a whole lot.
For reference, I develop on a 3 year old Mac Book Pro wth a AMD R9 M370x GPU with a 2880x1880 screen resolution; that's a pretty large screen for a mid-range GPU, on a laptop to boot. Full screen in editor play mode, I get about 80fps on demo scenes of MicroSplat with some quite heavy features on (tessellation, etc), while I get around 60fps in similar scenes with MegaSplat. The fact that your shot shows you running at a screen resolution of 1024 and only getting 30fps on Unity's terrain shader makes me think you are running on an extremely low end device, or doing something else that's crippling rendering (like having 10 cameras in your scene). Unity Terrains can run at over 30fps on low end mobile devices, so that seems a really low frame rate to be having regardless of shader. What do you get on my example scenes, for instance?
It's probable something crippling me. I do have an older desktop, but it has been upgraded. i7 2600 CPU @340 GHz, 16GB RAM, Win 7. Video card is a NVIDIA GeForce GTX 780 w/ 3 gig on board. It's only one terrain made with Gaia and I'm just doing a conversion from Gaia with UNity 5.6.3f1.
On this run, I only had the basic, single layer with no extra features (basically out of the box). I've seen your videos and know you are getting great operation. Which is why I'm confused. I've been holding off implementing into the project until I got a good understanding of it. I've done that and thought I'd give it a try and that is where I'm at.
I'll start a clean project and run some tests and see if I can figure out what is causing the problem.
I am an artist and coming over from Vue, so this is fairly new to me as I've only been at Unity for a few months.
I am currently trying to clean up my project, but I'll let you know how the new project works and if I can find out which asset is interfering with your plugins.
I would try just loading the demo scenes and see what you get on them, so you can see if it's some issue in your project/scene or something more intrinsic to your hardware/etc. Your machine is more powerful than my laptop, so you should get good frame rates. If you can verify that everything is fast in the demo scenes, then it's just a matter of figuring out what's wrong in your particular scene.
I started reworking an old scene, tried to convert the old splatmap using ColorToSplat utility, but no good results ... will probably need to repaint it.
But I'm a bit confused why the shader is not listing "Normal Smooth AO" for packing...
Any idea what to look out for ?
I have tried updating the texture array.
The new texture packer handles this for you, so there's no need to select a packing format unless you are using one of the non-PBR modes (no normals or specular options).
I ran the demo scenes and it was a complete success! Thanks for pointing that out.
Now the hard part, I have to find out what is conflicting in the scene that is messing up megasplat.
I am very relieved that it is working! If I can figure out what is causing the slow down I will post it so you and others can know what to look out for.
Ok thanks ... in that case, please update your documentation, as it had me scratching around for hours
I don't feel there is enough feedback to user when setting up textures.
Specially because you now have an automatic fallback system to generate missing maps.
I'd obviously want to use my own - which (should be read from my previous *_nsao files)
So how do I know if its used the maps I selected for importing (via channels), or if its generated its own maps?
Specially as the texture previews don't show actual AO etc.
It would be nice to have better feedback, maybe small text in top left of each preview indicating where its sourced from, eg:
"X" = Calculated
"F" = file
"L" = channel
The textures don't seem to be as effective as they were before, so I'm trying to figure out why that is.
@mwituni -- what do you mean by 'The textures don't seem to be as effective as they were before, so I'm trying to figure out why that is.' ?
Reason I'm asking is when I tried upgrading my project to the new packer format, I noticed a visible change / reduction in texture quality and the blends between some textures changed too. I've reverted back to the previous MegaSplat on my master branch until I can figure it out.
What packing format were you using previously?
Previously using standard packing format -- so I suppose would notice a difference, however it seems quite noticeable to me, so I'm a little undecided on what to-do. Really like the new packer though, so would like to use it.
A bit like you experienced I guess ... everything just looks a bit "dead", and not popping.
In my case its early days ... so I thought (hope) there's some reason for that.
I guess I was hoping the experience would have been a bit more transparent, and "just work".
In my case, the same ... _nsao
Is there a way (by checking files created or something) ... if the shader is using values extracted from previous _nsao files, or calculated?
This is actually pretty confusing to some of us.
Can you please try find ways to make it easier to use, or document changes better.
What else does the new packing format handle?
eg. In the shader compiler, I've assigned megasplat_diffuse as Splats->Albedo/Height Array
Is the Normal "automatic" too, or do i need to assign it, and if so to what?I'm guessing not, as if i look at the files, the only 4 that have changed when i updated the textures are all diffuse :
Please improve the documentation to reflect changes... this suggests to populate normal and mseo etc...
So, the new packer uses a new unified format for all of it's resulting texture data. Diffuse + height in one texture, with normal + smoothness + ao in a second, however, it's not packed in NSAO format, but rather a new format which improved the quality of the normals slightly.
In the old "standard" format, normals and smoothness/ao wouldn't have been packed together. In fact, Standard didn't support AO at all. But the advantage of not packing them together is you get slighting higher quality on your normals, and slightly higher quality on the smoothness/metal map, because texture compression is designed to work on colors and none of this information is color. So what is done in Standard format is to only use the G/A channels of the texture, which means the texture compression only works on one channel of data at a time (256 possible values vs. 16 million).
MSEO format retained the high quality normals, and in most cases (Where metal is a single value and emissive mask is not used) you get high quality smoothness and AO as well.
The cost of standard/mseo though was an extra texture set (memory) and extra samples for every operation (layer, distance resampling, etc). Packing formats, and the resulting work required to pack textures, were the two highest support/complaint causing things in MegaSplat, so when I moved to the texture packer settling on a Unified format made the most sense, as it removes all of that confusion/work for the user. This means some of the quality vs. performance tradeoff's available in previous versions of MegaSplat were no longer available though, as honestly the average Unity user had no idea what those tradeoff's were no matter how much explanation I would do.
There are only two states- you are either reading the data from a texture which you supplied and shows up clearly in the interface, or you have not supplied a texture and it will be generated for you. There is no third state.
The texture packer always outputs two sets of arrays- a diffuse+height and a normalSAO array, which you assign to the material. If you supply metal or emissive textures, or an alpha texture, it will output an array for them as well which needs to be assigned to the material. This is a significant reduction in possible confusion from the old interface, in which you could pack multiple combinations of formats and arrays and had to do it all manually. I apparently missed one image in 47 pages of documentation which was updated.
I identified 3 so far, but who's counting?
More important to get them fixed so others don't waste time on it.
Ok I added a texture with a manual diff and normal only to see that .... so if I understand you, the top texture shows all the previews, and because those are only 2 different ones (diff and _nsao), that means its read the values from those 2, while the bottom one has calculated H, S, AO.
Please add that type of info (maybe like a "TIP" or "INFO") to the docs when you edit it - that's helpful to know.
Thats kindof what I thought and tried, but when I assign "megasplat_diffuse_normSAO_tarray" to shader->splats->Normal I get this...
without a normal assigned, I get this...
Now, it may be that some settings need to be tweaked, but from the few i've played with it doesn't look right.
5) Also ... when I add a texture to the array (as in step 3), I then cannot paint with that (it just paints in the previous texture (the pebbles) when selected). I assume its because array needs rebuilding, so tried the following:
a) Update array
b) Regen clusters
c) Re-assign updated array to Terrain Paint
d) Restart Unity
Still cannot paint with the new texture. Is there an option I am missing?
This is all I could see in the manual...
While I'm on a roll...
How about making this remember its last config...
so we don't have to reselect it ...
EDIT: Sorry - each time we run the game from editor
Yes, no texture == auto calculate. If you (or the auto-importer) put a texture there, then it reads the value from the texture.
Are you sure that's not the old normSAO array from the previous MegaSplat version? Since the channel arrangement is different than in those arrays, they would display some bizarre results like this if used.
No, I'm betting your assigning the old array, and so it doesn't match what your seeing when you select the new arrays config.
No, its definitely recreated - at the time i clicked update after adding a new texture.
There is only one ... after I updated it recreated the file.
I will update again, and make some changes to trigger shader recompile.
Well, its doing the same thing
So not working...
I removed the last texture I added previously from the array, updated textures, and that displayed fine (the texture array). I then changed the shader to trigger recompile. Went to terrain, and added "megasplat_diffuse_normSAO_tarray" as Splats->normal, and the same (metallic-like) mess ...
vs this with no normal...
I'm not sure what else I can do / test to correct this ?
EDIT: Well I might have to rethink this anyway ... my scene is running at 15-25 fps, and terrain normals are not working yet ... hopefully there's an issue bottlenecking it. With Forst's "CTS Colormap Ultra shader" it was 35-50 fps - just before i replaced it with Megasplat. Which is important as there's not too much content yet, and more coming. Maybe so many terrain textures aren't that important.
Send me a scene and I'll take a look at see what went wrong.
Are there any logs that can help?
Scene is huge.
Or anyway to check it remotely?
If it won't repro in a smaller scene, then it might be something else in your scene causing the issue.
Yes, guess that's true. I will try create a smaller scene.
OK, thanks for the detailed update -- I'll look into upgrading MegaSplat again next week, after my demo build is done later this week.
Any idea on the other issue I reported, i.e. why the blend position moves after upgrading to the new texture packing format? I'll reference the post again below... however basically, the position of a drain model no longer lines up with the terrain blend of adjacent textures, after changing to the new format and updating the related MegaSplat material.
Stranger still - was that when trying to repaint the terrain in that area, I could not achieve the same blend between the two textures, as per the previous (pre-new-packer) version of MegaSplat. Link below to the post I'm referring to.
https://forum.unity.com/threads/rel...at-mapping-system.441329/page-60#post-3238529 (this how they look now -- however after upgrading MegaSplat, no longer align with the model.)
The Diffuse+Height array hasn't changed in any way (Well, unless you didn't provide a height map, which I'm guessing you have in this case), and none of the blending code has changed in a long while either, so I'm not sure why the physical blend position would have changed.
Should baked GI lighting take tessellation into account and bake the shadows from tessellation into the lightmaps? Doesn't appear to be in our case but perhaps I am doing some wrong?!
(Have searched this thread but couldn't find a solid answer so apologies if this has been discussed already)
No, Unity's lighting system doesn't bake tessellation details, mainly because that detail is likely too small to bake into a light map.
Ok thanks for the quick reply
Day3: Some success.
So, while preparing a smaller scene to send you, I noticed a few things :
1) When i created a new unity terrain and applied MegaSplat, it behaved differently to how my previous (problem) scene did. On the new scene, it asks for a material, and when you click on the "material" button I immediately had the editable material properties.
My previous scene didn't ... when i clicked the "material" button, it showed a material but it was read-only.
I then looked in the manual, and it said to create a new material, which i did. I then assigned that to the terrain etc.
(in reflection it could be because it was an existing scene terrain that had "ATS ColorMap ultra" material previously) ... its probably a good TIP to mention in the manual (about applying to existing terrains).
So to check if that was the cause, I then went back to the original problem scene and deleted the material and shader, as well as control and params files. Then re-added MegaSplat to the terrain to recreate them, and was able to click through the "material" button and edit the material. Once I applied that, the new extra texture I added to array is now coming up and paint-able.
2) Regarding the funky metallic look when i apply the "megasplat_diffuse_normSAO_tarray", most of it now looks ok (just some are very large textures - so i'll have to turn on per-tex scale I guess).
3) BUT ... i still have some very dark areas when i apply the "megasplat_diffuse_normSAO_tarray" as the Splats->normal (see above).
I have noticed these are my own textures, yours are fine.
Which I find very strange as I had exactly these in the older MegaSplat version and they were perfect ... I have imported all from my previous _nsao files.
That Said ... the "new" one (just added) is fine! ... but it only uses diff and NML.
So either the texture importer is not converting them correctly, or your new changes in rendering do not suit what I did when i made them, but in that case I suspect many other users would have issues with their older custom textures.
I guess I will need to redo them. Are there any changed guides / requirements for the nml, HM, S, or AO files?
EDIT: I just added per tex scale, and get errors re Unsupported texture format ... so thats likely related! ...
Unsupported texture format - needs to be ARGB32, RGBA32, RGB24, Alpha8 or one of float formats
UnityEngine.Texture2D:SetPixel(Int32, Int32, Color)
SplatArrayShaderGUI: DrawTextureEditor(MaterialEditor, MaterialProperty, Material, FeatureData) (at Assets/MegaSplat/Scripts/Editor/SplatArrayShaderGUI.cs:404)
SplatArrayShaderGUI:OnGUI(MaterialEditor, MaterialProperty) (at Assets/MegaSplat/Scripts/Editor/SplatArrayShaderGUI.cs:968)
UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)
Shader warning in 'MegaSplat/Terrain_Visiwa': floating point division by zero at UnityCG.cginc(460) (on d3d11)
Compiling Fragment program with SHADOWS_DEPTH LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME
Lots of warnings:
There are inconsistent line endings in the 'Assets/Terrain_Visiwa.shader' script. Some are Mac OS X (UNIX) and some are Windows.
This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
If your working with a unity terrain, then you want to select the material on the terrain component, not in the terrain's material setting. This is because the terrain has an instance of the template material on it, so if that was editable it would work, but none of the settings would get saved (because it wouldn't be editing the template material).
This is my working theory of what's going on. Your trying to convert from your old NSAO files, but I think there's an issue here. Looking at the code, when it finds the " _normsao" extension it sets up the smoothness and ao channel to be extracted from that texture, but it doesn't assign it to the normal slot, because Unity's normal format is to pack the RG channels of a Normal Map into the Alpha and Green channels, and the packer is expecting things to be packed into Unity's normal map format. If I'm correct, and you have assigned those _normsao files to the normal, then it is reading the G/A channels for the normal map, which is actually the one channel of the normal map and one channel with AO in it, which is making your normals point very hard towards one (wrong) direction.
I think I missed this when I was originally writing this because I've always had the original normal files around in MegaSplat, so it just selected those instead. This leaves me with an interesting dilemma of what to do about it though- looking forward no one who is not upgrading from an old version is going to have NSAO files around - and my choices are basically to add a special option to the packer which lets you select NSAO format as a source format (making the already dense UI more complex) or remove the direct NSAO import all together (cleaning up the code).
Anyway, if you extract those into regular normal maps and set them to type normal in the importer, I'm betting it all starts working. Please let me know if this is the case.
Normals are expected to be set to 'Normal' format in the importer, otherwise you can pull any of the single channel textures from whatever channel you have the data in.
This keeps happening to people on newer versions of Unity- you can select the _properties texture and set it's compression type to 'none' in the editor to fix it. Unity actually removed the ARGB32 format from the texture import UI (That's what MegaSplat was set to use because they used to recommend it, and it's still in the error message above). I should likely switch it to enforce RGBA32 for everything instead.
Can you send me your exact material settings for what causes this?
I just fixed this for MicroSplat, actually - it's harmless, but happens because the fragment files are not converted to windows line formats when you install the asset (the .cs files are, but not .txt files).
I was hoping the latest update would resolve the constant crashing problem I've had forever now, but it hasn't.
Every time I open my scene (in the editor) with a Megasplat terrain on it Unity crashes to desktop.
I used to be able to get into the scene by disabling the scene and game windows, loading the scene, disabling Megasplat on the terrain then enabling the scene and game window again.
However now the scene crashes even with the scene and game windows closed so I can no longer open my scene AT ALL, Unity crashes to desktop every time.
I love the results of Megasplat, but it's the only asset I've ever used that breaks my scenes permanently and makes them impossible to edit.
Is this something you have encountered before, or do you know a possible fix?
#Edit: Fixed by changing script execution order of MegaSplatTerrainManager.cs to be the last script executed. (for anyone else having this problem.)
First I've heard of it - is this reproducible across machines? And do you have any logs with an error?
Is there any way we can up our texture resolution to 4096x4096 on our project? It seems that the previous versions of megasplat allowed this, but now 2K seems to be the max? Our project relied on 4K textures to an extent as by updating to the latest version of megasplat the difference between our scene's objects and the terrain is more noticeable and therefore the blend isn't as natural.
There's an enum in TextureArrayConfig, just add "k4096 = 4096", to the top of it. I'll add this in the next patch as well.