C# Class VoxelTerrain.CPUGenerator

Inheritance: IGenerate
Show file Open project: barograf/VoxelTerrain Class Usage Examples

Public Methods

Method Description
CPUGenerator ( SlimDX.Direct3D11.Device graphicsDevice, VoxelMeshContainer container ) : System
Dispose ( ) : void
GenerateFromFormula ( int width, int height, int depth ) : void

Generates mesh using mathematical functions.

GenerateFromNoiseCube ( int width, int height, int depth ) : void

Generates mesh using some random values interpolated with trilinear interpolation.

GenerateFromNoiseCubeWithWarp ( int width, int height, int depth ) : void

Generates mesh using some random values interpolated with trilinear interpolation. Uses coordinates transformed with warp values.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
ComputeAmbient ( Voxel voxels ) : void

Computes ambient color for each voxel.

ComputeNormal ( Voxel voxels ) : void

Computes normal vectors based on weight of each voxel.

ComputeTriangles ( Voxel voxels, int levelOfDetail ) : List

Computes triangle positions and normal vectors based on array of voxels.

CreateGeometryBuffer ( List triangles ) : void

Creates shader vertex buffer based on computed triangles.

Method Details

CPUGenerator() public method

public CPUGenerator ( SlimDX.Direct3D11.Device graphicsDevice, VoxelMeshContainer container ) : System
graphicsDevice SlimDX.Direct3D11.Device
container VoxelMeshContainer
return System

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GenerateFromFormula() public method

Generates mesh using mathematical functions.
public GenerateFromFormula ( int width, int height, int depth ) : void
width int Mesh width.
height int Mesh height.
depth int Mesh depth.
return void

GenerateFromNoiseCube() public method

Generates mesh using some random values interpolated with trilinear interpolation.
public GenerateFromNoiseCube ( int width, int height, int depth ) : void
width int Mesh widht.
height int Mesh height.
depth int Mesh depth.
return void

GenerateFromNoiseCubeWithWarp() public method

Generates mesh using some random values interpolated with trilinear interpolation. Uses coordinates transformed with warp values.
public GenerateFromNoiseCubeWithWarp ( int width, int height, int depth ) : void
width int Mesh widht.
height int Mesh height.
depth int Mesh depth.
return void