Search Unity

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

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

  1. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    @jbooth - Thanks again for the tip on the code edit, works perfect and wow, beautiful. Even with the normals a little subdued on TriPlanar it still looks beautiful with the right high quality textures. Anywho, just wanted to let you know, found a little bug, maybe. Parallax does not seem to work in TriPlanar mode. I have Project Tangents on and I can see it works because my snow and normal now work. No Parallax though - if I change the shader in real time to UV Project Axis with Project Tangents then BOOM, Parallax pops out and looks awesome.
     
  2. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, parallax doesn’t work with triplaner because you basically have 3 tangent spaces to work in if you want to be correct. In MicroSplat I got this to work by blending the space based on the projection, which produces a different set of inaccuracies because you aren’t using three separate spaces but rather getting a blend of them.
     
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm also getting the following error in Unity 2017.2.0p4:

    Shader error in 'MegaSplat/MegaSplat': invalid subscript '_ShadowCoord' at line 2735 (on d3d11)
    Compiling Vertex program with 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_LIGHT_PROBE_PROXY_VOLUME

    I just imported the asset and didn't do anything else with it.
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Do any of the shaders show up pink or render incorrectly?
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Well, I don't know. Like I said, I just imported the asset and didn't do anything else. I can try to move forward and see how far I get though. It seems the shaders being reported are 3 that I'll not be using anyway. Some example mesh shader and some tessmesh shader or something like that.

    [EDIT]
    Actually, yes. Those 3 mentioned shaders show as pink in the project folder.
     
  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
  7. Akshara

    Akshara

    Joined:
    Apr 9, 2014
    Posts:
    100
    Fwiw, I had the same thing happen over the weekend with those three shaders in their example scenes in 2017.2.0p4 and 2017.3.0f2 in fresh projects with only MegaSplat installed, each shader being pink with an error, though the line numbers were different for me here; yet they each worked fine in 2017.2.0f1. I was hoping to test in 2017.2.1f1 once released before posting about it, in case it was something to do with the patch or the beta.

    And as we're here, I also experienced the missing files issue as was reported in the MicroSplat thread after having both Micro and Mega installed together alone in the same project and then removing Mega due to the issue above, though this was in 2017.3.0f2 so didn't report it.

    Thank you, Jason.
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, so it sounds like some kind of 2017.2 issue- I'll do a fresh install of MegaSplat into a new 2017.2 project and see if I can repro.
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, so this is the usual bullshit with Unity where they change some of the low level lighting code around, don't document it at all, and suddenly everything breaks. It seems, for some odd reason, the UNITY_SHADOW_COORDS macro is not defined, despite it being defined deep in a pile of macros in AutoLight.cginc which is included. This all compiles fine in 5.6, 2017.1 but breaks on 2017.2 due to either changes in the shader code, which Unity NEVER documents, or perhaps some new compiler bug.

    I'm really pissed at this right now. I just spent 40+ hours last month digging through the changes they made in 5.5, 5.6 and 2017.1 to get it all to work across those versions. The least they could do is document the changes they make to these pipelines.
     
    ftejada, mkgame, Rowlan and 4 others like this.
  10. Akshara

    Akshara

    Joined:
    Apr 9, 2014
    Posts:
    100
    I am so sorry, Jason, and hear you man. It is inexcusable how Unity doesn't give you a heads up or document the changes, especially when you put such enormous time and care into your work and the support of it. I totally understand being pissed and would likely give them a piece of my mind, and will in my next opportunity.

    I want you to know that I have tremendous appreciation and respect for your effort and support with maintaining your tools through all of this insanity and with being here for all of us, when you really don't have to. It means a lot man, even if today were the last day.

    My case here isn't pressing and is more experimental and can be worked around. It may be worth waiting until 2017.3 is final, though 'final' doesn't really mean much anymore if they're willing to make breaking changes in patch releases like this one here. Hopefully Unity will take a step back and show more consideration for their asset store developers with 2018 and moving forward. They really need to.
     
    Last edited: Dec 13, 2017
    mkgame and Seneral like this.
  11. magic9cube

    magic9cube

    Joined:
    Jan 30, 2014
    Posts:
    58
    Hello,

    Not sure if this is my own novice mistake or not but when using flow, i get artifacts along the edges of some faces. The result is same for projected uv, triplanar & precalculated uvs.

    megasplat-flow-lines.jpg
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Interesting - is Per-Texture UV scale on by chance? I fixed a bunch of issues that look similar to this and perhaps I missed a case. Also, just to be clear, this is using Flow Mapping and not the built in Lava feature?
     
  13. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Thanks Akshara- I heard back from Unity yesterday and this is definitely a bug on their end. Or rather, it's a change in behavior that they made in a patch release (2017.2.0p2,) which seems to not break their shaders but breaks mine. Since they have absolutely no documentation about how any of these macro's are supposed to be used, or what the change was, I pretty much consider that their bug. I have, once again, asked for documentation on this, what context the macro expects to be used in, and information on what the long term fix is or short term workaround. Hopefully they'll get back to me soon, however, this likely means tessellated shaders will not work in 2017.2 until 6+ patches after 2017.2.0p2 or more as their bug turnaround time is, at minimum, 6 patch releases or so. (The bug that broke saving/loading of texture arrays in 5.6, and thus broke MegaSplat, wasn't fixed until 5.6.1p2 but was originally scheduled for 5.6.3p1 until I managed to get it moved up). But if we're lucky, maybe a workaround can be used and I can patch it on my end.
     
    Akshara and Rowlan like this.
  14. magic9cube

    magic9cube

    Joined:
    Jan 30, 2014
    Posts:
    58
    Ahh, my bad. I updated to latest version.. All good! Cheers!
     
    jbooth likes this.
  15. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    hi @jbooth

    I'm encountering a very strange problem. I am using the latest version of the store and Unity version 2017.1.0f3

    I'm creating an own texture Array to which I drag a substance so that MegaSplat generates the textures it needs.
    Although this problem also occurs without MegaSplat having to generate the missing textures, that is, doing (Normal, Height, AO, etc) in an external program.

    When I apply it to the ground in certain angles of the sun, it does not seem that MegaSplat interprets normalMap well. He may not interpret others well either (Height, AO, Metallic) ... I do not know.

    In the photo below I leave you to see the difference in how the texture interpreted by MegaSplat looks like and how with the Substance directly to another terrain.

    ProblemaNormal.jpg
    ProblemaNormalConfig.jpg

    I do not know if I'm doing something wrong, but the visual quality suffers a lot because of this problem that is happening to me.

    I'm also realizing that texture contrast does not seem to make changes in these textures.

    And the NormalStrengch by texture (it seems it only works in one layer when you have TwoLayers activated in the LayerMode). I do not know if this should be like that or it is an error.
    One thing that I think would be helpful to include is that you can give values higher than 1 to Normal Strengch by texture

    Could you help me?

    regards, Sorry for my clumsy English.
     
    Tethys likes this.
  16. NightElfik

    NightElfik

    Joined:
    Oct 27, 2014
    Posts:
    27
    Hey Jason, thanks for answering my previous question! Now we have some problem with tessellation that causes self-shadowing. When tessellation is enabled the whole terrain (up to the max shadow distance) is partially shadowed with shadow-bands. Even when tessellation does not kick in.

    We do tessellate shadow pass. I was also adjusting with shadow bias on the light but it does not help. When tessellation is turned off this problem disappears. We work with deferred rendering path + linear color space in case that is important.

    Have you encountered this problem and do you know how to fix it? I was not able to reproduce this in the tessellation example scene.
    Thanks!

    tess.JPG
     
  17. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello JBooth,

    I just started using your Microsplat/Terrain Blending assets, and I got this error message:

    Assertion failed: Assertion failed on expression: 'scriptParameterClass != NULL'

    Could you please help me fix this error?

    Regards,
    Carlos
     
  18. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    By chance are your normal maps not set to "normal map" in the texture importer? The texture packer expects that they are packed into Normal Map format, which stores the data in the G/A channels rather than the RGB.
     
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    This is a regression bug in some of the latest versions of Unity- they have it scheduled to be fixed in newer versions of Unity, but it can be safely ignored because it does not seem to cause any issues. It seems to be happening to hundreds of store assets when they are installed.
     
  20. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I can't quite tell from your screenshot- that said, I occasionally experience an issue with shadows on my mac where it suddenly bands across the terrain, often flashing in and out as I move the camera. This seems to happen on any tessellated shader, including the ones in Unity's examples, so appears to be an issue with their cascaded shadow maps. What's odd is that it will often stop happing as randomly as it started.
     
  21. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Yes, the normal is like normalMap. It's the first thing I looked at.

    I leave you video so you can see how it works when I turn the light source (in this case the sun) around the scene so you can compare what it looks like.

    ProblemaNormal.jpg


    Another thing that I appreciate is that it seems that the texture shown by MegaSplat seems too clear about the same texture that is used by the standard unity shader

    regards
     
  22. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Thank you so much for your prompt response, I love your assets!

    Regards,
    Carlos
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Can you send me the source files for one of the textures/substances which is doing this?
     
  24. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    @jbooth
    I sent you a private message

    Regards
     
  25. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Ok, just pushed a patch to the asset store that fixes two issues:

    1. The tangent space on non-tessellated Unity terrains wasn't being set correctly, which was causing normal maps to not render correctly in these shader variants (the bug ftejada is talking about above)
    2. Unity's change in 2017.2p2 that was causing non-tessellated shaders to break is being worked around. Unity actually jumped on this one, supplied a workaround, and has a PR to fix this for real in a future patch, and I was able to apply the changes internally into my shader fragments to work around the issue.
     
    Tethys, Akshara and ftejada like this.
  26. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thanks for the private message. The NormalMap is already solved.
    I will continue testing. regards
     
  27. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hello again @jbooth !!!

    I still test the latest version of the MegaSplat Store
    I imagine that something will be wrong, but I do not know what it is.

    In this example, I have the textures generated by the MegaSplat texture packer, when I passed the substance that I sent you by private message yesterday. From what I have been able to find out it seems that the MegaSplat Packer generates an albedo / diff of lighter color than the original and with some loss of color and contrast. Or so it seems.

    I think it hurts the visual quality of the result shown on the screen

    These are the visual results of a mesh with the albedo texture of the substance and MegaSplat with the albedo texture generated from that substance by the MegaSplat texture packer:

    DistintaCalidadSubstanceShadersUnityVsMSplat2.jpg DistintaCalidadSubstanceShadersUnityVsMSplat3.jpg DistintaCalidadSubstanceShadersUnityVsMSplat4.jpg

    I repeat that this has only happened to me When MegaSplat packages the textures of a substance


    Could you clarify this doubt that I have?
    A Specular texture I imagine that it should also be dragged to the "Smoothness" of the MegaSplat array, right? Could you confirm it?

    Another doubt that I have and that reading the manual I can not clarify, is what is the splat that generates the texture packer of MegaSplat with the extension "_emismetal"?
    I see that it can no longer be included in the splats that the MegaSplat Shader requests. In other words, the Shader only asks for "Albedo / Height array" and "Normal" Splats ...

    In what cases and how is the Splat "_emismetal" used? Excuse my ignorance. Any clarification will be welcome.

    regards
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Hey Frejada,
    Is this with the patch I sent you yesterday with the tangent fix? Because that will definitely cause the lighting to be different between the two if not installed. That said, a likely cause of a difference of color values in the albedo is a difference in Gamma/linear between what substance outputs and what I am expecting. If you export the texture from substance and use it instead of using the substance directly, does this give you the expected result?

    Specular or Gloss maps are often not the same as Smoothness maps. In general, when I see Specular or Gloss on an image file, I am expecting that it's values are for a non-PBR pipeline (ie: Unity 4). While these things are conceptually similar, like Albedo and Diffuse are, the terms were changed as a way to understand their differences in PBR workflows. (A diffuse map, IMO, will often have shadows baked in, etc, while a Albedo map should have none of that and just represent the albedo color of the object and nothing else). Unfortunately these terms are sometimes used interchangeably - I am guilty of this as well, as MicroSplat currently uses the _diff extension on things when it should likely use _albedo instead..

    The _emissmetal array contains an RGB emissive map (for making things glow in the dark), with a metal value in the Alpha channel (if you want per-pixel metal values). For most of what people use MegaSplat for, terrains and such, these are not necessary to provide so the default is not to output these arrays or require them in the shader. If you wish to use these, you need to turn on the Emissive/Metal option in the shader, and it will give you a slot to provide the array.
     
    ftejada likes this.
  29. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Have you heard anything back on a MicroSplat integration? Pinning a lot of terrains open is rather intensive. Do you know of a work around already?
     
  30. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi jbooth !!

    Yes. These captures are from after the patch you told me yesterday. I suppose it may be because of what you say that the albedo / diff of the substance could be why you comment on gamma and linear. I can not prove what you say because they are free substances that carry the textures inside. So I do not know how to access them.

    Anyway, this problem is not serious for me since I really use textures without substances. I just wanted you to know that maybe there was a possible problem with the substances. If you want to try it for yourself in the private message that you send yesterday you still have the substance that I use.

    And thank you very much for the explanation for my doubts.

    regards
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    For MapMagic you'd have to ask Denis, I have not heard much on that front. A user managed to write a component to make this work for infinite terrain, so I'll see if I can dig up the messages. As far as I know, the TC2 author only does integrations with RTP, since they work together on the same project.
     
    boysenberry likes this.
  32. saber_7

    saber_7

    Joined:
    Nov 17, 2017
    Posts:
    3
    Hello,

    I have tried Megasplat and there seems to be an issue with collision when using tesselation. If I open the example there is a sphere which rolls down the hill and the tesselation does not make it collide with GPU geometry. After I tried to fix some basic things, like setting the physics option in texture properties and etc, it seems that terrain.templateMaterial is null, and Im not sure how to fix that. Any ideas?
     
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The terrain's template material should be assigned from the MegaSplatTerrainManager component - if it's not, there wouldn't be a MegaSplat shader on the terrain. I will take a look at the demo scenes and see if something has gotten unhooked- I haven't looked at that stuff in a while and there have been significant refactors since I was working on it last..
     
    saber_7 likes this.
  34. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @jbooth

    Do you know of a problem that a compilation version of a project that has MegaSplat crash when executing it?

    I downloaded the MegaSplat 1.61 version but the problem still happens. A folder with the report of the errors is generated.

    It may not be MegaSplat. I'm not sure

    Could you see the report and tell me if it's a problem with MegaSplat?

    regards
     

    Attached Files:

    Last edited: Dec 15, 2017
  35. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There's not much in the log to be read- if you can repro this in the editor or possibly in a debug build, any crashes will produce a call stack which will usually tell you what was running when the crash happens. There was a problem in some Unity versions (2017.1) where things would crash in the editor when loading a scene due to some changes Unity made to the startup initialization of terrains, but I implemented a workaround to this a while back and have not heard of it being an issue since.
     
    ftejada likes this.
  36. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    It's strange ... it only happens to me when I run the .exe of my compiled application ...
     
  37. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Compile as debug and you might get more info in the logs.
     
  38. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Hi Jason,

    I'm using MicroSplat tesselation and some of your other assets and have a question about your Terrain holes Asset.
    Can it be used to carve a semi-circle out of a cliff edge?

    I would like to create some cliffs which overhang at the top - I did a picture:


     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Terrain Blending with triplanar would work better for that. You could build a mesh for the cliff, then set the terrain blending so the terrain completely covers the mesh to texture it.
     
  40. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I was told the same thing by the Author. Tom and Nath have always worked close together. and work on games together. So we won't see Mega Splats and TC2. /Shrug. People can still use it just fine, I do .
     
  41. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    ahh I see Thankyou I'll have a fiddle.
     
  42. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I am using MapMagic, MicroSplat, Vegetation Studio and Unistorm together (along with ootii's wonderful controllers and UMA). Right now I am trying to figure out the most efficient way to get the MicroSplat textures on each of the terrains (between 9 and sixteen terrains using the same textures). I am thinking since all of the terrains currently use the same textures I could setup one terrain (the root terrain) with MicroSplat, using the setup component, then just make sure all of the rest of the terrains use the MicroSplat material.
    Does that sound like the right workflow?
    MapMagic can even take care of making sure the MicroSplat material is on each of the terrains. I am just not sure if each of the newly created terrains will need to have the setup component run each time they're created and whether or not they'll retain the painted texture data. I plan on running some tests while I wait for a reply, but figured you would know whether what I am thinking will work or not probably.
    Right now I assume I'll just have to keep them all pinned and see how the performance is until MapMagic gets the equivalent MicroSplat integration MegaSplat has.
     
    Last edited: Dec 16, 2017
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    A user got this to work with infinite terrains- I believe Map Magic has a callback when it creates a new terrain, and he would copy the MicroSplatTerrain component from the original terrain onto it and call MicroSplatTerrain.SyncAll() to instantiate the materials. You really want the MicroSplatTerrain component on each terrain, as it handles routing some of the data for various features and instantiating a unique material for each terrain.
     
    boysenberry likes this.
  44. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    Thanks, I think I'll try that as well!

    PS I have also considered just using MegaSplat instead of MicroSplat (I own both). I really like the features of MicroSplat, and assume most of them are available in MegaSplat as well, so that choosing one over the other might just be an ease of use issue (as you suggested in an earlier post) which I am fine with. The one thing I am not sure MegaSplat can do is integrate in the same way MicroSplat does with Vegetation Studio, namely the Vegetation Colormap Splat. Are there other features MicroSplat has that I would be without in MegaSplat?
     
  45. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Compiled in Debug and not crash ...
    I compile again without Debug and crash again ....

    Keep investigating

    regards
     
  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    There are some features that MicroSplat has that MegaSplat does not, and the blending looks different between the two as well, so they have a different look. I believe Lennart did a full integration with MegaSplat, so it can read the texturing from it and populate vegetation based on it. In terms of Map Magic, the integration worked really well when I tested it months ago- but I have heard that the new combined node for integrating with terrain shaders has some issues (with all of the various shader options, not just MegaSplat, apparently).

    Ouch- these are always a pain to debug. You might want to strip down your project adding various assets in one at a time, if possible, and see which asset or combination of assets triggers the issue- or 70% chance it all just works once you get done doing this.
     
    boysenberry likes this.
  47. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    I will do so.

    I have another problem ... I do not know if this has already been reported to you.
    When the sun is perpendicular to the terrain, angle 90 X_axis, very rare leftovers appear intermittently. I leave video for you to see it. The camera does not have any postprocessing effect



    a greeting
     
  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    That's Unity's cascaded shadow system, most likely the bias not being able to handle the extreme coplanar-ness of the shadow and terrain. Not something I can fix from the shader level, as it's all Unity's code..
     
    ftejada likes this.
  49. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Thanks for the reply. If it seems that putting on the parameter Bias of DirectionalLight, value other than 0, the problem is solved.

    thank you very much
     
  50. Pointcloud

    Pointcloud

    Joined:
    Nov 24, 2014
    Posts:
    37
    Hi, thanks for the quick responses. Quick question-
    Is there a way to have the alpha holes edges blend smoothly? For some reason I only seem to get harsh edges and would like to have a soft gradient edge that transitions between a microsplat texture and an alpha texture.