Struct truck_platform::Light[][src]

pub struct Light {
    pub position: Point3,
    pub color: Vector3,
    pub light_type: LightType,
}

Light

There is no limit to the number of lights that can be added to a Scene. The information about the lights is sent to the shader as a storage buffer (cf: Scene::lights_buffer()).

Fields

position: Point3

position of light

color: Vector3

[0, 1] range RGB color of light

light_type: LightType

type of light source: point or uniform

Implementations

impl Light[src]

pub fn buffer(&self, device: &Device) -> BufferHandler[src]

Creates a UNIFORM buffer of light.

This method is provided only for the advanced developer utility, and not used by Scene.

Shader Example

layout(// binding info //) uniform Light {
    vec4 position;      // the position of light, position.w == 1.0
    vec4 color;         // the color of light, color.w == 1.0
    uvec4 light_type;   // Point => uvec4(0, 0, 0, 0), Uniform => uvec4(1, 0, 0, 0)
};

Trait Implementations

impl Clone for Light[src]

impl Debug for Light[src]

impl Default for Light[src]

impl PartialEq<Light> for Light[src]

impl StructuralPartialEq for Light[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.