Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Hey Punk,
    Check the texture arrays that the importer outputs and make sure the aniso level is set there - I tested and the value gets set on the texture array, but it may be that Unity doesn't actually set this value on the texture when it uploads it to the GPU. I'll look into this.
    The metallic issue is likely a bug in that pathway and easy for me to fix. I'll look at it in a few hours and see if I can fix it.
     
  2. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Hi Jason - thanks very much for the quick reply - much appreciated. Err, do I send the PDF via a conversation/PM, or do you just want the number? There's no direct upload, so I can put the PDF on a page off our site, you can grab it then I'll take it down. Or an email?
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    All I need is the number- PM, email, however you want to do it. I can then send you a download link..
     
  4. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Hey bro, great yeah it does get put into the texture array, so it must be something else
     
  5. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    Hey guys I hope your not talking about banning me I was just looking for support and will gladly provide my invoice . Please Jason just let me know if what I posted seems relevant to the latest hosed update problem....
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    No, not you snoops3d. Abrasive/gremberman, who's basically been harassing me for a while and posted torrent links to MegaSplat in the thread. You issue is definitely the current update.
     
  7. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    cool sir ok I will send you my invoice number. really dig the tool man good work!
     
  8. Pete-El

    Pete-El

    Joined:
    Oct 24, 2012
    Posts:
    8
    Hi Jason,

    50% solved... I had a second camera in my test scene buried in the hierarchy. Even though it was disabled its settings were conflicting with my active camera. As soon as I deleted it, my fog started, however this is where it gets strange.

    Fog will only render over the megasplat material in a scene where the camera is set to deferred rendering. If I change it to forward, the fog does not render. I've included some images and the set up of my material.

    https://imgur.com/a/SGMZ8

    I am building a mesh procedurally, splitting the verts on the fly using code adapted from your mesh convertor and assigning the alpha channel texture index that way.

    Thanks for your help.
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Hey Pete,
    I happened to fix this today. It only happens on windows, which is why I wasn't able to repro it on my OSX machine. Seems there's some difference between the two compilers causing the issue, but I managed to work around it. If you send an invoice, I can send you a patch, or it'll be out in the next one (whenever Unity approves it).
     
  10. Pete-El

    Pete-El

    Joined:
    Oct 24, 2012
    Posts:
    8
    Thanks Jason,

    I'm in the process of reworking my noise code so I can probably wait until Unity updates the asset store. Thanks for the fast replies. I appreciate the support.
     
  11. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    It's been going pretty well today. Trying stuff out. Then I set the shader to distance tessellation, and got the pink terrain again, plus these:

    Shader error in 'IslandTwo': Parse error: syntax error, unexpected TVAL_ID at line 3258

    and this:

    Shader warning in 'IslandTwo': Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

    I'm using a Titan Black with the latest driver, 388.00, on Windows 10 64bit.

    Once this has happened, the shader is no longer accessible, and the interface becomes this:



    So I have to start again, as far as I can see.
     
  12. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    When did you get the patch from me? I thought I fixed this yesterday at one point. I can send the latest.

    BTW, if ever a shader breaks in MegaSplat, you can create a new one and assign it to the material, and it will restore all the settings. You can then turn off the option that broke and it'll recompile the shader with out it (and then tell me so I can fix it).

    EDIT: Sent you a PM..
     
  13. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Yes, you sent me a script package last night (UK time) which fixed the problem of the shader breaking and the terrain going pink, which other folk had reported. But then I noticed this tesselation thing this afternoon.

    Anyway, thanks for the latest scripts, and yes that fixed tesselation. Thanks also for the advice about recompiling a shader. It's all making a lot more sense today and I seem to be getting to grips with it.
     
  14. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Oh, I meant to ask; does Megasplat have a mesh terrain blending system, like Microsplat? I've watched the tuts about alpha painting, but that's not quite the same thing.
     
  15. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    One more - wetness seems not to be painting, or filling. If I hit Fill, I get this:

    NullReferenceException: Object reference not set to an instance of an object
    JBooth.TerrainPainter.TerrainPainterWindow.FillTerrainParams (JBooth.TerrainPainter.TerrainJob t, Int32 channel, Single val) (at Assets/MegaSplat/TerrainPainter/Editor/TerrainPainter_GUI.cs:717)
    JBooth.TerrainPainter.TerrainPainterWindow.DrawWetnessGUI () (at Assets/MegaSplat/TerrainPainter/Editor/TerrainPainter_GUI.cs:455)
    JBooth.TerrainPainter.TerrainPainterWindow.OnGUI () (at Assets/MegaSplat/TerrainPainter/Editor/TerrainPainter_GUI.cs:562)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:232)

    And nothing changes.
     
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Is it turned on in the material? If so, try painting it on before pressing fill? Either way it shouldn't throw an error, so I'll get that fixed.
     
  17. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Not like MicroSplat's - MicroSplat relies on the fact that it only works on Unity Terrains, not general meshes, etc. It does have some tools to help you do mesh blends (look a the ObjectBlend example scene), but it's not all automatic and nice like MicroSplat's.
     
  18. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Yes, definitely turned on. Painting prior to filling showed no difference in the terrain: no darkening, no specularity. Clicking on Fill likewise did nothing, except report that error.
     
  19. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    OK - thanks. I'll take a look at the ObjectBlend scene. It's a nice effect in MicroSplat. I downloaded MicroSplat as well last week, and in fairness, if I need that look, and can't get near with MegaSplat, I'll buy the module.
     
  20. Thoranar

    Thoranar

    Joined:
    Oct 5, 2013
    Posts:
    22
    Went ahead and purchased the asset, read through the documentation and looked at the example scenes but I did not find a lot of information on how to apply megasplat to procedural meshes at runtime. There appeared to only be a single paragraph on the subject that basically repeated what you said here. That's a good start but I need more detailed information. Is there particular script, document, video, etc. I can reference?
     
  21. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The vertex layout is described in the documentation in the section titled "Integration with other vertex painters or procedural geometry". This describes what data is read from which vertex attribute to control the shader, as well as the requirement for the mesh geometry. If you want some example code to see how I process the meshes, the mesh converter source is included. In essence, each triangle vertex must have 1 red, 1 blue, and 1 green color on it. These colors are used in the filtering of the splat map data. You can do this filtering in the shader with the "process mesh" option, but this uses the geometry shader which is expensive, so doing this in your mesh construction is preferable.
     
  22. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
    After further playing with Megasplat, I noticed MS don't really likes big meshes (by 'big' I mean those few thousands units long and wide) and I don't really like the idea of separating the mesh into several pieces. Therefore I would like to suggest few new features for the future updates:

    1. Customizable Noise3D resolution
    In large terrains, a single pixel generated by noise corresponds to a way too big terrain area.

    2. Few more thresholds for distance uv resampling
    I would like to i.e. seen texture not scaled at all when player is near, scaled down a lot in the very distance (like .1f), but also scaled down a bit in between (let's say .25f).

    3. Visualization gizmo for noise3d component of texture graph tool
    Not a must-have, but would help me (maybe also few more users) in debugging or setting up proper noise values.
     
  23. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    It's already fully adjustable on both the clusters themselves, and in all the tools (vertex painter, terrain painter, texture graph, etc) as Cluster Scale. Note that if you do not have vertices or terrain control map pixels to work on, then there's no data to "paint" with information, so you need to have your meshes subdivided/terrain resolution high enough enough to have things change.

    Each distance resample is a full resampling of albedo and normal arrays, which is quiet expensive. So adding a third would make the shader much more expensive than it already is with this one. UVs cannot be continuously scaled the way I think your thinking about it- each distance is a cross fade into a different set of samples at a different UV scale, so each one is basically running large parts of the shader a second time.

    For near issue tiling, I find texture clusters are way better than distance resampling. Once you get the right texture variations with the right cluster noise size and control map resolution, you really don't see tiling at all anymore.

    You mean like in the 3d view or something? Since that noise is effectively a volume cube, it's not something that can be easily visualized, but since changes to it reflect instantly on the terrain (in the terrain graph) is that not visualization enough? And if not, what would you expect to see?
     
  24. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    Hello noob question, Im trying to blend mountain pieces that have unique textures with my ground terrain that is using a splat map in 2 layer mode. I was thinking I could use two different texture arrays A) the ground terrain set 2 layer mode B) unique object array set to alpha mode. The problem Im having is when I set layer mode on one array it affects the other completely separate array. for example the ground terrain is set to two layer but when i change the object with unique uvs to alpha layer mode my ground turns partially white. Basically setting one effects the other even though they have different arrays.
     
  25. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
    Oh, so it's about vertices density. Now that you mention it, the smallest spot is about the same size as six faces with the same vertex. I thought it's the problem lies in multiplying maps, it makes sense now.
    I haven't noticed this as there is a bug which causes selection wire to disappear. I'll pm you when I'll write down steps to reproduce it.

    In my case textures are tiled 400 times on each axis. So "stains" created by cluster are still tiled. And I can't get smaller stains because - as I mentioned earlier - my mesh is not vertex dense enough.

    So what's your advice on mid range? Should I subdivide my terrain and add 500k more vertices to create smaller clusters spots? Or is it another way besides those two and distance noise?


    No, no, I just wanted to see the same square as in cluster or particle noise component:
    noise.png
    The problem with visualization on a terrain is - once again - mesh density. Now that I know about it, I'm not sure whether its necessary or not. It just grinds my gear that filters have a plot, but noise has nothing :|

    BTW. What's the difference between "Frequency" and "freq" ?
     
  26. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yes, when working with meshes, it's painting on the vertices. No vertices, no way to apply paint. When working on Unity Terrains it's using a texture. The reason mesh workflows tend to use vertices is a) they're cheap and b) no need to sample a texture or deal with having UVs that allow you to map a control texture over the object. If you have an extremely large terrain with low vertex density, then it's not going to work out that well as you'll be forced to tile over large areas. A few well placed vertices can do a lot though.


    Freq is smaller and fits in tighter UI spaces, but otherwise they are the same. Haha. I assume your talking about the display in the terrain graph- it doesn't render a noise preview because it's 3d noise and thus you'd have to choose a particular slice of it to preview it. Could be done though..
     
  27. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    Hello noob question, Im trying to blend mountain pieces that have unique textures with my ground terrain that is using a splat map in 2 layer mode. I was thinking I could use two different texture arrays A) the ground terrain set 2 layer mode B) unique object array set to alpha mode. The problem Im having is when I set layer mode on one array it affects the other completely separate array. for example the ground terrain is set to two layer but when i change the object with unique uvs to alpha layer mode my ground turns partially white. Basically setting one effects the other even though they have different arrays.
     
  28. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Are they sharing the same shader? You likely need to create a separate MegaSplat shader for the second setup. Basically, MegaSplat isn't a shader- it's a shader generation program. Whenever you change an option in the top section of the shader, you are re-generating the source code for the shader. This keeps things optimal as you aren't paying the cost of those other effects and allows MegaSplat to have far more options than a traditional shader. Anyway, to generate a new one, select Create/MegaSplat/MegaSplat Shader from the right click menu in the Project view and assign the material to it (or create a new one and assign the arrays, etc).
     
  29. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    ahh yeah thats it then!! thanks man!!
     
  30. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    Can someone please help me with this error:
    Shader error in 'MegaSplat/BrushPreview_Standard': redefinition of 'VertexOutput::_ShadowCoord' at line 406 (on d3d11)
    And the textures are all pink
     
  31. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I thought this was fixed with the latest patch?
     
  32. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    I brought i think version 1.55 and get this error when trying to follow the tutorials about mapmagic and megasplat
     
    Last edited: Nov 2, 2017
  33. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Download the latest update.
     
  34. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    ok will do thankyou
     
  35. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    I'm running 1.56. The pink problem disappeared and the wetness now works, but hitting the Convert button does nothing except issue this error:

    ArgumentException: Path is empty
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:209)
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
    (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int)
    System.IO.File.Create (System.String path, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:135)
    System.IO.File.Create (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:130)
    System.IO.File.WriteAllBytes (System.String path, System.Byte[] bytes) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:594)
    TerrainToMegaSplatConfig.Convert (JBooth.TerrainPainter.TerrainJob[] jobs) (at Assets/MegaSplat/Scripts/Editor/Utilities/TerrainToMegaSplatConfig.cs:325)
    TerrainToMegaSplatConfig.DrawGUI (JBooth.TerrainPainter.TerrainJob[] jobs) (at Assets/MegaSplat/Scripts/Editor/Utilities/TerrainToMegaSplatConfig.cs:76)
    JBooth.MegaSplat.TerrainToSplatConverter.OnGUI (JBooth.TerrainPainter.TerrainJob[] jobs) (at Assets/MegaSplat/Scripts/Editor/Utilities/TerrainToMegaSplat.cs:112)
    JBooth.TerrainPainter.TerrainPainterWindow.DrawUtilityGUI () (at Assets/MegaSplat/TerrainPainter/Editor/TerrainPainter_GUI.cs:649)
    JBooth.TerrainPainter.TerrainPainterWindow.OnGUI () (at Assets/MegaSplat/TerrainPainter/Editor/TerrainPainter_GUI.cs:583)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:245)

    Sorry if I'm being a pain in the noob, but the convert is not converting. I can, however, paint on the terrain. Now using Unity 2017.2.0f3, Windows 10 64bit.
     
  36. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461

    Yeah, this is a 2017.2 problem, I fixed it last night and will upload the change to the UAS tonight, but will send you a build as well, since the UAS likely won't ship a new patch until monday.
     
    JBT27 likes this.
  37. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    That would be much appreciated - thanks very much. I updated because I found that the previous build of Unity had broken Substances from the latest version of Substance Designer. I've not had a response from Allegorithmic on that, and Unity don't include it in the fix list, but updating seems to have them recognised again in Unity. Although older SBSAR files did work. Bit of a head banger.
     
  38. Pointcloud

    Pointcloud

    Joined:
    Nov 24, 2014
    Posts:
    37
    Hi this repo doesn't seem to be working with Unity 2017.2.0f3, any suggestions?
     
  39. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    The terrain converter has an issue with 2017.2 which I fixed last night but hasn't hit the asset store yet (feel free to send your invoice number if you want a patch earlier), but I know of no other incompatibility with 2017.2..
     
  40. Pointcloud

    Pointcloud

    Joined:
    Nov 24, 2014
    Posts:
    37
    Ok great thanks! Where should I email the invoice #? The same issue exists with MicroSplat and its Flow plugin
     
  41. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    You mean streams? Ok, I'll check that out to while I'm at it. What do you have to do to trigger it in MicroSplat? You can PM me, email, whatever works.
     
  42. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Hi Jason - apologies for pestering, but any chance of that patch that fixes the Convert problem please?
     
  43. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    sent..
     
  44. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Thanks very much. Installed and working again.
     
  45. gio_987654321

    gio_987654321

    Joined:
    Jan 25, 2017
    Posts:
    39
    Hello Mr Booth
    I m trying to solve a big problem since days
    SInce ive updated 1.1 to 1.56 i ve got a problem texture in the exe build mode. (appears in brown )

    in authoring mode all is ok ... : /

    Seems appears on each terrain ive made some additional painting with the 1.56 version on old texture v1.1.

    i hope to be clear ....

    ive tried to make a new material but same problem ..

    Help .. i ve tried to included all megasplat shader in preferences /graphics thats not solve anymore
    ...
    What is your preconisation ..?

    many thanks for your help
    GiO
     

    Attached Files:

  46. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    I haven't seen anything like this before- what version of Unity is it on? Can you send me a repro showing the issue?
     
  47. gio_987654321

    gio_987654321

    Joined:
    Jan 25, 2017
    Posts:
    39
    hello
    its on unity 2017.2

    the project is too bigi will trying to remake a new texture . i think it will be more fast to find why ..
    ive noticed a comment in the Terrain inspector
    in same time the mountain is like a "built standard" material mode ...
     

    Attached Files:

  48. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    Yeah, that comment doesn't matter. If you can isolate the case I'll be happy to take a look and see what is going on. I recently fixed a few bugs with 2017.2, but perhaps they have broken something else again.
     
  49. gio_987654321

    gio_987654321

    Joined:
    Jan 25, 2017
    Posts:
    39
    project is so huge .. i don't know if i can purge it ... i will trying ...

    i have reseted a mat terrain with another splat control .
    but its incredible .its same , and in this specific terrain ... its like the megasplat manager doesn't on ..

    i ve painted with terrain brush ... just for test before applying your shader . and i don't see the megasplat mat but just mat in the "built in standard" mode ...

    i don't know what i will to do..

    i will try to send you my scene ...hope
    thank you
     
  50. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    One thing to try is removing the MegaSplatManager, re-adding it, and re-hooking up the references to the control data. You can also see the complete list of what it stores in the Debug Inspector, as the editor doesn't show you everything. I have, on occasion, had one get stuck and not serialize the data after I saved it, so perhaps that is what is happening here.