Jump to content
  • Advertisement
Sign in to follow this  
Waxy

DX7 (d3d) Transparicies?

This topic is 4812 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

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!