New Feature: Virtual Textures

General discussion about Celestia that doesn't fit into other forums.
Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

New Feature: Virtual Textures

Post #1by chris » 05.08.2003, 17:23

As of 1.3.1pre9, Celestia supports a feature I've been calling virtual textures. This message is a plea for you texture artists to test this feature out . . .

Virtual textures consist of multiple levels of detail, each one four times
the size of the previous (twice the width, twice the height.) Every level
of detail is composed of 2n x n texture tiles, where n must be a power of
two. Celestia chooses the level of detail to use based on the size in
pixels of the object to be textured. The levels of detail do not need to
be fully populated; if a tile at the requested level of detail is not
available, Celestia will fall back to a lower level of detail that is
available. This allows you map planets with very high resolution at
particular locations without forcing you to map the entire planet at such
a resolution. In fact, since 1km/pixel maps of planets are cumbersome to
distribute online, I expect these detail tiles will be the main
application of virtual textures.

A virtual texture is identified by the extension .ctx. A ctx
file is actually just a text file in the familiar ssc-like format. There are
several fields describing the layout of the texture tiles. Here's my test
example:

Code: Select all

VirtualTexture
{
        ImageDirectory "tiles"
        BaseSplit 0
        TileSize 256
        TileType "jpg"
}


The image directory gives the location of the individual texture files.
BaseSplit determines the number of tiles in the lowest level of detail
(2^(baseSplit + 1) tiles wide, 2^baseSplit tiles high.) TileSize gives
the number of pixels in each dimension of the texture tiles. This value
is used to figure out what level of detail to use. It is not enforced,
and it could be very useful to have a higher resolution tile at the
highest LOD (though it's not recommended elsewhere.)

Code: Select all

foo/
    foo.ssc
    textures/
        medres/
            foo.jpg
        hires/
            foo.ctx
            tiles/
                level0/
                    tx_0_0.dds
                    tx_1_0.dds
                level1/
                    tx_0_0.dds
                    tx_1_0.dds
                    tx_2_0.dds
                    tx_3_0.dds
                    tx_0_1.dds
                    tx_1_1.dds
                    tx_2_1.dds
                    tx_3_1.dds
                level8/
                    tx_300_59.dds


In the above example, the planet is fully mapped at resolution levels 0 and 1, and there's one high detail tile at level 8. A few quick calculations . . . The base split here is 0. Let's assume that the tiles are 256x256. That means that the effective resolution at level 8 is 256*2*2^8 x 256*2^8, or 128k x 64k. For Earth, that's approximately 300m/texel. The general formula for the effective height of a virtual texture level is:

TileSize*2^(Level + BaseSplit)

The width is always double the height. I suppose that I should really make some sort of JavaScript calculator to compute sizes and the latitude and longitude ranges of tiles. :)

The main problem that I've had with creating virtual textures is finding high resolution data. I've got the 32k Earth texture split up into tiles, but I've been unable to find any higher resolution data. If anyone has some good links, please share them. Or better yet, go ahead and use it to create a virtual texture.

--Chris

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 05.08.2003, 20:10

Chris wrote:I've got the 32k Earth texture split up into tiles, but I've been unable to find any higher resolution data.


Maybe you're looking in the wrong places. Wouldn't those high resolution images be called "aerial photography" ? :)

Supposedly TerraServer has about 3.3TB of USGS aerial maps. The U.S. is about 10^7 square kilometers. The surface area of the whole Earth is about 5x10^8 square km. That means it'd take about 150TB of surface texture images to do the whole planet at high resolution.

I wonder how long it'll be before Mars is mapped to that resolution? :)
Selden

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years 2 months
Location: Pordenone/Italy

Post #3by Paolo » 05.08.2003, 20:16

This new feature sounds very good. :D
It is very interesting also because will give the basic for the implementation of high resolution 3D landscape mapping.
But I think that soon Celestia will need a CD distribution.
Bye - Paolo
Remember: Time always flows, it is the most precious thing that we have.
My Celestia - Celui

-Shadow-
Posts: 156
Joined: 18.04.2003
With us: 21 years 7 months
Location: Warbird D'Kara - Recreational area

Post #4by -Shadow- » 05.08.2003, 20:32

8O

Eye Circumference: 1.5 cm
Layer 2: 6 cm
Layer 3: 24 cm
Layer 4: 96 cm
Layer 5: 384cm
Layer 6: 1536cm

Now you know how wide my eye's just opened after reading that!
Keep it going and you'll lose some users, I'm on 56k! lol
Though I'm getting high speed again soon. Oh how this reminds me of Factorial :roll: Very interesting feature chris :wink:
A few more years of development and we'll be leaving TeraBytes behind,
I wonder what they'll think of next? TetraBytes? lol

- Shadow
Image

"Certain it is and sure: love burns, ale burns, fire burns, politics burns, but cold were life without them." - Romulan proverb

JackHiggins
Posts: 1034
Joined: 16.12.2002
With us: 21 years 11 months
Location: People's Republic Of Cork, Ireland

Post #5by JackHiggins » 05.08.2003, 21:10

When can we try this out?!!

What pre version will this be in, or will it be in the final version?
- Jack Higgins
Jack's Celestia Add-ons
And visit my Celestia Gallery too!

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Post #6by chris » 05.08.2003, 21:17


Mikeydude750
Posts: 169
Joined: 31.01.2002
With us: 22 years 9 months
Location: Wisconsin

Post #7by Mikeydude750 » 06.08.2003, 01:15

Is that the whole program, or just the .exe file?

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Post #8by chris » 06.08.2003, 01:15

