Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Which texture format to use?  (Read 2664 times)
0 Members and 1 Guest are viewing this topic.
Offline anarchotron

Junior Member




...precious bodily fluids.


« Posted 2004-06-15 02:10:08 »

Can anyone recommend a texture format for use in lwjgl for 3d games? I need textures that support alpha, mipmaps, and texture compression. Obviously DDS is probably the best format for this but microsoft standards make me feel icky. I also have not found any java Image readers for DDS, and I don't really want to write my own Image reader.

The java Image class only appears to support PNG, JPG, and GIF. None of these formats appear to properly support the alpha channel, although I could be mistaken.

Any advice?

A
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #1 - Posted 2004-06-15 02:24:59 »

PNG supports alpha perfectly well (1/8/16 bit). See my avatar? If you don't use a crap browser you can see alpha transparency there.

And you could use even jpg - just use a rgb image plus a grayscale image (However, jpg for alpha can produce rather visible artifacts).

So just use PNG and walk over those files with PNGOUT at the end (for maximum compression).

There's also a TGA loader floating around.

弾幕 ☆ @mahonnaiseblog
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #2 - Posted 2004-06-15 02:25:42 »

<- avatar infront of another background color Wink

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline anarchotron

Junior Member




...precious bodily fluids.


« Reply #3 - Posted 2004-06-15 02:57:45 »

Thanks for the response.

Hmm I must be commiting User Error in photoshop 6.0.  Whenever I save my pngs out it strips the alpha channel.  Maybe I need a new file plugin for photoshop.

Assuming I get my PNG writing fixed, how do you handle mipmaps?

A

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #4 - Posted 2004-06-15 03:05:10 »

>Whenever I save my pngs out it strips the alpha channel.

Hold ctrl and click on the alpha channel - now you have it as selection (eventually you have to invert the selection now... I'm not sure). Swith over to rgb and delete.

>how do you handle mipmaps?

GLU can create'em for you. GLU.gluBuild2DMipmaps(...) does the trick. See here:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=LWJGL;action=display;num=1083425041

弾幕 ☆ @mahonnaiseblog
Offline anarchotron

Junior Member




...precious bodily fluids.


« Reply #5 - Posted 2004-06-15 04:09:01 »

Hmm sorry this is getting offtopic but you seem to be able to help me Smiley

I can follow your instructions but what I end up with is only RGB channels with the transparent areas 'deleted' from the channels.  Most artists require the alpha channel to be seperate from the RGB so it can be painted onto.

If I attempt to save as PNG while I have my ARGB channels intact, photoshop cleverly unchecks & greys out the 'Alpha Channels' checkbox.  It also annoys me with this message: "Some of the document's data will not be saved using the chosen format and options." Argh!  I tried the SuperPNG plugin and that doesn't seem to help.

Do you know of a plugin that lets you save and load the PNG with the alpha channel intact?  The nvidia DDS plugin does this perfectly.

Thanks!

A
Offline Bombadil

Senior Member





« Reply #6 - Posted 2004-06-15 04:24:07 »

Quote
Do you know of a plugin that lets you save and load the PNG with the alpha channel intact?  The nvidia DDS plugin does this perfectly.

With Photoshop I can't help, but I can recommend Xnview to view, convert etc PNGs with our without alpha channel (it's free for non-commercial usage).

Btw does anyone know how you could create a 32bpp alpha channeled PNG with Xnview when you've got a 24bpp picture plus an 8bpp alpha channel picture as input?
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #7 - Posted 2004-06-15 05:28:23 »

Quote
I can follow your instructions but what I end up with is only RGB channels with the transparent areas 'deleted' from the channels.


Yes, it's deleted then if the default background was set to transparent then you have your final image. (You don't need the seperate alpha channel anymore)

Quote
Most artists require the alpha channel to be seperate from the RGB so it can be painted onto.


Well, that's just the finishing step. You can just go the 32bit tga route (I mean a sperate alpha channel) till the end, if you like.

弾幕 ☆ @mahonnaiseblog
Offline anarchotron

Junior Member




...precious bodily fluids.


« Reply #8 - Posted 2004-06-15 12:35:17 »

Ahh cool.  My photoshop problems are over.  I even found a plugin floating around that saves/loads PNGs with a seperate alpha channel here:

http://www.shiftermod.com/board/index.php?showtopic=1715&st=0&#entry15638

Thanks all!

[EDIT 2005-08-02]
The link above seems to have broken, try this one instead:

http://www.fnordware.com/superpng/
[/EDIT]
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #9 - Posted 2004-06-15 12:56:19 »

Ah thanks for the link.

One thing to note: the way it's implemented in PS makes more sense for most cases (were alpha is used for transparency) - all RGB values wich are in a 100% transparent area gets trashed and the remaining space gets filled with the last used color. That might sound a bit odd, but it results in better compression.

Well, no big deal as long as you don't fill the 100% transparent areas with random dithered pixels Wink

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cohnen

Junior Newbie




Java games rock!


« Reply #10 - Posted 2004-08-16 18:36:40 »

Hi, just wanna let u know I just finished a small tutorial for writing a DDS loader, currently works with DXT1-5 for 2d textures and  cube maps. Mipmaps also supported.
Any feedback very much appreciated.
U can find it @ http://www.chriscohnen.de

yours
/Chris

Quote
Obviously DDS is probably the best format for this but microsoft standards make me feel icky. I also have not found any java Image readers for DDS, and I don't really want to write my own Image reader.

The java Image class only appears to support PNG, JPG, and GIF. None of these formats appear to properly support the alpha channel, although I could be mistaken.

Any advice?

A

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (13 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (31 views)
2014-08-16 06:45:27

Tekkerue (31 views)
2014-08-16 06:22:17

Tekkerue (19 views)
2014-08-16 06:20:21

Tekkerue (29 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (42 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!