Module three_d::renderer [−][src]
Expand description
High-level features for easy rendering of different types of objects with different types of shading.
Can be combined seamlessly with the mid-level features in the core
module and also with calls in the context
module as long as the graphics state is reset.
Re-exports
pub use crate::core::math::*;
pub use crate::core::render_states::*;
pub use crate::core::render_target::*;
pub use crate::core::texture::*;
pub use crate::core::Context;
pub use material::*;
pub use effect::*;
pub use light::*;
pub use object::*;
pub use crate::ThreeDResult;
Modules
Effects applied to each pixel, for example fog or anti-aliasing.
A collection of light types. Currently implemented light types are ambient light, directional light, spot light and point light. Directional and spot lights can cast shadows.
A collection of objects that can be rendered, for example a mesh.
Structs
Used in a render call to define how to view the 3D world.
Deferred render pipeline which can render objects (implementing the Geometry trait) with a DeferredPhysicalMaterial and lighting. Supports different types of lighting models by changing the DeferredPipeline::lighting_model field. Deferred rendering draws the geometry information into a buffer in the DeferredPipeline::render_pass and use that information in the DeferredPipeline::lighting_pass. This means that the lighting is only calculated once per pixel since the depth testing is happening in the render pass. Note: Deferred rendering does not support blending and therefore does not support transparency!
Forward render pipeline which can render objects (implementing the Object trait). Forward rendering directly draws to the given render target (for example the screen) and is therefore the same as calling Object::render directly.
Defines the part of the screen/render target that is rendered to.
Enums
Used for debug purposes.
Error in the renderer module.
Functions
Compare function for sorting objects based on distance from the camera. The order is opaque objects from nearest to farthest away from the camera, then transparent objects from farthest away to closest to the camera.
Finds the closest intersection between a ray from the given camera in the given pixel coordinate and the given geometries.
The pixel coordinate must be in physical pixels, where (viewport.x, viewport.y) indicate the top left corner of the viewport
and (viewport.x + viewport.width, viewport.y + viewport.height) indicate the bottom right corner.
Returns None
if no geometry was hit between the near (z_near
) and far (z_far
) plane for this camera.
Finds the closest intersection between a ray starting at the given position in the given direction and the given geometries.
Returns None
if no geometry was hit before the given maximum depth.
Render the objects. Also avoids rendering objects outside the camera frustum and render the objects in the order given by cmp_render_order. Must be called in a render target render function, for example in the callback function of Screen::write.