Page 1 of 2

VirtualTextures - need help - BaseSplit1

Posted: 26.01.2004, 01:44
by Ptarmigan
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.

Posted: 26.01.2004, 10:54
by maxim
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

Posted: 26.01.2004, 13:51
by maxim
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

Posted: 26.01.2004, 15:21
by Ptarmigan
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

Posted: 26.01.2004, 16:02
by selden
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

Posted: 28.01.2004, 00:09
by Ptarmigan
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.

Posted: 28.01.2004, 00:49
by selden
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 `).

Posted: 28.01.2004, 02:00
by Ptarmigan
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.

Posted: 28.01.2004, 02:16
by selden
(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.

Posted: 28.01.2004, 03:35
by Ptarmigan
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:

Posted: 28.01.2004, 12:00
by selden
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.

Posted: 29.01.2004, 16:15
by Ptarmigan
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.

Posted: 29.01.2004, 16:57
by jestr
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

Posted: 30.01.2004, 13:42
by Ptarmigan
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.

Posted: 30.01.2004, 13:57
by jestr
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

Posted: 31.01.2004, 21:46
by selden
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

Posted: 01.02.2004, 04:03
by Ptarmigan
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

Posted: 01.02.2004, 20:28
by selden
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

Posted: 03.02.2004, 01:03
by Ptarmigan
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.

Posted: 03.02.2004, 08:15
by granthutchison
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