Custom terrain server questions

785 views
Skip to first unread message

felip...@googlemail.com

unread,
May 18, 2014, 7:34:09 PM5/18/14
to cesiu...@googlegroups.com
My previous experience with tiling comes from celestia, i made custom virtual textures for a few projects, creating a tree of levels, each (file) containing appropriately named raster tiles for height maps and color maps, the process was easy enough really.

I have created a very large set of custom data, a fictional planet that id like to make explorable in cesium, and I can export the data into tiles and rename them ofcourse. but im not too sure how i should name them and if i can keep the raster .png extension or it has to be converted?.

Under my logic a TMS format would be:

level 1:

-1.0 / 0.0
-----------
-1.1 / 0.-1

easy
now:

Level 3:

-0.3 , -1.3 , -2.3 , -3.3 / 0.3 , 1.3 , 2.3 , 3.3
-0.2 , -1.2 , -2.2 , -3.2 / 0.2 , 1.2 , 2.2 , 3.2
-0.1 , -1.1 , -2.1 , -3.1 / 0.1 , 1.1 , 2.1 , 3.1
-0.0 , -1.0 , -2.0 , -3.0 / 0.0 , 1.0 , 2.0 , 3.0
---------------------------------------------------------
-0.-3 , -1.-3 , -2.-3 , -3.-3 / 0.-3 , 1.-3 , 2.-3 , 3.-3
-0.-2 , -1.-2 , -2.-2 , -3.-2 / 0.-2 , 1.-2 , 2.-2 , 3.-2
-0.-1 , -1.-1 , -2.-1 , -3.-1 / 0.-1 , 1.-1 , 2.-1 , 3.-1
-0.-0 , -1.-0 , -2.-0 , -3.-0 / 0.-0 , 1.-0 , 2.-0 , 3.-0

is that right? if so fab

question 2 would be, do i need to have 1024 x 1024 tiles or can i use 1024 x 512 tiles too?

question 3, how are the levels formed, into file trees like this?

main
-level 1
-heightfield
-color
-level 2
-heightfield
-color
-level 2
-heightfield
-color

if not how?

question 4, i see there is a .terrain extension, what is that? cant i just use .png tiles? if not hoe do i convert the heighfield to . terrain?

sorry for the long post but im really exited about the possibility of displaying the world of our game in cesium (if you want you can show case it), and i would like to have this sorta understood as it will take me nearly 2 months to export all date to zoom level 12 (38 meters per pixel).

please help! i dont know why information of the tiling format is so scant and cryptic.

felip...@googlemail.com

unread,
May 19, 2014, 5:13:33 PM5/19/14
to cesiu...@googlegroups.com, felip...@googlemail.com
Bump. Please help.

Kevin Ring

unread,
May 19, 2014, 5:26:59 PM5/19/14
to cesiu...@googlegroups.com
Hi,

You can use TMS PNG files for imagery out of the box.  TileMapServiceImageryProvider reads tiles organized as described here.

Terrain is a little tougher.  CesiumTerrainProvider supports both heightmap and mesh-based terrain tile formats, described here (these are the .terrain files):

There are other terrain providers available as well.  Check out the Terrain tutorial.

We don't generally load terrain from PNG files because PNG only supports 8 bits per pixel component, which is insufficient for Earth terrains.  It's possible to encode heights across multiple components (ie, use all three channels, RGB) but that's awkward, doesn't really lead to images that compress very well, and is slower to work with in the web browser.

That said, if you already have a bunch of PNG terrain tiles that you're happy with, in a TMS-ish layout, it's probably pretty straightforward to write a custom TerrainProvider to read it.

We'd definitely be interested in adding your game to the showcase!

Kevin



--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

felip...@googlemail.com

unread,
May 19, 2014, 6:43:40 PM5/19/14
to cesiu...@googlegroups.com
Well I have the ability to export heighfield as .ter (used by terragen or leveller) which i gather is the same as .terrain from what I can find online, so i can easily rename the extensions, It is stated to be a 16Bit + export

here is the file structure:
http://www.planetside.co.uk/terragen/dev/tgterrain.html

Normally I use PNG as I am a visual person that prefers to see what im working with but I can deal with it.

