LWJGL
May 21, 2012, 01:00:27 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: tga loading  (Read 1829 times)
bisquit
Newbie
*
Posts: 6


« on: May 23, 2007, 19:37:48 »

hi! i'm trying to imitate lesson32 from nehe.gamedev.org and i noticed that they're using tga files... how can i use tga files without the black background showing? and how can i create my own tga files?

not really familiar with it.

i tried copying 'loadTextures(string path)' from the lesson, but it just gave me an error on Display.update(). which i don't get at all.

thanks for your helP!
Logged
bobjob
Prolific Timewaster
****
Posts: 335


LWJGL: WOW SO GOOD


« Reply #1 on: May 24, 2007, 01:53:01 »

assuming that the file loads.

if its only a problem with transperancy

add this in ur code: when setting up openGL

GL11.glAlphaFunc(GL11.GL_GREATER,0.1f);
GL11.glEnable(GL11.GL_ALPHA_TEST);
Logged

LWJGL Benchmark online test:
http://have2chat.net/benchmark/
http://have2chat.net/benchmark/fullpage.html (run full OpenGL webpage)
bisquit
Newbie
*
Posts: 6


« Reply #2 on: May 25, 2007, 15:33:12 »

thanks! now it works for .tga files..

but now, how can i make my own tga files? i've tried making it in photoshop with a transparent background.. but the background becomes white when i load it...
Logged
bobjob
Prolific Timewaster
****
Posts: 335


LWJGL: WOW SO GOOD


« Reply #3 on: May 25, 2007, 23:49:42 »

im not sure about photoshop.
I use Gimp its free Smiley

make a new transperant layer then delete the background, so that the transperant layer is the background.
then place your image on top.
Logged

LWJGL Benchmark online test:
http://have2chat.net/benchmark/
http://have2chat.net/benchmark/fullpage.html (run full OpenGL webpage)
oNyx
Talks Too Much
***
Posts: 177


弾幕


« Reply #4 on: May 26, 2007, 22:00:38 »

If you have a bunch of PNGs it's easier to convert em via imagemagick like:

mogrify -format tga *.png

If you want to create a 32bit tga in photoshop, you'll need to add an alpha channel in the channels tab (with that new channel button). If you want to use the existing alpha from the RGB stuff (well... photoshop is a bit weird in that regard) you can do it like:
-ctrl+click on the layer
-go to the channels tab
-hit new channel
-select white
-alt+backspace

And then you got some sparkling new alpha channel, which matches your usual alpha stuff.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!