mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-25 08:30:24 +00:00
Fixing skybox problems
This commit is contained in:
Generated
+8
-8
@@ -5889,7 +5889,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_bevy_xpbd_plugin"
|
name = "space_bevy_xpbd_plugin"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"bevy-inspector-egui",
|
"bevy-inspector-egui",
|
||||||
@@ -5900,7 +5900,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_editor"
|
name = "space_editor"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"space_bevy_xpbd_plugin",
|
"space_bevy_xpbd_plugin",
|
||||||
@@ -5911,7 +5911,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_editor_core"
|
name = "space_editor_core"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"bevy_egui",
|
"bevy_egui",
|
||||||
@@ -5926,7 +5926,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_editor_ui"
|
name = "space_editor_ui"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bevy",
|
"bevy",
|
||||||
@@ -5954,7 +5954,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_persistence"
|
name = "space_persistence"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"ron",
|
"ron",
|
||||||
@@ -5964,7 +5964,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_prefab"
|
name = "space_prefab"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"bevy-inspector-egui",
|
"bevy-inspector-egui",
|
||||||
@@ -5978,7 +5978,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_shared"
|
name = "space_shared"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bevy",
|
"bevy",
|
||||||
@@ -5991,7 +5991,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "space_undo"
|
name = "space_undo"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "git+https://github.com/rewin123/space_editor?rev=0e27774697ffc8d9006736f8f0a5b939d55de53a#0e27774697ffc8d9006736f8f0a5b939d55de53a"
|
source = "git+https://github.com/rewin123/space_editor?rev=e191880bdfc7498a1c93d6efd98393c462990dea#e191880bdfc7498a1c93d6efd98393c462990dea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"pretty-type-name",
|
"pretty-type-name",
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"space_persistence::PersistenceSettings": "{\"space_persistence::PersistenceSettings\":(load_on_startup:true,save_on_close:true)}",
|
|
||||||
"space_undo::ChangeChainSettings": "{\"space_undo::ChangeChainSettings\":(max_change_chain_size:200)}",
|
|
||||||
"space_editor_core::hotkeys::HotkeySet<space_editor_ui::tools::gizmo::GizmoHotkey>": "{\"space_editor_core::hotkeys::HotkeySet<space_editor_ui::tools::gizmo::GizmoHotkey>\":(bindings:{Rotate:[R],Translate:[G],Scale:[S],Multiple:[ShiftLeft],Clone:[AltLeft],Delete:[X]},name:\"GizmoHotkey\")}",
|
|
||||||
"space_editor_ui::sizing::Sizing": "{\"space_editor_ui::sizing::Sizing\":(icon:Regular,gizmos:Gizmos,text:14.0)}",
|
|
||||||
"space_editor_ui::settings::GameModeSettings": "{\"space_editor_ui::settings::GameModeSettings\":(mode:Game3D)}",
|
"space_editor_ui::settings::GameModeSettings": "{\"space_editor_ui::settings::GameModeSettings\":(mode:Game3D)}",
|
||||||
|
"space_persistence::PersistenceSettings": "{\"space_persistence::PersistenceSettings\":(load_on_startup:true,save_on_close:true)}",
|
||||||
|
"space_editor_core::hotkeys::HotkeySet<space_editor_ui::tools::gizmo::GizmoHotkey>": "{\"space_editor_core::hotkeys::HotkeySet<space_editor_ui::tools::gizmo::GizmoHotkey>\":(bindings:{Clone:[AltLeft],Rotate:[KeyR],Multiple:[ShiftLeft],Delete:[KeyX],Translate:[KeyG],Scale:[KeyS]},name:\"GizmoHotkey\")}",
|
||||||
"space_editor_ui::settings::NewWindowSettings": "{\"space_editor_ui::settings::NewWindowSettings\":(new_tab:SameNode)}",
|
"space_editor_ui::settings::NewWindowSettings": "{\"space_editor_ui::settings::NewWindowSettings\":(new_tab:SameNode)}",
|
||||||
|
"space_undo::ChangeChainSettings": "{\"space_undo::ChangeChainSettings\":(max_change_chain_size:200)}",
|
||||||
|
"space_editor_ui::sizing::Sizing": "{\"space_editor_ui::sizing::Sizing\":(icon:Regular,gizmos:Gizmos,text:14.0)}",
|
||||||
}
|
}
|
||||||
+1
-1
@@ -46,7 +46,7 @@ futures-lite = "2.2.0"
|
|||||||
futures = "0.3.30"
|
futures = "0.3.30"
|
||||||
image = "0.24.8"
|
image = "0.24.8"
|
||||||
bytemuck = "1.14.1"
|
bytemuck = "1.14.1"
|
||||||
space_editor = {git = "https://github.com/rewin123/space_editor", rev = "0e27774697ffc8d9006736f8f0a5b939d55de53a"}
|
space_editor = {git = "https://github.com/rewin123/space_editor", rev = "e191880bdfc7498a1c93d6efd98393c462990dea"}
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
serde_repr = "0.1.18"
|
serde_repr = "0.1.18"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
(
|
|
||||||
meta_format_version: "1.0",
|
|
||||||
asset: Load(
|
|
||||||
loader: "bevy_render::texture::hdr_texture_loader::HdrTextureLoader",
|
|
||||||
settings: (),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
+1
-1
@@ -70,7 +70,7 @@ impl Plugin for DebugPlugin {
|
|||||||
.disable::<GizmoToolPlugin>()
|
.disable::<GizmoToolPlugin>()
|
||||||
// .disable::<EditorGizmoConfigPlugin>()
|
// .disable::<EditorGizmoConfigPlugin>()
|
||||||
// .disable::<MeshlessVisualizerPlugin>()
|
// .disable::<MeshlessVisualizerPlugin>()
|
||||||
// .disable::<space_editor::prelude::SelectedPlugin>(),
|
.disable::<space_editor::prelude::SelectedPlugin>(),
|
||||||
);
|
);
|
||||||
|
|
||||||
app.add_systems(Update, sync_editor_camera);
|
app.add_systems(Update, sync_editor_camera);
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ impl PluginGroup for CommonPlugins {
|
|||||||
.add(InspectorPlugin)
|
.add(InspectorPlugin)
|
||||||
.add(InterpolationPlugin)
|
.add(InterpolationPlugin)
|
||||||
.add(ScenePlugin)
|
.add(ScenePlugin)
|
||||||
.add(SkyboxPlugin)
|
// .add(SkyboxPlugin)
|
||||||
.add(StudioInputPlugin)
|
.add(StudioInputPlugin)
|
||||||
.add(UiLayerPlugin)
|
.add(UiLayerPlugin)
|
||||||
.add(WorldGridPlugin)
|
.add(WorldGridPlugin)
|
||||||
|
|||||||
+3
-1
@@ -175,7 +175,9 @@ fn check_loading(
|
|||||||
if let Some((load_state, dep_load_state, rec_load_state)) =
|
if let Some((load_state, dep_load_state, rec_load_state)) =
|
||||||
asset_server.get_load_states(h.id())
|
asset_server.get_load_states(h.id())
|
||||||
{
|
{
|
||||||
let is_loaded = dep_load_state == DependencyLoadState::Loaded;
|
let is_loaded = dep_load_state == DependencyLoadState::Loaded
|
||||||
|
|| rec_load_state == RecursiveDependencyLoadState::Loaded
|
||||||
|
|| load_state == LoadState::Loaded;
|
||||||
|
|
||||||
let is_failed = dep_load_state == DependencyLoadState::Failed
|
let is_failed = dep_load_state == DependencyLoadState::Failed
|
||||||
|| rec_load_state == RecursiveDependencyLoadState::Failed
|
|| rec_load_state == RecursiveDependencyLoadState::Failed
|
||||||
|
|||||||
+36
-28
@@ -47,12 +47,20 @@ fn load_skybox(mut cmd: Commands, assets: Res<AssetServer>, id: Res<SkyboxId>) {
|
|||||||
brightness: 1.0,
|
brightness: 1.0,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let paths = SkyboxPaths::new(id);
|
|
||||||
cmd.insert_resource(SkyboxAssets {
|
let color = Color::hex("AAAAAA").unwrap();
|
||||||
cubemap: assets.load(paths.cubemap),
|
cmd.insert_resource(ClearColor(color));
|
||||||
env_diffuse: assets.load(paths.env_diffuse),
|
cmd.insert_resource(AmbientLight {
|
||||||
env_specular: assets.load(paths.env_specular),
|
color,
|
||||||
|
brightness: 1.0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// let paths = SkyboxPaths::new(id);
|
||||||
|
// cmd.insert_resource(SkyboxAssets {
|
||||||
|
// cubemap: assets.load(paths.cubemap),
|
||||||
|
// env_diffuse: assets.load(paths.env_diffuse),
|
||||||
|
// env_specular: assets.load(paths.env_specular),
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,31 +94,31 @@ fn spawn_skybox(
|
|||||||
skybox_assets: Res<SkyboxAssets>,
|
skybox_assets: Res<SkyboxAssets>,
|
||||||
q_camera: Query<Entity, With<MainCamera>>,
|
q_camera: Query<Entity, With<MainCamera>>,
|
||||||
) {
|
) {
|
||||||
// Configure the skybox texture as a cubemap
|
// // Configure the skybox texture as a cubemap
|
||||||
let image = images.get_mut(&skybox_assets.cubemap).unwrap();
|
// let image = images.get_mut(&skybox_assets.cubemap).unwrap();
|
||||||
if image.texture_descriptor.array_layer_count() == 1 {
|
// if image.texture_descriptor.array_layer_count() == 1 {
|
||||||
image.reinterpret_stacked_2d_as_array(6);
|
// image.reinterpret_stacked_2d_as_array(6);
|
||||||
image.texture_view_descriptor = Some(TextureViewDescriptor {
|
// image.texture_view_descriptor = Some(TextureViewDescriptor {
|
||||||
dimension: Some(TextureViewDimension::Cube),
|
// dimension: Some(TextureViewDimension::Cube),
|
||||||
..default()
|
// ..default()
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Add components to the scene camera
|
// // Add components to the scene camera
|
||||||
cmd.entity(q_camera.single()).insert((
|
// cmd.entity(q_camera.single()).insert((
|
||||||
Skybox {
|
// Skybox {
|
||||||
image: skybox_assets.cubemap.clone(),
|
// image: skybox_assets.cubemap.clone(),
|
||||||
brightness: 1.0,
|
// brightness: 10.0,
|
||||||
},
|
// },
|
||||||
EnvironmentMapLight {
|
// EnvironmentMapLight {
|
||||||
diffuse_map: skybox_assets.env_diffuse.clone(),
|
// diffuse_map: skybox_assets.env_diffuse.clone(),
|
||||||
specular_map: skybox_assets.env_specular.clone(),
|
// specular_map: skybox_assets.env_specular.clone(),
|
||||||
intensity: 1.0,
|
// intensity: 10.0,
|
||||||
},
|
// },
|
||||||
));
|
// ));
|
||||||
|
|
||||||
// Remove the intermediate resource
|
// // Remove the intermediate resource
|
||||||
cmd.remove_resource::<SkyboxAssets>();
|
// cmd.remove_resource::<SkyboxAssets>();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SkyboxPaths {
|
struct SkyboxPaths {
|
||||||
|
|||||||
Reference in New Issue
Block a user