Unity 3d exporter missing terrain

Yo @nasimiasl … Any word on that texture atlas shader code ???

hi sorry i don’t find a chance to continue this yet

@MackeyK24, does terrain problem affect the generation of navigation mesh ? I tried to create a nav mesh but it isn’t exported. Can you help me ?

Can send me scene with nav mesh setup.

Are you sure your baking the nav mesh ???

Yes, i baked it. I don’t know if i’m doing something wrong, but i don’t see the generated nav mesh in the assets folder. I see the blue navigation layer on the terrain in unity editor but no file is generated when baked. Am i missing something ?

Edit. Maybe i found the problem. I let you know if i solve.

Its bakes the nav mesh as geometry in the the scene… I think is called NavigationMesh

By defaults it is invisible but you can use the inspector to show it.

The whole point is to bake that nav mesh in Unity… It gets exported in the scene like any other cube or whatever… you can use scene.getMeshByName(“NavigationMesh”)

then use youe babylon.navmesh API to build your nav mesh nodes again the actual NavigationMesh then you can plot shit out using the navmesh API :slight_smile:

I installed a package called microsplat and the navmesh.unity file is placed there, maybe that’s the problem.
Currently i’m using the unity exporter to export only some things like heightmap and navmesh. Than i create the babylon scene manually.
How does the exporter create the navmesh ? Does it create a .babylon file ?

yes… it create a .babylon scene file. with the mesh data inside as a native BABYLON.Mesh

1 Like

Ok, i understood. I thought it was exported as a separate .babylon file. Thanks.

Tried to export a simple scene and import it in the babylon sandbox. I get the error o.h.Instantiate(…) is null.

Dunno… Send me your scene…

BYW… The sandbox does not support any metadata type functionality … but it should at least render the raw geometry…

Anyways… package up and send me a .unitypackage of your scene and i take a look at it :slight_smile:

I sent you a PM. :slight_smile:

Yo @manrix … I looked at the project in Classic Edition… I just see a large terrain and no navmesh setup… I dont know what MicroSplat is… I just export the internal unity nav mesh triangles… If this microsplat somehow effects the internal Unity nav mesh triangles before i export them… Kool.

The terrains in the Classic Edition are SCREWED … There has been a long going post about the texture amount and texture atlas and edge seams… But NO ONE ELSE in the whole community can or will go into Toolkit code and try and fix some things that i obviously cant get right. Like:

01… Terrain Splatmap Shader With Texture Atlas — AND NO EDGE SEAMS

02 … Skeletal Initial Bone Matrix Inverse Bind Poses — TAKING INTO ACCOUNT THE TRANSFORM Absolute Position

03… Some POLOR Space Coord Interpolation Game Math I need for Animation Blending Weights — BEEN BEGGING FOR THIS OVER A YEAR

and a couple other minor issues… But those are the main hold ups the Babylon Toolkit - Unity Exporter

BTW… I been trying to work on a Pro Terrain SDK that manages terrain and collision segments…

That terrain exceeds Unity 65,000 triangles and must be segmented (Unless you make the mesh yourself in code using the exported heightmap and layer textures)

I can only use the base texture right now because of texture atlas and edge seams… But this is what your seen looks like so far in my new Pro Toolkit:

And the Green Overlay is your NavigationMesh that you have setup directly on the terrain

Yo @manrix … The terrain based nav mesh looking good so far :slight_smile:

As far as raw terrain segments and mesh geometry running such a LARGE terrain for WebGL…

And rocking 60 FPS :slight_smile:

Got the the Unity Skybox vs Babylon Skybox Infinite Distance Magic Padding Number Worked out so you get the true Unity Lighting and Perspective Viewing but in a web friendly gltf scene file with unity metadata that the new Babylon Scene Manager will parse on load automatically:

Looking better and better… Just need to get the texture atlas shader with no edge seams going:

Unity Shot:

Babylon Shot (With just the base texture wrapped over entire terrain… for now):

Looks pretty close for one being a million dollar game engine and the other being the the Awesome Babylon WebGL Game Engine

You gotta luv it :slight_smile:

1 Like

Hey.
Really nice. :slight_smile:
Can’t wait to try the new exporter.
I’m using that big image as a placeholder to rebuild the map.
At end what i need is heightmap, splatmaps of textures and navmesh. For texturing the terrain i’m going to use the code here PBR texture splatting (up to 64 textures). The problem is the current version of exporter generates splatmap for only first 6 textures. I also had to remove the black color to make it work with that code.
I think at this point is the only way. I don’t see other solutions. It’s a bit sad because texturing a scene is one of most important things in a game.
Thanks for your nice work Mackey. :wink:

I am updating the classic edition… Depreciating the attemt at exporting terrain meshes and materials…

Just export the Layer Textures, Layer Normals, Splatmap Texture Atlas (up to 4 splatmap textures per atlas) and the terrain heightmap image…

Add up support for up to 12 Separate Layer Textures and Normals (Not in Texture Atlas)

If you get a splat map texture going… Please show me the EXACT SHADER CODE you used to get it to work…

What would you prefer for classic exporter to dump…

1… Each separate Layer Texture Image (up to 12)

or

2… A Terrain Image Layrer Atlas with up to images encoded in texture atlas (also a Normals Atlas)

Let me know if you can get texture Atlas working and i will make the classic edition pack the 12 separate layer textures into an atlas :slight_smile:

I’m using the code from the playground i linked you.
Shader code is quite difficult, i can’t help you much. I think you already know more than me. Choose you the best way to do it. :slight_smile:

That looks really good… I think i can see a tiny bit of edge seams… but is by far the best four tap implementation i have seen so far.

Who wrote that originally… ?

Do you understand everything going on in that shader… ?

I tried something like this before, but could never get it to work… ?

My initial issue i guess is what they are calling positions and scale… I use Unity PackTexture features… so i end up with RECT from 0 to 1 that specify each texture in the whole atlas…

I need to figure out how to convert that example to more of a Unity Prepared content…

Can you work with me on this… Not just making that PBRCustomMaterial (Which is great too, that why i created that class… But i wanna go DEEPER into the native unity workflow to use that shader)

If you work with me… over gotomeeting or something like that… So we can work on together… I will send you my new Pro Toolkit (not ready for public redist yet) and we can work on terrains together… but in the context of the New GLTF based Babylon Toolkit …

PM me and let me know if that is something would like to work on with me :slight_smile:

And btw… the classic edition you are currently using… I take it you want the Texture Atlas and not individual texture layer images ???