Share via


TextureLoader.ComputeNormalMap(Texture,Texture,NormalMap,Channel,Single) Method (Microsoft.DirectX.Direct3D)

Converts a height map into a normal map.

Definition

Visual Basic Public Shared Sub ComputeNormalMap( _
    ByVal texture As Texture, _
    ByVal srcTexture As Texture, _
    ByVal flags As NormalMap, _
    ByVal channel As Channel, _
    ByVal amplitude As Single _
)
C# public static void ComputeNormalMap(
    Texture texture,
    Texture srcTexture,
    NormalMap flags,
    Channel channel,
    float amplitude
);
C++ public:
static void ComputeNormalMap(
    Texturetexture,
    TexturesrcTexture,
    NormalMap flags,
    Channel channel,
    float amplitude
);
JScript public static function ComputeNormalMap(
    texture : Texture,
    srcTexture : Texture,
    flags : NormalMap,
    channel : Channel,
    amplitude : float
);

Parameters

texture Microsoft.DirectX.Direct3D.Texture
A Texture object that represents the destination texture.
srcTexture Microsoft.DirectX.Direct3D.Texture
A Texture object that represents the source height-map texture.
flags Microsoft.DirectX.Direct3D.NormalMap
One or more NormalMap flags that indicate creation options.
channel Microsoft.DirectX.Direct3D.Channel
A Channel flag that specifies the source of the height information.
amplitude System.Single
Constant value by which the height information is multiplied.

Remarks

This method computes the normal by using the central difference with a kernel size of 3x3. The (x,y,z) components of each normal are mapped to the (r,g,b) channels of the output texture. RGB channels in the destination contain biased (x,y,z) components of the normal.

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.