Skip to main content

SceneError

Enum SceneError 

Source
pub enum SceneError {
Show 65 variants UnknownMaterial, UnknownModel, UnknownInstance, UnknownLight, UnknownEnvironment, UnknownDecal, UnknownDecalImage, MaterialInUse, ModelInUse, DecalImageInUse, MissingImage, MissingMaterial, MissingMesh, EmptyImage, MissingDecodedImage, RayDataMismatch, InvalidCompressedImage, CompressedImageViews, IndexOutOfRange, NonFiniteGeometry, TooManyLightmapCharts { mesh: usize, }, InvalidPose, InvalidMaterialFactors, InvalidAnisotropy, MissingAnisotropyTangents, InvalidAlphaCutoff, InvalidReflectance, InvalidOcclusion, InvalidIridescence, InvalidTransmission, InvalidSheen, InvalidDiffuseTransmission, InvalidNormalLayers, InvalidLod, TooManyLods, TooManySections, LodInSameModel, StaticInstance, InvalidLight, InvalidDecal, InvalidEnvironmentMap, InvalidLightmap, InvalidDirectionality, InvalidIrradianceAtlas, InvalidIrradiance, CompressionUnsupported, HeatVertexCount, InvalidHeatVertex, InvalidFogVolume, InvalidDeformation, DeformationMismatch, DeformingModel, InvalidOrigin, InvalidDynamicGiVolume, InvalidIrradianceVolume, InvalidIrradianceRegion, IrradianceRegionOutside, UnknownShader, ShaderInUse, ShaderParameters { expected: u32, given: u32, }, Shader(ShaderError), InvalidDisplacementBound, ShaderDataLength { mesh: usize, }, DeviceLimit, Probe(ProbeError),
}
Expand description

A Scene operation’s refusal.

Variants§

§

UnknownMaterial

The material was removed, or another scene issued its identity.

§

UnknownModel

The model was removed, or another scene issued its identity.

§

UnknownInstance

The instance was removed, or another scene issued its identity.

§

UnknownLight

The light was removed, or another scene issued its identity.

§

UnknownEnvironment

The environment was removed, or another scene issued its identity.

§

UnknownDecal

The decal was removed, or another scene issued its identity.

§

UnknownDecalImage

The decal image was removed, or another scene issued its identity.

§

MaterialInUse

A model’s mesh uses the material.

§

ModelInUse

An instance uses the model, or it is a level of detail of a mesh.

§

DecalImageInUse

A decal uses the decal image, or a light projects it as its cookie.

§

MissingImage

A material names an image index beyond the images added with it.

§

MissingMaterial

An asset’s mesh names a material index beyond the asset’s materials.

§

MissingMesh

The model has no mesh at that index.

§

EmptyImage

An image has no texels.

§

MissingDecodedImage

An ETC2/ASTC image needs decoded level 0 for material ray sampling or the CPU decal atlas, but supplied none.

§

RayDataMismatch

A prepared model’s ray-data capability differs from this scene’s.

§

InvalidCompressedImage

A compressed image’s sides are not multiples of its block size or exceed 16384, or it holds no level, more than a full chain, or a level of the wrong size; an ETC2/ASTC decoded companion must match level 0, whereas BC7 must not carry a companion.

§

CompressedImageViews

A compressed image that materials sample as both sRGB colour and linear data needs DownlevelFlags::VIEW_FORMATS, which wgpu’s GL backend lacks.

§

IndexOutOfRange

A mesh index names no vertex of its mesh.

§

NonFiniteGeometry

A vertex position, UV or lightmap UV is not finite, a mesh’s UVs span more than f32 holds, or a vertex normal is zero or not finite.

§

TooManyLightmapCharts

A mesh’s vertices name more than 65,536 distinct lightmap chart bounds (Vertex::lightmap_bounds). mesh is its index among the model’s meshes, an asset’s mesh index through Scene::add_asset.

Fields

§mesh: usize
§

InvalidPose

A pose is not finite or not invertible.

§

InvalidMaterialFactors

A material’s metallic, roughness, clearcoat, clearcoat roughness or base alpha is outside 0..=1, or a channel of its base colour or emission or its environment scale is negative or not finite. Also returned for a non-finite normal, coat-normal or bump scale.

§

InvalidAnisotropy

Anisotropy strength is outside 0..=1 or its rotation is not finite.

§

MissingAnisotropyTangents

An anisotropic material’s mesh lacks authored tangent frames.

§

InvalidAlphaCutoff

A masked material’s alpha cutoff is not finite and nonnegative.

§

InvalidReflectance

A material’s IOR is below 1 or NaN, its specular strength outside 0..=1, or a channel of its specular colour not finite and nonnegative.

§

InvalidOcclusion

A material’s occlusion strength is outside 0..=1.

§

InvalidIridescence

A material’s iridescence is outside 0..=1, its film’s IOR below 1 or not finite, or a film thickness negative or not finite.

§

InvalidTransmission

A material’s transmission is outside 0..=1 or set on an unlit material, its thickness or dispersion is negative or not finite, its attenuation distance is not positive, or an attenuation colour channel is outside 0..=1.

