Preloading Textures in start.cel

All about writing scripts for Celestia in Lua and the .cel system
Topic author
haukew
Posts: 2
Joined: 20.02.2006
With us: 18 years 9 months
Location: Hamburg, Germany

Preloading Textures in start.cel

Post #1by haukew » 20.02.2006, 18:24

Hello!
I am using the 64k-Surface-Map of the Earth posted by FightSpit as my default-texture for the Earth. In my start.cel is defined, that the camera shall fly directly to the Earth, which causes lags - obviously because the texture is so big.
How can i preload a virtual texture in a .cel-script? i tried using the absolute path , the path from the celestia-directory and i tried just to give the name of the 2 main png's. Nothing worked, the lag is still there.

Thanks in advance, Hauke

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #2by Fightspit » 20.02.2006, 20:00

I am not an expert of script but I repeat again this addon need a fast computer because of big textures.
More info here:
http://www.celestiaproject.net/forum/viewtopic.php?t=8895

About your problem I think you should change the distance from earth in start.cel to load only the two textures (tx_0_0 and tx_1_0).
Here the original code:

Code: Select all

 
select {object "Sol/Earth"}
  follow {}
  goto   {time 3.0  distance 6.0}
  wait   {duration 2.0}


Try to change the distance > 6.0 (10 or 15 for exemple but I am not sure, if someone can confirm me ?)
If this method can solve your problem, try to download the 32K or 16k of Earth made by others autors.

Bye!
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Topic author
haukew
Posts: 2
Joined: 20.02.2006
With us: 18 years 9 months
Location: Hamburg, Germany

Post #3by haukew » 20.02.2006, 20:51

Hello!
Thanks for your reply, i think my computer should be fast enough (Athlon3000+, GeForce FX 5900, 512 MB Ram) or isn't it?
The lag isn't too big (about half a second), though it would be great if it happened when the camera isn't moving.
Isn't it even possible to load the textures on celestia startup? a long startup (half a second longer...) is ok for me as long as it doesn't lag ;)
Your solution would only make the camera zoom not-so-far-in-that-the-texture-isnt loaded, right?

My problem is, it lags already when the 1st Earth-texture is loaded, so about 4.000.000 km from earth, so a preload to make it lag half a second when camera isnt moving would be greatly apreaciated... :)

Thanks in advance, Hauke

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Re: Preloading Textures in start.cel

Post #4by Harry » 22.02.2006, 20:41

haukew wrote:How can i preload a virtual texture in a .cel-script?

VTs are used to avoid loading a complete texture. So you can't preload it - and you probably wouldn't want to anyway (take a look at the size of the VT on your HD - do you really want Celestia to load the whole thing?).

Harald


Return to “Scripting”