Struct arendur::component::shape::ShapedPrimitive
[−]
[src]
pub struct ShapedPrimitive<S, M> { pub shape: S, pub material: M, pub lighting_profile: Option<Arc<Texture<Texel = RGBSpectrumf>>>, }
Represents a primitive made up by a single Shape
Fields
shape: S
material: M
lighting_profile: Option<Arc<Texture<Texel = RGBSpectrumf>>>
Methods
impl<S, M> ShapedPrimitive<S, M> where
S: Shape,
M: Material,
[src]
S: Shape,
M: Material,
fn new(
shape: S,
material: M,
lighting_profile: Option<Arc<Texture<Texel = RGBSpectrumf>>>
) -> ShapedPrimitive<S, M>
shape: S,
material: M,
lighting_profile: Option<Arc<Texture<Texel = RGBSpectrumf>>>
) -> ShapedPrimitive<S, M>
construction
Trait Implementations
impl<S: Clone, M: Clone> Clone for ShapedPrimitive<S, M>
[src]
fn clone(&self) -> ShapedPrimitive<S, M>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<S, M> Composable for ShapedPrimitive<S, M> where
S: Shape,
M: Material,
[src]
S: Shape,
M: Material,
fn bbox_parent(&self) -> BBox3f
returns bounding box in parent frame.
fn intersect_ray(&self, ray: &mut RawRay) -> Option<SurfaceInteraction>
test for intersection. Note that its guarantees are from Shape
's: - ray
is specified in parent frame, - if hit, returns surface interaction data in parent frame. - if hit, ray
's tmax
would be updated to the hitting t
. Read more
fn can_intersect(&self, ray: &RawRay) -> bool
test if an intersection can occur. Might be more efficient
fn as_light(&self) -> &Light
fn intersection_cost(&self) -> Float
impl<S, M> Light for ShapedPrimitive<S, M> where
S: Shape,
M: Material,
[src]
S: Shape,
M: Material,
fn flags(&self) -> LightFlag
return the flags of the light
fn is_delta(&self) -> bool
test if the light has delta distribution
fn evaluate_path(&self, pos: Point3f, dir: Vector3f) -> RGBSpectrumf
Given a position on surface and an direction in local coordinates, evaluate the light's emitted radiance along that direction.
fn evaluate_sampled(&self, pos: Point3f, sample: Point2f) -> LightSample
Given a surface pos
and norm
in local frame with a uniform sample
in $[0, 1)$, sample an incoming direction from the light to that
location, returns the sampling result in a LightSample
.
fn generate_path(&self, samples: SampleInfo) -> PathInfo
Generate a photon path from the light source based on the sample info
fn pdf_path(
&self,
pos: Point3f,
dir: Vector3f,
norm: Vector3f
) -> (Float, Float)
&self,
pos: Point3f,
dir: Vector3f,
norm: Vector3f
) -> (Float, Float)
Given position and direction of a photon path, and the light's normal
return its pdfs as (pdfpos, pdfdir)
Read more
fn pdf(&self, pos: Point3f, wi: Vector3f) -> Float
Given a position and lighting ray wi
of an interaction, return the pdf of it Read more
fn power(&self) -> RGBSpectrumf
returns an estimation of total power of this light
fn evaluate_ray(&self, rd: &RayDifferential) -> RGBSpectrumf
Given a position and an incoming direction in local coordinates, evaluate the light's radiance along that direction. This method takes an RayDifferential
because some light implementations might found thouse differentials helpful. Read more
fn preprocess(&mut self, _s: &Scene)
preporcess with scene components, if necessary. renderers should respect this requirement. Read more
impl<S, M> Primitive for ShapedPrimitive<S, M> where
S: Shape,
M: Material,
[src]
S: Shape,
M: Material,
fn get_material(&self) -> &Material
return the material associated with this primitive
fn is_emissive(&self) -> bool
return if the primitive can emit lights