§

InvalidSheen

A material’s sheen colour or sheen roughness is outside 0..=1.

§

InvalidDiffuseTransmission

A material’s diffuse transmission is outside 0..=1, or its colour is negative or not finite.

§

InvalidNormalLayers

A material’s normal layers have a velocity, scale or strength that is not finite, a scale that is not positive or a speed beyond 2^24 repeats of the map per hour, or the material has no normal map that repeats on both axes for them to scroll.

§

InvalidLod

A level of detail’s error is not finite and nonnegative.

§

TooManyLods

A mesh is given more alternatives than lod::MAX_MESH_LODS.

§

TooManySections

A mesh holds more than 65,536 sections of 128 triangles (8,388,608 triangles), the most a GPU-built draw list culls a mesh by.

§

LodInSameModel

A level of detail names a mesh of the model it details, which draws all its meshes.

§

StaticInstance

An ambient cube was given to a static instance, which takes baked diffuse light from lightmap charts and the irradiance atlas.

§

InvalidLight

A light’s position, colour, intensity, range or specular scale is not finite, or not positive where it must be, its shadow opacity is outside 0..=1, a spot’s direction is zero or its angles are not 0 <= inner <= outer < π/2, or it has a cookie but is not a spot of a positive outer angle, or the cookie’s up has no finite part across the spot’s direction.

§

InvalidDecal

A decal’s position, rotation or size is not finite, its size not positive, or its colour, mix or fades outside their ranges.

§

InvalidEnvironmentMap

A PMREM atlas’s texels do not match its dimensions.

§

InvalidLightmap

A lightmap’s texels do not match its size, or its UV scale/offset is not finite.

§

InvalidDirectionality

Directionality neither is empty nor matches its chart with finite [0, 1] lobes, or it holds a lobe that rounds to the reserved all-zero RGBA8 lobe.

§

InvalidIrradianceAtlas

An irradiance atlas’s layers do not match its size (for a compressed atlas, nonzero multiples of 4).

§

InvalidIrradiance

Irradiance outside the finite nonnegative RGBA16F range, or a compressed atlas’s scale that is not finite and nonnegative.

§

CompressionUnsupported

The device lacks the image format’s BC, ETC2 or ASTC compression feature.

§

HeatVertexCount

Heat geometry is not a triangle list of at most heat_distortion::MAX_VERTICES vertices.

§

InvalidHeatVertex

A heat vertex’s position is not finite, its displacement not within heat_distortion::MAX_DISPLACEMENT_PIXELS or its weight not in 0..=1.

§

InvalidFogVolume

A fog volume’s centre, rotation or size is not finite, its rotation is zero, its size not positive, or its density, albedo or edge fade negative or not finite.

§

InvalidDeformation

A mesh’s influences or morph targets do not match its vertices, a vertex’s weights are not finite and nonnegative with a finite positive sum, a displacement is not finite, a joint or morph weight index is above 65535, or the mesh has more than 256 morph targets.

§

DeformationMismatch

The instance’s model does not deform, or its joint matrices or morph weights are fewer than its model takes, or not finite.

§

DeformingModel

A deforming model’s instances move and keep their model, and it takes no part in levels of detail.

§

InvalidOrigin

A render origin (Scene::move_origin) is not finite.

§

InvalidDynamicGiVolume

A dynamic GI volume’s origin or spacing is not finite, its spacing not positive, or it has fewer than two probes along an axis.

§

InvalidIrradianceVolume

An irradiance volume’s origin or cell size is not finite, its cell size not positive, or it has no cell along an axis.

§

InvalidIrradianceRegion

A prepared irradiance region’s corner is not finite, it has no cell along an axis, its values are not one per cell, or a value’s light is not finite, nonnegative and within RGBA16F range or its sky visibility not within 0..=1.

§

IrradianceRegionOutside

No irradiance volume is installed, or an irradiance region’s corner is off its lattice or the region not wholly within it.

§

UnknownShader

The shader was removed, or another scene issued its identity; or a material names such a shader.

§

ShaderInUse

A material names the shader.

§

ShaderParameters

Scene::set_shader_parameters was given given bytes for a material whose shader’s ShaderParams takes expected, 0 for a material without a shader.

Fields

§expected: u32
§given: u32
§

Shader(ShaderError)

Scene::add_shader refused the module.

§

InvalidDisplacementBound

A material’s shader’s displacement bound is not finite and nonnegative.

§

ShaderDataLength

Mesh mesh’s shader data is neither empty nor one entry per vertex, or no data was given for it (PreparedModel::with_shader_data).

Fields

§mesh: usize
§

DeviceLimit

The content would exceed a limit of the device.

§

Probe(ProbeError)

The specular probe collection was refused.

Trait Implementations§

Source§

impl Debug for SceneError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SceneError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SceneError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ProbeError> for SceneError

Source§

fn from(error: ProbeError) -> Self

Converts to this type from the input type.
Source§

impl From<ShaderError> for SceneError

Source§

fn from(error: ShaderError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,