VirtualTextures - need help - BaseSplit1

Tips for creating and manipulating planet textures for Celestia.
Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

VirtualTextures - need help - BaseSplit1

Post #1by Ptarmigan » 26.01.2004, 01:44

I have been learning about virtual textures (new to me since I upgraded from 1.2.5 to 1.3.1) and thanks to Seldon's most excellent description at
http://www.lepp.cornell.edu/~seb/celest ... s.html#2.5
I have got a BaseSplit 0 partially populated Earth working.

But I am having troubles with a base 1 set.
If I populate level 0 with eight different tiles only two get used on the planet (Earth) sphere.
All the 8 tile positions get "painted" with 4 copies of tx_0_0.jpg and 4 copies of tx_1_0.jpg.
All the 8 real .jpg's need to be present in the level0 folder but six of them dont get "painted" onto the sphere.
(if they are not present then the corresponding position does not recieve its copy of either tx_0_0.jpg or tx_1_0.jpg)
A bit difficult to describe without getting too long-winded !

My system =
P3/1GHz/128MBram,WinME, Celestia 1.3.1, Nvidia GeForce2 GTS,
Celestia reports OpenGL driver thus :
Vendor: NVIDIA Corporation
Renderer: GeForce2 GTS/AGP/SSE
Version: 1.2.1
Max simultaneous textures: 2
Max texture size: 2048

My .ctx =
VirtualTexture
{
ImageDirectory "vt"
BaseSplit 1 # previously 0
TileSize 128
TileType "jpg"
}

and my folder/files =

Code: Select all

vt
 +level0
    tx_0_0.jpg, tx_0_1.jpg, tx_1_0.jpg, tx_1_1.jpg, tx_2_0.jpg, tx_2_1.jpg, tx_3_0.jpg, tx_3_1.jpg

 +level1
          tx_0_0.jpg, tx_0_1.jpg, tx_1_0.jpg, tx_1_1.jpg, tx_1_1.jpg, tx_2_1.jpg (only partially populated)


can anyone spot where I am going wrong?
thanks,
Malcolm.

maxim
Posts: 1036
Joined: 13.11.2003
With us: 21 years
Location: N?rnberg, Germany

Post #2by maxim » 26.01.2004, 10:54

level0 starts with 2 tiles (eastern hemisphere, western hemisphere)
level1 has 8 tiles ( 4x2 ).
level2 has 32 tiles ( 4x8 ).
level3 has 128 tiles ( 4x32 ).
...

I've never seen it working otherwise. Possibly the only configuration Celestia knows.

maxim

maxim
Posts: 1036
Joined: 13.11.2003
With us: 21 years
Location: N?rnberg, Germany

Post #3by maxim » 26.01.2004, 13:51

A Guess:

BaseSplit may tell Celestia which ist the first data level for this VT.
BaseSplit = 1 then means that the VT starts with level1, so you would have to omit level0 to make it work.

Celestia usually needs all lower levels to be present while accessing to a higher details level.

maxim

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #4by Ptarmigan » 26.01.2004, 15:21

Hi Maxim, thanks for your thoughts, I will go and have a play with your "guess" and see what I can make it do !

Before I returned and saw your second post I had been away preparing a reply to your first post :-) about the tile numbers,
what you list is correct for a BaseSplit 0 set, however,
on Seldens site he says " BaseSplit determines the number of tiles in the lowest level of detail (2^(BaseSplit + 1) tiles wide, 2^BaseSplit tiles high. A BaseSplit of 0 requires 2 tiles in the first directory level.) "

So from that I think the lowest level in a BaseSplit 1 should have 8 tiles ( two rows of four)
and I had made that lowest level "level0"
I have made a webpage with some pictures to show what I am getting as a result
http://uk.geocities.com/ptarmigana/celestia/index.htm
they say a picture is worth a thousand words !! :D

Now I will go and renumber my level folders as per your guess and see what happens,
thanks,
Malcolm

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

Post #5by selden » 26.01.2004, 16:02

A lot of the description of the virtual texture was taken from the initial posting that Chris made here on the forum. See http://63.224.48.65/forum/viewtopic.php?t=3041
Selden

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #6by Ptarmigan » 28.01.2004, 00:09

