Crate bevy_pbr

Source

Re-exports§

pub use decal::clustered::ClusteredDecalPlugin;

Modules§

decal
Decal rendering.
deferred
environment_map
Environment maps and reflection probes.
graph
irradiance_volume
Irradiance volumes, also known as voxel global illumination.
light_consts
Constants for operating with the light units: lumens, and lux.
prelude
The PBR prelude.
resources
wireframe

Structs§

AmbientLight
An ambient light, which lights the entire scene equally.
Atmosphere
This component describes the atmosphere of a planet, and when added to a camera will enable atmospheric scattering for that camera. This is only compatible with HDR cameras.
AtmosphereSettings
This component controls the resolution of the atmosphere LUTs, and how many samples are used when computing them.
BuildIndirectParametersBindGroups
The bind groups for the compute shaders that reset indirect draw counts and build indirect parameters.
BuildIndirectParametersPipeline
The pipeline for the indirect parameter building shader.
BuildIndirectParametersPipelineKey
Specifies variants of the indirect parameter building shader.
Cascade
CascadeShadowConfig
Controls how cascaded shadow mapping works. Prefer using CascadeShadowConfigBuilder to construct an instance.
CascadeShadowConfigBuilder
Builder for CascadeShadowConfig.
Cascades
CascadesVisibleEntities
ClearIndirectParametersMetadataNode
The render node that clears out the GPU-side indirect metadata buffers.
ClusterZConfig
Configure the depth-slicing strategy for clustered forward rendering
Clusters
CubemapVisibleEntities
DefaultOpaqueRendererMethod
Default render method used for opaque materials.
DirectionalLight
A Directional light.
DirectionalLightShadowMap
Controls the resolution of DirectionalLight shadow maps.
DistanceFog
Configures the “classic” computer graphics distance fog effect, in which objects appear progressively more covered in atmospheric haze the further away they are from the camera. Affects meshes rendered via the PBR StandardMaterial.
DrawMesh
EarlyGpuPreprocessNode
The render node for the first mesh preprocessing pass.
EarlyPrepassBuildIndirectParametersNode
The render node for the part of the indirect parameter building pass that draws the meshes visible from the previous frame.
EarlyShadowPassNode
The rendering node that renders meshes that were “visible” (so to speak) from a light last frame.
EntitiesNeedingSpecialization
EntitySpecializationTicks
EnvironmentMapUniform
The uniform struct extracted from EnvironmentMapLight. Will be available for use in the Environment Map shader.
EnvironmentMapUniformBuffer
A GPU buffer that stores the environment map settings for each view.
ExtendedMaterial
A material that extends a base Material with additional shaders and data.
ExtractMaterialsSet
A SystemSet that contains all extract_mesh_materials systems.
ExtractMeshesSet
A SystemSet that encompasses both extract_meshes_for_cpu_building and extract_meshes_for_gpu_building.
ExtractedClusterConfig
ExtractedClusterableObjects
ExtractedDirectionalLight
ExtractedPointLight
FallbackBindlessResources
Dummy instances of various resources that we fill unused slots in binding arrays with.
FogMeta
Metadata for fog
FogPlugin
A plugin that consolidates fog extraction, preparation and related resources/assets
FogVolume
GlobalClusterableObjectMeta
GlobalVisibleClusterableObjects
GpuClusterableObject
GpuClusterableObjectsStorage
GpuClusterableObjectsUniform
GpuDirectionalCascade
GpuDirectionalLight
GpuFog
The GPU-side representation of the fog configuration that’s sent as a uniform to the shader
GpuLights
GpuMeshPreprocessPlugin
A plugin that builds mesh uniforms on GPU.
LateGpuPreprocessNode
The render node for the second mesh preprocessing pass.
LatePrepassBuildIndirectParametersNode
The render node for the part of the indirect parameter building pass that draws the meshes that are potentially visible on this frame but weren’t visible on the previous frame.
LateShadowPassNode
The rendering node that renders meshes that became newly “visible” (so to speak) from a light this frame.
LightKeyCache
LightMeta
LightProbe
A marker component for a light probe, which is a cuboid region that provides global illumination to all fragments inside it.
LightProbePlugin
Adds support for light probes: cuboid bounding regions that apply global illumination to objects within them.
LightProbesBuffer
A GPU buffer that stores information about all light probes.
LightProbesUniform
A per-view shader uniform that specifies all the light probes that the view takes into account.
LightSpecializationTicks
LightViewEntities
Component automatically attached to a light entity to track light-view entities for each view.
LightVisibilityClass
The VisibilityClass used for all lights (point, directional, and spot).
Lightmap
A component that applies baked indirect diffuse global illumination from a lightmap.
LightmapPlugin
A plugin that provides an implementation of lightmaps.
LightmapSlab
A binding array that contains lightmaps.
LightmapSlabIndex
The index of the slab (binding array) in which a lightmap is located.
LightmapSlotIndex
The index of the slot (element within the binding array) in the slab in which a lightmap is located.
MainBuildIndirectParametersNode
The render node for the part of the indirect parameter building pass that draws all meshes, both those that are newly-visible on this frame and those that were visible last frame.
MaterialBindGroupBindlessAllocator
The allocator that places bindless materials into bind groups and tracks their resources.
MaterialBindGroupId
MaterialBindGroupIndex
The index of each material bind group.
MaterialBindGroupNonBindlessAllocator
The allocator that stores bind groups for non-bindless materials.
MaterialBindGroupSlot
The index of the slot containing material data within each material bind group.
MaterialBindingId
The location of a material (either bindless or non-bindless) within the slabs.
MaterialBindlessSlab
A single bind group and the bookkeeping necessary to allocate into it.
MaterialExtensionKey
MaterialExtensionPipeline
MaterialPipeline
Render pipeline data for a given Material.
MaterialPipelineKey
A key uniquely identifying a specialized MaterialPipeline.
MaterialPlugin
Adds the necessary ECS resources and render logic to enable rendering entities using the given Material asset type.
MaterialProperties
Common Material properties, calculated for a specific material instance.
MaterialSlab
The public interface to a slab, which represents a single bind group.
MeshBindGroupPair
MeshCullingData
Information about each mesh instance needed to cull it on GPU.
MeshCullingDataBuffer
A GPU buffer that holds the information needed to cull meshes on GPU.
MeshFlags
Various flags and tightly-packed values on a mesh.
MeshInputUniform
Information that has to be transferred from CPU to GPU in order to produce the full MeshUniform.
MeshLayouts
All possible BindGroupLayouts in bevy’s default mesh shader (mesh.wgsl).
MeshMaterial3d
A material used for rendering a Mesh3d.
MeshPhaseBindGroups
The bind groups for meshes currently loaded.
MeshPipeline
All data needed to construct a pipeline for rendering 3D meshes.
MeshPipelineKey
MSAA uses the highest 3 bits for the MSAA log2(sample count) to support up to 128x MSAA.
MeshPipelineViewLayout
MeshPipelineViewLayoutKey
A key that uniquely identifies a MeshPipelineViewLayout.
MeshPipelineViewLayouts
Stores the view layouts for every combination of pipeline keys.
MeshRenderPlugin
Provides support for rendering 3D meshes.
MeshTransforms
MeshUniform
MeshViewBindGroup
MeshesToReextractNextFrame
Holds a list of meshes that couldn’t be extracted this frame because their materials weren’t prepared yet.
MorphIndex
MorphIndices
Maps each mesh affected by morph targets to the applicable offset within the MorphUniforms buffer.
MorphUniforms
The GPU buffers containing morph weights for all meshes with morph targets.
NotShadowCaster
Add this component to make a Mesh3d not cast shadows.
NotShadowReceiver
Add this component to make a Mesh3d not receive shadows.
PbrPlugin
Sets up the entire PBR infrastructure of bevy.
PbrProjectionPlugin
Camera projection PBR functionality.
PhaseBuildIndirectParametersBindGroups
The per-phase set of bind groups for the compute shaders that reset indirect draw counts and build indirect parameters.
PointLight
A light that emits light in all directions from a central point.
PointLightShadowMap
Controls the resolution of PointLight shadow maps.
PreparedMaterial
Data prepared for a Material instance.
PrepassPipeline
PrepassPipelineInternal
Internal fields of the PrepassPipeline that don’t need the generic bound This is done as an optimization to not recompile the same code multiple time
PrepassPipelinePlugin
Sets up everything required to use the prepass pipeline.
PrepassPlugin
Sets up the prepasses for a Material.
PrepassViewBindGroup
PreprocessBindGroups
The compute shader bind group for the mesh preprocessing pass for each render phase.
PreprocessPhasePipelines
Compute shader pipelines for a specific phase: early, late, or main.
PreprocessPipeline
The pipeline for the GPU mesh preprocessing shader.
PreprocessPipelineKey
Specifies variants of the mesh preprocessing shader.
PreprocessPipelines
The compute shader pipelines for the GPU mesh preprocessing and indirect parameter building passes.
PreviousGlobalTransform
RenderCascadesVisibleEntities
RenderCubemapVisibleEntities
RenderLightmaps
Stores data for all lightmaps in the render world.
RenderMaterialBindings
A resource that maps each untyped material ID to its binding.
RenderMaterialInstance
The material associated with a single mesh instance in the main world.
RenderMaterialInstances
Stores all extracted instances of all Materials in the render world.
RenderMeshInstanceCpu
CPU data that the render world keeps for each entity, when not using GPU mesh uniform building.
RenderMeshInstanceFlags
Various useful flags for [RenderMeshInstance]s.
RenderMeshInstanceGpu
CPU data that the render world needs to keep for each entity that contains a mesh when using GPU mesh uniform building.
RenderMeshInstanceGpuBuilder
Information that is gathered during the parallel portion of mesh extraction when GPU mesh uniform building is enabled.
RenderMeshInstanceGpuQueues
The per-thread queues containing mesh instances, populated during the extract phase.
RenderMeshInstanceShared
CPU data that the render world needs to keep about each entity that contains a mesh.
RenderMeshInstancesCpu
Information that the render world keeps about each entity that contains a mesh, when using CPU mesh instance data building.
RenderMeshInstancesGpu
Information that the render world keeps about each entity that contains a mesh, when using GPU mesh instance data building.
RenderMeshQueueData
Data that crate::material::queue_material_meshes and similar systems need in order to place entities that contain meshes in the right batch.
RenderViewLightProbes
A component, part of the render world, that stores the mapping from asset ID or IDs to the texture index in the appropriate binding arrays.
RenderVisibleMeshEntities
ResetIndirectBatchSetsPipeline
The pipeline for the batch set count reset shader.
ScreenSpaceAmbientOcclusion
Component to apply screen space ambient occlusion to a 3d camera.
ScreenSpaceAmbientOcclusionPlugin
Plugin for screen space ambient occlusion.
ScreenSpaceAmbientOcclusionResources
ScreenSpaceReflections
Add this component to a camera to enable screen-space reflections (SSR).
ScreenSpaceReflectionsBuffer
A GPU buffer that stores the screen space reflection settings for each view.
ScreenSpaceReflectionsNode
The node in the render graph that traces screen space reflections.
ScreenSpaceReflectionsPipeline
Information relating to the render pipeline for the screen space reflections shader.
ScreenSpaceReflectionsPipelineId
Identifies which screen space reflections render pipeline a view needs.
ScreenSpaceReflectionsPipelineKey
Identifies a specific configuration of the SSR pipeline shader.
ScreenSpaceReflectionsPlugin
Enables screen-space reflections for a camera.
ScreenSpaceReflectionsUniform
A version of ScreenSpaceReflections for upload to the GPU.
SetMaterialBindGroup
Sets the bind group for a given Material at the configured I index.
SetMeshBindGroup
SetMeshViewBindGroup
SetPrepassViewBindGroup
Shadow
ShadowBatchSetKey
Information that must be identical in order to place opaque meshes in the same batch set.
ShadowBinKey
Data used to bin each object in the shadow map phase.
ShadowPassNode
Encapsulates rendering logic shared between the early and late shadow pass nodes.
ShadowSamplers
ShadowView
SkinUniforms
The GPU buffers containing joint matrices for all skinned meshes.
SkipGpuPreprocess
Stops the GpuPreprocessNode attempting to generate the buffer for this view useful to avoid duplicating effort if the bind group is shared between views
SpecializedMaterialPipelineCache
Stores the SpecializedMaterialViewPipelineCache for each view.
SpecializedMaterialViewPipelineCache
Stores the cached render pipeline ID for each entity in a single view, as well as the last time it was changed.
SpecializedPrepassMaterialPipelineCache
Stores the SpecializedPrepassMaterialViewPipelineCache for each view.
SpecializedPrepassMaterialViewPipelineCache
Stores the cached render pipeline ID for each entity in a single view, as well as the last time it was changed.
SpecializedShadowMaterialPipelineCache
SpecializedShadowMaterialViewPipelineCache
SpotLight
A light that emits light in a given direction from a central point.
StandardMaterial
A material with “standard” properties used in PBR lighting. Standard property values with pictures here: https://google.github.io/filament/Material%20Properties.pdf.
StandardMaterialFlags
Bitflags info about the material a shader is currently rendering. This is accessible in the shader in the StandardMaterialUniform
StandardMaterialKey
The pipeline key for StandardMaterial, packed into 64 bits.
StandardMaterialUniform
The GPU representation of the uniform data of a StandardMaterial.
TransmittedShadowReceiver
Add this component to make a Mesh3d using a PBR material with diffuse_transmission> 0.0 receive shadows on its diffuse transmission lobe. (i.e. its “backside”)
ViewClusterBindings
ViewEnvironmentMapUniformOffset
A component that stores the offset within the EnvironmentMapUniformBuffer for each view.
ViewFogUniformOffset
Inserted on each Entity with an ExtractedView to keep track of its offset in the gpu_fogs DynamicUniformBuffer within FogMeta
ViewKeyCache
ViewKeyPrepassCache
ViewLightEntities
A component that holds the shadow cascade views for all shadow cascades associated with a camera.
ViewLightProbesUniformOffset
A component attached to each camera in the render world that stores the index of the LightProbesUniform in the LightProbesBuffer.
ViewLightsUniformOffset
ViewPrepassSpecializationTicks
ViewScreenSpaceReflectionsUniformOffset
A component that stores the offset within the ScreenSpaceReflectionsBuffer for each view.
ViewShadowBindings
ViewSpecializationTicks
VisibleClusterableObjects
VisibleMeshEntities
Collection of mesh entities visible for 3D lighting.
VolumetricFog
When placed on a bevy_core_pipeline::core_3d::Camera3d, enables volumetric fog and volumetric lighting, also known as light shafts or god rays.
VolumetricFogPlugin
A plugin that implements volumetric fog.
VolumetricLight
Add this component to a DirectionalLight with a shadow map (shadows_enabled: true) to make volumetric fog interact with it.

