Don't reëxport bevy_image from bevy_render (#16163)

Fixes #15940

Remove the `pub use` and fix the compile errors.
Make `bevy_image` available as `bevy::image`.

Feature Frenzy would be good here! Maybe I'll learn how to use it if I
have some time this weekend, or maybe a reviewer can use it.

Use `bevy_image` instead of `bevy_render::texture` items.

---------

Co-authored-by: chompaa <antony.m.3012@gmail.com>
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
This commit is contained in:
Benjamin Brienen 2024-11-10 07:54:38 +01:00 committed by François
parent 1da3fcc2b5
commit 31ec5751f5
No known key found for this signature in database
92 changed files with 189 additions and 170 deletions

View file

@ -3,11 +3,11 @@ use super::compensation_curve::{
}; };
use bevy_asset::prelude::*; use bevy_asset::prelude::*;
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::Image;
use bevy_render::{ use bevy_render::{
globals::GlobalsUniform, globals::GlobalsUniform,
render_resource::{binding_types::*, *}, render_resource::{binding_types::*, *},
renderer::RenderDevice, renderer::RenderDevice,
texture::Image,
view::ViewUniform, view::ViewUniform,
}; };
use core::num::NonZero; use core::num::NonZero;

View file

@ -3,8 +3,9 @@ use core::ops::RangeInclusive;
use super::compensation_curve::AutoExposureCompensationCurve; use super::compensation_curve::AutoExposureCompensationCurve;
use bevy_asset::Handle; use bevy_asset::Handle;
use bevy_ecs::{prelude::Component, reflect::ReflectComponent}; use bevy_ecs::{prelude::Component, reflect::ReflectComponent};
use bevy_image::Image;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{extract_component::ExtractComponent, texture::Image}; use bevy_render::extract_component::ExtractComponent;
use bevy_utils::default; use bevy_utils::default;
/// Component that enables auto exposure for an HDR-enabled 2d or 3d camera. /// Component that enables auto exposure for an HDR-enabled 2d or 3d camera.

View file

@ -6,6 +6,7 @@ use crate::{
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, Handle}; use bevy_asset::{load_internal_asset, Handle};
use bevy_ecs::{prelude::*, query::QueryItem}; use bevy_ecs::{prelude::*, query::QueryItem};
use bevy_image::BevyDefault as _;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
extract_component::{ExtractComponent, ExtractComponentPlugin, UniformComponentPlugin}, extract_component::{ExtractComponent, ExtractComponentPlugin, UniformComponentPlugin},
@ -16,7 +17,6 @@ use bevy_render::{
*, *,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::BevyDefault,
view::{ExtractedView, ViewTarget}, view::{ExtractedView, ViewTarget},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -65,14 +65,15 @@ pub const DEPTH_TEXTURE_SAMPLING_SUPPORTED: bool = true;
use core::ops::Range; use core::ops::Range;
use bevy_asset::{AssetId, UntypedAssetId};
use bevy_color::LinearRgba;
pub use camera_3d::*; pub use camera_3d::*;
pub use main_opaque_pass_3d_node::*; pub use main_opaque_pass_3d_node::*;
pub use main_transparent_pass_3d_node::*; pub use main_transparent_pass_3d_node::*;
use bevy_app::{App, Plugin, PostUpdate}; use bevy_app::{App, Plugin, PostUpdate};
use bevy_asset::{AssetId, UntypedAssetId};
use bevy_color::LinearRgba;
use bevy_ecs::{entity::EntityHashSet, prelude::*}; use bevy_ecs::{entity::EntityHashSet, prelude::*};
use bevy_image::{BevyDefault, Image};
use bevy_math::FloatOrd; use bevy_math::FloatOrd;
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::{ use bevy_render::{
@ -91,7 +92,7 @@ use bevy_render::{
}, },
renderer::RenderDevice, renderer::RenderDevice,
sync_world::RenderEntity, sync_world::RenderEntity,
texture::{BevyDefault, ColorAttachment, Image, TextureCache}, texture::{ColorAttachment, TextureCache},
view::{ExtractedView, ViewDepthTexture, ViewTarget}, view::{ExtractedView, ViewDepthTexture, ViewTarget},
Extract, ExtractSchedule, Render, RenderApp, RenderSet, Extract, ExtractSchedule, Render, RenderApp, RenderSet,
}; };

View file

