newbie VT question

Tips for creating and manipulating planet textures for Celestia.
Topic author
FCVPI99
Posts: 36
Joined: 16.09.2006
With us: 18 years 1 month

newbie VT question

Post #1by FCVPI99 » 27.03.2018, 20:02

i have read the VT for dummies and had a problem doing the set in installing of Netpbm in Cygwin

i have a big old new CPU with nothing for it to do so lets play with images i have a 1.9 GB pic from nasa of mercury-Morphology Mosaic (from space images ) and id like to crunch it into a VT but again the directions from VT dummies isnt working .. im hoping there is an alternative now in 2017 that there wasnt when vt for dummies was wrote

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

Post #2by selden » 28.03.2018, 11:13

These days doing everything in Imagemagick (or a variant) is more appropriate than trying to use netpbm, I think. I'll try to remember to update the intro description of VTs RealSoonNow.

Here's a bash script that I used recently (under Cygwin) to cut a single image into pieces for a level. It was developed by Fridger Schrempp long ago. He's also written more efficient software to do the job, but I was more comfortable using this.

Code: Select all

#! /usr/bin/sh
if [ $# -lt 3 -o "$1" = "--help" ]; then
  echo
  echo 'Usage: virtualtex [--help | <texture name> <tile size> <tile format>] [e|E|w|W]'
  echo
  echo
  echo The shell script \'virtualtex\' is a tool for Celestia \> 1.3.0
  echo that supports \'virtual textures\'.
  echo
  echo The script generates the required tiles tx_i_j of \
       desired \(square\) size, 
  echo \<tile size\>, in a specified format, \<tile format\> = \
       png, tga, jpg,...,
  echo from an input texture, \<texture name\>, in any popular graphics format.
  echo
  echo The optional 4th argument e\|E\|w\|W is for the case of tiling 
  echo square /e/astern \| /w/estern halfes of the full texture separately!
  echo 
  echo Besides Linux/Unix, the script also runs in a current Cygwin \
       installation
  echo under Windows, \( http://www.cygwin.com \). If the z-shell \(\'zsh\'\) \
       is unavailable,
  echo it also may be executed with the \'bash\' shell, by replacing \
       \#\! /usr/bin/zsh by
  echo \#\! /bin/bash in the first line.
  echo
  echo The script assumes that a recent version \(\>= 6.1.8\) of the ImageMagick package
  echo \( http://www.ImageMagick.org \) is installed \
       \(either under Unix/Linux or Windows\).
  echo The utilities \'convert\' and \'identify\' of that package are used.
  echo
  echo You may increase the pixel cache size \$maxmem from the 80 MB default
  echo value to e.g. 80\% of your RAM size within the script with an editor.
  echo This will speed up the performance of \'virtualtex\' considerably.
  echo
  echo On a PIII/512MB RAM the tiling of a 16k x 8k texture into
  echo 32 \(2k x 2k\) tiles now only takes 15 minutes with a Linux OS!
  echo
  echo Author: Dr. Fridger Schrempp, fridger.schrempp@desy.de
  echo Version: 1.04, 02/15/05
  echo 
else
maxmem=8000
texturesize=`identify -format "%wx%h" $1`
texturewidth=`identify -format "%w" $1`
textureheight=`identify -format "%h" $1`
tilesize=$2
tileformat="$3"
echo
echo "Texture size = " $texturewidth "x" $textureheight "tilesize = " $tilesize
echo "Number of tiles =" $(( ((texturewidth/tilesize)) * ((textureheight/tilesize)) ))
echo "Image format of tiles:" $tileformat
echo
echo "Tile: "
echo

convert -cache $maxmem -define dds:compression=dxt1 -crop ${tilesize}x${tilesize} $1 out%d.$tileformat


j=0
while (( j * tilesize + tilesize <=  textureheight )); do
    ((offy = j * tilesize))
    if [ $# -eq 4 ]; then
   if [ "$4" = "e" -o "$4" = "E" ]; then
       ioff=$(( texturewidth/tilesize ))
   elif [ "$4" = "w" -o "$4" = "W" ]; then
       ioff=0
        else
            echo
            echo "*** Incorrect 4th parameter! ***"
            echo
            return
        fi
    fi
    i=0
    while (( i * tilesize + tilesize <= texturewidth )); do
        ((offx = i * tilesize))
        echo "tx_"$((i + ioff))"_"${j}":  x-offset:" $((offx + ioff * tilesize)) "y-offset:" $offy
    mv out$((i+ ((texturewidth/tilesize)) * j)).$tileformat tx_$((i + ioff))_${j}.$tileformat
        ((i++))
    done
    ((j++))
done
fi
Selden

Topic author
FCVPI99
Posts: 36
Joined: 16.09.2006
With us: 18 years 1 month

Post #3by FCVPI99 » 28.03.2018, 13:45

15 years later and we are still using Linux software in windows? i would have thought there would have been a windows alt i have never been able to run anything linux in windows besides Celestia itself i have DLed the nmtools and f-tex tool and they dont even work at all .. they open and then close right away and imahemagick wont even open the picture im trying to open

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

Post #4by selden » 28.03.2018, 13:58

Windows 10 has its own optional Linux subsystem, which includes bash.

What error message do you get from imagemagick?
Selden

Topic author
FCVPI99
Posts: 36
Joined: 16.09.2006
With us: 18 years 1 month

Post #5by FCVPI99 » 28.03.2018, 16:15

i open imagemagick and the try to open the pic i downloaded and it stops responding so it wont even open the image

(MDIS_Monochrome_20170512_PDS16_256ppd_equirectangular.png - 2GB file)

isnt there a program that isnt text/dos liked based you open the pic click VT put in the level settings weater it be 1 2 3 4 ect and then put in the base number for level 0 2 tiles 4 tiles ect ??

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

Post #6by selden » 28.03.2018, 16:44

Is that image available for downloading somewhere so I can test it?

PNG images are highly compressed, so the size of the file doesn't say anything about the amount of memory needed to process the image. I suspect your computer seems to hang because you don't have enough main memory, so ImageMagick will either page to disk or try to process the image using multiple disk files. That kind of processing is going to be *very* slow.

You do need to be running both a 64 bit version of Windows with at least 16GB of main memory.and a 64 bit version of ImageMagick. From the name of the file, I'm guessing you might also need to be using a version of ImageMagick which includes support for 16bit color channels.

Many GUI image processing software products can cut up images, but they don't give the pieces the names needed by Celestia. Photoshop can be used to cut images, for example. see http://srufaculty.sru.edu/david.dailey/graphics/photoslice.htm

ImageSplitter is an online service that can do it.
Selden

Topic author
FCVPI99
Posts: 36
Joined: 16.09.2006
With us: 18 years 1 month

Post #7by FCVPI99 » 28.03.2018, 17:32

http://messenger.jhuapl.edu/Explore/Images.html#global-mosaics
click
Global Mosaics


i only have 8 GB of ram but also have lots of V ram on HDD so im not worried about memory (i fig if i could make a mosaic in Photoshop that ends up to be a 8 GB file and i did it one a quadcore with 4 gb of ram im good being i have double the ram and a hex core now)
yes 64 bit everything is being used

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

Post #8by selden » 28.03.2018, 20:50

I couldn't find the image that you listed, so I downloaded
MDIS_LowIncidence_20170512_PDS16_256ppd_equirectangular.png
It's 1.98 GB so it should be close.

The image is 92,160 x 46,080 pixels, which causes two problems:

1. it needs to be scaled down or up so that it's a power of two on a side in order to be made into a VT: Either scale it down to 65536x32768 or up to 131072x65536. (i.e. down to 64Kx32K or up to 128Kx64K.)

2. The initial image is gigantic: 92160x46080 pixels x 4 bytes/pixel = 16,986,931,200 bytes. (i.e. ~16GB) If you don't have at least 3x that amount of RAM (i.e. ~48GB) , processing it is going to take an absurd amount of time with ImageMagick, because it needs to load the entire input and output images into RAM. Paging to disk will cause a dramatic slowdown, perhaps even as much as 1000x slower, taking milliseconds for operations to disk instead of microseconds for operations to memory.

In other words, this is a case where you must use Fridger's utilities. They process an image a single scan-lne at a time without needing to load the entire image into RAM for processing.

Sorry.

p.s. edited to fix the arithmetic: worse than I'd originally written. :(
Last edited by selden on 29.03.2018, 10:33, edited 1 time in total.
Selden

Topic author
FCVPI99
Posts: 36
Joined: 16.09.2006
With us: 18 years 1 month

Post #9by FCVPI99 » 28.03.2018, 22:56

no biggy thought i would do something good for Celestia doesnt hurt me any just the users as the single image works just fine on my system

and this is the file i have
Attachments
Capture.JPG

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #10by FarGetaNik » 29.03.2018, 13:39

I also found myself stunned at the VT for dummies guide some years ago and could not get cygwin to work properly. I eventually got t00fri's texture tools to work and have been using them ever since, with the combination of other image prcessing tools like Nip2. I can only recomend to read and try to follow the instructions and forum discussions on virtual texture and nmtools. If there is a more convenient way to create them with Windows software let me know.

Anyways, my efforts included a Mercury 16k VT in truecolor and a 64k VT in greyscale. Let me know if you are interested, as I am hesitant to use my personal cloud storage to much on these texture monsters.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #11by CM1215 » 30.03.2018, 12:10

I'd been wondering if there was an available Mercury VT larger than 32k...and apparently there is. Could you put the grayscale 64k VT up for download? Because I may be able to use the BIMP plugin for GIMP to colorize it.
CM1215: Celestial master in learning.

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #12by FarGetaNik » 03.04.2018, 08:57

CM1215 wrote:I'd been wondering if there was an available Mercury VT larger than 32k...and apparently there is. Could you put the grayscale 64k VT up for download? Because I may be able to use the BIMP plugin for GIMP to colorize it.

Ooh that'll be nice! Sorry for the late response, I was not home over the weekend. In that case, do you need the whole textures or just the VT tiles? I would imagine it'll be easier to work with the whole texture.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #13by CM1215 » 03.04.2018, 14:10

FarGetaNik wrote:In that case, do you need the whole textures or just the VT tiles? I would imagine it'll be easier to work with the whole texture.

I can use a template of the whole texture to figure out what colorization edits I will need (this template should be lower resolution than the original), then I can use the BIMP plugin (AKA the Batch Image Manipulation Plugin) to apply the same edits to all the tiles, one complete folder of tiles at a time.

So to answer your question, I will need a template of the whole texture at around 4k resolution, as well as all the VT tiles in their respective folders. Also, I will need an image of Mercury to use as a basis, so that I know what I should colorize the textures to look like. I used a similar method to apply colors to John Van Vliet's 128k Venus texture (that is, back when I still thought it was grayscale) as can be seen in this screenshot:
2celestia6.jpg
CM1215: Celestial master in learning.

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #14by FarGetaNik » 03.04.2018, 14:52

Oh so you plan on just tinting the texture in a monochrome color? That's a bit of a disappointment as I wanted to process the b&w texture in a way I did my 16k color texture and apply the coloring of that texture onto the larger one. I simply failed at the size of the texture as I can't possibly process that huge texture with the means I have. To get a realistic color you might just leave the texture monochrome and call it good as the endresult of carefull processing leaved me with this truecolor texture of mercury:

mercury.jpg


Although the brightness and contrast of the monochrome texture still deviate a lot from this one. I used this site as a color reference and I think I also considered a sprectrum but I'm not entirely sure anymore... But I will still upload the files in the meantime.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #15by CM1215 » 03.04.2018, 14:59

Actually, I may be able to process the 64k texture as a whole and apply the colors of that there reference image to the 64k texture using the same method you explained to me concerning the false-color Charon map. My computer is quite powerful, so it should be able to handle it. If that's what you're looking for, I may be able to do that.
CM1215: Celestial master in learning.

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #16by FarGetaNik » 03.04.2018, 16:00

Hm in that case, here is the whole 16k mercury truecolor texture.

I had a 8k copy of the greyscale map on my computer: https://drive.google.com/open?id=12PuL_s92Bfgg1bPeHfqNo2YlzRp3_PfI
And here the 64k VT: https://drive.google.com/open?id=1nPMO5N8In95V2eC_ULG63pSMfF9hbXKS
(It's a 1.29 GB zip monster! I want to clear that drive space as soon as you're done actually...)

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #17by CM1215 » 04.04.2018, 12:20

I'm afraid that to use the method I mentioned above, I will need the entire texture as one file, so that I can apply the colorization to the entire texture at once. I have downloaded the grayscale VT that you put up for download, so you should be able to delete it off your drive now.

I will need the whole 64k texture as one file to use the method.
CM1215: Celestial master in learning.

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #18by FarGetaNik » 04.04.2018, 13:36

Ok thanks for letting me know. In that case, can you handle the original 92k texture?

If not I will upload my resized 64k texture.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #19by CM1215 » 14.04.2018, 18:41

After a long time and a ton of computer lag, I managed to colorize the 92k texture with the colors of your colorized texture. It honestly doesn't look very different from the original, but it DOES have the color.

Here is the download link: https://drive.google.com/open?id=1N6HhZu2ResYyd9QlGjY7vMYuiOHuOSKl

Also, would you be able to take the 92k and directly make it into a VT without shrinking it to 64k? If so, I would like to have a copy of this VT.
CM1215: Celestial master in learning.

Avatar
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #20by FarGetaNik » 15.04.2018, 12:48

Thank you! Currently downloading it.

CM1215 wrote:Also, would you be able to take the 92k and directly make it into a VT without shrinking it to 64k? If so, I would like to have a copy of this VT.

I have to look into it. It's been a while since I made a VT so I'm not actually sure if there is a step involved that requires the textures to be a power of 2 in size. But reducing the file size by a a factor of 2 is usually a no-brainer for me... if we are talking about such huge textures.


Return to “Textures”