Enums§

ClusterConfig
Configuration of the clustering strategy for clustered forward rendering
ClusterFarZMode
Configure the far z-plane mode used for the furthest depth slice for clustered forward rendering
FogFalloff
Allows switching between different fog falloff modes, and configuring their parameters.
GpuClusterableObjects
LightEntity
MaterialBindGroupAllocator
A resource that places materials into bind groups and tracks their resources.
MeshBindGroups
All bind groups for meshes currently loaded.
OpaqueRendererMethod
Render method used for opaque materials.
ParallaxMappingMethod
The parallax mapping method to use to compute depth based on the material’s depth_map.
PhasePreprocessBindGroups
The compute shader bind group for the mesh preprocessing step for a single render phase on a single view.
RenderMeshInstanceGpuQueue
The per-thread queues used during extract_meshes_for_gpu_building.
RenderMeshInstances
Information that the render world keeps about each entity that contains a mesh.
RenderPhaseType
ScreenSpaceAmbientOcclusionQualityLevel
ShadowFilteringMethod
Add this component to a Camera3d to control how to anti-alias shadow edges.
SimulationLightSystems
System sets used to run light-related systems.
UvChannel
An enum to define which UV attribute to use for a texture.

Constants§

BUILD_INDIRECT_PARAMS_SHADER_HANDLE
The handle to the build_indirect_params.wgsl compute shader.
CLUSTERED_FORWARD_HANDLE
CLUSTERED_FORWARD_STORAGE_BUFFER_COUNT
FOG_SHADER_HANDLE
Handle for the fog WGSL Shader internal asset
FORWARD_IO_HANDLE
LIGHTMAPS_PER_SLAB
The number of lightmaps that we store in a single slab, if bindless textures are in use.
LIGHTMAP_SHADER_HANDLE
The ID of the lightmap shader.
LIGHT_PROBE_SHADER_HANDLE
MAX_CASCADES_PER_LIGHTNon-webgl or non-WebAssembly or webgpu
MAX_DIRECTIONAL_LIGHTSNon-webgl or non-WebAssembly or webgpu
MAX_JOINTS
Maximum number of joints supported for skinned meshes.
MAX_UNIFORM_BUFFER_CLUSTERABLE_OBJECTS
MAX_VIEW_LIGHT_PROBES
The maximum number of each type of light probe that each view will consider.
MESH_BINDINGS_HANDLE
MESH_FUNCTIONS_HANDLE
MESH_PIPELINE_VIEW_LAYOUT_SAFE_MAX_TEXTURESDebug-assertions enabled
How many textures are allowed in the view bind group layout (@group(0)) before broader compatibility with WebGL and WebGPU is at risk, due to the minimum guaranteed values for MAX_TEXTURE_IMAGE_UNITS (in WebGL) and maxSampledTexturesPerShaderStage (in WebGPU), currently both at 16.
MESH_PREPROCESS_SHADER_HANDLE
The handle to the mesh_preprocess.wgsl compute shader.
MESH_SHADER_HANDLE
MESH_TYPES_HANDLE
MESH_VIEW_BINDINGS_HANDLE
MESH_VIEW_TYPES_HANDLE
MORPH_HANDLE
OCCLUSION_CULLING_HANDLE
PARALLAX_MAPPING_SHADER_HANDLE
PBR_AMBIENT_HANDLE
PBR_BINDINGS_SHADER_HANDLE
PBR_DEFERRED_FUNCTIONS_HANDLE
PBR_DEFERRED_TYPES_HANDLE
PBR_FRAGMENT_HANDLE
PBR_FUNCTIONS_HANDLE
PBR_LIGHTING_HANDLE
PBR_PREPASS_FUNCTIONS_SHADER_HANDLE
PBR_PREPASS_SHADER_HANDLE
PBR_SHADER_HANDLE
PBR_TRANSMISSION_HANDLE
PBR_TYPES_SHADER_HANDLE
PREPASS_BINDINGS_SHADER_HANDLE
PREPASS_IO_SHADER_HANDLE
PREPASS_SHADER_HANDLE
PREPASS_UTILS_SHADER_HANDLE
RESET_INDIRECT_BATCH_SETS_SHADER_HANDLE
The handle to the reset_indirect_batch_sets.wgsl compute shader.
RGB9E5_FUNCTIONS_HANDLE
SHADOWS_HANDLE
SHADOW_SAMPLING_HANDLE
SKINNING_HANDLE
TONEMAPPING_LUT_SAMPLER_BINDING_INDEX
TONEMAPPING_LUT_TEXTURE_BINDING_INDEX
UTILS_HANDLE
VIEW_TRANSFORMATIONS_SHADER_HANDLE

