Auto-tiling Textures

Description: General discussion about Celestia that doesn't fit into other forums.

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#1by t00fri » 10.08.2003, 21:13

...just back from a great 3 weeks hiking vacation in Switzerland....
anybody still remembers me?;-)

For Linux users, custom auto-tiling of a given texture is really simple and
does not require any extra software. Today I have quickly hacked a
most convenient shell-script that does the job transparently and flexible:

It uses the two command-line utilities of the ImageMagick package,
convert and identify. Since some arithmetics is done in the
script, it has to be written for execution with the much more powerful
'/usr/bin/zsh' (z-shell) rather than the simple '/bin/sh'.

The main advantage of doing the job via a shell script is clearly that it
may be written/debugged very fast and be easily modified without any
compilation...


Here are the instructions:

1) calling my script, 'virtualtex', with less than the required 3
arguments or '--help' gives a 'usage' printout:

> virtualtex

Usage: virtualtex [--help| <texture name> <tile size> <tile format>]


2) let the original texture 'foo.tga' be of any size that is a power of two and
with aspect ratio 2:1. I have supposed here that it is in *.tga
format, but most other formats are equally supported. Let the
tilesize be e.g. 512 and the desired output tile format e.g. *.tga (such
that it may be easily converted into DXT later with nvdxt, for
example)

Then all you got to do in the appropriate level directory is to copy
foo.tga into it and call

> virtualtex foo.tga 512 tga

a typical output would then be

Texture size = 8192 x 4096 tilesize = 512
Number of tiles = 128
Image format of tiles: tga

along with the desired 128 tile files tx_i_j.tga, i=0..15, j=0..7


Note that the original texture size is automatically determined by the
ImageMagick programm 'identify' within the script!

Under windows, the result may then easily be converted into
(e.g. uncompressed!) DXT including mipmaps like so:

nvdxt -file *.tga -24 u888

3) Here is the script: You may just copy it into a file named
'virtualtex' that you must make executable with 'chmod +x
virtualtex', of course! Then place it somewhere into your execution
PATH, e.g. /usr/local/bin or ~/bin,....

-----------------virtualtex-------------------------

Code: Select all

#! /usr/bin/zsh
if [ $# -ne 3 -o "$1" = "--help" ]; then
  echo
  echo 'Usage: virtualtex [--help| <texture name> <tile size> <tile format>]'
  echo
else
texturewidth=`/usr/bin/identify $1|cut -d " " -f 3|cut -d x -f 1`
((textureheight = texturewidth/2))
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
j=0

while (( j * tilesize <  textureheight )); do
    ((offy = j * tilesize))
    i=0
    while (( i * tilesize < texturewidth )); do
        ((offx = i * tilesize))
        echo "tx_"${i}"_"${j}":  x-offset:" $offx "y-offset:" $offy
        /usr/bin/convert -crop ${tilesize}x${tilesize}+${offx}+${offy} $1 tx_${i}_${j}.$tileformat
        ((i++))
    done
    ((j++))
done
fi

-----------------------------------------------


4) The safest bet is, however, to download 'virtualtex' from here

http://www.shatters.net/~t00fri/virtualtex

NOTE: It must be (made) executable!

5) By means of 'virtualtex' I made a full set of level0, level1,
level2 tiles /both/ for my 16k earth texture and the associated 16k
earth-normal texture, using a rather large tilesize of 2048 (to
start;-)). While the script was working, I went out for dinner with
my wife....



Bye Fridger
Last edited by t00fri on 14.08.2003, 09:55, edited 1 time in total.

jamarsa
jamarsa
Posts: 326
With us: 14 years 5 months
Location: San Sebastian (Spain)

#2by jamarsa » 10.08.2003, 22:31

t00fri wrote:...just back from a great 3 weeks hiking vacation in Switzerland....
anybody still remembers me?


Hello, Fridger, glad to see you again!! Yes, I remembered almost every day. I hope you didn't suffer this heat wave there in the Swiss heights... three weeks!!! I haven't had these long vacations for more than 10 years!!
So, do we have Fridger Reloaded? :wink:


Regarding your small script, it could be useful for people making virtual textures now, lets say Brendan and DBrady:

