So, as some peoples know, I'm attempting to remake ET in OpenGL and SDL. o_o
Instead of having 3D models or anything for ET and the baddies, I want to have flat 2D sprites like this:
I know how to load textures, but I don't know how to set a certain area to transparent. Do I need to figure out how to check each pixel on a texture and replace, say, (1.0, 0.0, 1.0) with ... nothingness. 0.o;
I don't know. I assume there's a function in OpenGL to turn an image partially or fully transparent, and I just need to do that for the appropriate pixels.
OpenGL Sprites
Moderator: Coders of Rage
- Moosader
- Game Developer
- Posts: 1081
- Joined: Wed May 07, 2008 12:29 am
- Current Project: Find out at: http://www.youtube.com/coderrach
- Favorite Gaming Platforms: PC, NES, SNES, PS2, PS1, DS, PSP, X360, WII
- Programming Language of Choice: C++
- Location: Kansas City
- Contact:
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
- Moosader
- Game Developer
- Posts: 1081
- Joined: Wed May 07, 2008 12:29 am
- Current Project: Find out at: http://www.youtube.com/coderrach
- Favorite Gaming Platforms: PC, NES, SNES, PS2, PS1, DS, PSP, X360, WII
- Programming Language of Choice: C++
- Location: Kansas City
- Contact:
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
- Moosader
- Game Developer
- Posts: 1081
- Joined: Wed May 07, 2008 12:29 am
- Current Project: Find out at: http://www.youtube.com/coderrach
- Favorite Gaming Platforms: PC, NES, SNES, PS2, PS1, DS, PSP, X360, WII
- Programming Language of Choice: C++
- Location: Kansas City
- Contact:
About GLPNG -- It requires GLUT as well? So are you using OpenGL, SDL, AND GLUT for the game?GyroVorbis wrote:. . . I have a certain fondness for that square.
The way we did it was really easy. Our PNG library: glpng handles transparencies itself. You just load it as being a transparent PNG. That's what I recommend you look into, because I'm not a big fan of hardcoding transparencies.
- cypher1554R
- Chaos Rift Demigod
- Posts: 1124
- Joined: Sun Jun 22, 2008 5:06 pm