Struct truck_platform::SceneDescriptor [−][src]
Configures of Scene.
Fields
background: Colorbackground color. Default is Color::BLACK.
camera: Cameracamera of the scene. Default is Camera::default().
lights: Vec<Light>All lights in the scene. Default is vec![Light::default()].
sample_count: u32sample count for anti-aliasing by MSAA. 1, 2, 4, 8, or 16.
Implementations
impl SceneDescriptor[src]
pub fn camera_buffer(&self, handler: &DeviceHandler) -> BufferHandler[src]
Creates a UNIFORM buffer of camera.
The bind group provides Scene holds this uniform buffer.
Shader Example
layout(set = 0, binding = 0) uniform Camera {
mat4 camera_matrix; // the camera matrix
mat4 camera_projection; // the projection into the normalized view volume
};
pub fn lights_buffer(&self, device: &Device) -> BufferHandler[src]
Creates a STORAGE buffer of all lights.
The bind group provides Scene holds this uniform buffer.
Shader Example
struct 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)
};
layout(set = 0, binding = 1) buffer Lights {
Light lights[];
};
Trait Implementations
impl Clone for SceneDescriptor[src]
fn clone(&self) -> SceneDescriptor[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for SceneDescriptor[src]
impl Default for SceneDescriptor[src]
fn default() -> SceneDescriptor[src]
Auto Trait Implementations
impl RefUnwindSafe for SceneDescriptor[src]
impl Send for SceneDescriptor[src]
impl Sync for SceneDescriptor[src]
impl Unpin for SceneDescriptor[src]
impl UnwindSafe for SceneDescriptor[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,