TextureLoader.ComputeNormalMap Method

Language:

Converts a height map into a normal map.

Definition

Visual Basic Public Shared Sub ComputeNormalMap( _
    ByVal texture As Texture, _
    ByVal srcTexture As Texture, _
    ByRef sourcePalette As PaletteEntry, _
    ByVal flags As NormalMap, _
    ByVal channel As Channel, _
    ByVal amplitude As Single _
)
C# public static void ComputeNormalMap(
    Texture texture,
    Texture srcTexture,
    out PaletteEntry sourcePalette,
    NormalMap flags,
    Channel channel,
    float amplitude
);
C++ public:
static void ComputeNormalMap(
    Texturetexture,
    TexturesrcTexture,
    [Out] PaletteEntrysourcePalette,
    NormalMap flags,
    Channel channel,
    float amplitude
);
JScript public static function ComputeNormalMap(
    texture : Texture,
    srcTexture : Texture,
    sourcePalette : PaletteEntry,
    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.
sourcePalette Microsoft.DirectX.Direct3D.PaletteEntry[]
Array of PaletteEntry structures containing a 256-color palette that represents the mapped normals.
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.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center