Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, AndrewAMD, 7th_zorro), 946 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bmap_lock and internal textures #338359
08/17/10 16:14
08/17/10 16:14
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I am currently writing some basic lightmap generation for terrain. It basicly works fine, but I want it to support objects with alpha transparency like trees, including that transparency.
That also already works fine, but now, everything without transparency doesn´t throw a shadow anymore.
The reason is bmap_lock, which returns 8888 for all textures. In this special case, most textures are saved in the mdl files and WED tells me that some are 24 and others are 32bit, which is exactly how it is meant to be.

And while I am at bmaps, a request: Is there anyway to allow at least pixel_for_bmap for dds files? Would be helpfull laugh.

Re: bmap_lock and internal textures [Re: Slin] #338472
08/18/10 14:09
08/18/10 14:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
bmap_lock can return either 888 or 8888 for 24 bit textures, dependent on how they are stored on the 3D card. Some cards store textures always in 32 bit, regardless if they contain an alpha channel or not. bmap_lock has to return this value because the pixel functions need to know if the bitmap is stored in 24 bit or 32 bit format.

Pixel_for_bmap would not return anything useful for DDS files. They don't contain pixels, but image sections with palettes. But you could convert the DDS file into another format, like TGA, that contains pixels.

Re: bmap_lock and internal textures [Re: jcl] #338487
08/18/10 14:50
08/18/10 14:50
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline OP
Expert
Slin  Offline OP
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Okay, that makes sense.
Is there any way to find out if there actually was an alphachannel or not, or to make sure, that the alphachannel value is always >0 for such a textures pixels?
I could of course just check all pixels of a texture and decide that there is no alphachannel, if their alpha values are all 0, but I guess, that such an approach is quite slow.

Re: bmap_lock and internal textures [Re: Slin] #338496
08/18/10 15:42
08/18/10 15:42
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, with TGA images you can check this through the "bytespp" parameter of the BMAP struct. At 3, it's no alphachannel, at 4 it has an alphachannel.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1