pub struct Renderer {
    pub profile: RendererProfile,
    pub adapter_info: ExtendedAdapterInfo,
    pub queue: Arc<Queue>,
    pub device: Arc<Device>,
    pub features: Features,
    pub limits: Limits,
    pub downlevel: DownlevelCapabilities,
    pub handedness: Handedness,
    pub data_core: Mutex<RendererDataCore>,
    pub mipmap_generator: MipmapGenerator,
    /* private fields */
}
Expand description

Core struct which contains the renderer world. Primary way to interact with the world.

Fields

profile: RendererProfile

The rendering profile used.

adapter_info: ExtendedAdapterInfo

Information about the adapter.

queue: Arc<Queue>

Queue all command buffers will be submitted to.

device: Arc<Device>

Device all objects will be created with.

features: Features

Features of the device

limits: Limits

Limits of the device

downlevel: DownlevelCapabilities

Downlevel limits of the device

handedness: Handedness

Handedness of all parts of this renderer.

data_core: Mutex<RendererDataCore>

All the lockable data

mipmap_generator: MipmapGenerator

Tool which generates mipmaps from a texture.

Implementations

Create a new renderer with the given IAD.

You can create your own IAD or call create_iad.

The aspect ratio is that of the window. This automatically configures the camera. If None is passed, an aspect ratio of 1.0 is assumed.

Adds a 3D mesh to the renderer. This doesn’t instantiate it to world. To show this in the world, you need to create an Object using this mesh.

The handle will keep the mesh alive. All objects created will also keep the mesh alive.

Adds a skeleton into the renderer. This combines a Mesh with a set of joints that can be used to animate that mesh.

The handle will keep the skeleton alive. All objects created will also keep the skeleton alive. The skeleton will also keep the mesh it references alive.

Add a 2D texture to the renderer. This can be used in a Material.

The handle will keep the texture alive. All materials created with this texture will also keep the texture alive.

Add a 2D texture to the renderer by copying a set of mipmaps from an existing texture. This new can be used in a Material.

The handle will keep the texture alive. All materials created with this texture will also keep the texture alive.

Adds a Cube texture to the renderer. This can be used as a cube environment map by a render routine.

The handle will keep the texture alive.

Adds a material to the renderer. This can be used in an Object.

The handle will keep the material alive. All objects created with this material will also keep this material alive.

The material will keep the inside textures alive.

Updates a given material. Old references will be dropped.

Adds an object to the renderer. This will create a visible object using the given mesh and materal.

The handle will keep the material alive.

The object will keep all materials, textures, and meshes alive.

Duplicates an existing object in the renderer, returning the new object’s handle. Any changes specified in the change struct will be applied to the duplicated object, and the same mesh, material and transform as the original object will be used otherwise.

Move the given object to a new transform location.

Sets the joint positions for a skeleton. See Renderer::set_skeleton_joint_matrices to set the vertex transformations directly, without having to supply two separate matrix vectors.

Inputs
  • joint_global_positions: Contains one transform matrix per bone, containing that bone’s current clobal transform
  • inverse_bind_poses: Contains one inverse bind transform matrix per bone, that is, the inverse of the bone’s transformation at its rest position.

Sets the joint matrices for a skeleton. The joint matrix is the transformation that will be applied to a vertex affected by a joint. Note that this is not the same as the joint’s transformation. See Renderer::set_skeleton_joint_transforms for an alternative method that allows setting the joint transformation instead.

Add a sun-like light into the world.

The handle will keep the light alive.

Updates the settings for given directional light.

Sets the aspect ratio of the camera. This should correspond with the aspect ratio of the user.

Sets the position, pov, or projection mode of the camera.

Render a frame of the scene onto the given output, using the given RenderRoutine.

The RendererStatistics may not be the results from this frame, but might be the results from multiple frames ago.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.