|

楼主 |
发表于 2009-10-24 18:50:00
|
显示全部楼层
Re:某人???3DXSPRITE要求?理??次?纾?@是?解!只要硬件支持,就
lpD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&Caps);
if(Caps.TextureCaps & D3DPTEXTURECAPS_POW2)
POW2 = true;//我的显卡上结果为true
else
POW2 = false;
if(Caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL)
NONPOW2CONDITIONAL = true;//我的显卡上结果为true
else
NONPOW2CONDITIONAL = false;
上面的检测代码在我显卡上执行后,D3DPTEXTURECAPS_POW2和D3DPTEXTURECAPS_NONPOW2CONDITIONAL都为真。
下面是微软的官方说明:
D3DPTEXTURECAPS_NONPOW2CONDITIONAL
D3DPTEXTURECAPS_POW2 is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.
The texture addressing mode for the texture stage is set to D3DTADDRESS_CLAMP.
Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
Mipmapping is not in use (use magnification filter only).
Texture formats must not be D3DFMT_DXT1 through D3DFMT_DXT5.
If this flag is not set, and D3DPTEXTURECAPS_POW2 is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.
A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.
也就说当这两个标志都为开启时,可以有条件地支持非2次幂纹理。
但是这官方说明里可没有说 仍然会使用2次幂尺寸的显存 哦!
(话说我的可是超级垃圾的集成显卡,但是也可以有条件地支持非2次幂,这说明什么?) |
|