DX7 (d3d) Transparicies?

Started by
3 comments, last by Waxy 18 years, 10 months ago
In Direct3D7, is it possiable to use transparent colors in your textures? If so, where is the tutoral. If not, then how difficult is it to port a D3D7 source to D3D9? Open for suggestions.
Advertisement
Quote:Original post by Waxy
In Direct3D7, is it possiable to use transparent colors in your textures?
If so, where is the tutoral.

Yes it's possible, and to my knowledge it should be pretty much the same as the D3D8/9 methods when using the FF pipeline.

The two key things you need to do:
1. Create a texture resource with an alpha component, this is the bit I can't remember for D3D7 as you're still messing with parts of DD7 iirc..
2. Setup the necessary render states, in particular the source and destination blending.

Quote:Original post by Waxy
If not, then how difficult is it to port a D3D7 source to D3D9?

That depends on a lot of things - what are you doing? how big is your codebase? is it particularly advanced (for D3D7 anyway). You could possibly do it in a few days for a simple engine/project, but for a bigger or more complicated piece of software it could take weeks (if not longer).

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Right now -

I'm re-visiting my previous hobby of D3D programming.
The extent of my application is very simple:

1 - Set full screen mode of static resolution and color depth specified in pre-
loaded options

2 - Load surfaces from a custom file format (because i never understood BSP or
else i'd just use a quake editor) The same is used for loading animated models -
arrays of surfaces indexed by frames.

3 - move camera around via keyboard/mouse input (should be no need to change
input method, just how to handle the camera)

4 - detect collisions bassed on rectangle bounding boxes (Ewwwwww Yuck! never
learned real collision/sliding)

5 - Lighting (never got shadows to work. light would shine through walls and
light surfaces on the other side of a lit wall. :( )


D3D7:
I get 50FPS on 1280x1024 with 4,000 faces, 32bit color depth, full depth bitmap textures.
lighting seems to effect FPS very little.
2.3ghz celeron
win98 (WHat? No XP??? no, longhorn comes out next year at x-mas. why bother?)
256MB ram
G-Force FX 5500

I'm using Imeadiate mode and never learned how to get fog to work, either. in
D3D7 it appears to be RealMode only to allow proper fog. I specificly stuck with IM because i read somewhere that D3D8/9 don't have RM so i figured it'd be easier to port if i tried to upgrade my self-education later.

Would D3D9 improve FPS and make some of the future target features easier for me to acheive?
Waxy,

Yes. It is possible in DirectX7 to perform alpha blending, but it cannot be done using DirectDraw7. Instead, you must use Direct3D Immediate mode to render the surfaces either with multitexturing enabled, or with multiple passes and the correct texture blending operations set.

Here is information on multitexturing straight from Microsoft. Follow this page and its links at the bottom and you should be well versed on the subject of texture blending.

As far as converting from DirectX7 to DirectX9, that mostly depends on whether you're using Direct3D or DirectDraw. In general, DirectX is backwards compatible so you can largely just go through your code and replace 7's with 9's. Wherever there is a conflict, replace the function with the newer version, etc...

If you're using DirectDraw however, its a bit more tricky, as DirectDraw no longer exists as of DX8. In this case, you will need to go through and replace the DirectDraw code with D3D code that is functionally the same.

Read the documentation I provided above and if you have specific technical questions afterwards, just post those as a follow-up here and we'll answer them as best we can.

Cheers mate, and good luck!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
Extremely helpful and/or friendly

This topic is closed to new replies.

Advertisement