pub struct IsourfaceMaterial {
    pub voxels: Rc<Texture3D>,
    pub threshold: f32,
    pub color: Color,
    pub metallic: f32,
    pub roughness: f32,
    pub size: Vec3,
    pub lighting_model: LightingModel,
}
Expand description

A material that renders the isosurface defined by the voxel data in the IsourfaceMaterial::voxels and the IsourfaceMaterial::threshold. The surface is defined by all the points in the volume where the red channel of the voxel data is equal to the threshold. This material should be applied to a cube with center in origo, for example CpuMesh::cube.

Fields

voxels: Rc<Texture3D>

The voxel data that defines the isosurface.

threshold: f32

Threshold (in the range [0..1]) that defines the surface in the voxel data.

color: Color

Base surface color. Assumed to be in linear color space.

metallic: f32

A value in the range [0..1] specifying how metallic the surface is.

roughness: f32

A value in the range [0..1] specifying how rough the surface is.

size: Vec3

The size of the cube that is used to render the voxel data. The texture is scaled to fill the entire cube.

lighting_model: LightingModel

The lighting model used when rendering this material

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the fragment shader source for this material. Should output the final fragment color.

Sends the uniform data needed for this material to the fragment shader.

Returns the render states needed to render with this material.

Returns whether or not this material is transparent.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more