Posts

Showing posts with the label d3d

C# / XNA - Error - XNA Framework HiDef Profile

When creating an XNA game, and the application produces the following error, your video card does not support the current version of DirectX. In this case, the requirement is video card support for pixel shader 4.0 . No suitable graphics card found. Could not find a Direct3D device that supports the XNA Framework HiDef profile. Verify that a suitable graphics device is installed. Make sure the desktop is not locked, and that no other application is running in full screen mode. Avoid running under Remote Desktop or as a Windows service. Check the display properties to make sure hardware acceleration is set to Full. If your video card does not support pixel shader 4.0 , you can toggle the game profile, from HiDef to Reach . To modify this, go to project properties , XNA Game Studio , and toggle the radio button, Use Reach to access a limited API set supported by Windows Phone, Xbox 360, and Windows.

C++ - Direct X 9.0 - Overlap Tests (Mesh)

This is a code snippet, that I put together to handle mesh-overlapping, so if the view of a player's model is obstructed by something such as a tree, this will cause that tree to have an applied transparency. The code snippet can be used however you want, and broken up/restructured to be more organized -- however, please give me credit if you use it. Thanks. D3DXVECTOR3 vCenter; // Lock the Vertex Buffer if(SUCCEEDED(pMesh->LockVertexBuffer(D3DLOCK_READONLY, (BYTE**)&Ptr))) { // Computer Bounding Sphere Radius D3DXComputeBoundingSphere((void*)Ptr, pMesh->GetNumVertices(), pMesh->GetNumBytesPerVertex(), &vCenter, &fObjectRadius); fObjectRadius = D3DXVec3Length(&vCenter) + fObjectRadius; // Unlock the Vertex Buffer pMesh->UnlockVertexBuffer(); } This calculates the Radius, for use in the below Overlap test, your radius will never change, since this mesh isn't adjusting in size. D3DXVECTOR3 vObjectPosVS, vPla...