http://www.shatters.net/forum/viewtopic.php?t=3041&start=30

They seem to have a tedious time cutting, pasting and renaming!!

Darkmiss
Darkmiss
Posts: 1059
With us: 15 years 1 month
Location: London, England

#3by Darkmiss » 11.08.2003, 00:29

Welcome back Fridger
Sounds like a nice holiday you was on.
CPU- Intel Pentium Core 2 Quad ,2.40GHz
RAM- 2Gb 1066MHz DDR2
Motherboard- Gigabyte P35 DQ6
Video Card- Nvidia GeForce 8800 GTS + 640Mb
Hard Drives- 2 SATA Raptor 10000rpm 150GB
OS- Windows Vista Home Premium 32

Christophe
Christophe
Posts: 945
With us: 15 years 2 months
Location: Lyon (France)

#4by Christophe » 11.08.2003, 09:53

ImageMagick and zsh are available for Cygwin, so your script can be useful to Windows users too. You can even find native Windows versions of both.

Why not perl? ;-) ImageMagick has a perl API.
Christophe

Guest
Guest

#5by Guest » 11.08.2003, 10:46

Christophe wrote:ImageMagick and zsh are available for Cygwin, so your script can be useful to Windows users too. You can even find native Windows versions of both.

Why not perl? ;-) ImageMagick has a perl API.


Correct, I wanted to make a respective comment myself. Perhaps Selden could test it, since he has a Cygwin installation as far as I know.

Despite my love for Perl, I felt the script was almost too trivial;-) The 'zsh' or 'bash' is unavoidable on all Linux/Unix systems. Perl may or may not be installed, depending on the users preferences...The Perl API of ImageMagick comes as an add-on as far as I remember.

My script should also work with bash execution, I think. At best it needs /trivial/ modifications.

Bye Fridger

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#6by t00fri » 11.08.2003, 10:49

Sigh, forgot to login in my preceeding post;-)

Bye Fridger

Guest
Guest

#7by Guest » 12.08.2003, 18:15

Any Windows image manipulation people >,,,
I do not (yet) have ImageMagick downloaded or installed.
However, doing some Googling, there appears to be binary distributions for several flavours of Windows. Also Q8 and Q16 versions of IM, which seem to be for different levels of 'fidelity'.

I have no experience of IM, (nor of Perl, zsh or bash or other unixy things,,) but I have heard of WindowsScriptingHost(WSH) and there is an option in the IM installation to enable WSH support (as well as for VScript and VisualBasic) I didnt see anything about Cscript though
So as a WindowsME user interested in doing some tiling with Chris' new gizmo, would anyone know if this was an interesting and worthwhile route to explore ?

Or would that be too "trivial" for anyone to wish to explain to a mere mortal ?? (insert some perlish wink emoticons if needed)

PS. would it be a useful adjunct to TheGimp which is an excellent bit of software?

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#8by selden » 12.08.2003, 18:39

Anonymous guest,

ImageMagick and NetPBM are packages of programs that were originally designed as command line utilities. For full functionality, IM requires access to an X display server -- Exceed or Xfree86, for example. WSH and the other interfaces are provided as ways to integrate IM into other applications -- ones that need to provide access to image manipulation in addition to their primary purposes.

Whether you use Q8 or Q16 depends on your intended use for the final image and what kinds of manipulations you'll be doing to produce intermediate images. My understanding is that Celestia requires 8bits/color, i.e. Q8. Q16 would create image files with 16 bits/color -- appropriate for intermediate normalmaps, perhaps.

I'd suggest installing Cygwin so that you have access to Xfree86 and command interpreters which are more sophisticated than the simplistic one included with Windows. (bash, zsh, perl, python, and others). Cygwin is available for all the Win32 operating systems. http://www.cygwin.com/

I didn't have zsh installed, so I haven't had a chance to try Fridger's script yet.
Selden

Guest
Guest

#9by Guest » 12.08.2003, 19:11

> X display server -- Exceed or Xfree86, for example.

OK , thanks, I'll go investigate.

