XnView now writes DDS format

Tips for creating and manipulating planet textures for Celestia.
Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

XnView now writes DDS format

Post #1by t00fri » 03.10.2005, 17:46

Hi,

in case some of you are not yet aware, the latest XnView 1.80.3 version of XnView now writes dds format besides reading it. There are no options available (I think), but the images look OK.

Bye Fridger

Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Post #2by Boux » 03.10.2005, 19:01

Thanks alot for the tip :D
It is useful to have another program handy.
My experience is that mileage may vary a lot with DDS export/import according to the app you are using.
For example, Photoshop and PaintShop Pro do not always behave the same.
Maybe XnView will be a judge of peace, sort of.

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

Post #3by maxim » 03.10.2005, 20:22

Thank you, very helpful hint.
I didn't use xnview very much, so I wasn't aware of the newest features.

maxim

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #4by cartrite » 04.10.2005, 14:55

Thanks for the tip,

Your a life saver. XnView can open my problem World Wind dds files without any problem. And convert them too. I got them to open with the gimp but I had to change some flags for pitch and linear size with a hex editor to do it. Thanks Again.javascript:emoticon(':D')
Very Happy

cartrite

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #5by cartrite » 04.10.2005, 14:58

Hi again,

I wanted to test something.:D

cartrite

DaveMc
Posts: 79
Joined: 09.08.2003
With us: 21 years 3 months
Location: Woodinville, WA, USA

Re: XnView now writes DDS format

Post #6by DaveMc » 05.10.2005, 19:22

There must be something a little buggy with the XnView write routine, dds files saved with it can't be read by Irfanview's dds plugin. They can however be read by Photoshop and PaintShop Pro and look good in Celestia so this is no big deal.

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Post #7by fsgregs » 05.10.2005, 22:58

Fridger:

I have been trying for some time to find a program to resize dds files and save them as a smaller size. I, therefore, immediately went to XnView and downloaded the latest version (1.80.3).

I then opened a dds cloud texture with it. It opened fine. I then tried to save it (without resizing) to another place on the hard drive by clicking "Save As" and choosing "DDS" as the file format. It seemed to save OK. However, when I opened it, I found this:

http://albums.photo.epson.com/j/ViewPhoto?u=4333456&a=31914917&p=72934181

I tried saving a regular planet texture. Same result.

HELP!

What is going wrong? :(

Frank

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #8by t00fri » 05.10.2005, 23:15

fsgregs wrote:Fridger:

I have been trying for some time to find a program to resize dds files and save them as a smaller size. I, therefore, immediately went to XnView and downloaded the latest version (1.80.3).

I then opened a dds cloud texture with it. It opened fine. I then tried to save it (without resizing) to another place on the hard drive by clicking "Save As" and choosing "DDS" as the file format. It seemed to save OK. However, when I opened it, I found this:

http://albums.photo.epson.com/j/ViewPhoto?u=4333456&a=31914917&p=72934181

I tried saving a regular planet texture. Same result.

HELP!

What is going wrong? :(

Frank


But a cloud texture needs an alpha chanel in order to handle transparency. That requires to save in DXT3 format (RGB+A). For the same reason, clouds cannot be JPG format (RGB only), but must rather be PNG (RGB+A).

I suppose XnView just does DXT1. Since I could not find a respective switch, this issue seems pretty obvious to me. Probably it will take another XnView version before DXT1,3,... formats are available for writing.

Check it out by saving images that DEFINITELY use RGB layers only, like a very simple JPG texture. That works for me, at least.

There is more XnView cannot do yet at the dds front: it does not write mipmaps together with the main texture. That is however quite essential for speedy displays.

Bye Fridger

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 22 years 1 month
Location: Manassas, VA

Post #9by fsgregs » 06.10.2005, 19:27

Thanks Fridger. Could you recommend a free software program for Windows that does save in DXT 3 format? Is there any?

Frank

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

Post #10by selden » 07.10.2005, 02:57

Frank,

Nvidia provides free command-line DDS creation utilities (and photoshop plugins) at
http://developer.nvidia.com/object/dds_utilities.html
Selden

Trajan
Posts: 1
Joined: 11.10.2005
With us: 19 years 1 month

Post #11by Trajan » 11.10.2005, 23:00

Hello!

I'm a new member. Last year i have written this script (batch for winxp):

Code: Select all

@echo off
cls
echo [ Create VT-Map for Celestia
echo ===============================================================================
echo.
set /p source=Enter path and name of sourcefile             :
echo.
set /p x=Enter x [Pixel]                               :
echo.
set /p y=Enter y [Pixel]                               :
echo.
set /p tilesize=Enter tilesize [Pixel]                        :
echo.
set /p target=Enter output directory                        :
echo.
set /p format=Enter output format (png, dxt1c, dxt3 or dxt5):

set /a var=%y%/%tilesize%
set /a level=0
set /a col=0
set /a row=0
set /a u=0
set /a v=0

:level
if (%var%)==(1) (goto:makedir) else (
   set /A level=%level%+1
   set /A var=%var%/2
   )
   goto:level

:makedir
md %target%\level%level%
goto:step1

:step1
if (%u%)==(%x%) (
   del %target%\level%level%\temp.tif
   goto:eof
   ) else (
   nconvert -quiet -out tiff -o "%target%\level%level%\temp.tif" -crop "%u%" "0" "%tilesize%" "%y%" "%source%"
   set /a u=%u%+%tilesize%
   )

:step2
nconvert -quiet -out png -o "%target%\level%level%\tx_%col%_%row%.png" -crop "0" "%v%" "%tilesize%" "%tilesize%" "%target%\level%level%\temp.tif"
if (%format%)==(png) (goto:step3) else (
   nvdxt -file %target%\level%level%\tx_%col%_%row%.png -%format% -nomipmap -outdir %target%\level%level%
   del %target%\level%level%\tx_%col%_%row%.png
   )

:step3
set /a v=%v%+%tilesize%
set /a row=%row%+1
if not (%v%)==(%y%) (goto:step2) else (
   set /a v=0
   set /a row=0
   set /a col=%col%+1
   goto:step1
)

It use nvdxt.exe and ncovert.exe (a part of xnview). Both files must be in the same directory with the batchfile. It's very fast! I have test it with 16k-textures. Maybe it works with 32k and up.

Save your texture from Photoshop or Gimp. If you use an alpha channel, take a format like tiff. Then execute the batchfile and enter the values.

Hope you find it useful! ... and sorry for my bad english.

Trajan

crespowu
Posts: 1
Joined: 29.12.2007
With us: 16 years 10 months

Post #12by crespowu » 29.12.2007, 06:44

Great tips! Thanks a lot,it helps me much.


Return to “Textures”