Struct rend3::Renderer[][src]

pub struct Renderer {
Show 13 fields pub mode: RendererMode, pub adapter_info: ExtendedAdapterInfo, pub queue: Arc<Queue>, pub device: Arc<Device>, pub camera_manager: RwLock<CameraManager>, pub mesh_manager: RwLock<MeshManager>, pub d2_texture_manager: RwLock<TextureManager>, pub d2c_texture_manager: RwLock<TextureManager>, pub material_manager: RwLock<MaterialManager>, pub object_manager: RwLock<ObjectManager>, pub directional_light_manager: RwLock<DirectionalLightManager>, pub mipmap_generator: MipmapGenerator, pub profiler: Mutex<GpuProfiler>, // some fields omitted
}
Expand description

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

Fields

mode: RendererMode

The culling mode 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.

camera_manager: RwLock<CameraManager>

Position and settings of the camera.

mesh_manager: RwLock<MeshManager>

Manages all vertex and index data.

d2_texture_manager: RwLock<TextureManager>

Manages all 2D textures, including bindless bind group.

d2c_texture_manager: RwLock<TextureManager>

Manages all Cube textures, including bindless bind groups.

material_manager: RwLock<MaterialManager>

Manages all materials, including material bind groups in CPU mode.

object_manager: RwLock<ObjectManager>

Manages all objects.

directional_light_manager: RwLock<DirectionalLightManager>

Manages all directional lights, including their shadow maps.

mipmap_generator: MipmapGenerator

Tool which generates mipmaps from a texture.

profiler: Mutex<GpuProfiler>

Stores gpu timing and debug scopes.

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.

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.

Move the given object to a new transform location.

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.