Although I dont have zsh etc the script was understandable so I thought that a windows script handler might be a simple way of implementing it in WinME. However, it seems not, from what you say.
I do have some little experience in C and so at the moment I am reviewing the IM API documentation, but that might take a bit longer to cook up in my DevC/Mingw ! ,,,

I did have Cygwin once upon a time, but it didn't survive a HDcrash and computer rebuild, so it might be a good time to re-explore that route.

Thanks for your reply.

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#10by t00fri » 12.08.2003, 20:03

Anonymous wrote:> X display server -- Exceed or Xfree86, for example.

OK , thanks, I'll go investigate.

Although I dont have zsh etc the script was understandable so I thought that a windows script handler might be a simple way of implementing it in WinME. However, it seems not, from what you say.
I do have some little experience in C and so at the moment I am reviewing the IM API documentation, but that might take a bit longer to cook up in my DevC/Mingw ! ,,,

I did have Cygwin once upon a time, but it didn't survive a HDcrash and computer rebuild, so it might be a good time to re-explore that route.

Thanks for your reply.


I investigated a bit about Cygwin that is now part of RedHat Linux. If one has a fast internet connection, the Cygwin installation and the associated ImageMagick is /most conveniently/ installed via a setup.exe file. Just a few clicks selecting the required extra applications like ImageMagick and zsh are required. I did not find the Unix command 'cut' though...

If there is preference for the 'bash' shell instead of 'zsh', I can easily run a few tests with it. Should be virtually identical.

Here is the cygwin url that also displays support for ImageMagick 5.4.6

http://cygwin.com/

Bye Fridger

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#11by selden » 12.08.2003, 20:52

Fridger,


Unfortunately, ImageMagick is not one of the packages included with Cygwin. It isn't installed by Cygwin's setup program.

The ImageMagick link on the Cygwin Web page is mislabelled. It points to the primary ImageMagick ftp server, which currently provides v5.5.7. It has 4 different Windows binary installation kits (Q8 or Q16, dll or staticly linked) plus tar.gz files optimized for building on whatever platform. The "Cygwin" ImageMagick tar package is of sources, not binaries, so one also has to install the full complement of Cygwin development packages (gcc, autoconf, etc), which most people don't do.

I've found that a Windows binary installation works fine under Cygwin, so long as one adds IM's bin directory to the PATH definition.

p.s. cut is included in Cygwin, but uudecode isn't.
Selden

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#12by t00fri » 12.08.2003, 21:38

selden wrote:Fridger,


Unfortunately, ImageMagick is not one of the packages included with Cygwin. It isn't installed by Cygwin's setup program.

The ImageMagick link on the Cygwin Web page is mislabelled. It points to the primary ImageMagick ftp server, which currently provides v5.5.7. It has 4 different Windows binary installation kits (Q8 or Q16, dll or staticly linked) plus tar.gz files optimized for building on whatever platform. The "Cygwin" ImageMagick tar package is of sources, not binaries, so one also has to install the full complement of Cygwin development packages (gcc, autoconf, etc), which most people don't do.

I've found that a Windows binary installation works fine under Cygwin, so long as one adds IM's bin directory to the PATH definition.

p.s. cut is included in Cygwin, but uudecode isn't.


Selden,

I am not 100% sure whether I understood precisely what you wrote:

Are you saying that my script works if you use the native, binary IM 5.5.7 Windows installation and add it to the Cygwin execution path? If true, this would be great!

A few motivating words for people who are still unsure whether to install a Cygwin Unix environment under Windows: It may seem a lot of effort just for my simple script above, but

there are lots of similar applications waiting, notably for people who are involved with handling large textures! Remember, that we are reaching the 16bit grayscale front with elevation maps, for example. Here IM's Q16 offers a complete set of 16bit image manipulation commands, like no other image manipulation program on the market.

Unix shell execution of scripts is simply sooooo much more versatile/powerful than what is offered by the Windows click philosophy. Also ambitious people may install Perl as well and then may work easily on data sets like astronomical catalogs, extract location files etc....

Once I see that more people would be able to use my (Perl) scripts, I clearly would be more motivated for producing additional ones;-)


Bye Fridger

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#13by selden » 12.08.2003, 22:17

Fridger wrote:I am not 100% sure whether I understood precisely what you wrote:

