Archived

This topic is now archived and is closed to further replies.

Execute buffers and Alpha

This topic is 6390 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Gang, I posted a question below, but unfortunately, times have moved past me, and the help I got didn''t turn out to be much help. Here''s , I switched over to ththe issue: I wrote my game engine using d3d execute buffers. A while back I ported it over to drawprimitives and the new d3d interfaces, and I lost 15 frames/sec. I spend two days polishing it, and at the end of that period, I was only down 13 frames/sec. So, I''m sticking with execute buffers. All my code is optimized for it, and it runs nicely. So far, it does everything I want it to do. Except recently, I decided I wanted One More Thing. I want to alpha my textures. Right now I load textures onto an ordinary directdraw surface with DDCAPS_TEXTURE as its "cap." HOW CAN I ATTACH AN ALPHA LAYER TO THIS??? All I want to do is make an alpha surface and attach it to the texture surface. I can''t make an alpha surface at all. Does anyone have a swift chunk of code that simple makes an alpha-only surface? Thanks in advance! --Goodlife P.S. Please do not provide advice on what I should be doing instead of what I''m doing. I get very much of that, but every successive version of direct3d gives me a speed DECREASE when I change over to the "new way." All my visuals are satisfactory right now. If I can''t alpha a texture, I am going to render the texture twice, or three times, with successively less transparent passes each time-- I don''t need to use these alpha textures very often. Just for glare and things. But, if you have accomplished the mean feat of attaching an alpha layer to a directdraw surface, please do let me know how in God''s name you did it. I just keep getting invalid parameters... over and over again.

Share this post


Link to post
Share on other sites
When you create the texture surface you need to set a flag that tells DX that it has an alpha channel, if this flag is not set DX will ignore any alpha channel information you put in the data.
Unfortunately I don''t remember which flag that needs to be set (I use D3DX to create my textures and it automatically sets the flag) but you should be able to find it if you (re)read the DX docs.

Now that I think about it, it might actually be a bit difficult to find which flag needs to be set since you probably can''t use the interfaces used for DX7. But maybe the process for creating textures in DX7 isn''t that much different from what you do.

good luck (j/k)

- WitchLord

Share this post


Link to post
Share on other sites