pub struct Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>{Show 25 fields
pub scene: Scene,
pub scene_ray_color: fn(&Scene, f32, usize) -> (A::In, ShaderArgs),
pub shader: Shader<A::In, ShaderArgs>,
pub is_transparent: fn(&A::In) -> bool,
pub acc_to_linear_rgba: fn(A::Out) -> Rgba,
pub producer: &'a Prod,
pub img: &'a mut Img,
pub size: fn(&Img) -> PixelPos,
pub pxl: fn(_: &mut Img, _: PixelPos, c: Rgba<u8>),
pub acc_data: A::Data,
pub persp: &'a CameraPerspective,
pub cam: &'a Camera,
pub flip_xyz: Vector,
pub compr_masks: &'a mut [CompressedMasks],
pub pre_compr_masks: &'a mut [CompressedMasks],
pub sub_compr_masks: &'a mut Vec<Vec<CompressedMasks>>,
pub sub_tile_triangle_limit: u32,
pub profile: &'a mut P,
pub profile_render: fn(&mut P, Option<f64>),
pub profile_compress: fn(&mut P, ProfileCompressData<'_>, Option<f64>),
pub sub_masks: bool,
pub pre_masks: bool,
pub profile_enabled: bool,
pub acc_limit: u32,
pub scale_to_pre_tile_size: u32,
}Expand description
Stores data needed during rendering.
Fields§
§scene: SceneScene data.
scene_ray_color: fn(&Scene, f32, usize) -> (A::In, ShaderArgs)Gets a default ray color prior to shading.
Make sure to convert to the same color space as the accumulator.
For example, if the accumulator uses linear color space, and you use sRGB color space in scene data, then you should convert to linear color space.
shader: Shader<A::In, ShaderArgs>A customized shader transform prior to color accumulation.
This can be used to change the color of the ray.
is_transparent: fn(&A::In) -> boolReturns true if color is transparent, false otherwise.
This is used to filter out colors that do not contribute in accumulator.
acc_to_linear_rgba: fn(A::Out) -> RgbaProduces the final color from accumulator.
producer: &'a ProdA producer.
img: &'a mut ImgThe target image.
size: fn(&Img) -> PixelPosGet the size of the image in pixels.
pxl: fn(_: &mut Img, _: PixelPos, c: Rgba<u8>)Writes pixel to image.
acc_data: A::DataAccumulator data.
This is used to pre-configure the accumulator with some data.
persp: &'a CameraPerspectiveThe camera perspective.
cam: &'a CameraThe camera.
flip_xyz: VectorCan be used to scale or flip axis.
compr_masks: &'a mut [CompressedMasks]Stores compressed masks per render tile.
pre_compr_masks: &'a mut [CompressedMasks]Stores compressed masks for pre-pre-processing.
sub_compr_masks: &'a mut Vec<Vec<CompressedMasks>>Stores compressed masks for adaptive sub-tiling.
sub_tile_triangle_limit: u32A limit on the number of triangles per tile before doing adaptive sub-tiling.
Adaptive sub-tiling produces sub-tiles such that the average number of triangles is less than this limit, down to 2x2 sub-tiles.
profile: &'a mut PData used to store performance profiling information.
profile_render: fn(&mut P, Option<f64>)Reports the amount of seconds taken to render (None if profiling is disabled).
profile_compress: fn(&mut P, ProfileCompressData<'_>, Option<f64>)Reports profile compress data and amount of seconds (None if profiling is disabled).
sub_masks: boolWhether to use adaptive sub-tiling.
Adaptive sub-tiling splits tiles that have a large amount
of triangles into sub-tiles, where the average amount of triangles
is less thatn sub_tile_triangle_limit.
pre_masks: boolWhether to use pre-masks.
This is a pre-pre-processing step where run-length compression on masks uses a lower resolution, to speed up pre-processing.
profile_enabled: boolWhether profiling is enabled.
Profiling gathers some data about the rendering process.
acc_limit: u32A limit of how many accumulations per tile.
Is used to prevent inner infinite rendering loops.
This is usually some multiple of the accumulator buffer size.
scale_to_pre_tile_size: u32The scale ratio between pre-tile size and tile size.
Implementations§
Auto Trait Implementations§
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> !UnwindSafe for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> Freeze for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> RefUnwindSafe for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>where
Scene: RefUnwindSafe,
<A as Acc>::Data: RefUnwindSafe,
Prod: RefUnwindSafe + ?Sized,
Img: RefUnwindSafe,
P: RefUnwindSafe,
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> Send for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> Sync for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> Unpin for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>
impl<'a, Scene, Prod, Img, A, ShaderArgs, P> UnsafeUnpin for Renderer<'a, Scene, Prod, Img, A, ShaderArgs, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more