Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Alpha Map in DirectX 7

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Vampire Posted - Jul 26 2005 : 07:02:04 AM
Does anyone know, how to use alpha maps in DX7?
I'd like a surface to look in some parts more transparent than in others.
5   L A T E S T    R E P L I E S    (Newest First)
Vampire Posted - Aug 09 2005 : 03:50:56 AM
Thanks a lot. I'll give it a try. Ca'nt wait see working...
Although I decided to switch to DirectX 8. It has lots of new stuff. I think it is more suitable for what I have in mind.
Eric Coleman Posted - Aug 04 2005 : 6:14:32 PM
The first zip file has code that loads .bmp textures with an alpha file. The second zip file has code to generate the alpha file from gray scale images.

Download Attachment: Test.zip
73.8 KB

Download Attachment: alphamapper.zip
97.98 KB
Vampire Posted - Jul 29 2005 : 01:24:31 AM
Well, I looked at it and... it seemed too complicated. I mean there are two steps. One uses DX7 and the other DX8. The first step saves the two (RGB & alpha) images into one and then the second step loads and uses it. I'd like to do it directly... Eric Coleman, can you send me the code you tried? I'd like to stick to one DX. And that is v7.
Vampire Posted - Jul 29 2005 : 12:04:41 AM
Thanks for the info. I've found an example at Lucky's site:
http://www.rookscape.com/vbgaming/tutBV.php
I'll try it out... But it would be great if you could give me an other example...
Thanks again...
Eric Coleman Posted - Jul 27 2005 : 10:30:20 AM
It's not easy. I was never able to figure out how to load any files with alpha maps, such as TGA, PNG, or DDS. However, I was able to get some basic alpha map support by storing alpha informaiton in a secondary file and then modifying the pixels with the appropriate alpha value.

Overall I used two files. The main image was either gif, jpg, or bmp. As for the alpha map, I simply used a second file that had a single byte for each pixel in the original image, and I use .alpha as the file extension. For example, for "tile.jpg", the alpha file would have been "tile.jpg.alpha". The texture load function that I used looked for the alpha file automatically and if it existed then it would use it.

As for using the file, I created a DD surface(texture) from the bmp file (gif and jpg converted to bmp). I then locked the surface and read each pixel, combined the alpha value with the color, and then wrote the pixel value back to the surface. This method could have been faster if I would have used the getlockedarray function instead of accessing each pixel individually.

One problem that I encountered with nVidia GeForce 2 cards was that the color returned from GetPixel was always black. I was never able to figure out how to solve the problem.

I'll look around to see if I can find the code.

VBGamer © Go To Top Of Page
This page was generated in 0.08 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.