Archived

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

d000hg

How do I know what I can do?

Recommended Posts

You can easily extract from d3d how many streams, simultaneous and texture blend stages are supported on a given card. For instance my GF2 supports 8 texture blend ops and 2 simultaneous textures, which suggests I can use 2 textures in a single pass. Easy. But the GF4 reports 4 simultaneous textures, and I''m sure in DoomIII they''re using like 7 textures at once in a single pass on the top cards ie GF3/4. How is this accomplished? John 3:16

Share this post


Link to post
Share on other sites
When your application starts up you try setting each of the setups (texture stage states, renderstates, vertex shaders, texture formats etc) you're going to be using in the whole application - testing each set up with ValidateDevice() - if the call fails you try an alternative setup.

This is also much of the what D3DX Effects & Techniques aee intended to solve.

So for example if I knew I'd have some glowing stuff, some alpha test stuff, some opaque stuff, some foggy opaque stuff I'd do something like:


for (j=0; j<numberOfMethodsIKnowForGlowingEffects; ++j)
{
SetRS(), SetTSS(), SetTexture() for glowing effect
if (SUCCEEDED(ValidateDevice())
break;
}

for (j=0; j<numberOfMethodsIKnowForAlphaTestEffects; ++j)
{
SetRS(), SetTSS(), SetTexture() for alpha test effect
if (SUCCEEDED(ValidateDevice())
break;
}

for (j=0; j<numberOfMethodsIKnowForGlowingEffects; ++j)
{
SetRS(), SetTSS(), SetTexture() for glowing effect
if (SUCCEEDED(ValidateDevice())
break;
}
...
for (j=0;j<numberOfMethodsIKnowForFoggyOpaqueEffects; ++j)
{
SetRS(), SetTSS(), SetTexture() for foggy opaque effect
if (SUCCEEDED(ValidateDevice())
break;
}



Without having millions of caps flags (which would be too tedious to test as well as a massive pain for MS and the IHVs), there's no way other than ValidateDevice for hardware to expose all the exact combinations of states and texture formats its capable of.

[edit: lt for less than signs]

--
Simon O'Connor
Creative Asylum Ltd
www.creative-asylum.com

[edited by - s1ca on July 15, 2002 6:41:36 PM]

Share this post


Link to post
Share on other sites