Crate pbr

Crate pbr 

Source

Modules§

decal
Decal rendering.
deferred
environment_map
Environment maps and reflection probes.
generate
Like EnvironmentMapLight, but filtered in realtime from a cubemap.
graph
irradiance_volume
Irradiance volumes, also known as voxel global illumination.
prelude
The PBR prelude.
resources
wireframe

Structs§

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.
Bluenoise
A resource that stores the spatio-temporal blue noise texture.
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.
ClearIndirectParametersMetadataNode
The render node that clears out the GPU-side indirect metadata buffers.
ClusteredDecalPlugin
A plugin that adds support for clustered decals.
DefaultOpaqueRendererMethod
Default render method used for opaque materials.
DeferredDrawFunction
DeferredFragmentShader
DeferredVertexShader
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.
ErasedMaterialKey
ErasedMaterialKeyVTable
ErasedMaterialPipelineKey
ExtendedMaterial
A material that extends a base Material with additional shaders and data.
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
GlobalClusterableObjectMeta
GpuAtmosphereSettings
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
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.
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.
MaterialBindGroupAllocators
MaterialBindGroupBindlessAllocator
The allocator that places bindless materials into bind groups and tracks their resources.
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.
MaterialDrawFunction
MaterialExtensionBindGroupData
MaterialExtensionKey
MaterialExtensionPipeline
MaterialExtractionSystems
A SystemSet that contains all extract_mesh_materials systems.
MaterialFragmentShader
MaterialPipeline
Render pipeline data for a given Material.
MaterialPipelineKey
A key uniquely identifying a specialized MaterialPipeline.
MaterialPipelineSpecializer
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.
MaterialVertexShader
MaterialsPlugin
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.
MeshExtractionSystems
A SystemSet that encompasses both extract_meshes_for_cpu_building and extract_meshes_for_gpu_building.
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.
MeshletDeferredFragmentShader
MeshletFragmentShader
MeshletPrepassFragmentShader
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.
PbrPlugin
Sets up the entire PBR infrastructure of bevy.
PhaseBuildIndirectParametersBindGroups
The per-phase set of bind groups for the compute shaders that reset indirect draw counts and build indirect parameters.
PreparedMaterial
Data prepared for a Material instance.
PrepassDrawFunction
PrepassEnabled
Marker resource for whether prepass is enabled globally for this material type
PrepassFragmentShader
PrepassPipeline
PrepassPipelinePlugin
Sets up everything required to use the prepass pipeline.
PrepassPipelineSpecializer
PrepassPlugin
Sets up the prepasses for a material.
PrepassVertexShader
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
SetMeshViewBindingArrayBindGroup
SetMeshViewEmptyBindGroup
SetPrepassViewBindGroup
SetPrepassViewEmptyBindGroup
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
ShadowsDrawFunction
ShadowsEnabled
Marker resource for whether shadows are enabled for this material type
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
StandardMaterial
A material with “standard” properties used in PBR lighting. Standard property values with pictures here: https://google.github.io/filament/notes/material_properties.html.
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.
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
VolumetricFogPlugin
A plugin that implements volumetric fog.

Enums§

AtmosphereMode
Selects how the atmosphere is rendered. Choose based on scene scale and volumetric shadow quality, and based on performance needs.
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
UvChannel
An enum to define which UV attribute to use for a texture.

Constants§

CLUSTERED_FORWARD_STORAGE_BUFFER_COUNT
LIGHTMAPS_PER_SLAB
The number of lightmaps that we store in a single slab, if bindless textures are in use.
MATERIAL_BIND_GROUP_INDEX
MAX_CASCADES_PER_LIGHT
MAX_DIRECTIONAL_LIGHTS
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_PIPELINE_VIEW_LAYOUT_SAFE_MAX_TEXTURES
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.
TONEMAPPING_LUT_SAMPLER_BINDING_INDEX
TONEMAPPING_LUT_TEXTURE_BINDING_INDEX

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§

alpha_mode_pipeline_key
check_entities_needing_specialization
check_light_entities_needing_specialization
check_prepass_views_need_specialization
check_views_lights_need_specialization
check_views_need_specialization
collect_meshes_for_gpu_building
Creates the RenderMeshInstanceGpus and MeshInputUniforms when GPU mesh uniforms are built.
extract_ambient_light
extract_ambient_light_resource
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_shadow_filtering_method
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
init_fallback_bindless_resources
init_global_clusterable_object_meta
init_material_pipeline
init_prepass_pipeline
init_prepass_view_bind_group
init_render_lightmaps
init_screen_space_reflections_pipeline
init_shadow_samplers
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
stbn_placeholder
tonemapping_pipeline_key
update_mesh_previous_global_transforms
update_previous_view_data
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§

DrawMaterial
DrawPrepass
ExtractMaterialsSetDeprecated
Deprecated alias for MaterialExtractionSystems.
ExtractMeshesSetDeprecated
Deprecated alias for MeshExtractionSystems.