And my projection is equirectangular (Sphere wrap) not Mercator (Hate to work with Mercator) so I hope that wont be an Issue, or will it?

regarding the terrain provider, I suppose I could "Hijack" an existing one by replacing the server links to my server, and Image wise I can name them as this (tx_0,0.ter or tx_0_0.ter or even 0,0.ter), if i can have access to a terrain provider file im sure I might be able to pop it into notepad++ and replace the links I need to replace.

Kevin Ring

unread,
May 19, 2014, 6:52:14 PM5/19/14
to cesiu...@googlegroups.com
Hello,

.ter doesn't look like the same format as Cesium's .terrain to me.  The content is similar, but the structure is different.

Equirectangular (we call it Geographic) is no problem.  Cesium downloads the tilemapresource.xml from a TMS server and uses it to determine the projection to use.

I'm not sure what you're referring to when you say "if I can have access to a terrain provider file."  Cesium itself is open source, if you're referring to source code:

If you're going to be working on a custom terrain provider, I recommend setting up your system according to the instructions in the Contributor's Guide:

Kevin


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Walklin

unread,
May 19, 2014, 7:15:35 PM5/19/14
to cesiu...@googlegroups.com, felip...@googlemail.com

Hi,

Sorry not to hijack the discussion, but which format (quantized-mesh vs heightmap) is generally more efficient in terms of storage space?

Thanks,

Ryan 

Kevin Ring

unread,
May 19, 2014, 7:20:16 PM5/19/14
to cesiu...@googlegroups.com
Hi Ryan,

It's hard to compare exactly, but they're both in the same ballpark going over the wire.  The mesh terrain takes less memory on the client, renders faster, and is better able to guarantee accurate rendering of the terrain.

Kevin


--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

felip...@googlemail.com

unread,
May 19, 2014, 7:33:17 PM5/19/14
to cesiu...@googlegroups.com
Thank you, I will in that case being exporting all my data (a 3 levels to test) and will try to set up a custom terrain provider as you mentioned, might be easier than I imagine from what I see, Maybe I will be able to disable the 2D and Columbus view (but can live with them). and of course try to customize the stars and moon (since we have textures for that) and possibly add a ring since our planet is ringed (I will do it using the polygon facility).

Will have to explore the source code since I dont know which specific file points to the data server.

felip...@googlemail.com

unread,
May 19, 2014, 7:35:15 PM5/19/14
to cesiu...@googlegroups.com, felip...@googlemail.com
Hope you don't mind if I pick your brains (Figuratively)in the future, and it would be awesome and cool if you did include our world as a showcase, it is complete fiction but highlight a slightly niche use for cesium.

Kevin Ring

unread,
May 19, 2014, 7:39:49 PM5/19/14
to cesiu...@googlegroups.com
The URL of the server is specified as a parameter to the constructor of the terrain provider, so you don't need to change code just to point to a different server.  But the source for CesiumTerrainProvider is here:

Other terrain providers are in the same directory.

When you have something you'd like to show, send us a writeup and some pictures, videos, or a link to a working demo and we'll add it to the showcase page.

Kevin


On Mon, May 19, 2014 at 7:35 PM, <felip...@googlemail.com> wrote:
Hope you don't mind if I pick your brains (Figuratively)in the future, and it would be awesome and cool if you did include our world as a showcase, it is complete fiction but highlight a slightly niche use for cesium.
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Walklin

unread,
May 19, 2014, 8:01:52 PM5/19/14
to cesiu...@googlegroups.com
Good to know, thanks. Are there any tools available to generate tiles from source elevation data in quantized-mesh format?

Kevin Ring

unread,
May 19, 2014, 8:06:12 PM5/19/14
to cesiu...@googlegroups.com

Ryan Walklin

unread,
May 19, 2014, 8:13:07 PM5/19/14
to cesiu...@googlegroups.com
Great, thanks.

Ryan Walklin

unread,
May 19, 2014, 6:45:44 PM5/19/14
to cesiu...@googlegroups.com

Hi,

Sorry not to hijack the discussion, but which format (quantized-mesh vs heightmap) is generally more efficient in terms of storage space?

Thanks,

Ryan

 

Reply all
Reply to author
Forward
0 new messages