Search Unity

[Released] MegaSplat, a 256 texture splat mapping system..

Discussion in 'Assets and Asset Store' started by jbooth, Nov 16, 2016.

  1. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    1) Just to clarify ... its _nsao extension, not _normsao, right?

    We went through this a few weeks back, were the instruction said _nsao, causing some of us to rename files to _nsao.
    Hopefully it's not that renaming that has caused this?

    2) The rest looks a bit techie. We users ... just really want the thing to work like it says on the tin.
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It doesn't really matter what the extension is- you can pull the smoothness/ao maps from any extension using the importer. But what is relevant here is there currently is not a way to pull the normal channels from the RG channels of a texture (which is where it is in your textures)- it's always looking for them to be packed the way that Unity packs them (Unity takes your RGB normal map and rearranges the channels of it so the R/G channels are actually in the G/A channels of the texture).
     
  3. tomhamilton

    tomhamilton

    Joined:
    Aug 31, 2013
    Posts:
    9
    Thanks Jason!
     
  4. Pete-El

    Pete-El

    Joined:
    Oct 24, 2012
    Posts:
    8
    Hi Jason, love your asset, I couldn't do without it however I'm having a couple of issues.

    I can't seem to enable fog. If I enable tessellation then it works but I don't want the FR penalty.

    Also I can't adjust values in the Per Texture Scale fields

    https://imgur.com/a/vUs7w

    Let me know if you need any extra info.

    Thanks
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I assume it's throwing a warning into the console when you try to change the settings? Select the _properties texture and switch it's compression type to none.

    What version of Unity are you on, and what OS are you running along with what target platform? I'll see if I can repro the fog issue.
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    @punk @tomhamilton @mwituni

    Fixed these tonight, some of which were affecting you:
    • Fix issue with per-texture normal strength which was broken in texture packer upgrade
    • Fix issue with disable bottom layer unpacking new texture format incorrectly creating a shiny/black look when used
    • Fix issue with _properties textures getting compressed by Unity in 2017.1+
    • Fix issue with compiled shaders complaining about OS X newlines on windows machines
    • Fix issues with normals being unpacked incorrectly on some of the more esoteric shader options
    • Fix images in documentation from texture packing upgrade
     
    mwituni, ftejada, m4d and 1 other person like this.
  7. Pete-El

    Pete-El

    Joined:
    Oct 24, 2012
    Posts:
    8
    I am using 2017.1.1f1 and am running and Targeting Windows platform.

    Sorry yes I noticed after I posted that it was throwing error messages about my image format. I made the suggested fix to my images and am still getting the following error. My file type is .tga is that the issue?

    Code (csharp):
    1.  
    2. Unsupported texture format - needs to be ARGB32, RGBA32, RGB24, Alpha8 or one of float formats
    3. UnityEngine.Texture2D:SetPixel(Int32, Int32, Color)
    4. SplatArrayShaderGUI:DrawTextureEditor(MaterialEditor, MaterialProperty[], Material, FeatureData) (at Assets/MegaSplat/Scripts/Editor/SplatArrayShaderGUI.cs:414)
    5. SplatArrayShaderGUI:OnGUI(MaterialEditor, MaterialProperty[]) (at Assets/MegaSplat/Scripts/Editor/SplatArrayShaderGUI.cs:1007)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    7.  
     
  8. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Cool. When are you posting the update?
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    posted it last night- lately it's taking unity about 2 days to get through, but people are welcome to send me an invoice number and I'll send it early..
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It has to do with the _properties image that MegaSplat creates/manages getting set to be compressed, In 2017.1, Unity changed the way texture importers work, so I had to update that code to work both the old and new ways..
     
    ftejada and Pete-El like this.
  11. tomhamilton

    tomhamilton

    Joined:
    Aug 31, 2013
    Posts:
    9
    Hi Jason, I'm having an issue using baked + realtime lighting and tesselation. You'll see in the picture below, I have a test scene with a megasplat terrain and a unity standard shader applied to a sphere. You'll see on the left, the megasplat shader has tesselation switched off. The shaders match perfectly, which will allow us to blend large geometry rocks into our terrain in our project, which is great. However, if i switch tesselation on, you'll see there is a drastic difference in lighting between the two objects. I've drilled down and it seems to be something to do with the way normal maps (and possibly AO) are being treated by the tesselation shader. I've recorded a short video and prepared a test scene to explain it as it's quite hard to explain. I hope you don't mind me PMing it over to you? I'm using unity 5.5.0 and Megasplat 1.53.

    Any help would be much appreciated as we've found these issues late into our project and are concerned that we aren't going to be able to use megasplat to it's full potential.
     

    Attached Files:

  12. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Hey there, just bought MegaSplat based on the pretty pictures and the docs. However, I'm running into some issues.
    • Unity Terrain conversion doesn't work out of the box. I was able to fix the code in TerrainToMegaSplatConfig.cs - you're recreating a tex (if dimensions don't match an existing terrain) and then hoping that GetAssetPath for that freshly created texture returns magically the old texture path, which it doesn't.
    • Converting to splat maps does not reimport the newly created texture, thus the user doesn't see that it worked unless he reimports manually.
    • TextureConversion profile save/load/new all throw errors related to wrong pathes. Something is wrong with the way you access the asset database.
    • Terrain drawing order is not adjustable, that breaks some effects like "Lightmapped Terrain in RenderTextures"
      EDIT: in the meantime tomhamilton posted his error, which I think is the same I'm seeing here.
    Would be great if you can test your asset and its features with Unity 2017 to see what I'm talking about.
     
  13. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
    Hello Jason,

    I am having problem with distance resampling.
    Here's how terrain (mesh) looks like with "texture scale" set to 10 and "resample uv scale" set to 1. And that's fine.
    1.png
    Here's however the same terrain wint "texture scale" set to 100 and "resample uv scale" set to 0.1. And that's not fine at all.
    2.png

    I'm using the latest version of Megasplat and Unity 2017.2
     
  14. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I tested the first two with the version that was submitted last night running on 2017.1.1p3 and was not able to repro them. Since my fix had to do with changes to how texture formats are assigned in 2017, it's possible this was fixed by those changes. The save/load was also fixed.

    I'm not exactly sure what you mean by terrain drawing order breaking lightmapped terrain in render textures. Do you mean you'd like access to the shaders sort order (ie: "Geometry +100")?
     
  15. Pete-El

    Pete-El

    Joined:
    Oct 24, 2012
    Posts:
    8
    Excellent, found the _properties file you meant, made the change and the errors have stopped.

    Have you had any success reproducing my fog issue? This is more of a show stopper for me at the moment.
     
  16. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Hi Jason,
    I am right now using TerrainComposer and RTP to create my terrain. I am modeling very big real live terrain (pacific island), and for performance reasons, I decided to do a 4 layer terrain. That should be ok, as the terrain will only be seen from quite a distance. I managed to get rid of the patterning on all of my 3 layer textures I am using on the terrain, with RTP settings. But what is left are noticeable patterns in the areas where this textures are height blended (too big areas).
    A guy in the TerrainComposer forum pointed me at MegaSplat, and I find it very interesting!

    But I am using the sat image of the island as global color map and blend it against the detail textures, which creates a very realistic look far away. (RTP feature)
    My question now is if that would be possible in MegaSplat as well?

    br
    Funkeys
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, I check in all four shader types using the example scenes and it appears to work for me. Are you sure your camera didn't get flipped to deferred rendering? Also, does it work in the example scenes?


    It's possible in MegaSplat using the Macro Texture features, but you might want to consider MicroSplat if performance and ease of use is a top priority. The global module will do satellite image blending, and the anti-tiling module will cover up tiling issues, which will run you less than MegaSplat and perform faster as well. MegaSplat really comes into play when you want to work on meshes or with very high numbers of textures. I made a little comparison page here.
     
    Funkeys likes this.
  18. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Thank you for this very quick an informative response. I had a look over the MicroSplat tutorial videos, and this looks very interesting from the workflow side. I also like and appreciate how detailed and beginner friendly you explain all your features! :)

    But I have still one concern, well I don´s know if it even matters, but it is about performance. I want to use a very high far clipping, and I am concerned about the cpu load of the terrain because my tiles are going to be around 50x50 km. To counter this my plan was to use the tesselation feature of RTP to be able to set the pixel error of the terrain to 300 and still have good looking terrain shape even from far away. My idea on that was also to be able to shift some of the load away form the cpu to the gpu. Well I dont know really if that would work!
    And it looks to me that your Tesselation add on is just ment to add up close detail?
     
    Last edited: Oct 27, 2017
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I would not recommend that approach; Invoking the tessellation stages on a GPU, even if no extra vertices are created, has a high cost. And while it could potentially allow you to move some CPU load to the GPU, I think there are better ways to reduce the CPU load without destroying your GPU. The main cost of Unity Terrains is going to be it's continuous LOD of the meshes as you move around; if this is a high CPU cost, then consider swapping the terrains for meshes in the distance. Most terrain shaders will actually work fine on meshes if the meshes conform to the same rules as the terrains do (height map based, etc), So you can use Unity Terrain up close, and then swap to an LOD'd mesh at some distance which you generate from the terrain data as part of your build or level design process. You could further optimize this by combining mesh chunks at a distance and replacing the shader with a single texture, but that would be a lot more work.
     
    ftejada and Funkeys like this.
  20. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Ok I see, that pretty much fits to my first small tests, I did. The gpu load was much higher then expected. But this also means i need MegaSplat because of the meshes I guess!?
    Thank you very much pointing this out for me! :)
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, Unity Terrains are just meshes under the hood. You could paint your terrains as normal, then generate meshes from them and assign the materials from the terrains to them when you do the swap.
     
    ftejada likes this.
  22. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, I know what's causing this and will fix it tonight- I can send you a patch if you send me a PM with your invoice #..
     
    mwituni likes this.
  24. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Hi,
    it seems I cannot get MicroSplat to do height blending. Cannot figure out what is going wrong here. Textures are all the same size, and I added the height maps.
    Do I miss something?
    upload_2017-10-27_20-35-52.png
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There's a contrast control which controls how much height blending is applied, as well as an option to disable height blending. Did you provide your own height maps, or let MicroSplat generate them? To provide them yourself, switch the config to PBR from Basic, otherwise they are generated based on your normal maps (if provided, if not, based on the luminosity of the albedo).
     
  26. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    I used my own height map (GameTextures), well height blending works in Basic mode, but as soon as i switch to PBR it seems it´s just alpha blending. I played around with the contrast slider but it seems to do nothing.
    upload_2017-10-27_20-56-42.png
    this is the result when i switch to basic.

    This is my texture config for PBR:
    upload_2017-10-27_21-0-2.png
     
  27. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Are you sure the height maps are in the G channel and aren't alpha8 textures or something?
     
  28. EclipseGamesLLC

    EclipseGamesLLC

    Joined:
    Jun 18, 2011
    Posts:
    27
    i keep getting this error when changing a parameter
    Code (Boo):
    1. Shader error in 'MegaSplat/Terrain_Desert': redefinition of 'VertexOutput::_ShadowCoord' at line 414 (on d3d11)
    2.  
    3. Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN
    4. 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
    5.  
     
  29. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'm assuming this is from the MegaSplat patch that came out today? I must have missed one of the 800 lighting combinatorics in the lighting system. I did some changes to solve some lighting issues in a particular mode and must have broken another. Sorry about that.

    Yup, found, fixed. You can turn off tessellation for the moment and it'll work again, but I can also send you a patch if you send me your invoice. I'm headed out for the night, but can send it later or in the morning.
     
  30. EclipseGamesLLC

    EclipseGamesLLC

    Joined:
    Jun 18, 2011
    Posts:
    27
    I get this error even when I change any parameter in the material. then the whole terrain turns pink.
     
  31. Funkeys

    Funkeys

    Joined:
    Apr 16, 2017
    Posts:
    64
    Yes, some of them where Alpha8, corrected them, now it works :)
    Thank you!
     
  32. PineappleParty

    PineappleParty

    Joined:
    Jul 31, 2017
    Posts:
    17
    This question might be obvious but I didn't come across any information on it in the doc. When I'm finished painting my mesh and want to start adding in everything else for my game and then build it out to desktop, are there any steps I need to take megasplat wise for that to work. Such as turning off megasplat while I'm not using it. I'm not sure if I need to hit the Bake Scene To Mesh Cache or something like that. Perhaps if I build out a demo to desktop all the megasplat information on my mesh will be saved and looking the same?
     
  33. Thoranar

    Thoranar

    Joined:
    Oct 5, 2013
    Posts:
    22
    Does this asset support Procedural Sphere Meshes (cubesphere/planets with multiple grid/faces) generated at runtime?
     
  34. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The answer here is somewhat complex, unfortunately. You don't need to do anything special to make MegaSplat work in builds- it will just work the same as in the editor, however, there are reason you might want to bake out meshes anyway.

    MegaSplat uses my Vertex Painter to save the data for the paint job into a component, and then applies that at runtime via Unity's additionalVertexStream functionality. If you are painting dozens of instances of the same mesh (say, rock piles), then this can be a memory savings, but requires doing work at startup which can slow load times. Additionally, some lighting modes in Unity require you to have static meshes (as do static mesh optimizations), and Unity does not allow you to use additionalVertexStreams in static meshes, because these could change the location of the vertices. So if you want to use these optimizations/lighting systems, then you must bake your mesh out to a new mesh using the mesh baking utilities (or with the full scene one).

    However, if you are using runtime lighting and won't see a big gain from static batching (because your painting large chunks of mesh), then leaving things as they are is just fine.
     
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    MegaSplat will work on arbitrary geometry, but the geometry must have special data on the colors which MegaSplat uses for filtering. A preprocessor is included which converts geometry into this format, and some people have applied this to work at runtime as they generate a mesh (voxel engines, etc). There is also an option to do this work in the geometry shader, but I would recommend against doing this in full production because the geometry shader adds significant extra cost to the shader which is better done during mesh generation or as a preprocessing step. Information about this is included in the documentation, which is also available online.
     
  36. PineappleParty

    PineappleParty

    Joined:
    Jul 31, 2017
    Posts:
    17

    Thanks so much for the detailed answer. I was afraid my question was really stupid. :D I'm going to save what you said, i'm sure ill need it later down the road.
     
  37. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    @jbooth Hey bro,

    couple of problems

    firstly textures are looking blurry at an angle it's like ansio is ignored, I've got it set to 9 and it's not making any difference, these are 2k textures and I'm using a single layer with nothing else but the 'Detail noise Texture' enabled, no blending at all just filled in objects, I've got a feeling I'm having a similar problem in Micro splat, but I'll get back to you on that.

    2.jpg

    then I tested out the 'Disable Bottom Layer' option that you recently fixed and it did this

    3.jpg

    notice the blur has gone, so this leads me to believe that there is something not quite working correctly and this brings me to no 2. The 'Disable Bottom Layer' is better, the normal's are now correct, but there seems to be an issue with emission/Metal textures which is better illustrated in the following images:

    'Disable Bottom Layer disabled' - notice the metal bracket and the emissive windows

    4.jpg

    'Disable Bottom Layer enabled' notice the metal and emission has changed, the occlusion could be wrong also because the other objects specular is changing, although that could be due to the metal problem, getting close tho! :)

    5.jpg
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      309.8 KB
      Views:
      820
  38. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    MegaSplat is the death end.

    The author of this asset now knows that any custom crap works not as fast as Unity built in stuff.
    So say goodbye to your bucks. Buy again MicroSplat.
     
    Last edited: Oct 29, 2017
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'm not exactly sure what this is even trying to say- but MicroSplat will outperform Unity's built in stuff by a fair clip once you get above 4 or 8 textures, and Unity's built in system doesn't offer much in the way of features..
     
    punk likes this.
  40. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    I know that star image...
    This is not ok dude.
    I do not understand why you would behave this way.
    I only have good experiences with Jason and his products.
     
    punk likes this.
  41. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    I newer say that Jason is not a shader genious. He really is.
    I just don't like this behaviour to sell his knowledge many times.
     
  42. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    So if you know how to make a game, you can only ever make one game? A farmer can only ever grow one piece of food? Your logic makes no sense..
     
    blitzvb, punk and ZoneOfTanks like this.
  43. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    I can see there's a mention of this above, but I'm going to ask anyway because it's 'doing my 'ead in' o_O

    I bought Megasplat last week. I'm running the 1.54 version in Unity 2017.1.2f1, on Windows 10 64bit. I'm running a Titan Black with the latest driver, 388.00. It's an i7 4930 3.4Ghz with 64Gb RAM.

    I'm getting the pink terrain thing a lot. Which I'll concede might be me, as I'm a noob with this, so I'll take the wrap. But it doesn't seem that hard - watched the tuts over and over.

    I've got a World Creator terrain. I open Terrain Painter and hit the first button, but get this error:

    Shader error in 'MegaSplat/IslandOne': redefinition of 'VertexOutput::_ShadowCoord' at line 413 (on d3d11)

    Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN
    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_LIGHT_PROBE_PROXY_VOLUME

    As the person above did.

    I then obviously get the next panel which tells me the terrain has no diffuse array, so select the material and assign one.

    So I then get the Megasplat shader compiler.

    The first thing I do is set the layers from one to two. Instantly the terrain goes pink. In fairness I haven't added the texture array files - presumably those are the ones in the examples folder ... I keep thinking I should be building my own. But for now just trying to follow the newest convert terrain tutorial verbatim.

    However, immediately I get the pink terrain, I also get this:



    It's not strictly what happens in the tutorial.

    There is also only one line of texture scales, despite setting two layers. And X, Y, Z and W - I don't know what W is. In regular 3D I think it's for volume coords, but don't get how it applies here.

    If I select the example arrays and the two splat files that got created, go back to Terrain Painter and hit convert, what it then gives me is this:



    I really don't think it should be this hard. Even for a Megasplat noob. Is this simply that bug you identified, or is something else going on here too?

    Thanks.
     
  44. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Send me your invoice and I'll send you the patch- the one on the asset store is semi-hosed, and though I've already submitted a patch it's up to waiting on Unity now.. When a shader doesn't compile, practically everything breaks from there (doesn't show the right interface, etc).
     
    Last edited: Oct 29, 2017
    JBT27 likes this.
  45. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    The God will send you a patch.
    But don't forget your invoice number...
     
    Last edited: Oct 29, 2017
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I'm not sure what your problem is abrasive. I ask for an invoice because I get people who pirate my assets asking for support on here on a regular basis - or do you expect me to spend my time supporting people who steel my work? Why are you on my forum thread yet again?
     
  47. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    Hello Jason I think I have a similar problem as Gremberman, I'm new to megasplat (great tool!), everything seemed to be working as it should, but after I got the update this morning my test terrain started showing up pink after re-launching unity. Theres an error, the messages says "shader error in 'megaSplat/BrushPeview_standard': redefinition of "vertexOutput::_ShadowCoord' at line 406 ( on d3d11).

    Thanks!
     
  48. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    invoice is not a problem I get it, just not sure if the issue is related to the update.
     
  49. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    @hippocoder Can you ban this idiot already? Posting torrent links to asset store assets right in the forums?
     
    Nateply, punk and antoripa like this.
  50. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Note to Unity staff - please see deleted post above.

    @jbooth I agree, it's a lifetime ban as has been our policy for years now. Pirates include promoting pirate links. His harassment is clearly documented and it's reached the final straw with piracy of your work.

    Please carry on :)