Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / A DDS image texturing problem

Author
Message
Alex Xia
13
Years of Service
User Offline
Joined: 29th Sep 2010
Location:
Posted: 10th Oct 2010 04:57
I've got some DDS image files and these DDS files have no alpha channel. They are just with a black background?

If I use them to texture a 3D model, how to make the black background transparent?

I tried to load them in 2D, and use dbSetImageColorKey(0,0,0) before loading them as images. But they are still opaque on screen.

Thanks for any info.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 10th Oct 2010 13:39
I'd say change the image itself to have an alpha channel and set the objects transparency on. That would be the easiest way.
Another way I could think of is writing a simple shader that sets every black pixel to full transparency.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 13th Oct 2010 18:05
DXSDK ships with a texture editor. You can load an image to it's alpha channel. If you don't want to use an alpha channel, there is no need to use .dds.

The fastest code is the code never written.
Manga Tiger Boy
15
Years of Service
User Offline
Joined: 24th Aug 2009
Location:
Posted: 14th Oct 2010 23:44
Try Paint.net. Nice, free, image editor; plus it exports to almost any filetype!

Alex Xia
13
Years of Service
User Offline
Joined: 29th Sep 2010
Location:
Posted: 22nd Oct 2010 10:20
Hi guys, thanks a lot for the suggestions.

The DDS files are extracted from a game. I am pretty sure that the black color is rendered as transparent with these DDS files. So, I am just curious that how the engine the game uses did that. There is must a way, maybe some technique we don't know, or not familar with...

I am just curious and want to figure out if I could do it with dark GDK.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 25th Oct 2010 05:38
void dbSetImageColorKey ( int iRed, int iGreen, int iBlue )

That's what you are looking for. Just use 0,0,0 for black.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-09-28 16:31:18
Your offset time is: 2024-09-28 16:31:18