|
|
我做了这么几步工作:
1. 新建CubeTexture。
D3DXCreateCubeTexture( Dev, 128, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pNormalCubeTex );
2. 将pNormalCubeTex的6个面涂成红色
pNormalCubeTex->LockRect( D3DCUBEMAP_FACE_POSITIVE_X, 0, &LRct, NULL, 0 );
pPixel = ( DWORD* )( LRct.pBits );
for ( int T = 0; T < 128; T++ )
{
for ( int S = 0; S < 128; S++ )
{
pPixel[ S ] = 0xFF0000;
}
pPixel += LRct.Pitch;
}
.......//以下分别对另外5个面的纹理涂成红色
3. 在PS中使用pNormalCubTex
Dev->SetTexture( 0, pNormalCubeTex );
ps.1.4
texld r0, t0
应该渲染出来的物体是红色的吧,可结果却是一个黑色的物体,谁能帮我看看这是为什么呢?谢谢! |
|