It's the entire program . . . A number of data files have changed, so I didn't bother making an EXE-only release for pre9.

--Chris

Mikeydude750
Posts: 169
Joined: 31.01.2002
With us: 22 years 9 months
Location: Wisconsin

Post #9by Mikeydude750 » 06.08.2003, 01:28

Darn...I was hoping it would be an EXE only because I don't want to have to change all my settings every new release.

Oh well...

Don. Edwards
Posts: 1510
Joined: 07.09.2002
Age: 59
With us: 22 years 2 months
Location: Albany, Oregon

Post #10by Don. Edwards » 06.08.2003, 03:53

Selden is right. I found some very good data.
Look here is my apartment complex.
Image

It is in the upper right corner.

Don.
I am officially a retired member.
I might answer a PM or a post if its relevant to something.

Ah, never say never!!
Past texture releases, Hmm let me think about it

Thanks for your understanding.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #11by selden » 06.08.2003, 12:58

Another source of high resolution images of the US is the landsat server at http://mapus.jpl.nasa.gov/

http://viewer.digitalearth.gov/ doesn't seem to be able to generate extremely high resolution images, unfortunately.
Selden

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Re: New Feature: Virtual Textures

Post #12by don » 06.08.2003, 15:49

chris wrote:As of 1.3.1pre9, Celestia supports a feature I've been calling virtual textures.

Congratulations Chris! Great new feature! Should make for some very interesting add-ons, like country, state, and county boundary line maps, highway maps, city maps, low-altitude textures / aerial photos, and all kinds of fun stuff <smile>!

I'm sure the texture guru's know where to look for free and royalty free hires images.
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

HankR

Post #13by HankR » 06.08.2003, 21:57

It might be more convenient if the .ctx file was itself a directory, so that only one file would have to be moved to download or install the texture. The configuration information could be in a text file inside the directory. Or possibly the configuration file could be eliminated altogether. This would be possible if the ImageDirectory were required to be named "tiles", BaseSplit were forced to 0 (but level directories could be omitted), TileSize were ignored (or determined by the actual size of a tile image), and TileType were determined by the tile filename extensions.

- Hank

Guest

Post #14by Guest » 07.08.2003, 07:54

I had a try of it using some dummy textures with patterns and the filenames on them. (ill put up some screenshots when i get home next)

I can get plenty of sattelite photos and i know the Lat/Long of the four corners of each image. Knowing this information it should be easy to mark the the four corners on the tile(s), and then paste and scale image in.
I even have color ariel photos of my home town and house, that would be cool...

Is there a way to quickly chop up a big texture so we can use it as the background of a detail tile?

What is the maximum resolution of the tiles?

The dummy textures worked well except for this possible bug.
Just before level 8 appears the entire planet (i used io) dissapears. It re-appears when I get a little closer.

I tested level 0,1,6 and 8 using 256x256 png images.

Code: Select all

Vendor: Intel
Renderer: Intel Brookdale-G
Version: 1.3.0 - Build 4.13.01.3442
Max simultaneous textures: 4
Max texture size: 2048

Supported Extensions:
GL_ARB_multitexture
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_env_crossbar
GL_ARB_transpose_matrix
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_clip_volume_hint
GL_EXT_compiled_vertex_array
GL_EXT_cull_vertex
GL_EXT_fog_coord
GL_EXT_packed_pixels
GL_EXT_packed_pixels_12
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_stencil_wrap
GL_EXT_texture_compression_s3tc
GL_EXT_texture_env_add
GL_EXT_texture_env_combine
GL_EXT_texture_filter_anisotropic
GL_3DFX_texture_compression_FXT1
GL_IBM_texture_mirrored_repeat
GL_NV_texgen_reflection
GL_WIN_swap_hint

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #15by marc » 07.08.2003, 07:59

Oops, that was me.

Can we go higher than level 8?

here are the screenshots.

Image
Image
Image
Image
Image

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Post #16by chris » 07.08.2003, 15:09

Thanks for trying this out Marc!
Right now, you can go up to level 9 . . . That's an arbitrary limit, and it's just a matter of changing one constant to change it. I'm not sure what's causing the planet to disappear--the highest I've gone to is level 5 (albeit with 1024x1024 tiles.) I'll test out some higher levels of detail . . .

--Chris

Thierry_d

Post #17by Thierry_d » 07.08.2003, 19:50

This is a really good idea!!!
Thx Chris :wink:

DBrady
Posts: 66
Joined: 14.07.2003
With us: 21 years 4 months
Location: Sydney

Post #18by DBrady » 07.08.2003, 23:22

Hi chris,
What kind of frame rates do you get on a 32k texture. Can you zoom in smoothly all the way?
Is this feature only for surface textures or will it work with normal maps also? How about spec maps, cloud maps etc?
Slan

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Post #19by chris » 08.08.2003, 00:35

I haven't tested with a full 32k tile set yet, because I haven't had the time to write a tool that breaks large textures into tiles. With just a small set of high-detail tiles, the frame rate is the same as with a 1k texture. But that's not much of a surprise . . .

You can zoom in smoothly all the way, though the transition between texture levels of detail can be noticeable. The abruptness of the transition can be mitigated somewhat by biasing the texture level of detail--specifying a tile size that's one power of two lower than the actual tile size. However, this results in more texture tiles getting loaded.

--Chris

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #20by marc » 08.08.2003, 01:12

Chris.

This might be a long shot, is there any way to fade the textures in/out rather than just turning them on/off?


Return to “Celestia Users”