Table of Contents

Class TexturedMeshUtils

Namespace
OmegaEngine.Graphics
Assembly
OmegaEngine.dll

Utility method for textured SlimDX.Direct3D9.Meshes.

public static class TexturedMeshUtils
Inheritance
TexturedMeshUtils
Inherited Members

Methods

GenerateNormals(Device, ref Mesh)

Generate normal vectors if not present and convert into PositionNormalBinormalTangentTextured format for shaders. Tangent and binormal data is left empty.

public static void GenerateNormals(Device device, ref Mesh mesh)

Parameters

device Device

The SlimDX.Direct3D9.Device containing the mesh

mesh Mesh

The mesh to be manipulated

Remarks

Normal vectors are required for lighting.

GenerateTBN(Device, ref Mesh, bool)

Generate TBN (tangent, binormal and normal) vectors if not present and convert into PositionNormalBinormalTangentTextured format for shaders.

public static void GenerateTBN(Device device, ref Mesh mesh, bool weldVertexes = false)

Parameters

device Device

The SlimDX.Direct3D9.Device containing the mesh

mesh Mesh

The mesh to be manipulated

weldVertexes bool

Weld vertexes before generating tangents. Useful for organic objects, stones, trees, etc. (anything with a lot of round surfaces). If a lot of single faces are not connected on the texture (e.g. rockets, buildings, etc.) do not use.

Remarks

TBN vectors are required for normal mapping.