@ -26,6 +26,7 @@ use bevy_ecs::{
system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::BevyDefault as _;
use bevy_math::ops; use bevy_math::ops;
use bevy_reflect::{prelude::ReflectDefault, Reflect}; use bevy_reflect::{prelude::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
@ -48,7 +49,7 @@ use bevy_render::{
renderer::{RenderContext, RenderDevice}, renderer::{RenderContext, RenderDevice},
sync_component::SyncComponentPlugin, sync_component::SyncComponentPlugin,
sync_world::RenderEntity, sync_world::RenderEntity,
texture::{BevyDefault, CachedTexture, TextureCache}, texture::{CachedTexture, TextureCache},
view::{ view::{
prepare_view_targets, ExtractedView, Msaa, ViewDepthTexture, ViewTarget, ViewUniform, prepare_view_targets, ExtractedView, Msaa, ViewDepthTexture, ViewTarget, ViewUniform,
ViewUniformOffset, ViewUniforms, ViewUniformOffset, ViewUniforms,

View file

@ -6,6 +6,7 @@ use crate::{
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, Handle}; use bevy_asset::{load_internal_asset, Handle};
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::BevyDefault as _;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
extract_component::{ExtractComponent, ExtractComponentPlugin}, extract_component::{ExtractComponent, ExtractComponentPlugin},
@ -16,7 +17,6 @@ use bevy_render::{
*, *,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::BevyDefault,
view::{ExtractedView, ViewTarget}, view::{ExtractedView, ViewTarget},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -5,6 +5,7 @@ use bevy_ecs::{
system::{Commands, Query, Res, ResMut, Resource}, system::{Commands, Query, Res, ResMut, Resource},
world::FromWorld, world::FromWorld,
}; };
use bevy_image::BevyDefault as _;
use bevy_render::{ use bevy_render::{
globals::GlobalsUniform, globals::GlobalsUniform,
render_resource::{ render_resource::{
@ -19,7 +20,6 @@ use bevy_render::{
TextureFormat, TextureSampleType, TextureFormat, TextureSampleType,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::BevyDefault,
view::{ExtractedView, Msaa, ViewTarget}, view::{ExtractedView, Msaa, ViewTarget},
}; };

View file

@ -9,6 +9,7 @@ use bevy_ecs::{
entity::{EntityHashMap, EntityHashSet}, entity::{EntityHashMap, EntityHashSet},
prelude::*, prelude::*,
}; };
use bevy_image::BevyDefault as _;
use bevy_render::{ use bevy_render::{
render_resource::{ render_resource::{
binding_types::{storage_buffer_sized, texture_depth_2d, uniform_buffer}, binding_types::{storage_buffer_sized, texture_depth_2d, uniform_buffer},
@ -18,7 +19,6 @@ use bevy_render::{
Shader, ShaderDefVal, ShaderStages, TextureFormat, Shader, ShaderDefVal, ShaderStages, TextureFormat,
}, },
renderer::{RenderAdapter, RenderDevice}, renderer::{RenderAdapter, RenderDevice},
texture::BevyDefault,
view::{ExtractedView, ViewTarget, ViewUniform, ViewUniforms}, view::{ExtractedView, ViewTarget, ViewUniform, ViewUniforms},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -14,6 +14,7 @@ use bevy_ecs::{
system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::{BevyDefault, Image};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
camera::Camera, camera::Camera,
@ -32,7 +33,7 @@ use bevy_render::{
TextureDimension, TextureFormat, TextureSampleType, TextureDimension, TextureFormat, TextureSampleType,
}, },
renderer::{RenderContext, RenderDevice, RenderQueue}, renderer::{RenderContext, RenderDevice, RenderQueue},
texture::{BevyDefault, GpuImage, Image}, texture::GpuImage,
view::{ExtractedView, ViewTarget}, view::{ExtractedView, ViewTarget},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -6,6 +6,7 @@ use bevy_ecs::{
schedule::IntoSystemConfigs, schedule::IntoSystemConfigs,
system::{Commands, Query, Res, ResMut, Resource}, system::{Commands, Query, Res, ResMut, Resource},
}; };
use bevy_image::{BevyDefault, Image};
use bevy_math::{Mat4, Quat}; use bevy_math::{Mat4, Quat};
use bevy_render::{ use bevy_render::{
camera::Exposure, camera::Exposure,
@ -19,7 +20,7 @@ use bevy_render::{
*, *,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::{BevyDefault, GpuImage, Image}, texture::GpuImage,
view::{ExtractedView, Msaa, ViewTarget, ViewUniform, ViewUniforms}, view::{ExtractedView, Msaa, ViewTarget, ViewUniform, ViewUniforms},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -30,6 +30,10 @@
//! //!
//! [SMAA]: https://www.iryoku.com/smaa/ //! [SMAA]: https://www.iryoku.com/smaa/
use crate::{
core_2d::graph::{Core2d, Node2d},
core_3d::graph::{Core3d, Node3d},
};
use bevy_app::{App, Plugin}; use bevy_app::{App, Plugin};
#[cfg(feature = "smaa_luts")] #[cfg(feature = "smaa_luts")]
use bevy_asset::load_internal_binary_asset; use bevy_asset::load_internal_binary_asset;
@ -44,6 +48,7 @@ use bevy_ecs::{
system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::{BevyDefault, Image};
use bevy_math::{vec4, Vec4}; use bevy_math::{vec4, Vec4};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
@ -67,24 +72,12 @@ use bevy_render::{
VertexState, VertexState,
}, },
renderer::{RenderContext, RenderDevice, RenderQueue}, renderer::{RenderContext, RenderDevice, RenderQueue},
texture::{BevyDefault, CachedTexture, GpuImage, Image, TextureCache}, texture::{CachedTexture, GpuImage, TextureCache},
view::{ExtractedView, ViewTarget}, view::{ExtractedView, ViewTarget},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };
#[cfg(feature = "smaa_luts")]
use bevy_render::{
render_asset::RenderAssetUsages,
texture::{CompressedImageFormats, ImageFormat, ImageSampler, ImageType},
};
use bevy_utils::prelude::default; use bevy_utils::prelude::default;
#[cfg(not(feature = "smaa_luts"))]
use crate::tonemapping::lut_placeholder;
use crate::{
core_2d::graph::{Core2d, Node2d},
core_3d::graph::{Core3d, Node3d},
};
/// The handle of the `smaa.wgsl` shader. /// The handle of the `smaa.wgsl` shader.
const SMAA_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(12247928498010601081); const SMAA_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(12247928498010601081);
/// The handle of the area LUT, a KTX2 format texture that SMAA uses internally. /// The handle of the area LUT, a KTX2 format texture that SMAA uses internally.
@ -306,11 +299,11 @@ impl Plugin for SmaaPlugin {
#[cfg(all(debug_assertions, feature = "dds"))] #[cfg(all(debug_assertions, feature = "dds"))]
"SMAAAreaLUT".to_owned(), "SMAAAreaLUT".to_owned(),
bytes, bytes,
ImageType::Format(ImageFormat::Ktx2), bevy_image::ImageType::Format(bevy_image::ImageFormat::Ktx2),
CompressedImageFormats::NONE, bevy_image::CompressedImageFormats::NONE,
false, false,
ImageSampler::Default, bevy_image::ImageSampler::Default,
RenderAssetUsages::RENDER_WORLD, bevy_asset::RenderAssetUsages::RENDER_WORLD,
) )
.expect("Failed to load SMAA area LUT") .expect("Failed to load SMAA area LUT")
); );
@ -324,11 +317,11 @@ impl Plugin for SmaaPlugin {
#[cfg(all(debug_assertions, feature = "dds"))] #[cfg(all(debug_assertions, feature = "dds"))]
"SMAASearchLUT".to_owned(), "SMAASearchLUT".to_owned(),
bytes, bytes,
ImageType::Format(ImageFormat::Ktx2), bevy_image::ImageType::Format(bevy_image::ImageFormat::Ktx2),
CompressedImageFormats::NONE, bevy_image::CompressedImageFormats::NONE,
false, false,
ImageSampler::Default, bevy_image::ImageSampler::Default,
RenderAssetUsages::RENDER_WORLD, bevy_asset::RenderAssetUsages::RENDER_WORLD,
) )
.expect("Failed to load SMAA search LUT") .expect("Failed to load SMAA search LUT")
); );

View file

@ -16,6 +16,7 @@ use bevy_ecs::{
system::{Commands, Query, Res, ResMut, Resource}, system::{Commands, Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::BevyDefault as _;
use bevy_math::vec2; use bevy_math::vec2;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
@ -34,7 +35,7 @@ use bevy_render::{
renderer::{RenderContext, RenderDevice}, renderer::{RenderContext, RenderDevice},
sync_component::SyncComponentPlugin, sync_component::SyncComponentPlugin,
sync_world::RenderEntity, sync_world::RenderEntity,
texture::{BevyDefault, CachedTexture, TextureCache}, texture::{CachedTexture, TextureCache},
view::{ExtractedView, Msaa, ViewTarget}, view::{ExtractedView, Msaa, ViewTarget},
ExtractSchedule, MainWorld, Render, RenderApp, RenderSet, ExtractSchedule, MainWorld, Render, RenderApp, RenderSet,
}; };

View file

@ -2,6 +2,7 @@ use crate::fullscreen_vertex_shader::fullscreen_shader_vertex_state;
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, Assets, Handle}; use bevy_asset::{load_internal_asset, Assets, Handle};
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::{CompressedImageFormats, Image, ImageSampler, ImageType};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
camera::Camera, camera::Camera,
@ -13,7 +14,7 @@ use bevy_render::{
*, *,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::{CompressedImageFormats, FallbackImage, GpuImage, Image, ImageSampler, ImageType}, texture::{FallbackImage, GpuImage},
view::{ExtractedView, ViewTarget, ViewUniform}, view::{ExtractedView, ViewTarget, ViewUniform},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };
@ -433,14 +434,14 @@ pub fn get_lut_bind_group_layout_entries() -> [BindGroupLayoutEntryBuilder; 2] {
// allow(dead_code) so it doesn't complain when the tonemapping_luts feature is disabled // allow(dead_code) so it doesn't complain when the tonemapping_luts feature is disabled
#[allow(dead_code)] #[allow(dead_code)]
fn setup_tonemapping_lut_image(bytes: &[u8], image_type: ImageType) -> Image { fn setup_tonemapping_lut_image(bytes: &[u8], image_type: ImageType) -> Image {
let image_sampler = ImageSampler::Descriptor(bevy_render::texture::ImageSamplerDescriptor { let image_sampler = ImageSampler::Descriptor(bevy_image::ImageSamplerDescriptor {
label: Some("Tonemapping LUT sampler".to_string()), label: Some("Tonemapping LUT sampler".to_string()),
address_mode_u: bevy_render::texture::ImageAddressMode::ClampToEdge, address_mode_u: bevy_image::ImageAddressMode::ClampToEdge,
address_mode_v: bevy_render::texture::ImageAddressMode::ClampToEdge, address_mode_v: bevy_image::ImageAddressMode::ClampToEdge,
address_mode_w: bevy_render::texture::ImageAddressMode::ClampToEdge, address_mode_w: bevy_image::ImageAddressMode::ClampToEdge,
mag_filter: bevy_render::texture::ImageFilterMode::Linear, mag_filter: bevy_image::ImageFilterMode::Linear,
min_filter: bevy_render::texture::ImageFilterMode::Linear, min_filter: bevy_image::ImageFilterMode::Linear,
mipmap_filter: bevy_render::texture::ImageFilterMode::Linear, mipmap_filter: bevy_image::ImageFilterMode::Linear,
..default() ..default()
}); });
Image::from_buffer( Image::from_buffer(

View file

@ -20,6 +20,7 @@ bevy_sprite = { path = "../bevy_sprite", version = "0.15.0-rc.3", optional = tru
bevy_app = { path = "../bevy_app", version = "0.15.0-rc.3" } bevy_app = { path = "../bevy_app", version = "0.15.0-rc.3" }
bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" }
bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" }
bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" }
bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" }
bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" } bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" }
bevy_render = { path = "../bevy_render", version = "0.15.0-rc.3", optional = true } bevy_render = { path = "../bevy_render", version = "0.15.0-rc.3", optional = true }

View file

@ -13,6 +13,7 @@ use bevy_ecs::{
system::{Query, Res, ResMut, Resource}, system::{Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::BevyDefault as _;
use bevy_math::FloatOrd; use bevy_math::FloatOrd;
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::{ use bevy_render::{
@ -22,7 +23,6 @@ use bevy_render::{
ViewSortedRenderPhases, ViewSortedRenderPhases,
}, },
render_resource::*, render_resource::*,
texture::BevyDefault,
view::{ExtractedView, Msaa, RenderLayers, ViewTarget}, view::{ExtractedView, Msaa, RenderLayers, ViewTarget},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -17,6 +17,7 @@ use bevy_ecs::{
system::{Query, Res, ResMut, Resource}, system::{Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::BevyDefault as _;
use bevy_pbr::{MeshPipeline, MeshPipelineKey, SetMeshViewBindGroup}; use bevy_pbr::{MeshPipeline, MeshPipelineKey, SetMeshViewBindGroup};
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::{ use bevy_render::{
@ -26,7 +27,6 @@ use bevy_render::{
ViewSortedRenderPhases, ViewSortedRenderPhases,
}, },
render_resource::*, render_resource::*,
texture::BevyDefault,
view::{ExtractedView, Msaa, RenderLayers, ViewTarget}, view::{ExtractedView, Msaa, RenderLayers, ViewTarget},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -103,12 +103,12 @@ pub use loader::*;
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::{Asset, AssetApp, AssetPath, Handle}; use bevy_asset::{Asset, AssetApp, AssetPath, Handle};
use bevy_ecs::{prelude::Component, reflect::ReflectComponent}; use bevy_ecs::{prelude::Component, reflect::ReflectComponent};
use bevy_image::CompressedImageFormats;
use bevy_pbr::StandardMaterial; use bevy_pbr::StandardMaterial;
use bevy_reflect::{std_traits::ReflectDefault, Reflect, TypePath}; use bevy_reflect::{std_traits::ReflectDefault, Reflect, TypePath};
use bevy_render::{ use bevy_render::{
mesh::{skinning::SkinnedMeshInverseBindposes, Mesh, MeshVertexAttribute}, mesh::{skinning::SkinnedMeshInverseBindposes, Mesh, MeshVertexAttribute},
renderer::RenderDevice, renderer::RenderDevice,
texture::CompressedImageFormats,
}; };
use bevy_scene::Scene; use bevy_scene::Scene;

View file

@ -15,6 +15,10 @@ use bevy_ecs::{
world::World, world::World,
}; };
use bevy_hierarchy::{BuildChildren, ChildBuild, WorldChildBuilder}; use bevy_hierarchy::{BuildChildren, ChildBuild, WorldChildBuilder};
use bevy_image::{
CompressedImageFormats, Image, ImageAddressMode, ImageFilterMode, ImageLoaderSettings,
ImageSampler, ImageSamplerDescriptor, ImageType, TextureError,
};
use bevy_math::{Affine2, Mat4, Vec3}; use bevy_math::{Affine2, Mat4, Vec3};
use bevy_pbr::{ use bevy_pbr::{
DirectionalLight, MeshMaterial3d, PointLight, SpotLight, StandardMaterial, UvChannel, DirectionalLight, MeshMaterial3d, PointLight, SpotLight, StandardMaterial, UvChannel,
@ -31,10 +35,6 @@ use bevy_render::{
primitives::Aabb, primitives::Aabb,
render_asset::RenderAssetUsages, render_asset::RenderAssetUsages,
render_resource::{Face, PrimitiveTopology}, render_resource::{Face, PrimitiveTopology},
texture::{
CompressedImageFormats, Image, ImageAddressMode, ImageFilterMode, ImageLoaderSettings,
ImageSampler, ImageSamplerDescriptor, ImageType, TextureError,
},
view::Visibility, view::Visibility,
}; };
use bevy_scene::Scene; use bevy_scene::Scene;

View file

@ -14,6 +14,7 @@ use core::hash::Hash;
use derive_more::derive::{Display, Error, From}; use derive_more::derive::{Display, Error, From};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use wgpu::{Extent3d, TextureDimension, TextureFormat, TextureViewDescriptor}; use wgpu::{Extent3d, TextureDimension, TextureFormat, TextureViewDescriptor};
pub trait BevyDefault { pub trait BevyDefault {
fn bevy_default() -> Self; fn bevy_default() -> Self;
} }

View file

@ -2,6 +2,10 @@
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")] #![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![allow(unsafe_code)] #![allow(unsafe_code)]
pub mod prelude {
pub use crate::{BevyDefault as _, Image, ImageFormat, TextureError};
}
mod image; mod image;
pub use self::image::*; pub use self::image::*;
#[cfg(feature = "basis-universal")] #[cfg(feature = "basis-universal")]

View file

@ -37,6 +37,8 @@ pub use bevy_gizmos as gizmos;
#[cfg(feature = "bevy_gltf")] #[cfg(feature = "bevy_gltf")]
pub use bevy_gltf as gltf; pub use bevy_gltf as gltf;
pub use bevy_hierarchy as hierarchy; pub use bevy_hierarchy as hierarchy;
#[cfg(feature = "bevy_image")]
pub use bevy_image as image;
pub use bevy_input as input; pub use bevy_input as input;
pub use bevy_log as log; pub use bevy_log as log;
pub use bevy_math as math; pub use bevy_math as math;

View file

@ -6,6 +6,10 @@ pub use crate::{
MinimalPlugins, MinimalPlugins,
}; };
#[doc(hidden)]
#[cfg(feature = "bevy_image")]
pub use crate::image::prelude::*;
pub use bevy_derive::{bevy_main, Deref, DerefMut}; pub use bevy_derive::{bevy_main, Deref, DerefMut};
#[doc(hidden)] #[doc(hidden)]

View file

@ -37,6 +37,7 @@ bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" }
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" } bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" }
bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" } bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" }
bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" }
bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" }
bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" }
bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [
"bevy", "bevy",

View file

@ -5,6 +5,9 @@ use crate::{
ViewScreenSpaceReflectionsUniformOffset, TONEMAPPING_LUT_SAMPLER_BINDING_INDEX, ViewScreenSpaceReflectionsUniformOffset, TONEMAPPING_LUT_SAMPLER_BINDING_INDEX,
TONEMAPPING_LUT_TEXTURE_BINDING_INDEX, TONEMAPPING_LUT_TEXTURE_BINDING_INDEX,
}; };
use crate::{
MeshPipelineKey, ShadowFilteringMethod, ViewFogUniformOffset, ViewLightsUniformOffset,
};
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, Handle}; use bevy_asset::{load_internal_asset, Handle};
use bevy_core_pipeline::{ use bevy_core_pipeline::{
@ -16,6 +19,7 @@ use bevy_core_pipeline::{
tonemapping::{DebandDither, Tonemapping}, tonemapping::{DebandDither, Tonemapping},
}; };
use bevy_ecs::{prelude::*, query::QueryItem}; use bevy_ecs::{prelude::*, query::QueryItem};
use bevy_image::BevyDefault as _;
use bevy_render::{ use bevy_render::{
extract_component::{ extract_component::{
ComponentUniforms, ExtractComponent, ExtractComponentPlugin, UniformComponentPlugin, ComponentUniforms, ExtractComponent, ExtractComponentPlugin, UniformComponentPlugin,
@ -23,15 +27,10 @@ use bevy_render::{
render_graph::{NodeRunError, RenderGraphApp, RenderGraphContext, ViewNode, ViewNodeRunner}, render_graph::{NodeRunError, RenderGraphApp, RenderGraphContext, ViewNode, ViewNodeRunner},
render_resource::{binding_types::uniform_buffer, *}, render_resource::{binding_types::uniform_buffer, *},
renderer::{RenderContext, RenderDevice}, renderer::{RenderContext, RenderDevice},
texture::BevyDefault,
view::{ExtractedView, ViewTarget, ViewUniformOffset}, view::{ExtractedView, ViewTarget, ViewUniformOffset},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };
use crate::{
MeshPipelineKey, ShadowFilteringMethod, ViewFogUniformOffset, ViewLightsUniformOffset,
};
pub struct DeferredPbrLightingPlugin; pub struct DeferredPbrLightingPlugin;
pub const DEFERRED_LIGHTING_SHADER_HANDLE: Handle<Shader> = pub const DEFERRED_LIGHTING_SHADER_HANDLE: Handle<Shader> =

View file

@ -116,6 +116,7 @@ use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, AssetApp, Assets, Handle}; use bevy_asset::{load_internal_asset, AssetApp, Assets, Handle};
use bevy_core_pipeline::core_3d::graph::{Core3d, Node3d}; use bevy_core_pipeline::core_3d::graph::{Core3d, Node3d};
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::Image;
use bevy_render::{ use bevy_render::{
alpha::AlphaMode, alpha::AlphaMode,
camera::{ camera::{
@ -128,10 +129,11 @@ use bevy_render::{
render_graph::RenderGraph, render_graph::RenderGraph,
render_resource::Shader, render_resource::Shader,
sync_component::SyncComponentPlugin, sync_component::SyncComponentPlugin,
texture::{GpuImage, Image}, texture::GpuImage,
view::{check_visibility, VisibilitySystems}, view::{check_visibility, VisibilitySystems},
ExtractSchedule, Render, RenderApp, RenderSet, ExtractSchedule, Render, RenderApp, RenderSet,
}; };
use bevy_transform::TransformSystem; use bevy_transform::TransformSystem;
pub const PBR_TYPES_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(1708015359337029744); pub const PBR_TYPES_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(1708015359337029744);

View file

@ -51,6 +51,7 @@ use bevy_ecs::{
bundle::Bundle, component::Component, query::QueryItem, reflect::ReflectComponent, bundle::Bundle, component::Component, query::QueryItem, reflect::ReflectComponent,
system::lifetimeless::Read, system::lifetimeless::Read,
}; };
use bevy_image::Image;
use bevy_math::Quat; use bevy_math::Quat;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
@ -63,7 +64,7 @@ use bevy_render::{
TextureSampleType, TextureView, TextureSampleType, TextureView,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::{FallbackImage, GpuImage, Image}, texture::{FallbackImage, GpuImage},
}; };
use core::{num::NonZero, ops::Deref}; use core::{num::NonZero, ops::Deref};

View file

@ -133,6 +133,7 @@
//! [Why ambient cubes?]: #why-ambient-cubes //! [Why ambient cubes?]: #why-ambient-cubes
use bevy_ecs::{component::Component, reflect::ReflectComponent}; use bevy_ecs::{component::Component, reflect::ReflectComponent};
use bevy_image::Image;
use bevy_render::{ use bevy_render::{
render_asset::RenderAssets, render_asset::RenderAssets,
render_resource::{ render_resource::{
@ -140,7 +141,7 @@ use bevy_render::{
TextureSampleType, TextureView, TextureSampleType, TextureView,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::{FallbackImage, GpuImage, Image}, texture::{FallbackImage, GpuImage},
}; };
use core::{num::NonZero, ops::Deref}; use core::{num::NonZero, ops::Deref};

View file

@ -12,6 +12,7 @@ use bevy_ecs::{
schedule::IntoSystemConfigs, schedule::IntoSystemConfigs,
system::{Commands, Local, Query, Res, ResMut, Resource}, system::{Commands, Local, Query, Res, ResMut, Resource},
}; };
use bevy_image::Image;
use bevy_math::{Affine3A, FloatOrd, Mat4, Vec3A, Vec4}; use bevy_math::{Affine3A, FloatOrd, Mat4, Vec3A, Vec4};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
@ -22,7 +23,7 @@ use bevy_render::{
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
settings::WgpuFeatures, settings::WgpuFeatures,
sync_world::RenderEntity, sync_world::RenderEntity,
texture::{FallbackImage, GpuImage, Image}, texture::{FallbackImage, GpuImage},
view::{ExtractedView, Visibility}, view::{ExtractedView, Visibility},
Extract, ExtractSchedule, Render, RenderApp, RenderSet, Extract, ExtractSchedule, Render, RenderApp, RenderSet,
}; };

View file

@ -39,6 +39,7 @@ use bevy_ecs::{
schedule::IntoSystemConfigs, schedule::IntoSystemConfigs,
system::{Query, Res, ResMut, Resource}, system::{Query, Res, ResMut, Resource},
}; };
use bevy_image::Image;
use bevy_math::{uvec2, vec4, Rect, UVec2}; use bevy_math::{uvec2, vec4, Rect, UVec2};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::sync_world::MainEntityHashMap; use bevy_render::sync_world::MainEntityHashMap;
@ -46,7 +47,7 @@ use bevy_render::{
mesh::{Mesh, RenderMesh}, mesh::{Mesh, RenderMesh},
render_asset::RenderAssets, render_asset::RenderAssets,
render_resource::Shader, render_resource::Shader,
texture::{GpuImage, Image}, texture::GpuImage,
view::ViewVisibility, view::ViewVisibility,
Extract, ExtractSchedule, RenderApp, Extract, ExtractSchedule, RenderApp,
}; };

View file

@ -60,8 +60,9 @@ use core::{
/// ``` /// ```
/// # use bevy_pbr::{Material, MeshMaterial3d}; /// # use bevy_pbr::{Material, MeshMaterial3d};
/// # use bevy_ecs::prelude::*; /// # use bevy_ecs::prelude::*;
/// # use bevy_image::Image;
/// # use bevy_reflect::TypePath; /// # use bevy_reflect::TypePath;
/// # use bevy_render::{mesh::{Mesh, Mesh3d}, render_resource::{AsBindGroup, ShaderRef}, texture::Image}; /// # use bevy_render::{mesh::{Mesh, Mesh3d}, render_resource::{AsBindGroup, ShaderRef}};
/// # use bevy_color::LinearRgba; /// # use bevy_color::LinearRgba;
/// # use bevy_color::palettes::basic::RED; /// # use bevy_color::palettes::basic::RED;
/// # use bevy_asset::{Handle, AssetServer, Assets, Asset}; /// # use bevy_asset::{Handle, AssetServer, Assets, Asset};

View file

@ -14,6 +14,7 @@ use bevy_ecs::{
query::ROQueryItem, query::ROQueryItem,
system::{lifetimeless::*, SystemParamItem, SystemState}, system::{lifetimeless::*, SystemParamItem, SystemState},
}; };
use bevy_image::{BevyDefault, ImageSampler, TextureFormatPixelInfo};
use bevy_math::{Affine3, Rect, UVec2, Vec3, Vec4}; use bevy_math::{Affine3, Rect, UVec2, Vec3, Vec4};
use bevy_render::{ use bevy_render::{
batching::{ batching::{
@ -32,7 +33,7 @@ use bevy_render::{
}, },
render_resource::*, render_resource::*,
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::{BevyDefault, DefaultImageSampler, ImageSampler, TextureFormatPixelInfo}, texture::DefaultImageSampler,
view::{ view::{
prepare_view_targets, GpuCulling, RenderVisibilityRanges, ViewTarget, ViewUniformOffset, prepare_view_targets, GpuCulling, RenderVisibilityRanges, ViewTarget, ViewUniformOffset,
ViewVisibility, VisibilityRange, ViewVisibility, VisibilityRange,

View file

@ -15,13 +15,14 @@ use bevy_ecs::{
system::{Commands, Query, Res, Resource}, system::{Commands, Query, Res, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::BevyDefault as _;
use bevy_math::Vec4; use bevy_math::Vec4;
use bevy_render::{ use bevy_render::{
globals::{GlobalsBuffer, GlobalsUniform}, globals::{GlobalsBuffer, GlobalsUniform},
render_asset::RenderAssets, render_asset::RenderAssets,
render_resource::{binding_types::*, *}, render_resource::{binding_types::*, *},
renderer::RenderDevice, renderer::RenderDevice,
texture::{BevyDefault, FallbackImage, FallbackImageMsaa, FallbackImageZero, GpuImage}, texture::{FallbackImage, FallbackImageMsaa, FallbackImageZero, GpuImage},
view::{ view::{
Msaa, RenderVisibilityRanges, ViewUniform, ViewUniforms, Msaa, RenderVisibilityRanges, ViewUniform, ViewUniforms,
VISIBILITY_RANGES_STORAGE_BUFFER_COUNT, VISIBILITY_RANGES_STORAGE_BUFFER_COUNT,

View file

@ -23,6 +23,7 @@ use bevy_ecs::{
system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource}, system::{lifetimeless::Read, Commands, Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::BevyDefault as _;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{ use bevy_render::{
extract_component::{ExtractComponent, ExtractComponentPlugin}, extract_component::{ExtractComponent, ExtractComponentPlugin},
@ -36,7 +37,6 @@ use bevy_render::{
TextureFormat, TextureSampleType, TextureFormat, TextureSampleType,
}, },
renderer::{RenderContext, RenderDevice, RenderQueue}, renderer::{RenderContext, RenderDevice, RenderQueue},
texture::BevyDefault as _,
view::{ExtractedView, Msaa, ViewTarget, ViewUniformOffset}, view::{ExtractedView, Msaa, ViewTarget, ViewUniformOffset},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };

View file

@ -42,6 +42,7 @@ use bevy_ecs::{
bundle::Bundle, component::Component, reflect::ReflectComponent, bundle::Bundle, component::Component, reflect::ReflectComponent,
schedule::IntoSystemConfigs as _, schedule::IntoSystemConfigs as _,
}; };
use bevy_image::Image;
use bevy_math::{ use bevy_math::{
primitives::{Cuboid, Plane3d}, primitives::{Cuboid, Plane3d},
Vec2, Vec3, Vec2, Vec3,
@ -52,7 +53,6 @@ use bevy_render::{
render_graph::{RenderGraphApp, ViewNodeRunner}, render_graph::{RenderGraphApp, ViewNodeRunner},
render_resource::{Shader, SpecializedRenderPipelines}, render_resource::{Shader, SpecializedRenderPipelines},
sync_component::SyncComponentPlugin, sync_component::SyncComponentPlugin,
texture::Image,
view::{InheritedVisibility, ViewVisibility, Visibility}, view::{InheritedVisibility, ViewVisibility, Visibility},
ExtractSchedule, Render, RenderApp, RenderSet, ExtractSchedule, Render, RenderApp, RenderSet,
}; };

View file

@ -16,6 +16,7 @@ use bevy_ecs::{
system::{lifetimeless::Read, Commands, Local, Query, Res, ResMut, Resource}, system::{lifetimeless::Read, Commands, Local, Query, Res, ResMut, Resource},
world::{FromWorld, World}, world::{FromWorld, World},
}; };
use bevy_image::{BevyDefault, Image};
use bevy_math::{vec4, Mat3A, Mat4, Vec3, Vec3A, Vec4, Vec4Swizzles as _}; use bevy_math::{vec4, Mat3A, Mat4, Vec3, Vec3A, Vec4, Vec4Swizzles as _};
use bevy_render::{ use bevy_render::{
mesh::{ mesh::{
@ -37,7 +38,7 @@ use bevy_render::{
}, },
renderer::{RenderContext, RenderDevice, RenderQueue}, renderer::{RenderContext, RenderDevice, RenderQueue},
sync_world::RenderEntity, sync_world::RenderEntity,
texture::{BevyDefault as _, GpuImage, Image}, texture::GpuImage,
view::{ExtractedView, Msaa, ViewDepthTexture, ViewTarget, ViewUniformOffset}, view::{ExtractedView, Msaa, ViewDepthTexture, ViewTarget, ViewUniformOffset},
Extract, Extract,
}; };

View file

@ -41,6 +41,7 @@ enum BindingState<'a> {
pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> { pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
let manifest = BevyManifest::default(); let manifest = BevyManifest::default();
let render_path = manifest.get_path("bevy_render"); let render_path = manifest.get_path("bevy_render");
let image_path = manifest.get_path("bevy_image");
let asset_path = manifest.get_path("bevy_asset"); let asset_path = manifest.get_path("bevy_asset");
let ecs_path = manifest.get_path("bevy_ecs"); let ecs_path = manifest.get_path("bevy_ecs");
@ -264,7 +265,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
binding_impls.insert(0, quote! { binding_impls.insert(0, quote! {
( #binding_index, ( #binding_index,
#render_path::render_resource::OwnedBindingResource::TextureView({ #render_path::render_resource::OwnedBindingResource::TextureView({
let handle: Option<&#asset_path::Handle<#render_path::texture::Image>> = (&self.#field_name).into(); let handle: Option<&#asset_path::Handle<#image_path::Image>> = (&self.#field_name).into();
if let Some(handle) = handle { if let Some(handle) = handle {
images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?.texture_view.clone() images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?.texture_view.clone()
} else { } else {
@ -305,7 +306,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
( (
#binding_index, #binding_index,
#render_path::render_resource::OwnedBindingResource::TextureView({ #render_path::render_resource::OwnedBindingResource::TextureView({
let handle: Option<&#asset_path::Handle<#render_path::texture::Image>> = (&self.#field_name).into(); let handle: Option<&#asset_path::Handle<#image_path::Image>> = (&self.#field_name).into();
if let Some(handle) = handle { if let Some(handle) = handle {
images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?.texture_view.clone() images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?.texture_view.clone()
} else { } else {
@ -362,7 +363,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
( (
#binding_index, #binding_index,
#render_path::render_resource::OwnedBindingResource::Sampler({ #render_path::render_resource::OwnedBindingResource::Sampler({
let handle: Option<&#asset_path::Handle<#render_path::texture::Image>> = (&self.#field_name).into(); let handle: Option<&#asset_path::Handle<#image_path::Image>> = (&self.#field_name).into();
if let Some(handle) = handle { if let Some(handle) = handle {
let image = images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?; let image = images.get(handle).ok_or_else(|| #render_path::render_resource::AsBindGroupError::RetryNextUpdate)?;

View file

@ -4,7 +4,6 @@ use crate::view::RenderVisibleEntities;
use crate::{ use crate::{
batching::gpu_preprocessing::GpuPreprocessingSupport, batching::gpu_preprocessing::GpuPreprocessingSupport,
camera::{CameraProjection, ManualTextureViewHandle, ManualTextureViews}, camera::{CameraProjection, ManualTextureViewHandle, ManualTextureViews},
prelude::Image,
primitives::Frustum, primitives::Frustum,
render_asset::RenderAssets, render_asset::RenderAssets,
render_graph::{InternedRenderSubGraph, RenderSubGraph}, render_graph::{InternedRenderSubGraph, RenderSubGraph},
@ -30,6 +29,7 @@ use bevy_ecs::{
system::{Commands, Query, Res, ResMut, Resource}, system::{Commands, Query, Res, ResMut, Resource},
world::DeferredWorld, world::DeferredWorld,
}; };
use bevy_image::Image;
use bevy_math::{ops, vec2, Dir3, Mat4, Ray3d, Rect, URect, UVec2, UVec4, Vec2, Vec3}; use bevy_math::{ops, vec2, Dir3, Mat4, Ray3d, Rect, URect, UVec2, UVec4, Vec2, Vec3};
use bevy_reflect::prelude::*; use bevy_reflect::prelude::*;
use bevy_render_macros::ExtractComponent; use bevy_render_macros::ExtractComponent;

View file

@ -1,7 +1,6 @@
use crate::{ use crate::{extract_resource::ExtractResource, render_resource::TextureView};
extract_resource::ExtractResource, render_resource::TextureView, texture::BevyDefault,
};
use bevy_ecs::{prelude::Component, reflect::ReflectComponent, system::Resource}; use bevy_ecs::{prelude::Component, reflect::ReflectComponent, system::Resource};
use bevy_image::BevyDefault as _;
use bevy_math::UVec2; use bevy_math::UVec2;
use bevy_reflect::prelude::*; use bevy_reflect::prelude::*;
use bevy_utils::HashMap; use bevy_utils::HashMap;

View file

@ -1,12 +1,11 @@
use crate::{ use crate::{
extract_component::ExtractComponentPlugin, extract_component::ExtractComponentPlugin,
prelude::Image,
render_asset::RenderAssets, render_asset::RenderAssets,
render_resource::{Buffer, BufferUsages, Extent3d, ImageDataLayout, Texture, TextureFormat}, render_resource::{Buffer, BufferUsages, Extent3d, ImageDataLayout, Texture, TextureFormat},
renderer::{render_system, RenderDevice}, renderer::{render_system, RenderDevice},
storage::{GpuShaderStorageBuffer, ShaderStorageBuffer}, storage::{GpuShaderStorageBuffer, ShaderStorageBuffer},
sync_world::MainEntity, sync_world::MainEntity,
texture::{GpuImage, TextureFormatPixelInfo}, texture::GpuImage,
ExtractSchedule, MainWorld, Render, RenderApp, RenderSet, ExtractSchedule, MainWorld, Render, RenderApp, RenderSet,
}; };
use async_channel::{Receiver, Sender}; use async_channel::{Receiver, Sender};
@ -21,6 +20,7 @@ use bevy_ecs::{
prelude::{Component, Resource, World}, prelude::{Component, Resource, World},
system::{Query, Res}, system::{Query, Res},
}; };
use bevy_image::{Image, TextureFormatPixelInfo};
use bevy_reflect::Reflect; use bevy_reflect::Reflect;
use bevy_render_macros::ExtractComponent; use bevy_render_macros::ExtractComponent;
use bevy_utils::{default, tracing::warn, HashMap}; use bevy_utils::{default, tracing::warn, HashMap};

View file

@ -61,12 +61,11 @@ pub mod prelude {
}, },
render_resource::Shader, render_resource::Shader,
spatial_bundle::SpatialBundle, spatial_bundle::SpatialBundle,
texture::{Image, ImagePlugin, IntoDynamicImageError}, texture::ImagePlugin,
view::{InheritedVisibility, Msaa, ViewVisibility, Visibility, VisibilityBundle}, view::{InheritedVisibility, Msaa, ViewVisibility, Visibility, VisibilityBundle},
ExtractSchedule, ExtractSchedule,
}; };
} }
use batching::gpu_preprocessing::BatchingPlugin; use batching::gpu_preprocessing::BatchingPlugin;
use bevy_ecs::schedule::ScheduleBuildSettings; use bevy_ecs::schedule::ScheduleBuildSettings;
use bevy_utils::prelude::default; use bevy_utils::prelude::default;

View file

@ -78,7 +78,7 @@ impl Deref for BindGroup {
/// ok to do "expensive" work here, such as creating a [`Buffer`] for a uniform. /// ok to do "expensive" work here, such as creating a [`Buffer`] for a uniform.
/// ///
/// If for some reason a [`BindGroup`] cannot be created yet (for example, the [`Texture`](crate::render_resource::Texture) /// If for some reason a [`BindGroup`] cannot be created yet (for example, the [`Texture`](crate::render_resource::Texture)
/// for an [`Image`](crate::texture::Image) hasn't loaded yet), just return [`AsBindGroupError::RetryNextUpdate`], which signals that the caller /// for an [`Image`](bevy_image::Image) hasn't loaded yet), just return [`AsBindGroupError::RetryNextUpdate`], which signals that the caller
/// should retry again later. /// should retry again later.
/// ///
/// # Deriving /// # Deriving
@ -87,7 +87,8 @@ impl Deref for BindGroup {
/// what their binding type is, and what index they should be bound at: /// what their binding type is, and what index they should be bound at:
/// ///
/// ``` /// ```
/// # use bevy_render::{render_resource::*, texture::Image}; /// # use bevy_render::render_resource::*;
/// # use bevy_image::Image;
/// # use bevy_color::LinearRgba; /// # use bevy_color::LinearRgba;
/// # use bevy_asset::Handle; /// # use bevy_asset::Handle;
/// # use bevy_render::storage::ShaderStorageBuffer; /// # use bevy_render::storage::ShaderStorageBuffer;
@ -133,7 +134,7 @@ impl Deref for BindGroup {
/// GPU resource, which will be bound as a texture in shaders. The field will be assumed to implement [`Into<Option<Handle<Image>>>`]. In practice, /// GPU resource, which will be bound as a texture in shaders. The field will be assumed to implement [`Into<Option<Handle<Image>>>`]. In practice,
/// most fields should be a [`Handle<Image>`](bevy_asset::Handle) or [`Option<Handle<Image>>`]. If the value of an [`Option<Handle<Image>>`] is /// most fields should be a [`Handle<Image>`](bevy_asset::Handle) or [`Option<Handle<Image>>`]. If the value of an [`Option<Handle<Image>>`] is
/// [`None`], the [`crate::texture::FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `sampler` binding attribute /// [`None`], the [`crate::texture::FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `sampler` binding attribute
/// (with a different binding index) if a binding of the sampler for the [`Image`](crate::texture::Image) is also required. /// (with a different binding index) if a binding of the sampler for the [`Image`](bevy_image::Image) is also required.
/// ///
/// | Arguments | Values | Default | /// | Arguments | Values | Default |
/// |-----------------------|-------------------------------------------------------------------------|----------------------| /// |-----------------------|-------------------------------------------------------------------------|----------------------|
@ -161,7 +162,7 @@ impl Deref for BindGroup {
/// resource, which will be bound as a sampler in shaders. The field will be assumed to implement [`Into<Option<Handle<Image>>>`]. In practice, /// resource, which will be bound as a sampler in shaders. The field will be assumed to implement [`Into<Option<Handle<Image>>>`]. In practice,
/// most fields should be a [`Handle<Image>`](bevy_asset::Handle) or [`Option<Handle<Image>>`]. If the value of an [`Option<Handle<Image>>`] is /// most fields should be a [`Handle<Image>`](bevy_asset::Handle) or [`Option<Handle<Image>>`]. If the value of an [`Option<Handle<Image>>`] is
/// [`None`], the [`crate::texture::FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `texture` binding attribute /// [`None`], the [`crate::texture::FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `texture` binding attribute
/// (with a different binding index) if a binding of the texture for the [`Image`](crate::texture::Image) is also required. /// (with a different binding index) if a binding of the texture for the [`Image`](bevy_image::Image) is also required.
/// ///
/// | Arguments | Values | Default | /// | Arguments | Values | Default |
/// |------------------------|-------------------------------------------------------------------------|------------------------| /// |------------------------|-------------------------------------------------------------------------|------------------------|
@ -194,9 +195,10 @@ impl Deref for BindGroup {
/// ///
/// As mentioned above, [`Option<Handle<Image>>`] is also supported: /// As mentioned above, [`Option<Handle<Image>>`] is also supported:
/// ``` /// ```
/// # use bevy_render::{render_resource::AsBindGroup, texture::Image};
/// # use bevy_color::LinearRgba;
/// # use bevy_asset::Handle; /// # use bevy_asset::Handle;
/// # use bevy_color::LinearRgba;
/// # use bevy_image::Image;
/// # use bevy_render::render_resource::AsBindGroup;
/// #[derive(AsBindGroup)] /// #[derive(AsBindGroup)]
/// struct CoolMaterial { /// struct CoolMaterial {
/// #[uniform(0)] /// #[uniform(0)]
@ -433,8 +435,9 @@ where
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::*; use super::*;
use crate::{self as bevy_render, prelude::Image}; use crate as bevy_render;
use bevy_asset::Handle; use bevy_asset::Handle;
use bevy_image::Image;
#[test] #[test]
fn texture_visibility() { fn texture_visibility() {

View file

@ -4,18 +4,11 @@ mod texture_attachment;
mod texture_cache; mod texture_cache;
pub use crate::render_resource::DefaultImageSampler; pub use crate::render_resource::DefaultImageSampler;
#[cfg(feature = "exr")]
pub use bevy_image::ExrTextureLoader;
#[cfg(feature = "hdr")]
pub use bevy_image::HdrTextureLoader;
pub use bevy_image::{
BevyDefault, CompressedImageFormats, FileTextureError, Image, ImageAddressMode,
ImageFilterMode, ImageFormat, ImageFormatSetting, ImageLoader, ImageLoaderError,
ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, ImageType, IntoDynamicImageError,
TextureError, TextureFormatPixelInfo,
};
#[cfg(feature = "basis-universal")] #[cfg(feature = "basis-universal")]
pub use bevy_image::{CompressedImageSaver, CompressedImageSaverError}; use bevy_image::CompressedImageSaver;
#[cfg(feature = "hdr")]
use bevy_image::HdrTextureLoader;
use bevy_image::{CompressedImageFormats, Image, ImageLoader, ImageSamplerDescriptor};
pub use fallback_image::*; pub use fallback_image::*;
pub use gpu_image::*; pub use gpu_image::*;
pub use texture_attachment::*; pub use texture_attachment::*;
@ -39,7 +32,7 @@ pub const TRANSPARENT_IMAGE_HANDLE: Handle<Image> =
// TODO: replace Texture names with Image names? // TODO: replace Texture names with Image names?
/// Adds the [`Image`] as an asset and makes sure that they are extracted and prepared for the GPU. /// Adds the [`Image`] as an asset and makes sure that they are extracted and prepared for the GPU.
pub struct ImagePlugin { pub struct ImagePlugin {
/// The default image sampler to use when [`ImageSampler`] is set to `Default`. /// The default image sampler to use when [`bevy_image::ImageSampler`] is set to `Default`.
pub default_sampler: ImageSamplerDescriptor, pub default_sampler: ImageSamplerDescriptor,
} }
@ -69,7 +62,7 @@ impl Plugin for ImagePlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
#[cfg(feature = "exr")] #[cfg(feature = "exr")]
{ {
app.init_asset_loader::<ExrTextureLoader>(); app.init_asset_loader::<bevy_image::ExrTextureLoader>();
} }
#[cfg(feature = "hdr")] #[cfg(feature = "hdr")]

View file

@ -18,8 +18,8 @@ use crate::{
render_resource::{DynamicUniformBuffer, ShaderType, Texture, TextureView}, render_resource::{DynamicUniformBuffer, ShaderType, Texture, TextureView},
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::{ texture::{
BevyDefault, CachedTexture, ColorAttachment, DepthAttachment, GpuImage, CachedTexture, ColorAttachment, DepthAttachment, GpuImage, OutputColorAttachment,
OutputColorAttachment, TextureCache, TextureCache,
}, },
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}; };
@ -28,6 +28,7 @@ use bevy_app::{App, Plugin};
use bevy_color::LinearRgba; use bevy_color::LinearRgba;
use bevy_derive::{Deref, DerefMut}; use bevy_derive::{Deref, DerefMut};
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::BevyDefault as _;
use bevy_math::{mat3, vec2, vec3, Mat3, Mat4, UVec4, Vec2, Vec3, Vec4, Vec4Swizzles}; use bevy_math::{mat3, vec2, vec3, Mat3, Mat4, UVec4, Vec2, Vec3, Vec4, Vec4Swizzles};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render_macros::ExtractComponent; use bevy_render_macros::ExtractComponent;

View file

@ -2,7 +2,7 @@ use super::ExtractedWindows;
use crate::{ use crate::{
camera::{ManualTextureViewHandle, ManualTextureViews, NormalizedRenderTarget, RenderTarget}, camera::{ManualTextureViewHandle, ManualTextureViews, NormalizedRenderTarget, RenderTarget},
gpu_readback, gpu_readback,
prelude::{Image, Shader}, prelude::Shader,
render_asset::{RenderAssetUsages, RenderAssets}, render_asset::{RenderAssetUsages, RenderAssets},
render_resource::{ render_resource::{
binding_types::texture_2d, BindGroup, BindGroupEntries, BindGroupLayout, binding_types::texture_2d, BindGroup, BindGroupEntries, BindGroupLayout,
@ -11,7 +11,7 @@ use crate::{
SpecializedRenderPipelines, Texture, TextureUsages, TextureView, VertexState, SpecializedRenderPipelines, Texture, TextureUsages, TextureView, VertexState,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::{GpuImage, OutputColorAttachment, TextureFormatPixelInfo}, texture::{GpuImage, OutputColorAttachment},
view::{prepare_view_attachments, prepare_view_targets, ViewTargetAttachments, WindowSurfaces}, view::{prepare_view_attachments, prepare_view_targets, ViewTargetAttachments, WindowSurfaces},
ExtractSchedule, MainWorld, Render, RenderApp, RenderSet, ExtractSchedule, MainWorld, Render, RenderApp, RenderSet,
}; };
@ -23,6 +23,7 @@ use bevy_ecs::{
entity::EntityHashMap, event::event_update_system, prelude::*, system::SystemState, entity::EntityHashMap, event::event_update_system, prelude::*, system::SystemState,
}; };
use bevy_hierarchy::DespawnRecursiveExt; use bevy_hierarchy::DespawnRecursiveExt;
use bevy_image::{Image, TextureFormatPixelInfo};
use bevy_reflect::Reflect; use bevy_reflect::Reflect;
use bevy_tasks::AsyncComputeTaskPool; use bevy_tasks::AsyncComputeTaskPool;
use bevy_utils::{ use bevy_utils::{

View file

@ -22,6 +22,7 @@ bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" }
bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" }
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" } bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" }
bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" }
bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" }
bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" }
bevy_picking = { path = "../bevy_picking", version = "0.15.0-rc.3", optional = true } bevy_picking = { path = "../bevy_picking", version = "0.15.0-rc.3", optional = true }
bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [

View file

@ -1,8 +1,9 @@
use crate::TextureAtlasLayout; use crate::TextureAtlasLayout;
use bevy_image::{Image, TextureFormatPixelInfo};
use bevy_math::{URect, UVec2}; use bevy_math::{URect, UVec2};
use bevy_render::{ use bevy_render::{
render_asset::{RenderAsset, RenderAssetUsages}, render_asset::{RenderAsset, RenderAssetUsages},
texture::{GpuImage, Image, TextureFormatPixelInfo}, texture::GpuImage,
}; };
use guillotiere::{size2, Allocation, AtlasAllocator}; use guillotiere::{size2, Allocation, AtlasAllocator};

View file

@ -51,13 +51,13 @@ use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, AssetApp, Assets, Handle}; use bevy_asset::{load_internal_asset, AssetApp, Assets, Handle};
use bevy_core_pipeline::core_2d::Transparent2d; use bevy_core_pipeline::core_2d::Transparent2d;
use bevy_ecs::{prelude::*, query::QueryItem}; use bevy_ecs::{prelude::*, query::QueryItem};
use bevy_image::Image;
use bevy_render::{ use bevy_render::{
extract_component::{ExtractComponent, ExtractComponentPlugin}, extract_component::{ExtractComponent, ExtractComponentPlugin},
mesh::{Mesh, Mesh2d, MeshAabb}, mesh::{Mesh, Mesh2d, MeshAabb},
primitives::Aabb, primitives::Aabb,
render_phase::AddRenderCommand, render_phase::AddRenderCommand,
render_resource::{Shader, SpecializedRenderPipelines}, render_resource::{Shader, SpecializedRenderPipelines},
texture::Image,
view::{check_visibility, NoFrustumCulling, VisibilitySystems}, view::{check_visibility, NoFrustumCulling, VisibilitySystems},
ExtractSchedule, Render, RenderApp, RenderSet, ExtractSchedule, Render, RenderApp, RenderSet,
}; };

View file

@ -4,13 +4,10 @@ use crate::{AlphaMode2d, Material2d, Material2dPlugin, MaterialMesh2dBundle};
use bevy_app::{App, Plugin}; use bevy_app::{App, Plugin};
use bevy_asset::{load_internal_asset, Asset, AssetApp, Assets, Handle}; use bevy_asset::{load_internal_asset, Asset, AssetApp, Assets, Handle};
use bevy_color::{Alpha, Color, ColorToComponents, LinearRgba}; use bevy_color::{Alpha, Color, ColorToComponents, LinearRgba};
use bevy_image::Image;
use bevy_math::Vec4; use bevy_math::Vec4;
use bevy_reflect::prelude::*; use bevy_reflect::prelude::*;
use bevy_render::{ use bevy_render::{render_asset::RenderAssets, render_resource::*, texture::GpuImage};
render_asset::RenderAssets,
render_resource::*,
texture::{GpuImage, Image},
};
pub const COLOR_MATERIAL_SHADER_HANDLE: Handle<Shader> = pub const COLOR_MATERIAL_SHADER_HANDLE: Handle<Shader> =
Handle::weak_from_u128(3253086872234592509); Handle::weak_from_u128(3253086872234592509);

View file

@ -58,8 +58,9 @@ use derive_more::derive::From;
/// ``` /// ```
/// # use bevy_sprite::{Material2d, MeshMaterial2d}; /// # use bevy_sprite::{Material2d, MeshMaterial2d};
/// # use bevy_ecs::prelude::*; /// # use bevy_ecs::prelude::*;
/// # use bevy_image::Image;
/// # use bevy_reflect::TypePath; /// # use bevy_reflect::TypePath;
/// # use bevy_render::{mesh::{Mesh, Mesh2d}, render_resource::{AsBindGroup, ShaderRef}, texture::Image}; /// # use bevy_render::{mesh::{Mesh, Mesh2d}, render_resource::{AsBindGroup, ShaderRef}};
/// # use bevy_color::LinearRgba; /// # use bevy_color::LinearRgba;
/// # use bevy_color::palettes::basic::RED; /// # use bevy_color::palettes::basic::RED;
/// # use bevy_asset::{Handle, AssetServer, Assets, Asset}; /// # use bevy_asset::{Handle, AssetServer, Assets, Asset};

View file

@ -14,8 +14,8 @@ use bevy_ecs::{
query::ROQueryItem, query::ROQueryItem,
system::{lifetimeless::*, SystemParamItem, SystemState}, system::{lifetimeless::*, SystemParamItem, SystemState},
}; };
use bevy_image::{BevyDefault, Image, ImageSampler, TextureFormatPixelInfo};
use bevy_math::{Affine3, Vec4}; use bevy_math::{Affine3, Vec4};
use bevy_render::sync_world::{MainEntity, MainEntityHashMap};
use bevy_render::{ use bevy_render::{
batching::{ batching::{
gpu_preprocessing::IndirectParameters, gpu_preprocessing::IndirectParameters,
@ -34,10 +34,8 @@ use bevy_render::{
render_phase::{PhaseItem, RenderCommand, RenderCommandResult, TrackedRenderPass}, render_phase::{PhaseItem, RenderCommand, RenderCommandResult, TrackedRenderPass},
render_resource::{binding_types::uniform_buffer, *}, render_resource::{binding_types::uniform_buffer, *},
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::{ sync_world::{MainEntity, MainEntityHashMap},
BevyDefault, DefaultImageSampler, FallbackImage, GpuImage, Image, ImageSampler, texture::{DefaultImageSampler, FallbackImage, GpuImage},
TextureFormatPixelInfo,
},
view::{ view::{
ExtractedView, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms, ViewVisibility, ExtractedView, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms, ViewVisibility,
}, },

View file

@ -8,6 +8,7 @@ use crate::{Sprite, TextureAtlasLayout};
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::prelude::*; use bevy_asset::prelude::*;
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::Image;
use bevy_math::{prelude::*, FloatExt, FloatOrd}; use bevy_math::{prelude::*, FloatExt, FloatOrd};
use bevy_picking::backend::prelude::*; use bevy_picking::backend::prelude::*;
use bevy_render::prelude::*; use bevy_render::prelude::*;

View file

@ -18,6 +18,7 @@ use bevy_ecs::{
query::ROQueryItem, query::ROQueryItem,
system::{lifetimeless::*, SystemParamItem, SystemState}, system::{lifetimeless::*, SystemParamItem, SystemState},
}; };
use bevy_image::{BevyDefault, Image, ImageSampler, TextureFormatPixelInfo};
use bevy_math::{Affine3A, FloatOrd, Quat, Rect, Vec2, Vec4}; use bevy_math::{Affine3A, FloatOrd, Quat, Rect, Vec2, Vec4};
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::view::RenderVisibleEntities; use bevy_render::view::RenderVisibleEntities;
@ -33,10 +34,7 @@ use bevy_render::{
}, },
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
sync_world::{RenderEntity, TemporaryRenderEntity}, sync_world::{RenderEntity, TemporaryRenderEntity},
texture::{ texture::{DefaultImageSampler, FallbackImage, GpuImage},
BevyDefault, DefaultImageSampler, FallbackImage, GpuImage, Image, ImageSampler,
TextureFormatPixelInfo,
},
view::{ view::{
ExtractedView, Msaa, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms, ExtractedView, Msaa, ViewTarget, ViewUniform, ViewUniformOffset, ViewUniforms,
ViewVisibility, ViewVisibility,

View file

@ -1,9 +1,10 @@
use bevy_asset::Handle; use bevy_asset::Handle;
use bevy_color::Color; use bevy_color::Color;
use bevy_ecs::{component::Component, reflect::ReflectComponent}; use bevy_ecs::{component::Component, reflect::ReflectComponent};
use bevy_image::Image;
use bevy_math::{Rect, Vec2}; use bevy_math::{Rect, Vec2};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{sync_world::SyncToRenderWorld, texture::Image, view::Visibility}; use bevy_render::{sync_world::SyncToRenderWorld, view::Visibility};
use bevy_transform::components::Transform; use bevy_transform::components::Transform;
use crate::{TextureAtlas, TextureSlicer}; use crate::{TextureAtlas, TextureSlicer};

View file

@ -1,9 +1,9 @@
use bevy_asset::{Asset, AssetId, Assets, Handle}; use bevy_asset::{Asset, AssetId, Assets, Handle};
use bevy_image::Image;
use bevy_math::{URect, UVec2}; use bevy_math::{URect, UVec2};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
#[cfg(feature = "serialize")] #[cfg(feature = "serialize")]
use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
use bevy_render::texture::Image;
use bevy_utils::HashMap; use bevy_utils::HashMap;
/// Stores a mapping from sub texture handles to the related area index. /// Stores a mapping from sub texture handles to the related area index.

View file

@ -1,9 +1,9 @@
use bevy_asset::AssetId; use bevy_asset::AssetId;
use bevy_image::{Image, TextureFormatPixelInfo};
use bevy_math::{URect, UVec2}; use bevy_math::{URect, UVec2};
use bevy_render::{ use bevy_render::{
render_asset::RenderAssetUsages, render_asset::RenderAssetUsages,
render_resource::{Extent3d, TextureDimension, TextureFormat}, render_resource::{Extent3d, TextureDimension, TextureFormat},
texture::{Image, TextureFormatPixelInfo},
}; };
use bevy_utils::{ use bevy_utils::{
tracing::{debug, error, warn}, tracing::{debug, error, warn},
@ -179,6 +179,7 @@ impl<'a> TextureAtlasBuilder<'a> {
/// # use bevy_ecs::prelude::*; /// # use bevy_ecs::prelude::*;
/// # use bevy_asset::*; /// # use bevy_asset::*;
/// # use bevy_render::prelude::*; /// # use bevy_render::prelude::*;
/// # use bevy_image::Image;
/// ///
/// fn my_system(mut commands: Commands, mut textures: ResMut<Assets<Image>>, mut layouts: ResMut<Assets<TextureAtlasLayout>>) { /// fn my_system(mut commands: Commands, mut textures: ResMut<Assets<Image>>, mut layouts: ResMut<Assets<TextureAtlasLayout>>) {
/// // Declare your builder /// // Declare your builder

View file

@ -3,8 +3,8 @@ use crate::{ExtractedSprite, Sprite, SpriteImageMode, TextureAtlasLayout};
use super::TextureSlice; use super::TextureSlice;
use bevy_asset::{AssetEvent, Assets}; use bevy_asset::{AssetEvent, Assets};
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::Image;
use bevy_math::{Rect, Vec2}; use bevy_math::{Rect, Vec2};
use bevy_render::texture::Image;
use bevy_transform::prelude::*; use bevy_transform::prelude::*;
use bevy_utils::HashSet; use bevy_utils::HashSet;

View file

@ -18,6 +18,7 @@ bevy_asset = { path = "../bevy_asset", version = "0.15.0-rc.3" }
bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" } bevy_color = { path = "../bevy_color", version = "0.15.0-rc.3" }
bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" } bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" }
bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" }
bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" }
bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-rc.3" } bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-rc.3" }
bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" }
bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [

View file

@ -1,9 +1,9 @@
use bevy_asset::{Assets, Handle}; use bevy_asset::{Assets, Handle};
use bevy_image::{Image, ImageSampler};
use bevy_math::{IVec2, UVec2}; use bevy_math::{IVec2, UVec2};
use bevy_render::{ use bevy_render::{
render_asset::RenderAssetUsages, render_asset::RenderAssetUsages,
render_resource::{Extent3d, TextureDimension, TextureFormat}, render_resource::{Extent3d, TextureDimension, TextureFormat},
texture::{Image, ImageSampler},
}; };
use bevy_sprite::{DynamicTextureAtlasBuilder, TextureAtlasLayout}; use bevy_sprite::{DynamicTextureAtlasBuilder, TextureAtlasLayout};
use bevy_utils::HashMap; use bevy_utils::HashMap;

View file

@ -3,12 +3,12 @@ use bevy_ecs::{
event::EventReader, event::EventReader,
system::{ResMut, Resource}, system::{ResMut, Resource},
}; };
use bevy_image::Image;
use bevy_math::{IVec2, UVec2}; use bevy_math::{IVec2, UVec2};
use bevy_reflect::TypePath; use bevy_reflect::TypePath;
use bevy_render::{ use bevy_render::{
render_asset::RenderAssetUsages, render_asset::RenderAssetUsages,
render_resource::{Extent3d, TextureDimension, TextureFormat}, render_resource::{Extent3d, TextureDimension, TextureFormat},
texture::Image,
}; };
use bevy_sprite::TextureAtlasLayout; use bevy_sprite::TextureAtlasLayout;
use bevy_utils::HashMap; use bevy_utils::HashMap;

View file

@ -1,9 +1,9 @@
//! This module exports types related to rendering glyphs. //! This module exports types related to rendering glyphs.
use bevy_asset::Handle; use bevy_asset::Handle;
use bevy_image::Image;
use bevy_math::{IVec2, Vec2}; use bevy_math::{IVec2, Vec2};
use bevy_reflect::Reflect; use bevy_reflect::Reflect;
use bevy_render::texture::Image;
use bevy_sprite::TextureAtlasLayout; use bevy_sprite::TextureAtlasLayout;
/// A glyph of a font, typically representing a single character, positioned in screen space. /// A glyph of a font, typically representing a single character, positioned in screen space.

View file

@ -9,9 +9,9 @@ use bevy_ecs::{
reflect::ReflectComponent, reflect::ReflectComponent,
system::{ResMut, Resource}, system::{ResMut, Resource},
}; };
use bevy_image::Image;
use bevy_math::{UVec2, Vec2}; use bevy_math::{UVec2, Vec2};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::texture::Image;
use bevy_sprite::TextureAtlasLayout; use bevy_sprite::TextureAtlasLayout;
use bevy_utils::HashMap; use bevy_utils::HashMap;

View file

@ -16,13 +16,13 @@ use bevy_ecs::{
query::{Changed, Without}, query::{Changed, Without},
system::{Commands, Local, Query, Res, ResMut}, system::{Commands, Local, Query, Res, ResMut},
}; };
use bevy_image::Image;
use bevy_math::Vec2; use bevy_math::Vec2;
use bevy_reflect::{prelude::ReflectDefault, Reflect}; use bevy_reflect::{prelude::ReflectDefault, Reflect};
use bevy_render::sync_world::TemporaryRenderEntity; use bevy_render::sync_world::TemporaryRenderEntity;
use bevy_render::view::Visibility; use bevy_render::view::Visibility;
use bevy_render::{ use bevy_render::{
primitives::Aabb, primitives::Aabb,
texture::Image,
view::{NoFrustumCulling, ViewVisibility}, view::{NoFrustumCulling, ViewVisibility},
Extract, Extract,
}; };

View file

@ -18,6 +18,7 @@ bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.15.0-rc.3" }
bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" } bevy_derive = { path = "../bevy_derive", version = "0.15.0-rc.3" }
bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" } bevy_ecs = { path = "../bevy_ecs", version = "0.15.0-rc.3" }
bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-rc.3" } bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.15.0-rc.3" }
bevy_image = { path = "../bevy_image", version = "0.15.0-rc.3" }
bevy_input = { path = "../bevy_input", version = "0.15.0-rc.3" } bevy_input = { path = "../bevy_input", version = "0.15.0-rc.3" }
bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" } bevy_math = { path = "../bevy_math", version = "0.15.0-rc.3" }
bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [ bevy_reflect = { path = "../bevy_reflect", version = "0.15.0-rc.3", features = [

View file

@ -463,11 +463,11 @@ mod tests {
use bevy_hierarchy::{ use bevy_hierarchy::{
despawn_with_children_recursive, BuildChildren, ChildBuild, Children, Parent, despawn_with_children_recursive, BuildChildren, ChildBuild, Children, Parent,
}; };
use bevy_image::Image;
use bevy_math::{Rect, UVec2, Vec2}; use bevy_math::{Rect, UVec2, Vec2};
use bevy_render::{ use bevy_render::{
camera::{ManualTextureViews, OrthographicProjection}, camera::{ManualTextureViews, OrthographicProjection},
prelude::Camera, prelude::Camera,
texture::Image,
}; };
use bevy_transform::{ use bevy_transform::{
prelude::GlobalTransform, prelude::GlobalTransform,

View file

@ -16,6 +16,7 @@ use bevy_ecs::{
*, *,
}, },
}; };
use bevy_image::BevyDefault as _;
use bevy_math::{vec2, FloatOrd, Mat4, Rect, Vec2, Vec3Swizzles, Vec4Swizzles}; use bevy_math::{vec2, FloatOrd, Mat4, Rect, Vec2, Vec3Swizzles, Vec4Swizzles};
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::RenderApp; use bevy_render::RenderApp;
@ -25,7 +26,6 @@ use bevy_render::{
render_resource::{binding_types::uniform_buffer, *}, render_resource::{binding_types::uniform_buffer, *},
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
sync_world::{RenderEntity, TemporaryRenderEntity}, sync_world::{RenderEntity, TemporaryRenderEntity},
texture::BevyDefault,
view::*, view::*,
Extract, ExtractSchedule, Render, RenderSet, Extract, ExtractSchedule, Render, RenderSet,
}; };

View file

@ -17,6 +17,7 @@ use bevy_core_pipeline::core_3d::graph::{Core3d, Node3d};
use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d}; use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d};
use bevy_ecs::entity::{EntityHashMap, EntityHashSet}; use bevy_ecs::entity::{EntityHashMap, EntityHashSet};
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::Image;
use bevy_math::{FloatOrd, Mat4, Rect, URect, UVec4, Vec2, Vec3, Vec3Swizzles, Vec4Swizzles}; use bevy_math::{FloatOrd, Mat4, Rect, URect, UVec4, Vec2, Vec3, Vec3Swizzles, Vec4Swizzles};
use bevy_render::render_phase::ViewSortedRenderPhases; use bevy_render::render_phase::ViewSortedRenderPhases;
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
@ -28,7 +29,6 @@ use bevy_render::{
render_phase::{sort_phase_system, AddRenderCommand, DrawFunctions}, render_phase::{sort_phase_system, AddRenderCommand, DrawFunctions},
render_resource::*, render_resource::*,
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::Image,
view::{ExtractedView, ViewUniforms}, view::{ExtractedView, ViewUniforms},
Extract, RenderApp, RenderSet, Extract, RenderApp, RenderSet,
}; };

View file

@ -1,11 +1,11 @@
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::BevyDefault as _;
use bevy_render::{ use bevy_render::{
render_resource::{ render_resource::{
binding_types::{sampler, texture_2d, uniform_buffer}, binding_types::{sampler, texture_2d, uniform_buffer},
*, *,
}, },
renderer::RenderDevice, renderer::RenderDevice,
texture::BevyDefault,
view::{ViewTarget, ViewUniform}, view::{ViewTarget, ViewUniform},
}; };

View file

@ -11,6 +11,7 @@ use bevy_ecs::{
*, *,
}, },
}; };
use bevy_image::BevyDefault as _;
use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles}; use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles};
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::{ use bevy_render::{
@ -21,7 +22,6 @@ use bevy_render::{
render_resource::{binding_types::uniform_buffer, *}, render_resource::{binding_types::uniform_buffer, *},
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
sync_world::{RenderEntity, TemporaryRenderEntity}, sync_world::{RenderEntity, TemporaryRenderEntity},
texture::BevyDefault,
view::*, view::*,
Extract, ExtractSchedule, Render, RenderSet, Extract, ExtractSchedule, Render, RenderSet,
}; };

View file

@ -11,6 +11,7 @@ use bevy_ecs::{
*, *,
}, },
}; };
use bevy_image::{BevyDefault, Image};
use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles}; use bevy_math::{FloatOrd, Mat4, Rect, Vec2, Vec4Swizzles};
use bevy_render::sync_world::MainEntity; use bevy_render::sync_world::MainEntity;
use bevy_render::{ use bevy_render::{
@ -19,7 +20,7 @@ use bevy_render::{
render_resource::{binding_types::uniform_buffer, *}, render_resource::{binding_types::uniform_buffer, *},
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
sync_world::{RenderEntity, TemporaryRenderEntity}, sync_world::{RenderEntity, TemporaryRenderEntity},
texture::{BevyDefault, GpuImage, Image, TRANSPARENT_IMAGE_HANDLE}, texture::{GpuImage, TRANSPARENT_IMAGE_HANDLE},
view::*, view::*,
Extract, ExtractSchedule, Render, RenderSet, Extract, ExtractSchedule, Render, RenderSet,
}; };

View file

@ -30,8 +30,9 @@ use derive_more::derive::From;
/// ``` /// ```
/// # use bevy_ui::prelude::*; /// # use bevy_ui::prelude::*;
/// # use bevy_ecs::prelude::*; /// # use bevy_ecs::prelude::*;
/// # use bevy_image::Image;
/// # use bevy_reflect::TypePath; /// # use bevy_reflect::TypePath;
/// # use bevy_render::{render_resource::{AsBindGroup, ShaderRef}, texture::Image}; /// # use bevy_render::render_resource::{AsBindGroup, ShaderRef};
/// # use bevy_color::LinearRgba; /// # use bevy_color::LinearRgba;
/// # use bevy_asset::{Handle, AssetServer, Assets, Asset}; /// # use bevy_asset::{Handle, AssetServer, Assets, Asset};
/// ///

View file

@ -2,9 +2,10 @@ use crate::{ContentSize, Measure, MeasureArgs, Node, NodeMeasure, UiScale};
use bevy_asset::{Assets, Handle}; use bevy_asset::{Assets, Handle};
use bevy_color::Color; use bevy_color::Color;
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_image::Image;
use bevy_math::{Rect, UVec2, Vec2}; use bevy_math::{Rect, UVec2, Vec2};
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::texture::{Image, TRANSPARENT_IMAGE_HANDLE}; use bevy_render::texture::TRANSPARENT_IMAGE_HANDLE;
use bevy_sprite::{TextureAtlas, TextureAtlasLayout, TextureSlicer}; use bevy_sprite::{TextureAtlas, TextureAtlasLayout, TextureSlicer};
use bevy_window::{PrimaryWindow, Window}; use bevy_window::{PrimaryWindow, Window};
use taffy::{MaybeMath, MaybeResolve}; use taffy::{MaybeMath, MaybeResolve};

View file

@ -14,9 +14,10 @@ use bevy_ecs::{
system::{Local, Query, Res, ResMut}, system::{Local, Query, Res, ResMut},
world::{Mut, Ref}, world::{Mut, Ref},
}; };
use bevy_image::Image;
use bevy_math::Vec2; use bevy_math::Vec2;
use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{camera::Camera, texture::Image}; use bevy_render::camera::Camera;
use bevy_sprite::TextureAtlasLayout; use bevy_sprite::TextureAtlasLayout;
use bevy_text::{ use bevy_text::{
scale_value, ComputedTextBlock, CosmicFontSystem, Font, FontAtlasSets, LineBreak, SwashCache, scale_value, ComputedTextBlock, CosmicFontSystem, Font, FontAtlasSets, LineBreak, SwashCache,

View file

@ -25,7 +25,6 @@ use bevy::{
TextureFormat, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode, TextureFormat, VertexBufferLayout, VertexFormat, VertexState, VertexStepMode,
}, },
sync_world::MainEntityHashMap, sync_world::MainEntityHashMap,
texture::BevyDefault,
view::{ExtractedView, RenderVisibleEntities, ViewTarget}, view::{ExtractedView, RenderVisibleEntities, ViewTarget},
Extract, Render, RenderApp, RenderSet, Extract, Render, RenderApp, RenderSet,
}, },

View file

@ -7,7 +7,7 @@
//! Only one padded and one unpadded texture atlas are rendered to the screen. //! Only one padded and one unpadded texture atlas are rendered to the screen.
//! An upscaled sprite from each of the four atlases are rendered to the screen. //! An upscaled sprite from each of the four atlases are rendered to the screen.
use bevy::{asset::LoadedFolder, prelude::*, render::texture::ImageSampler}; use bevy::{asset::LoadedFolder, image::ImageSampler, prelude::*};
fn main() { fn main() {
App::new() App::new()

View file

@ -10,13 +10,13 @@ use bevy::{
prepass::{DepthPrepass, MotionVectorPrepass}, prepass::{DepthPrepass, MotionVectorPrepass},
smaa::{Smaa, SmaaPreset}, smaa::{Smaa, SmaaPreset},
}, },
image::{ImageSampler, ImageSamplerDescriptor},
pbr::CascadeShadowConfigBuilder, pbr::CascadeShadowConfigBuilder,
prelude::*, prelude::*,
render::{ render::{
camera::TemporalJitter, camera::TemporalJitter,
render_asset::RenderAssetUsages, render_asset::RenderAssetUsages,
render_resource::{Extent3d, TextureDimension, TextureFormat}, render_resource::{Extent3d, TextureDimension, TextureFormat},
texture::{ImageSampler, ImageSamplerDescriptor},
}, },
}; };

View file

@ -22,9 +22,9 @@ use std::f32::consts::PI;
use bevy::{ use bevy::{
color::palettes::css::{BLUE, GOLD, WHITE}, color::palettes::css::{BLUE, GOLD, WHITE},
core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox}, core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox},
image::ImageLoaderSettings,
math::vec3, math::vec3,
prelude::*, prelude::*,
render::texture::ImageLoaderSettings,
}; };
/// The size of each sphere. /// The size of each sphere.

View file

@ -7,13 +7,13 @@ use bevy::{
fxaa::Fxaa, fxaa::Fxaa,
prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass}, prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass},
}, },
image::ImageLoaderSettings,
math::ops, math::ops,
pbr::{ pbr::{
CascadeShadowConfigBuilder, DefaultOpaqueRendererMethod, DirectionalLightShadowMap, CascadeShadowConfigBuilder, DefaultOpaqueRendererMethod, DirectionalLightShadowMap,
NotShadowCaster, NotShadowReceiver, OpaqueRendererMethod, NotShadowCaster, NotShadowReceiver, OpaqueRendererMethod,
}, },
prelude::*, prelude::*,
render::texture::ImageLoaderSettings,
}; };
fn main() { fn main() {

View file

@ -1,7 +1,12 @@
//! Demonstrates how to enable per-object motion blur. This rendering feature can be configured per //! Demonstrates how to enable per-object motion blur. This rendering feature can be configured per
//! camera using the [`MotionBlur`] component.z //! camera using the [`MotionBlur`] component.z
use bevy::{core_pipeline::motion_blur::MotionBlur, math::ops, prelude::*}; use bevy::{
core_pipeline::motion_blur::MotionBlur,
image::{ImageAddressMode, ImageFilterMode, ImageSampler, ImageSamplerDescriptor},
math::ops,
prelude::*,
};
fn main() { fn main() {
let mut app = App::new(); let mut app = App::new();
@ -350,7 +355,7 @@ fn move_camera(
} }
fn uv_debug_texture() -> Image { fn uv_debug_texture() -> Image {
use bevy::render::{render_asset::RenderAssetUsages, render_resource::*, texture::*}; use bevy::render::{render_asset::RenderAssetUsages, render_resource::*};
const TEXTURE_SIZE: usize = 7; const TEXTURE_SIZE: usize = 7;
let mut palette = [ let mut palette = [

View file

@ -3,7 +3,7 @@
use std::fmt; use std::fmt;
use bevy::{math::ops, prelude::*, render::texture::ImageLoaderSettings}; use bevy::{image::ImageLoaderSettings, math::ops, prelude::*};
fn main() { fn main() {
App::new() App::new()

View file

@ -5,8 +5,8 @@ use std::f32::consts::PI;
use bevy::{ use bevy::{
color::palettes::css::{GOLD, WHITE}, color::palettes::css::{GOLD, WHITE},
core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox}, core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox},
image::ImageLoaderSettings,
prelude::*, prelude::*,
render::texture::ImageLoaderSettings,
}; };
/// Entry point. /// Entry point.

View file

@ -15,12 +15,12 @@ use bevy::{
bloom::Bloom, bloom::Bloom,
experimental::taa::{TemporalAntiAliasPlugin, TemporalAntiAliasing}, experimental::taa::{TemporalAntiAliasPlugin, TemporalAntiAliasing},
}, },
pbr::{DirectionalLightShadowMap, FogVolume, VolumetricFog, VolumetricLight}, image::{
prelude::*,
render::texture::{
ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler, ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler,
ImageSamplerDescriptor, ImageSamplerDescriptor,
}, },
pbr::{DirectionalLightShadowMap, FogVolume, VolumetricFog, VolumetricLight},
prelude::*,
}; };
/// Initializes the example. /// Initializes the example.

View file

@ -5,11 +5,11 @@ mod camera_controller;
use bevy::{ use bevy::{
core_pipeline::Skybox, core_pipeline::Skybox,
image::CompressedImageFormats,
prelude::*, prelude::*,
render::{ render::{
render_resource::{TextureViewDescriptor, TextureViewDimension}, render_resource::{TextureViewDescriptor, TextureViewDimension},
renderer::RenderDevice, renderer::RenderDevice,
texture::CompressedImageFormats,
}, },
}; };
use camera_controller::{CameraController, CameraControllerPlugin}; use camera_controller::{CameraController, CameraControllerPlugin};

View file

@ -5,19 +5,17 @@ use std::ops::Range;
use bevy::{ use bevy::{
color::palettes::css::{BLACK, WHITE}, color::palettes::css::{BLACK, WHITE},
core_pipeline::{fxaa::Fxaa, Skybox}, core_pipeline::{fxaa::Fxaa, Skybox},
image::{
ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler,
ImageSamplerDescriptor,
},
input::mouse::MouseWheel, input::mouse::MouseWheel,
math::{vec3, vec4}, math::{vec3, vec4},
pbr::{ pbr::{
DefaultOpaqueRendererMethod, ExtendedMaterial, MaterialExtension, ScreenSpaceReflections, DefaultOpaqueRendererMethod, ExtendedMaterial, MaterialExtension, ScreenSpaceReflections,
}, },
prelude::*, prelude::*,
render::{ render::render_resource::{AsBindGroup, ShaderRef, ShaderType},
render_resource::{AsBindGroup, ShaderRef, ShaderType},
texture::{
ImageAddressMode, ImageFilterMode, ImageLoaderSettings, ImageSampler,
ImageSamplerDescriptor,
},
},
}; };
/// This example uses a shader source file from the assets subdirectory /// This example uses a shader source file from the assets subdirectory

View file

@ -10,6 +10,7 @@
use bevy::{ use bevy::{
app::{AppExit, ScheduleRunnerPlugin}, app::{AppExit, ScheduleRunnerPlugin},
core_pipeline::tonemapping::Tonemapping, core_pipeline::tonemapping::Tonemapping,
image::TextureFormatPixelInfo,
prelude::*, prelude::*,
render::{ render::{
camera::RenderTarget, camera::RenderTarget,
@ -21,7 +22,6 @@ use bevy::{
TextureUsages, TextureUsages,
}, },
renderer::{RenderContext, RenderDevice, RenderQueue}, renderer::{RenderContext, RenderDevice, RenderQueue},
texture::{BevyDefault, TextureFormatPixelInfo},
Extract, Render, RenderApp, RenderSet, Extract, Render, RenderApp, RenderSet,
}, },
}; };

View file

@ -1,9 +1,8 @@
//! Shows how to modify texture assets after spawning. //! Shows how to modify texture assets after spawning.
use bevy::{ use bevy::{
input::common_conditions::input_just_pressed, image::ImageLoaderSettings, input::common_conditions::input_just_pressed, prelude::*,
prelude::*, render::render_asset::RenderAssetUsages,
render::{render_asset::RenderAssetUsages, texture::ImageLoaderSettings},
}; };
fn main() { fn main() {

View file

@ -1,8 +1,8 @@
//! This example demonstrates the usage of '.meta' files and [`AssetServer::load_with_settings`] to override the default settings for loading an asset //! This example demonstrates the usage of '.meta' files and [`AssetServer::load_with_settings`] to override the default settings for loading an asset
use bevy::{ use bevy::{
image::{ImageLoaderSettings, ImageSampler},
prelude::*, prelude::*,
render::texture::{ImageLoaderSettings, ImageSampler},
}; };
fn main() { fn main() {

View file

@ -2,11 +2,9 @@
//! This example shows how to configure it to repeat the image instead. //! This example shows how to configure it to repeat the image instead.
use bevy::{ use bevy::{
image::{ImageAddressMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor},
math::Affine2, math::Affine2,
prelude::*, prelude::*,
render::texture::{
ImageAddressMode, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor,
},
}; };
fn main() { fn main() {

View file

@ -30,7 +30,6 @@ use bevy::{
VertexFormat, VertexState, VertexStepMode, VertexFormat, VertexState, VertexStepMode,
}, },
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::BevyDefault as _,
view::{self, ExtractedView, RenderVisibleEntities, VisibilitySystems}, view::{self, ExtractedView, RenderVisibleEntities, VisibilitySystems},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}, },

View file

@ -26,7 +26,6 @@ use bevy::{
*, *,
}, },
renderer::{RenderContext, RenderDevice}, renderer::{RenderContext, RenderDevice},
texture::BevyDefault,
view::ViewTarget, view::ViewTarget,
RenderApp, RenderApp,
}, },

View file

@ -7,8 +7,7 @@ use bevy::{
extract_resource::{ExtractResource, ExtractResourcePlugin}, extract_resource::{ExtractResource, ExtractResourcePlugin},
gpu_readback::{Readback, ReadbackComplete}, gpu_readback::{Readback, ReadbackComplete},
render_asset::{RenderAssetUsages, RenderAssets}, render_asset::{RenderAssetUsages, RenderAssets},
render_graph, render_graph::{self, RenderGraph, RenderLabel},
render_graph::{RenderGraph, RenderLabel},
render_resource::{ render_resource::{
binding_types::{storage_buffer, texture_storage_2d}, binding_types::{storage_buffer, texture_storage_2d},
*, *,

View file

@ -28,7 +28,6 @@ use bevy::{
RenderPipelineDescriptor, SpecializedMeshPipeline, SpecializedMeshPipelineError, RenderPipelineDescriptor, SpecializedMeshPipeline, SpecializedMeshPipelineError,
SpecializedMeshPipelines, TextureFormat, VertexState, SpecializedMeshPipelines, TextureFormat, VertexState,
}, },
texture::BevyDefault as _,
view::{self, ExtractedView, RenderVisibleEntities, ViewTarget, VisibilitySystems}, view::{self, ExtractedView, RenderVisibleEntities, ViewTarget, VisibilitySystems},
Render, RenderApp, RenderSet, Render, RenderApp, RenderSet,
}, },

View file

@ -1,8 +1,8 @@
//! This example illustrates how to how to flip and tile images with 9-slicing in the UI. //! This example illustrates how to how to flip and tile images with 9-slicing in the UI.
use bevy::{ use bevy::{
image::{ImageLoaderSettings, ImageSampler},
prelude::*, prelude::*,
render::texture::{ImageLoaderSettings, ImageSampler},
ui::widget::NodeImageMode, ui::widget::NodeImageMode,
winit::WinitSettings, winit::WinitSettings,
}; };