Living without D3DX

General Helpers

The DirectX Tool Kit provides a number of helpers that are designed to simplify Direct3D 11 programming in the tradition of the original D3DX library. You can find the library on CodePlex and GitHub.

ID3DX10Sprite

SpriteBatch

ID3DX10Font

SpriteFont, SpriteBatch

ID3DX10Mesh

Model, ModelMesh, ModelMeshPart

D3DXCreateBox 
D3DXCreateCylinder 
D3DXCreateSphere
D3DXCreateTeapot 
D3DXCreateTorus

GeometricPrimitive

D3DX11CreateShaderResourceViewFromFile

CreateXXXTextureFromFile

D3DX11CreateShaderResourceViewFromResource
D3DX11CreateShaderResourceViewFromMemory

CreateXXXTextureFromMemory

D3DX11CreateTextureFromFile

CreateXXXTextureFromFile

D3DX11CreateTextureFromResource
D3DX11CreateTextureFromMemory

CreateXXXTextureFromMemory

D3DX11SaveTextureToFile

SaveXXXTextureToFile

HLSL Functions

The HLSL compiler, shader reflection API, and related functionality has been broken out into it's own D3DCompileDLL for some time. D3DCompile is in the Windows 8.x SDK and is included with VS 2012 and VS 2013 Preview.

D3DXCompileShaderFromFile
D3DX10CompileFromFile
D3DX11CompileFromFile
D3DCompileFromFile
D3DXCompileShader
D3D10CompileShader
D3DX10CompileFromMemory
D3DX11CompileFromMemory
D3DCompile
D3DXCompileShaderFromResource
D3DX10CompileFromResource
D3DX11CompileFromResource
No direct equivalent. Can use resource APIs and then D3DCompileabove.
D3DXPreprocessShader
D3DXPreprocessShaderFromFile
D3DXPreprocessShaderFromResource
D3D10PreprocessShader
D3DX10PreprocessShaderFromFile
D3DX10PreprocessShaderFromMemory
D3DX10PreprocessShaderFromResource
D3DX11PreprocessShaderFromFile
D3DX11PreprocessShaderFromMemory
D3DX11PreprocessShaderFromResource
D3DPreprocess
D3DXDisassembleShader
D3D10DisassembleShader
D3DX10DisassembleShader
D3DDisassemble
D3D10ReflectShader
D3DX10ReflectShader
D3DReflect
D3D11Reflect
ID3DXBuffer
ID3D10Blob
ID3DBlob
D3DXCreateBuffer
D3D10CreateBlob
D3DCreateBlob
D3D10GetInputSignatureBlob
D3D10GetOutputSignatureBlob
D3D10GetInputAndOutputSignatureBlob
D3D10GetShaderDebugInfo
D3DGetBlobPart

Texture Functions

The DirectXTex library is primarily intended for texture processing offline with tools, although it can also be used at runtime for doing texture block compression, mipmap generation, or handling more general image processing needs. DirectXTK is intended for use at runtime with light-weight helpers and image loaders, but does not provide support for general runtime texture format conversion. You can find both libraries on CodePlex and GitHub.

D3DX11ComputeNormalMap

DirectXTex library, ComputeNormalMap

D3DX11CreateShaderResourceViewFromFile
D3DX11CreateTextureFromFile

DDSTextureLoader: CreateDDSTextureFromFile
WICTextureLoader: CreateWICTextureFromFile

DirectXTex library (tools), LoadFromXXXFile thenCreateShaderResourceView or CreateTexture

D3DX11CreateShaderResourceViewFromMemory
D3DX11CreateTextureFromMemory

DDSTextureLoader: CreateDDSTextureFromMemory
WICTextureLoader: CreateWICTextureFromMemory

DirectXTex library (tools), LoadFromXXXMemory thenCreateShaderResourceView or CreateTexture

D3DX11CreateShaderResourceViewFromResource
D3DX11CreateTextureFromResource

No direct equivalent, can use Win32 resource functions and then the ‘from memory’ APIs above.

D3DX11FilterTexture

DirectXTex library, GenerateMipMaps and GenerateMipMaps3D

D3DX11GetImageInfoFromFile

DirectXTex library, GetMetadataFromXXXFile

D3DX11GetImageInfoFromMemory

DirectXTex library, GetMetadataFromXXXMemory

D3DX11GetImageInfoFromResource

No direct equivalent, can use Win32 resource functions and then the ‘from memory’ APIs above.

D3DX11LoadTextureFromTexture

DirectXTex library, ResizeConvertCompressDecompress, and/or CopyRectangle

D3DX11SaveTextureToFile

ScreenGrab: SaveDDSTextureToFile or SaveWICTextureToFile

DirectXTex library, CaptureTexture then SaveToXXXFile

D3DX11SaveTextureToMemory

DirectXTex library, CaptureTexture then SaveToXXXMemory

Geometry Functions

The DirectXMesh library is intended for geometry processing offline with tools, although it can be used at runtime. You can find the library on CodePlex and GitHub.

D3DXCleanMeshClean
D3DXComputeNormalsComputeNormals
D3DXComputeTangent
D3DXComputeTangentFrame
D3DXComputeTangentFrameEx
ComputeTangentFrame
ID3DX10Mesh::GenerateAdjacencyAndPointRepsGenerateAdjacencyAndPointReps
ID3DX10Mesh::GenerateGSAdjacencyGenerateGSAdjacency
ID3DX10Mesh::OptimizeAttributeSort
OptimizeFacesEx
OptimizeVertices
ReorderIB
FinalizeIB
FinalizeVB
D3DXOptimizeFacesOptimizeFaces
D3DXOptimizeVerticesOptimizeVertices
D3DXValidMeshValidate

Math

The legacy D3DXMath library has been replaced by DirectXMath. The library is in the Windows 8.x SDK and is included with VS 2012 and VS 2013 Preview.

D3DXFLOAT16HALF
D3DXMATRIXA16XMMATRIX or XMFLOAT4X4A

D3DXQUATERNION

D3DXPLANE

D3DXCOLOR

XMVECTOR is used rather than having unique types, so you will likely need to use an XMFLOAT4
D3DXVECTOR2XMFLOAT2
D3DXVECTOR2_16FXMHALF2
D3DXVECTOR3XMFLOAT3
D3DXVECTOR4XMFLOAT4

(or if you can guarantee the data is 16-byte aligned, XMVECTOR orXMFLOAT4A )

D3DXVECTOR4_16FXMHALF4
D3DX_PIXM_PI
D3DX_1BYPIXM_1DIVPI
D3DXToRadianXMConvertToRadians
D3DXToDegreeXMConvertToDegrees
D3DXBoxBoundProbeBoundingBox::Intersects(XMVECTOR, XMVECTOR, float&)
D3DXComputeBoundingBoxBoundingBox::CreateFromPoints
D3DXComputeBoundingSphereBoundingSphere::CreateFromPoints
D3DXSphereBoundProbeBoundingSphere::Intersects(XMVECTOR, XMVECTOR, float&)
D3DXIntersectTriFunctionTriangleTests::Intersects
D3DXFloat32To16ArrayXMConvertFloatToHalfStream
D3DXFloat16To32ArrayXMConvertHalfToFloatStream
D3DXVec2LengthXMVector2Length or XMVector2LengthEst
D3DXVec2LengthSqXMVector2LengthSq
D3DXVec2DotXMVector2Dot
D3DXVec2CCWXMVector2Cross
D3DXVec2AddXMVectorAdd
D3DXVec2SubtractXMVectorSubtract
D3DXVec2MinimizeXMVectorMin
D3DXVec2MaximizeXMVectorMax
D3DXVec2ScaleXMVectorScale
D3DXVec2LerpXMVectorLerp or XMVectorLerpV
D3DXVec2NormalizeXMVector2Normalize or XMVector2NormalizeEst
D3DXVec2HermiteXMVectorHermite or XMVectorHermiteV
D3DXVec2CatmullRomXMVectorCatmullRom or XMVectorCatmullRomV
D3DXVec2BaryCentricXMVectorBaryCentric or XMVectorBaryCentricV
D3DXVec2TransformXMVector2Transform
D3DXVec2TransformCoordXMVector2TransformCoord
D3DXVec2TransformNormalXMVector2TransformNormal
D3DXVec2TransformArrayXMVector2TransformStream
D3DXVec2TransformCoordArrayXMVector2TransformCoordStream
D3DXVec2TransformNormalArrayXMVector2TransformNormalStream
D3DXVec3LengthXMVector3Length or XMVector3LengthEst
D3DXVec3LengthSqXMVector3LengthSq
D3DXVec3DotXMVector3Dot
D3DXVec3CrossXMVector3Cross
D3DXVec3AddXMVectorAdd
D3DXVec3SubtractXMVectorSubtract
D3DXVec3MinimizeXMVectorMin
D3DXVec3MaximizeXMVectorMax
D3DXVec3ScaleXMVectorScale
D3DXVec3LerpXMVectorLerp or XMVectorLerpV
D3DXVec3NormalizeXMVector3Normalize or XMVector3NormalizeEst
D3DXVec3HermiteXMVectorHermite or XMVectorHermiteV
D3DXVec3CatmullRomXMVectorCatmullRom or XMVectorCatmullRomV
D3DXVec3BaryCentricXMVectorBaryCentric or XMVectorBaryCentricV
D3DXVec3TransformXMVector3Transform
D3DXVec3TransformCoordXMVector3TransformCoord
D3DXVec3TransformNormalXMVector3TransformNormal
D3DXVec3TransformArrayXMVector3TransformStream
D3DXVec3TransformCoordArrayXMVector3TransformCoordStream
D3DXVec3TransformNormalArrayXMVector3TransformNormalStream
D3DXVec3ProjectXMVector3Project
D3DXVec3UnprojectXMVector3Unproject
D3DXVec3ProjectArrayXMVector3ProjectStream
D3DXVec3UnprojectArrayXMVector3UnprojectStream
D3DXVec4LengthXMVector4Length or XMVector4LengthEst
D3DXVec4LengthSqXMVector4LengthSq
D3DXVec4DotXMVector4Dot
D3DXVec4AddXMVectorAdd
D3DXVec4SubtractXMVectorSubtract
D3DXVec4MinimizeXMVectorMin
D3DXVec4MaximizeXMVectorMax
D3DXVec4ScaleXMVectorScale
D3DXVec4LerpXMVectorLerp or XMVectorLerpV
D3DXVec4CrossXMVector4Cross
D3DXVec4NormalizeXMVector4Normalize or XMVector4NormalizeEst
D3DXVec4HermiteXMVectorHermite or XMVectorHermiteV
D3DXVec4CatmullRomXMVectorCatmullRom or XMVectorCatmullRomV
D3DXVec4BaryCentricXMVectorBaryCentric or XMVectorBaryCentricV
D3DXVec4TransformXMVector4Transform
D3DXVec4TransformArrayXMVector4TransformStream
D3DXMatrixIdentityXMMatrixIdentity
D3DXMatrixDeterminantXMMatrixDeterminant
D3DXMatrixDecomposeXMMatrixDecompose
D3DXMatrixTransposeXMMatrixTranspose
D3DXMatrixMultiplyXMMatrixMultiply
D3DXMatrixMultiplyTransposeXMMatrixMultiplyTranspose
D3DXMatrixInverseXMMatrixInverse
D3DXMatrixScalingXMMatrixScaling
D3DXMatrixTranslationXMMatrixTranslation
D3DXMatrixRotationXXMMatrixRotationX
D3DXMatrixRotationYXMMatrixRotationY
D3DXMatrixRotationZXMMatrixRotationZ
D3DXMatrixRotationAxisXMMatrixRotationAxis
D3DXMatrixRotationQuaternionXMMatrixRotationQuaternion
D3DXMatrixRotationYawPitchRollXMMatrixRotationRollPitchYaw
(Note the order of parameters is different:
D3DXMath takes yaw, pitch, roll,
DirectXMath takes pitch, yaw, roll)
D3DXMatrixTransformationXMMatrixTransformation
D3DXMatrixTransformation2DXMMatrixTransformation2D
D3DXMatrixAffineTransformationXMMatrixAffineTransformation
D3DXMatrixAffineTransformation2DXMMatrixAffineTransformation2D
D3DXMatrixLookAtRHXMMatrixLookAtRH
D3DXMatrixLookAtLHXMMatrixLookAtLH
D3DXMatrixPerspectiveRHXMMatrixPerspectiveRH
D3DXMatrixPerspectiveLHXMMatrixPerspectiveLH
D3DXMatrixPerspectiveFovRHXMMatrixPerspectiveFovRH
D3DXMatrixPerspectiveFovLHXMMatrixPerspectiveFovLH
D3DXMatrixPerspectiveOffCenterRHXMMatrixPerspectiveOffCenterRH
D3DXMatrixPerspectiveOffCenterLHXMMatrixPerspectiveOffCenterLH
D3DXMatrixOrthoRHXMMatrixOrthographicRH
D3DXMatrixOrthoLHXMMatrixOrthographicLH
D3DXMatrixOrthoOffCenterRHXMMatrixOrthographicOffCenterRH
D3DXMatrixOrthoOffCenterLHXMMatrixOrthographicOffCenterLH
D3DXMatrixShadowXMMatrixShadow
D3DXMatrixReflectXMMatrixReflect
D3DXQuaternionLengthXMQuaternionLength
D3DXQuaternionLengthSqXMQuaternionLengthSq
D3DXQuaternionDotXMQuaternionDot
D3DXQuaternionIdentityXMQuaternionIdentity
D3DXQuaternionIsIdentityXMQuaternionIsIdentity
D3DXQuaternionConjugateXMQuaternionConjugate
D3DXQuaternionToAxisAngleXMQuaternionToAxisAngle
D3DXQuaternionRotationMatrixXMQuaternionRotationMatrix
D3DXQuaternionRotationAxisXMQuaternionRotationAxis
D3DXQuaternionRotationYawPitchRollXMQuaternionRotationRollPitchYaw
(Note the order of parameters is different:
D3DXMath takes yaw, pitch, roll,
DirectXMath takes pitch, yaw, roll)
D3DXQuaternionMultiplyXMQuaternionMultiply
D3DXQuaternionNormalizeXMQuaternionNormalize or XMQuaternionNormalizeEst
D3DXQuaternionInverseXMQuaternionInverse
D3DXQuaternionLnXMQuaternionLn
D3DXQuaternionExpXMQuaternionExp
D3DXQuaternionSlerpXMQuaternionSlerp or XMQuaternionSlerpV
D3DXQuaternionSquadXMQuaternionSquad or XMQuaternionSquadV
D3DXQuaternionSquadSetupXMQuaternionSquadSetup
D3DXQuaternionBaryCentricXMQuaternionBaryCentric or XMQuaternionBaryCentricV
D3DXPlaneDotXMPlaneDot
D3DXPlaneDotCoordXMPlaneDotCoord
D3DXPlaneDotNormalXMPlaneDotNormal
D3DXPlaneScaleXMVectorScale
D3DXPlaneNormalizeXMPlaneNormalize or XMPlaneNormalizeEst
D3DXPlaneIntersectLineXMPlaneIntersectLine
D3DXPlaneFromPointNormalXMPlaneFromPointNormal
D3DXPlaneFromPointsXMPlaneFromPoints
D3DXPlaneTransformXMPlaneTransform
D3DXPlaneTransformArrayXMPlaneTransformStream
D3DXColorNegativeXMColorNegative
D3DXColorAddXMVectorAdd
D3DXColorSubtractXMVectorSubtract
D3DXColorScaleXMVectorScale
D3DXColorModulateXMColorModulate
D3DXColorLerpXMVectorLerp or XMVectorLerpV
D3DXColorAdjustSaturationXMColorAdjustSaturation
D3DXColorAdjustContrastXMColorAdjustContrast
D3DXFresnelTermXMFresnelTerm