Are you saying that my script works if you use the native, binary IM 5.5.7 Windows installation and add it to the Cygwin execution path? If true, this would be great!

I'm sorry for the confusion. I have not yet tested your script.

However, I have been using simple shell scripts that invoke a slightly older native Windows version of ImageMagick's convert utility plus NetPBM utilities and nvdxt to generate nebulae textures with a transparency channel (for doing alighments). The scripts look something like this (they're at home and I'm not, so this is a non-working example)

Code: Select all

jpegtoppm img.jpg >img.ppm
ppmtopgm img.ppm >img.pgm
pnmtopng -alpha img.pgm img.ppm >img.png
convert img.pgm img.tga
nvdxt -file img.tga -alpha -dxt3

I've left out the steps that pad, clip or scale the images to a power-of-two dimension.

It'd be nice if nvdxt could use png images as input. I think it was supposed to at one time. That would save a step. NetPBM doesn't understand tga format.

I use the NetPBM utilities because they're often much faster than the corresponding ImageMagick functions. They use a lot less memory because most of them only work on a single scanline at a time. The newest version of ImageMagick is supposed to be a lot better about that. I should have a chance to try the new version with your script this evening.
Selden

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#14by t00fri » 12.08.2003, 22:53

selden wrote:
Fridger wrote:I am not 100% sure whether I understood precisely what you wrote:

Are you saying that my script works if you use the native, binary IM 5.5.7 Windows installation and add it to the Cygwin execution path? If true, this would be great!
I'm sorry for the confusion. I have not yet tested your script.

However, I have been using simple shell scripts that invoke a slightly older native Windows version of ImageMagick's convert utility plus NetPBM utilities and nvdxt to generate nebulae textures with a transparency channel (for doing alighments). The scripts look something like this (they're at home and I'm not, so this is a non-working example)

Code: Select all

jpegtoppm img.jpg >img.ppm
ppmtopgm img.ppm >img.pgm
pnmtopng -alpha img.pgm img.ppm >img.png
convert img.pgm img.tga
nvdxt -file img.tga -alpha -dxt3

I've left out the steps that pad, clip or scale the images to a power-of-two dimension.

It'd be nice if nvdxt could use png images as input. I think it was supposed to at one time. That would save a step. NetPBM doesn't understand tga format.

I use the NetPBM utilities because they're often much faster than the corresponding ImageMagick functions. They use a lot less memory because most of them only work on a single scanline at a time. The newest version of ImageMagick is supposed to be a lot better about that. I should have a chance to try the new version with your script this evening.

The ImageMagick utilities are really worth a try!
Let me just list the huge number of (graphics) formats that /all/ ImageMagick utilities support both in 8bit and 16bit/channel form! Notably the 16bit/channel raw formats (GRAY <=> IMG, DEM (gray); RGB <= >RAW, DEM (color)) are supported that occur e.g. in elevation data!

Bye Fridger

Code: Select all

Name    Mode   Description

