Move CubemapLayout out of decal code (#19960)

# Objective

- Make bevy_light possible by making it possible to split out
clusterable into bevy_camera

## Solution

- Move cubemap stuff next to cubemap stuff.

## Testing

- 3d_scene runs

Note: no breaking changes thanks to re-exports
This commit is contained in:
atlv 2025-07-05 10:40:28 -04:00 committed by GitHub
parent a869383cda
commit f987920bbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 36 deletions

View File

@ -363,6 +363,42 @@ impl CubemapFrusta {
}
}
/// Cubemap layout defines the order of images in a packed cubemap image.
#[derive(Default, Reflect, Debug, Clone, Copy)]
pub enum CubemapLayout {
/// layout in a vertical cross format
/// ```text
/// +y
/// -x -z +x
/// -y
/// +z
/// ```
#[default]
CrossVertical = 0,
/// layout in a horizontal cross format
/// ```text
/// +y
/// -x -z +x +z
/// -y
/// ```
CrossHorizontal = 1,
/// layout in a vertical sequence
/// ```text
/// +x
/// -y
/// +y
/// -y
/// -z
/// +z
/// ```
SequenceVertical = 2,
/// layout in a horizontal sequence
/// ```text
/// +x -y +y -y -z +z
/// ```
SequenceHorizontal = 3,
}
#[derive(Component, Debug, Default, Reflect, Clone)]
#[reflect(Component, Default, Debug, Clone)]
pub struct CascadesFrusta {

View File

@ -32,6 +32,7 @@ use bevy_image::Image;
use bevy_math::Mat4;
use bevy_platform::collections::HashMap;
use bevy_reflect::Reflect;
pub use bevy_render::primitives::CubemapLayout;
use bevy_render::{
extract_component::{ExtractComponent, ExtractComponentPlugin},
load_shader_library,
@ -95,42 +96,6 @@ pub struct ClusteredDecal {
pub tag: u32,
}
/// Cubemap layout defines the order of images in a packed cubemap image.
#[derive(Default, Reflect, Debug, Clone, Copy)]
pub enum CubemapLayout {
/// layout in a vertical cross format
/// ```text
/// +y
/// -x -z +x
/// -y
/// +z
/// ```
#[default]
CrossVertical = 0,
/// layout in a horizontal cross format
/// ```text
/// +y
/// -x -z +x +z
/// -y
/// ```
CrossHorizontal = 1,
/// layout in a vertical sequence
/// ```text
/// +x
/// -y
/// +y
/// -y
/// -z
/// +z
/// ```
SequenceVertical = 2,
/// layout in a horizontal sequence
/// ```text
/// +x -y +y -y -z +z
/// ```
SequenceHorizontal = 3,
}
/// Add to a [`PointLight`] to add a light texture effect.
/// A texture mask is applied to the light source to modulate its intensity,
/// simulating patterns like window shadows, gobo/cookie effects, or soft falloffs.