Spherical Harmonics Math

The SHmath library is available as an add-on for DirectXMath.

XMSHEvalDirectionEvaluates the Spherical Harmonic basis functions. Equivalent toD3DXSHEvalDirection function.
XMSHRotateRotates SH vector by a rotation matrix. Equivalent to the D3DXSHRotate function.
XMSHRotateZRotates the SH vector in the Z axis by an angle. Equivalent to the D3DXSHRotateZfunction.
XMSHAddAdds two SH vectors. Equivalent to the D3DXSHAdd function.
XMSHScaleScales a SH vector. Equivalent to the D3DXSHScale function.
XMSHDotComputes the dot product of two SH vectors. Equivalent to the D3DXSHDotfunction.
XMSHMultiply
XMSHMultiply2
XMSHMultiply3
XMSHMultiply4
XMSHMultiply5
XMSHMultiply6
Computes the product of two functions represented using SH. Equivalent toD3DXSHMultiply2D3DXSHMultiply3D3DXSHMultiply4D3DXSHMultiply5, andD3DXSHMultiply6.
XMSHEvalDirectionalLightEvaluates a directional light and returns spectral SH data. Equivalent to theD3DXSHEvalDirectionalLight function.
XMSHEvalSphericalLightEvaluates a spherical light and returns spectral SH data. Equivalent to theD3DXEvalSphericalLight function.
XMSHEvalConeLightEvaluates a light that is a cone of constant intensity and returns spectral SH data. Equivalent to the D3DXSHEvalConeLight function.
XMSHEvalHemisphereLightEvaluates a light that is a linear interpolant between two colors over the sphere. Equivalent to the D3DXSHEvalHemisphereLight function.
SHProjectCubeMapProjects a function represented in a cube map into spherical harmonics. Equivalent to the D3DX11SHProjectCubeMap function.

