View unanswered posts | View active topics It is currently Thu Aug 28, 2014 6:10 am



Reply to topic  [ 5 posts ] 
 16bit Bitmap Transparency 
Author Message

Joined: Mon Jan 24, 2011 6:17 am
Posts: 4
How do I set a certain color like black to be transparent with a 16bit Bitmap?
Do I use GL_TEXTURE_COLOR0_TRANSPARENT?
There's no example that illustrates this in the libnds examples folder.


Mon Jan 31, 2011 6:30 am
Profile

Joined: Thu Jul 02, 2009 1:19 pm
Posts: 324
GL_TEXTURE_COLOR0_TRANSPARENT is for paletted textures only. for 16bit texture formats you need to use the alpha bit - bit 15.


Mon Jan 31, 2011 2:23 pm
Profile

Joined: Mon Jan 24, 2011 6:17 am
Posts: 4
OK thanks.
So I need to add a certain parameter to my *.grit file for the alpha bit?


Fri Feb 04, 2011 7:55 am
Profile

Joined: Wed Mar 31, 2010 6:05 pm
Posts: 212
have you tried putting an alpha channel in your source images? have you tried looking at the grit options such as

-gT{n} Transparent color; rrggbb hex or 16bit BGR hex [FF00FF]

which seem to describe what you want?


Sat Feb 05, 2011 10:20 am
Profile

Joined: Thu Sep 09, 2010 1:28 pm
Posts: 23
Location: Australia
habababa wrote:
How do I set a certain color like black to be transparent with a 16bit Bitmap?
Do I use GL_TEXTURE_COLOR0_TRANSPARENT?
There's no example that illustrates this in the libnds examples folder.

So you want ColourKey transparency? so basically:
A = 0 = RGB(0,0,0)
Where Alpha is equal to 0 if the RGB components are all 0 (black)
You can loop through your texture bitmap array and process each 16-bit value, if the RGB bits are all 0 then you can set bit 15 to 0 otherwise bit 15 would be 1

_________________
Move over Mario... and cruise by Crash... Croc Rocks!
It's a serious adventure 3D platformer for all retro gamers to drool over =D


Thu Feb 10, 2011 8:58 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.
Get devkitPro at SourceForge.net. Fast, secure and Free Open Source software downloads