LWJGL
May 21, 2012, 01:00:27
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
LWJGL 2.8.3 released!
Home
Help
Search
Login
Register
LWJGL
>
Programming
>
OpenGL
>
tga loading
Pages: [
1
]
« previous
next »
Print
Author
Topic: tga loading (Read 1829 times)
bisquit
Newbie
Posts: 6
tga loading
«
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
Re: tga loading
«
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
Re: tga loading
«
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
Re: tga loading
«
Reply #3 on:
May 25, 2007, 23:49:42 »
im not sure about photoshop.
I use Gimp its free
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
弾幕
Re: tga loading
«
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
ze blog
☆
eee games
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Programming
-----------------------------
=> Lightweight Java Library Game Development
=> LWJGL Documentation
=> Bug Reports / RFE
=> OpenGL
=> OpenAL
=> General Java Game Development
-----------------------------
Archive
-----------------------------
=> Resolved Bugs/RFE
=> DirectX
=> DevIL
=> FMOD
Loading...