Effects (FX)

The Effects system for Direct3D 11 is primarily provided as a porting aid for older code. The library is available onCodePlex and GitHub.

D3DXCreateEffect
D3DXCreateEffectEx
D3DXCreateEffectFromResource
D3DXCreateEffectFromResourceEx
D3D10CompileEffectFromMemory

D3DX11CompileEffectFromMemory

D3DXCreateEffectFromFile
D3DXCreateEffectFromFileEx

D3DX11CompileEffectFromFile

D3D10CreateEffectFromMemory

D3DX11CreateEffectFromMemory

D3DXCreateEffectPool
D3D10CreateEffectPoolFromMemory

Effects 11 does not support 'effect pools'
or D3DCOMPILE_EFFECT_CHILD_EFFECT. Effect groups provide a more efficient solution for common scenarios previously addressed with 'effect pools'

D3DXDisassembleEffect
D3D10DisassembleEffect

D3DDisassemble
D3DDisassemble10Effect in D3DCompile

Performance/Profiling

D3DX9 included the entry-points intercepted by PIX for Windows for performance profiling. This is now handled by the DirectX runtime directly and is monitored by the Visual Studio Graphics Diagnostics tool.

D3DPERF_BeginEvent
D3DPERF_EndEvent
D3DPERF_SetMarker
D3DPERF_SetRegion
D3DPERF_QueryRepeatFrame
D3DPERF_SetOptions
D3DPERF_GetStatus

ID3DUserDefinedAnnotation which is supported by the DirectX 11.1 runtime on Windows 8.x and Windows 7 Service Pack 1 + KB2670838

If using DirectX 11.2+, you can use ID3D11DeviceContext2 directly for BeginEventInt, SetMarkerInt, and EndEvent.

UVAtlas Functions

The UVAtlas library is intended for isochart creation offline with tools, although it can be used at runtime. You can find the library on CodePlex and GitHub.

D3DXUVAtlasCreateUVAtlasCreate
D3DXUVAtlasPartitionUVAtlasPartition
D3DXUVAtlasPackUVAtlasPack
D3DXComputeIMTFromPerVertexSignalUVAtlasComputeIMTFromPerVertexSignal
D3DXComputeIMTFromPerTexelSignalUVAtlasComputeIMTFromPerTexelSignal
D3DXComputeIMTFromSignalUVAtlasComputeIMTFromSignal
D3DXComputeIMTFromTextureUVAtlasComputeIMTFromTexture

Note

Careful readers will note that there are a few omissions from this table.

  • The ID3DXMatrixStack from D3DXMath doesn't have a new version, but it's actually pretty easy to implement your own. If someone has a burning need for this, please comment below.
  • The Precomputed Radiance Transfer (PRT) simulator is only available in closed-source form in legacy D3DX9. There are a number of papers that cover this technology in the literature, and the most generally useful parts of this functionality are the SHmath functions which are available.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值