ModelBuilder WithLodDistance( int lod, float distance )

book_4_sparkGenerated
code_blocksInput

Description

The WithLodDistance method of the ModelBuilder class allows you to specify the level of detail (LOD) and the corresponding distance at which this LOD should be used for a model. This method is useful for optimizing performance by adjusting the complexity of a model based on its distance from the camera.

Usage

To use the WithLodDistance method, call it on an instance of ModelBuilder and provide the desired LOD level and distance. This method returns the ModelBuilder instance, allowing for method chaining.

Example

// Example of using WithLodDistance
var modelBuilder = new ModelBuilder();
modelBuilder
    .WithLodDistance(0, 100.0f) // LOD 0 for distances up to 100 units
    .WithLodDistance(1, 200.0f) // LOD 1 for distances up to 200 units
    .WithLodDistance(2, 300.0f); // LOD 2 for distances up to 300 units

// Continue building the model
var model = modelBuilder.Create();