Traits§

LightProbeComponent
A trait implemented by all components that represent light probes.
Material
Materials are used alongside MaterialPlugin, Mesh3d, and MeshMaterial3d to spawn entities that are rendered with a specific Material type. They serve as an easy to use high level way to render Mesh3d entities with custom shader logic.
MaterialExtension
A subset of the Material trait for defining extensions to a base Material, such as the builtin StandardMaterial.

Functions§

add_clusters
alpha_mode_pipeline_key
build_directional_light_cascades
calculate_cluster_factors
check_dir_light_mesh_visibility
check_entities_needing_specialization
check_light_entities_needing_specialization
check_point_light_mesh_visibility
check_prepass_views_need_specialization
check_views_lights_need_specialization
check_views_need_specialization
clear_directional_light_cascades
collect_meshes_for_gpu_building
Creates the RenderMeshInstanceGpus and MeshInputUniforms when GPU mesh uniforms are built.
extract_camera_previous_view_data
extract_clusters
Extracts clusters from the main world from the render world.
extract_entities_needs_specialization
extract_lights
extract_meshes_for_cpu_building
Extracts meshes from the main world into the render world, populating the RenderMeshInstances.
extract_meshes_for_gpu_building
Extracts meshes from the main world into the render world and queues MeshInputUniforms to be uploaded to the GPU.
extract_morphs
extract_skins
generate_view_layouts
Generates all possible view layouts for the mesh pipeline, based on all combinations of MeshPipelineViewLayoutKey flags.
get_bind_group_layout_entries
get_bindings
material_uses_bindless_resources
Returns true if the material will actually use bindless resources or false if it won’t.
no_automatic_morph_batching
prepare_clusters
prepare_environment_uniform_buffer
Gathers up environment map settings for each applicable view and writes them into a GPU buffer.
prepare_fog
Prepares fog metadata and writes the fog-related uniform buffers to the GPU
prepare_lights
prepare_material_bind_groups
Creates and/or recreates any bind groups that contain materials that were modified this frame.
prepare_mesh_bind_groups
Creates the per-mesh bind groups for each type of mesh and each phase.
prepare_mesh_view_bind_groups
prepare_morphs
prepare_prepass_view_bind_group
prepare_preprocess_bind_groups
A system that attaches the mesh uniform buffers to the bind groups for the variants of the mesh preprocessing compute shader.
prepare_preprocess_pipelines
A system that specializes the mesh_preprocess.wgsl pipelines if necessary.
prepare_previous_view_uniforms
prepare_skins
Uploads the buffers containing the joints to the GPU.
prepare_ssr_pipelines
Sets up screen space reflection pipelines for each applicable view.
prepare_ssr_settings
Gathers up screen space reflection settings for each applicable view and writes them into a GPU buffer.
queue_material_meshes
For each view, iterates over all the meshes visible from that view and adds them to BinnedRenderPhases or SortedRenderPhases as appropriate.
queue_prepass_material_meshes
queue_shadows
For each shadow cascade, iterates over all the meshes “visible” from it and adds them to BinnedRenderPhases or SortedRenderPhases as appropriate.
screen_space_specular_transmission_pipeline_key
setup_morph_and_skinning_defs
skins_use_uniform_buffers
Returns true if skinning must use uniforms (and dynamic offsets) because storage buffers aren’t supported on the current platform.
specialize_material_meshes
specialize_prepass_material_meshes
specialize_shadows
tonemapping_pipeline_key
update_directional_light_frusta
update_mesh_previous_global_transforms
update_point_light_frusta
update_previous_view_data
update_spot_light_frusta
write_material_bind_group_buffers
Uploads the contents of all buffers that the MaterialBindGroupAllocator manages to the GPU.
write_mesh_culling_data_buffer
Writes the information needed to do GPU mesh culling to the GPU.

Type Aliases§

DrawPrepass
WithLight
A convenient alias for Or<(With<PointLight>, With<SpotLight>, With<DirectionalLight>)>, for use with bevy_render::view::VisibleEntities.