Maxim,
I tried your guess, but it did not fix the problem :-( !
It does require a level 0 folder, alsorts of other queer things happen if it isnt present.

Selden,
thanks for the link, I had read that thread some time ago but then lost it.
In that thread they talk about BaseSplit 0, which works OK for me, I cannot find anyone who has used BaseSplit 1

I am finding further problems, for example at larger range from earth if the moon is in view anywhere in a window the moon texture gets painted on the earth where a tile (or tiles) is missing.
Perhaps I should bundle my thing into a zip and offer it up for trial by someone ? Because I am beginning to think that there may be a bug in the way Celestia is handling the file names for the tiles in base 1.

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

Post #7by selden » 28.01.2004, 00:49

Malcom,

This substitution of textures suggests to me that Celestia isn't finding the textures that it's actually looking for. Of course, it may be looking for the wrong textures in the wrong place.

Have you tried turning on the "console log" to see if it says anything relevant?
Type a ~ (shift `).
Selden

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #8by Ptarmigan » 28.01.2004, 02:00

selden wrote:"console log" to see if it says anything relevant?
Type a ~ (shift `).
Thanks for that, looks most useful, new to me,
is there a way for me to direct its output to a specified (text) file ?
{ Later edit - ah! just discovered the up/down arrows, that's better,, but would still like it in a file to be able to cut&paste ?? }
A first quick look does not show errors in the loading of earth textures, but there are a lot being loaded so I'll count them up one by one for 'sequence' in a minute or two.
(there are errors/something wrong with initial loading of OGLE-something in extrasolar.ssc, will attend to that later !)

Some more thougts :--
selden wrote:This substitution of textures suggests to me that Celestia isn't finding the textures that it's actually looking for. Of course, it may be looking for the wrong textures in the wrong place.
Yes, something like that, I agree.
The effect that I am getting :-
at level 1 for example,
is that the presence of a tx_file is acting like a switch. If it is present in the folder then it 'enables' the display of a texture**, if it is not present then the lower level texture is shown.
**The texture which is displayed is one of only 8 out of the 32, the remaining 24 dont get displayed anywhere but need to be present in the folder.

For example tx_0_0 is displayed correctly at tile position 0_0 but also incorrectly at positions 1_0, 0_1 and 1_1 However the latter 3 are only shown if their respective tx_files are in the folder (and those get displayed at other locations, just to compound the issue !! ).
Another example : tile position 7_3 (botom right corner of level 1) receives the texture tx_3_1 even though tile position 3_1 is being painted with tx_1_0
It is all horribly confusing but there is a pattern to it when I scribble it on a bit of paper !

Hang-on, I'll go offline and see if I can type that more intelligibly later, maybe even scan in a scribbled diagram ,,,,

Malcolm.

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

Post #9by selden » 28.01.2004, 02:16

(there are errors/something wrong with initial loading of OGLE-something in extrasolar.ssc, will attend to that later !)

That's due to the list of extrasolar planets. See http://www.lns.cornell.edu/~seb/celestia/hutchison/missing-stars.html for the details and STC files that eliminate the message.
Selden

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #10by Ptarmigan » 28.01.2004, 03:35

selden wrote:See http://www.lns.cornell.edu/~seb/celestia/hutchison/missing-stars.html for the details and STC files that eliminate the message.
Thanks
Ptarmigan wrote:
selden wrote:"console log" to see if it says anything relevant?
Type a ~ (shift `).
is there a way for me to direct its output to a specified (text) file ?

No possibility ?

----->
It is now 3:45am local, so forgive the quality of this sketch of my BaseSplit 1 Level 1 map,
I tried to attach it as an image, but it didnt work, maybe Yahoo/Geocities dont allow image linking ? anyways, here is a quickly constructed page containing the image, can anyone see alogical flaw in what I or Celestia is doing ?
http://uk.geocities.com/ptarmigana/celestia/page2.htm
the coloured arrows show where the image tx_ comes from , and is painted to.
All tx_*_* files are populated.
Have I fouled up my number sequence ( I followed similar practice to my working BaseSplit 0 setup ) ?
{edit a few minutes later => there does seem to be a perverse logic to the way the tiles are being painted.
The 8 grey tiles are the "masters", the white tiles(textures) are the ones that do not get used. }

Malcolm,
I need a drink !! :lol:

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

Post #11by selden » 28.01.2004, 12:00

Malcom,

using the cli, you can type the command

Code: Select all

celestia --verbose >logfile.txt

(replacing "logfile.txt" by any appropriate name)

Unfortunately, many of the newer status messages aren't written to that file. :( I think this needs to be considered another bug.

I suspect that the tile problems you're having really are due to one or more bugs in the implementation of virtual textures.

Maybe if you were to explain why you want to use a basesplit other than 0, that might help inspire one of the developers to figure out what's wrong, either with the code or with how you're trying to use it.
Selden

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #12by Ptarmigan » 29.01.2004, 16:15

selden wrote:if you were to explain why you want to use a basesplit other than 0, that might help inspire one of the developers to figure out what's wrong
Good idea!
I have some aerial photos of stoneage/ironage/archaeology sites that I want to 'inlay' in high detail into the surrounding much lower res tiles. However, level 10 (or 11, which I cant use, but that is another story) are too big if I enlarge them to match the resolution of my photos, and if I then reduce the composite image (with inserted photo) back down to 2048 I lose my detail.

So I thought that the BaseSplit 1 might give me a route to extra-small tiles which I could then surround with the much lower level, much lower res. tiles which would contain signposts to the sites,,, iyswim.

Anyway, thanks for all your thoughts and time,
much appreciated,
Malcolm.

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #13by jestr » 29.01.2004, 16:57

I havent been able to get VT's to work with anything other than base split 0 either.Have you tried making level 10 tiles 4096x4096.If your graphics card is up to it it should load even if the tile size in ctx file is smaller.This might give you equivalent of level 11.Just a thought Jestr

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #14by Ptarmigan » 30.01.2004, 13:42

jestr wrote:I havent been able to get VT's to work with anything other than base split 0 either.
Thanks for the info. Jestr, that is what I needed to know, at least I am not going mad alone ! :-)
jestr wrote:Have you tried making level 10 tiles 4096x4096.If your graphics card is up to
No, my card can only go up to 2048x2048 :-( , and I'm rapidly running out of disk space !
I would need a tile something like 6500x6500 to match the res. of my pictures at level10 (but only a very small part of that tile actually needs to be at that res.)
So I'll have to wait for one of the clever programing chaps to spot where the file handling counters for base1 are going wrong. ( I used to be able to program in C but that was a long time ago and I havn't got a clue about all this CVS and Windows m'larkystuff ! )

Malcolm.

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #15by jestr » 30.01.2004, 13:57

If you remade your whole texture (or just levels 6+ say) with 2048 tiles wouldnt this mean you had to use less levels freeing up the higher levels to go to higher level of detail (worth a try).Jestr

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

Post #16by selden » 31.01.2004, 21:46

Malcom,

Another method to consider for providing a high resolution surface texture for just those areas you're interested in is to position a flat object at the correct location. You can use a map and aerial photograph as the object's AltSurface textures, for example.

This has the advantage that you can make the size, resolution and position of the object exactly right for whatever maps you have and you don't have to be constrained by the positions and boundaries of the VT tiles.

Are you aware of Jestr's model of Stonehenge? He discussed it at
http://63.224.48.65/forum/viewtopic.php?p=27399&highlight=#27399
Selden

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #17by Ptarmigan » 01.02.2004, 04:03

selden wrote:position a flat object at the correct location. You can use a map and aerial photograph as the object's AltSurface textures, for example.
Interesting, thanks Selden,
I had been playing with a test model of Silbury Hill (near Avebury and Stanton Drew between me and Stonehenge) as a thin disk representing a field and a cone representing the hill.
I got really tangled up with 'Orientation' and went off to try to learn spherical coordinates, so I didn't carry on with my lateral thinking to extend my disk into a wider area coverage such as you suggest to replace my missing tile thingy!
I have had a quick little play with your suggestion but I have failed miseably to apply AltSurfaces to my -Class spacecraft- model sitting on the earth surface. I changed it to a Class planet to no avail either, so then I hashed out my 3ds mesh and the resulting planet was then able to take normal and alt surfaces.
Ah ha I thought, a quick bit of Oblateness 0.9 say, and I'll buy Selden a virtual drink !! except that (A) my rectilinear map was horridly distorted and I may need to study Mercator and things and (B) the pole distortion was right square on in the middle of my circular field as viewed from above !

Argh, it's 4am local and I'm getting short on my beautysleep (Celestia has a lot to answer for :-) )

I tried the Jestr thread links, the (geocities)web link was unavailable/overbandwidth and the FTP kept dumping me
Jestr I'll try again later / else I'll give you a PM

Malcolm

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

Post #18by selden » 01.02.2004, 20:28

Malcom,

I quick threw together a "map-plane" addon. It includes the Anim8or model that I used as its basis, so you can see the alignment necessary for it to work with Grant's "panorama" spreadsheet. (I used Emacs to change the file name within the 3ds model so it'd accept any surface texture. As a result, the 3DS model itself can't be read by any 3D modelling softwre.)

See http://63.224.48.65/forum/viewtopic.php?p=30770#30770
Selden

Topic author
Ptarmigan
Posts: 127
Joined: 02.01.2004
With us: 20 years 10 months

Post #19by Ptarmigan » 03.02.2004, 01:03

Selden,
Very many thanks for your map-plane addon, with it as an example of how things should work I was able to fix my altsurface problem with my model. Apart from a couple of typos the main prob. was that the texture that I had included with the 3ds model was overriding the "Texture" and "AltSurface" defs that I was putting in the ssc. Once I got rid of the included texture then all was fine.

Also, I think I can see where we are going on the orientation front now.
Previously I had been trying to work out a unit vector normal to the model plane coords in its new location and to project it into the reference planes (horrid ! we will gloss over that experience !!),,, so I like your method better :-)
(sadly my MS Works spreadsheet wont import Grant's Exel spreadsheet)

{Edit slightly later, -- I wonder if we could persuade Grant to demonstrate his equations ? }

Malcolm.

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Post #20by granthutchison » 03.02.2004, 08:15

Here's an annotated definition for one of Selden's panorama cubes.

Code: Select all

#To place a picture cube on Earth at 16.5S, 151.75W and keep it there

#Desired radius = radius of Earth + desired altitude
#in this case, 6378.142 (Earth radius +2m)

"CubeCentre" "Sol/Earth"           # A dummy body to provide a suitable orbit centre
{
    Class "invisible"

    EllipticalOrbit {
        Period        1e12          # Effectively stationary
        SemiMajorAxis -1811.490199  # Desired radius * sin(Latitude)
        AscendingNode   280.5       # Earth's RotationOffset
        Inclination      90         # Polar orbit
        MeanAnomaly      90         # Fixed on Earth's rotation axis
    }
}
   


"Cube" "Sol/Earth/CubeCentre"
{
    Mesh    "4x2-spacedcube-ssc.3ds"
    Texture "4x2-cube.png"      # Desired texture
    Radius   0.002              # 2m

    EllipticalOrbit {
        Period             0.997269558  # Earth's rotation period (in days)
        SemiMajorAxis   6115.488422     # Desired radius * cos(Latitude)

                                        # Earth's RotationOffset =  +280.5
        MeanLongitude    128.75         # Subtract west longitude = -151.75
                                        #                            ======
                                        #                            128.75
    }

                                 
    Orientation [ 106.5 0 0 1 ] # Orientate model for latitude (z rotation = 90-latitude)

                                # Orientate model in Y axis =     +180 (this figure always the same)
                                # Earth's RotationOffset    =     +280.5
    RotationOffset 308.75       # Subtract west longitude   =     -151.75
                                #                                  ======
                                #                                  308.75

    Emissive true
}

"iCube" "Sol/Earth/CubeCentre" # Viewpoint in centre of cube
{
    #Class "invisible"
    Mesh "empty.3ds"   
    Radius 1e-12   

    EllipticalOrbit {
        Period             0.997269558  # Earth's rotation period (in days)
        SemiMajorAxis   6115.488422     # Desired radius * cos(Latitude)

                                        # Earth's RotationOffset =  +280.5
        MeanLongitude    128.75         # Subtract west longitude = -151.75
                                        #                            ======
                                        #                            128.75
    }
}

Any help?

Grant


Return to “Textures”