8BIM    *rw-      Photoshop resource format
AFM       *r--      TrueType font
APP1    *rw-      Photoshop resource format
ART       *r--      PF1: 1st Publisher
AVI       *r--      Audio/Visual Interleaved
AVS       *rw+   AVS X image
BIE       *rw-      Joint Bi-level Image experts Group interchange format
BMP       *rw+   Microsoft Windows bitmap image
CAPTION    *r+       Caption (requires separate size info)
CMYK    *rw-      Raw cyan, magenta, yellow, and black samples (8 or 16 bits, depending on the image depth)
CMYKA    *rw-      Raw cyan, magenta, yellow, black, and matte samples (8 or 16 bits, depending on the image depth)
CUT      *r--      DR Halo
DCM    *r--      Digital Imaging and Communications in Medicine image
DCX       *rw+   ZSoft IBM PC multi-page Paintbrush
DIB       *rw+   Microsoft Windows bitmap image
DPS       *r--      Display PostScript
DPX       *r--      Digital Moving Picture Exchange
EPDF    *rw-      Encapsulated Portable Document Format
EPI       *rw-      Adobe Encapsulated PostScript Interchange format
EPS       *rw-`   Adobe Encapsulated PostScript
EPS2    *-w-      Adobe Level II Encapsulated PostScript
EPS3    *-w-      Adobe Level III Encapsulated PostScript
EPSF    *rw-      Adobe Encapsulated PostScript
EPSI       *rw-      Adobe Encapsulated PostScript Interchange format
EPT       *rw-      Adobe Encapsulated PostScript with TIFF preview
FAX       *rw+   Group 3 FAX
FILE       *r--      Uniform Resource Locator
FITS       *rw-      Flexible Image Transport System
FPX       *rw-      FlashPix Format
FTP       *r--      Uniform Resource Locator
G3       *rw-      Group 3 FAX
GIF       *rw+   CompuServe graphics interchange format
GIF87    *rw-      CompuServe graphics interchange format (version 87a)
GRADIENT *r--      Gradual passing from one shade to another
GRANITE    *r--      Granite texture
GRAY    *rw+   Raw gray samples (8 or 16 bits, depending on the image depth)
H       *rw-      Internal format
HDF      -rw+      Hierarchical Data Format
HISTOGRAM *-w-   Histogram of the image
HTM       *-w-      Hypertext Markup Language and a
client-side image map
HTML    *-w-      Hypertext Markup Language and a
client-side image map
HTTP    *r--      Uniform Resource Locator
ICB       *rw+   Truevision Targa image
ICM       *rw-      ICC Color Profile
ICO       *r--      Microsoft icon
ICON    *r--      Microsoft icon
IMPLICIT    *---
IPTC       *rw-      IPTC Newsphoto
JBG       *rw+   Joint Bi-level Image experts Group
interchange format
JBIG       *rw+   Joint Bi-level Image experts Group
interchange format
JP2       *rw-      JPEG-2000 JP2 File Format Syntax
JPC       *rw-      JPEG-2000 Code Stream Syntax
JPEG    *rw-      Joint Photographic Experts Group
JFIF format
JPG       *rw-      Joint Photographic Experts Group
JFIF format
LABEL    *r--      Text image format
LOGO    *rw-      ImageMagick Logo
M2V       *rw+   MPEG-2 Video Stream
MAP       *rw-      Colormap intensities (8 or 16 bits,
depending on the image depth) and indices (8 or 16 bits, depending on whether colors exceeds 256).
MAT       *-w+   MATLAB image format
MATTE    *-w+   MATTE format
MIFF    *rw+   Magick image format
MNG    *rw+   Multiple-image Network Graphics
MONO    *rw-      Bi-level bitmap in least-significant-
-byte-first order
MPC       -rw-      Magick Persistent Cache image format
MPEG    *rw+   MPEG-1 Video Stream
MPG       *rw+   MPEG-1 Video Stream
MPR       *r--      Magick Persistent Registry
MSL       *r--      Magick Scripting Language
MTV       *rw+   MTV Raytracing image format
MVG    *rw-      Magick Vector Graphics
NETSCAPE *r--      Netscape 216 color cube
NULL    *r--      Constant image of uniform color
OTB       *rw-      On-the-air bitmap
P7       *rw+   Xv thumbnail format
PAL       *rw-      16bit/pixel interleaved YUV
PALM    *rw-      Palm Pixmap format
PBM       *rw+   Portable bitmap format (black and white)
PCD       *rw-      Photo CD
PCDS    *rw-      Photo CD
PCL       *-w-      Page Control Language
PCT       *rw-      Apple Macintosh QuickDraw/PICT
PCX       *rw-      ZSoft IBM PC Paintbrush
PDB       *r--      Pilot Image Format
PDF       *rw+   Portable Document Format
PFA       *r--      TrueType font
PFB       *r--      TrueType font
PFM       *r--      TrueType font
PGM       *rw+   Portable graymap format (gray scale)
PICON    *rw-      Personal Icon
PICT       *rw-      Apple Macintosh QuickDraw/PICT
PIX       *r--      Alias/Wavefront RLE image format
PLASMA    *r--      Plasma fractal image
PM       *rw-      X Windows system pixmap (color)
PNG       *rw-      Portable Network Graphics
PNM       *rw+   Portable anymap
PPM       *rw+   Portable pixmap format (color)
PREVIEW    *-w-      Show a preview an image enhancement, effect, or f/x
PS       *rw+   Adobe PostScript
PS2       *-w+   Adobe Level II PostScript
PS3       *-w+   Adobe Level III PostScript
PSD       *rw-      Adobe Photoshop bitmap
PTIF       *rw-      Pyramid encoded TIFF
PWP       *r--      Seattle Film Works
RAS       *rw+   SUN Rasterfile
RGB       *rw+   Raw red, green, and blue samples (8 or 16 bits, depending on the image depth)
RGBA    *rw+   Raw red, green, blue, and matte samples (8 or 16 bits, depending on the image depth)
RLA       *r--      Alias/Wavefront image
RLE       *r--      Utah Run length encoded image
ROSE    *rw-      70x46 Truecolor test image
SCT       *r--      Scitex HandShake
SFW       *r--      Seattle Film Works
SGI       *rw+   Irix RGB image
SHTML    *-w-      Hypertext Markup Language and a
client-side image map
STEGANO *r--      Steganographic image
SUN      *rw+   SUN Rasterfile
SVG       *rw+   Scalable Vector Gaphics
TEXT    *rw+   Raw text
TGA       *rw+   Truevision Targa image
TIF       *rw+   Tagged Image File Format
TIFF       *rw+   Tagged Image File Format
TILE       *r--      Tile image with a texture
TIM       *r--      PSX TIM
TTF       *r--      TrueType font
TXT       *rw+   Raw text
UIL       *-w-      X-Motif UIL table
UYVY    *rw-      16bit/pixel interleaved YUV
VDA       *rw+   Truevision Targa image
VICAR    *rw-      VICAR rasterfile format
VID       *rw+   Visual Image Directory
VIFF       *rw+   Khoros Visualization image
VST       *rw+   Truevision Targa image
WBMP    *rw-      Wireless Bitmap (level 0) image
WMF    *r--      Windows Metafile
WPG    *r--      Word Perfect Graphics
X       *rw-      X Image
XBM       *rw-      X Windows system bitmap (black
and white)
XC       *r--      Constant image uniform color
XCF       *r--      GIMP image
XML       *r--      Scalable Vector Gaphics
XPM       *rw-      X Windows system pixmap (color)
XV       *rw+   Khoros Visualization image
XWD    *rw-      X Windows system window dump (color)
YUV       *rw-      CCIR 601 4:1:1

Modes:
-------
*       Native blob support
r       Read
w       Write
+       Multi-image
Last edited by t00fri on 13.08.2003, 07:24, edited 1 time in total.

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#15by selden » 13.08.2003, 00:17

Fridger,

Your script only needed two small changes so that it would work with the current versions of Cygwin, zsh and ImageMagick under Windows XP.

The problem is that, of course, the ImageMagick Windows installer does not put its executables into Cygwin's /usr/bin directory. However, it does add the actual directory to Windows' default PATH definition, which Cygwin uses. All I had to do was change /usr/bin/identify and /usr/bin/convert into just identify and convert.

Now if Chris would only make it possible to use virtual textures with Nebula objects, I would be very happy!
Selden

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#16by t00fri » 13.08.2003, 00:22

selden wrote:Fridger,

Your script only needed two small changes so that it would work with the current versions of Cygwin, zsh and ImageMagick under Windows XP.

The problem is that, of course, the ImageMagick Windows installer does not put its executables into Cygwin's /usr/bin directory. However, it does add the actual directory to Windows' default PATH definition, which Cygwin uses. All I had to do was change /usr/bin/identify and /usr/bin/convert into just identify and convert.

Now if Chris would only make it possible to use virtual textures with Nebula objects, I would be very happy!


Now that is good news!

Thanks a lot for for testing ....

Now tile mass production can begin;-)

My script is running already the whole evening here on my machine...It has produced today a full tile set for the BM nightlights up to 16k resolution, i.e. 4k, 8k and 16k textures with 2k tile size.

Bye Fridger

t00fri
Topic author
Avatar
t00fri
Topic author
Age: 15
Posts: 8814
With us: 15 years 5 months
Location: Hamburg, Germany

#17by t00fri » 13.08.2003, 21:57

Hi all,

here are some update infos about my tile script, 'virtualtex':

-- I have made a version 1.01 that may be downloaded from
http://www.shatters.net/~t00fri/virtualtex

* it has a somewhat extended help, that is printed by just calling
'virtualtex' without any arguments or as 'virtualtex --help'.

* I skipped the path of the ImageMagick utilities 'convert' and
'identify' such as required for running the script under Cygwin
(<== Selden) in Windows.

-- Note that the script works even if the size of the input texture is
not a power of two: tiles are produced as usual
until a remainder less than the specified <tile size> is
encountered. From this remainder no tiles are formed, i.e. it is lost.

This feature may be useful in some applications.

-- I made sure that the script also executes correctly with the 'bash'
shell, in case the z-shell is not available or not liked. The only
required change is to replace #! /usr/bin/zsh by #! /bin/bash in
the first line of the script.


Another extension that I might easily incorporate is to allow for the
input of a nonvanishing initial (x,y)-offset in form of two
additional, optional arguments, offx0, offy0. This is useful
if only part of the texture is to be tiled, for example.

Let me know whether you want me to incorporate it. In case, no offsets
are specified, the operation of the script would be like before, of
course.

Bye Fridger

Guest
Guest

#18by Guest » 14.08.2003, 01:04

I said
there is an option in the IM installation to enable WSH support (as well as for VScript and VisualBasic)
and Selden said
ImageMagick
snip
WSH and the other interfaces are provided as ways to integrate IM into other applications -- ones that need to provide access to image manipulation

Umm, I thought that was what we are trying to do !

Ok, I'm still reading the discussion !
So, am I correct in assuming that the inclusion of support for WSH in the IM installation is a red-herring and a mental abberation on their part ? and that is not worth following up ? Is there anyone here that has integrated IM & WSH in a useful way ?

Then Fridger said
The ImageMagick utilities are really worth a try!
Let me just list the huge number of (
S'ok Fridger, we already got the message,, that this might be a neat bit of software ! Relax!! All we need to do now is to determine the simplest , lowest, impact to registry and sanity for Win (ME) users :-)
OK, I know, I should start a new thread, I suppose, that has not got Linux in its Subject field ?

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#19by selden » 14.08.2003, 01:35

I know next to nothing about WSH, so don't let me stop you from using it to invoke the ImageMagick functionality! Sometimes I lose track of the trees because of the forest :)

Obviously the program one would be trying to write would be the "split texture for Celestia" application. It's not quite as elaborate as a Geographic Information System, which is the example that came to my mind, but that's quite all right. :)

I'd suggest visiting the imageMagick home page and following the links there to find out what's been done. http://www.imagemagick.org/
Selden

Guest
Guest

#20by Guest » 14.08.2003, 02:02

Seldon>> I know next to nothing about WSH,

But I kept my fingers xxed that someone would!

>so don't let me stop you from using it to invoke the ImageMagick functionality!

Quite so ! No you wont do that, but I have had _so_many_ experiences in past lives of adapting the 'strange' logic and interfaces of ex-linux stuff to Windoze that before I lose yet more hair I'du'thort'someone might'uv gorn this route in advance of me ! iyswim.

> Sometimes I lose track of the trees because of the forest :)

Yep me too when the fruits of same trees get brewed :)

>>Obviously the program one would be trying to write would be the "split texture for Celestia" application. It's not quite as elaborate as a Geographic Information System, which is the example that came to my mind, but that's quite all right. :)

<Manuel>Que ? </Manuel>
,,, no dont answer that !

>>I'd suggest visiting the imageMagick home page and following the links there to find out what's been done. http://www.imagemagick.org/
I did ! Why do you think I'm here ?? :-))))))
That's where I got that wsh implementation stuff from, so I thort that there might be a good reason for them supporting it and thart some bods might have used it and that it might save me doing some C code mit zee APIs
(often a safer route than trying to install loadsa linuks lookaluikes !)

On the other hand, I could go back to live steam 16mm modelling and wait awhile, so much to do, so little time ,,,


Return to “Celestia Users”

Who is online (over the past 5 minutes)

Users browsing this forum: 7 guests