Expand description
Graphic utility library based on wgpu.
This crate is independent from other truck crates except truck-base.
It provides an API that allows users to handle drawing elements in a unified manner.
By implementing the Rendered trait, developers can define
their own rendering elements and have them rendered in Scene
in the same way as other rendering elements provided by truck.
This documentation is intended to be read by two kinds of people: users and developers. Users, those who just want to draw the shape of an existing mesh or boundary representation, will only use:
Scene,SceneDescriptor,DeviceHandler,Camera, andLight.
If you are a developer, who wants to try out new
visual representations, you can implement Rendered in your own structure and standardize it in
a form that can be used by users in Scene.
The sample code in this crate is for developers.
Users may wish to refer to the one in truck-rendimpl.
Re-exports§
pub use wgpu;
Macros§
- derive_
bind_ group - Derives
Rendred::bind_group() - derive_
bind_ group_ layout - Derives
Rendred::bind_group_layout() - derive_
pipeline - Derives
Rendred::pipeline() - derive_
render_ id - Derives
Rendred::render_id() - derive_
vertex_ buffer - Derives
Rendred::vertex_buffer() - impl_
render_ id - Implements
Rendered::render_id().
Structs§
- Backend
Buffer Config - Configuration for buffer preparation
- Buffer
Handler - safe handler of GPU buffer
Buffer - Camera
- Camera
- Device
Handler - Chain that holds
Device,QueueandSurfaceConfiguration. - Light
- Light
- Ray
- Rays corresponding to a point on the screen, defined by the camera.
- RenderID
- The unique ID for
Renderedstruct. - Render
Texture Config - Configuration for rendering texture
- Scene
- Wraps
wgpuand provides an intuitive graphics API. - Scene
Descriptor - Configures of
Scene. - Studio
Config - Configuration for studio to shoot the scene.
- Window
Scene - Utility for wrapper
- Window
Scene Descriptor - Configures of
WindowScene. Compared to the structureSceneDescriptor, this excludesrender_texture, which can be obtained from window.
Enums§
- Light
Type - the kinds of light sources: point or uniform
- Projection
Type - the projection type of camera
Constants§
- LIGHT_
MAX - maximum number of light
Traits§
- Rendered
- Rendered objects in the scene.