pub struct Imposters { /* private fields */ }Expand description
A level-of-detail technique to replace rendering of high-poly meshes. Should only be used where details cannot be seen, for example when the objects are far away. A set of objects are rendered from different angles into a set of textures and the textures are then rendered continuously instead of the expensive objects.
Implementations
sourceimpl Imposters
impl Imposters
sourcepub fn new(
context: &Context,
positions: &[Vec3],
objects: &[&dyn Object],
lights: &[&dyn Light],
max_texture_size: u32
) -> ThreeDResult<Self>
pub fn new(
context: &Context,
positions: &[Vec3],
objects: &[&dyn Object],
lights: &[&dyn Light],
max_texture_size: u32
) -> ThreeDResult<Self>
Constructs a new Imposters and render the imposter texture from the given objects with the given lights. The imposters are placed at the given positions.
sourcepub fn set_positions(&mut self, positions: &[Vec3]) -> ThreeDResult<()>
pub fn set_positions(&mut self, positions: &[Vec3]) -> ThreeDResult<()>
Set the positions of the imposters.
Trait Implementations
sourceimpl Geometry for Imposters
impl Geometry for Imposters
sourcefn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &[&dyn Light]
) -> ThreeDResult<()>
fn render_with_material(
&self,
material: &dyn Material,
camera: &Camera,
lights: &[&dyn Light]
) -> ThreeDResult<()>
Render the geometry with the given material.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method.
Use an empty array for the lights argument, if the objects does not require lights to be rendered. Read more
sourcefn aabb(&self) -> AxisAlignedBoundingBox
fn aabb(&self) -> AxisAlignedBoundingBox
Returns the AxisAlignedBoundingBox for this geometry in the global coordinate system. Read more
sourceimpl Object for Imposters
impl Object for Imposters
sourcefn render(&self, camera: &Camera, lights: &[&dyn Light]) -> ThreeDResult<()>
fn render(&self, camera: &Camera, lights: &[&dyn Light]) -> ThreeDResult<()>
Render the object.
Use an empty array for the lights argument, if the objects does not require lights to be rendered.
Must be called in the callback given as input to a RenderTarget, ColorTarget or DepthTarget write method. Read more
sourcefn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Returns whether or not this object should be considered transparent. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Imposters
impl !Send for Imposters
impl !Sync for Imposters
impl Unpin for Imposters
impl !UnwindSafe for Imposters
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more