Unity 3d exporter missing terrain

yes i can read that and use it

SWEET… I will get you all the rect coordinates for where each texture is in the atlas… asap :slight_smile:

please send me the color map

https://www.babylonjs-playground.com/#FBNKRF#25

https://www.babylonjs-playground.com/#FBNKRF#27

Yo @nasimiasl … These are the Terrain Atlas(s)

The Splatmaps is a 4K with 4 separate splatmaps (i only use the RGB)
Splatmap1.R = TerrainTexture1
Splatmap1.G = TerrainTexture2
Splatmap1.B = TerrainTexture3

Splatmap2.R = TerrainTexture4
Splatmap2.G = TerrainTexture5
Splatmap2.B = TerrainTexture6

Splatmap3.R = TerrainTexture7
Splatmap3.G = TerrainTexture8
Splatmap3.B = TerrainTexture9

Splatmap4.R = TerrainTexture10
Splatmap4.G = TerrainTexture11
Splatmap4.B = TerrainTexture12

Also is the Matching Normal Map Atlas…We need to also mix the normals for each splat :slight_smile:

Yo @nasimiasl

How the heck can you find the texture place in the atlas without knowing the rectangle of packing results from the Unity.PackTextures call ???

Thats VERY KOOL if you can, then i dont have to load up a bunch of vec4 uniforms for the shader for EACH texture placement within the atlas…

Is that what you are saying ???

send me a complete export let me check it

This is a complete export… https://www.babylontoolkit.com/files/TestTerrainAtlas.zip

  • The Splatmaps in an Atlas, Terrain Textures in an Atlas and the Terrain Normals in an Atlas.

The Splatmaps is a 4K with 4 separate splatmaps (i only use the RGB)
Splatmap1.R = TerrainTexture1
Splatmap1.G = TerrainTexture2
Splatmap1.B = TerrainTexture3

Splatmap2.R = TerrainTexture4
Splatmap2.G = TerrainTexture5
Splatmap2.B = TerrainTexture6

Splatmap3.R = TerrainTexture7
Splatmap3.G = TerrainTexture8
Splatmap3.B = TerrainTexture9

Splatmap4.R = TerrainTexture10
Splatmap4.G = TerrainTexture11
Splatmap4.B = TerrainTexture12

Also is the Matching Normal Map Atlas…We need to also mix the normals for each splat :slight_smile:

Yo @nasimiasl … so you don’t need to know the rect of where the texture is in the Atlas… how is that possible???

that is all texture indexes
when you find index you can calculate the rectangle

So does unity pack textures a certain way that allows this array to work…?

I just don’t understand how an array of this index values let you find a particular texture in the atlas… way over my head, but I would luv to understand how that works in case I ever need to do this in my own shaders

i need some more sample of unity export for make it finalize
and that need work on fps too

What kind of samples… Different terrain splatmaps with different number of layers ???

What kind of samples… Different terrain splatmaps with different number or same number

I will use the same set of tile images.
I will simply paint little circles or something and make a terrain with 2 layers, then another terrain with 3 layers… etc up to 12

Gonna take a sec… will upload images ASAP

Yo @nasimiasl

Here goes some simple examples that use 2 - 11 splats:

https://www.babylontoolkit.com/files/Terrains/Terrain2.zip
https://www.babylontoolkit.com/files/Terrains/Terrain3.zip
https://www.babylontoolkit.com/files/Terrains/Terrain4.zip
https://www.babylontoolkit.com/files/Terrains/Terrain5.zip
https://www.babylontoolkit.com/files/Terrains/Terrain6.zip
https://www.babylontoolkit.com/files/Terrains/Terrain7.zip
https://www.babylontoolkit.com/files/Terrains/Terrain8.zip
https://www.babylontoolkit.com/files/Terrains/Terrain9.zip
https://www.babylontoolkit.com/files/Terrains/Terrain10.zip
https://www.babylontoolkit.com/files/Terrains/Terrain11.zip

1 Like

Yo @nasimiasl

UPDATE

I been thinking about the mip map levels and Unity.

Unity has built-in support for Texture2D with full mip chain. So re-wrote the exporter to just use Unity Internal Mipmapping (save me from having to scale image with bilinear filtering to generate the mip levels… Unity handles that internally if using Texture2D with mip chain enable).

I can then PACK the whole mip map chain:

Example 4096K Atlas with 1024K Textures and Full Mipmap Chain (11 total levels):

https://www.babylontoolkit.com/files/Terrains/FullChainTerrain_4096.zip

Example 2048K Atlas with 512K Textures and Full Mipmap Chain (10 total levels):

https://www.babylontoolkit.com/files/Terrains/FullChainTerrain_2048.zip

This should take care for that SHARPNESS when view lod past the original 5 levels… Ought to look great with supporting the whole mip map chain in the Texture Atlas… I would think :slight_smile:

ALSO

Would it help if i made a LOOKUP texture and encoded things like:

1… The rect of each splat in the atlas (vec4)
2… The tile/scale and offset of the main texture splats (not the mipmaps)

Because i cant see how you can reliably get the texture from a Unity Packed Texture Atlas and it seems to me that you would need to the know the tile and offset values for each splat (they can be different) for proper tile wrapping

Hi.
Any news on next version of the exporter ?
Thanks.

I’m waiting on @nasimiasl help for the shader.

Ok. I hope it will be solved. I start to have fun with unity. :slight_smile: