Trait three_d::renderer::object::Shadable[][src]

pub trait Shadable {
    fn render_with_material(
        &self,
        material: &dyn Material,
        camera: &Camera,
        lights: &Lights
    ) -> ThreeDResult<()>;
fn render_forward(
        &self,
        material: &dyn Material,
        camera: &Camera,
        lights: &Lights
    ) -> ThreeDResult<()>;
fn render_deferred(
        &self,
        material: &DeferredPhysicalMaterial,
        camera: &Camera,
        viewport: Viewport
    ) -> ThreeDResult<()>; }
Expand description

Represents a 3D object that is possible to render with a material that implements the Material trait.

If requested by the material, the shadable object has to support the attributes position (in world space) out vec3 pos;, normal out vec3 nor;, uv coordinates out vec2 uvs; and color out vec4 col; in the vertex shader source code.

Required methods

Render the object with the given material. Must be called in a render target render function, for example in the callback function of Screen::write. You can use Lights::default() if you know the material does not require lights.

👎 Deprecated:

use render_with_material instead

Render the object with the given material. Must be called in a render target render function, for example in the callback function of Screen::write. You can use Lights::default() if you know the material does not require lights.

👎 Deprecated

Render the geometry and surface material parameters of the object. Should usually not be called directly but used in DeferredPipeline::geometry_pass.

Implementations on Foreign Types

👎 Deprecated:

use render_with_material instead

👎 Deprecated
👎 Deprecated:

use render_with_material instead

👎 Deprecated

Implementors