@@ -8,7 +8,7 @@ use bevy::prelude::{
88 DetectChangesMut , Handle , Image , Mesh , Mesh3d , Query , Res , ResMut , Resource , Transform , Update ,
99 Window , With ,
1010} ;
11- use bevy:: render:: camera:: RenderTarget ;
11+ use bevy:: render:: camera:: { ImageRenderTarget , RenderTarget } ;
1212use bevy:: render:: render_resource:: {
1313 Extent3d , TextureDescriptor , TextureDimension , TextureFormat , TextureUsages ,
1414} ;
@@ -119,6 +119,7 @@ fn voxel_plot_setup(
119119 commands. insert_resource ( AmbientLight {
120120 color : Color :: WHITE ,
121121 brightness : 2.0 , // Increase this to wash out shadows
122+ affects_lightmapped_meshes : false ,
122123 } ) ;
123124
124125 let size = Extent3d {
@@ -160,7 +161,7 @@ fn voxel_plot_setup(
160161 // render before the "main pass" camera
161162 clear_color : ClearColorConfig :: Custom ( Color :: srgba ( 1.0 , 1.0 , 1.0 , 0.0 ) ) ,
162163 order : -1 ,
163- target : RenderTarget :: Image ( image_handle. clone ( ) ) ,
164+ target : RenderTarget :: Image ( ImageRenderTarget :: from ( image_handle. clone ( ) ) ) ,
164165 ..default ( )
165166 } ,
166167 Transform :: from_translation ( Vec3 :: new ( 0.0 , -150.0 , 15.0 ) )
@@ -175,7 +176,7 @@ fn voxel_plot_setup(
175176 // Note: you probably want to update the `viewport_size` and `window_size` whenever they change,
176177 // I haven't done this here for simplicity.
177178 let primary_window = windows
178- . get_single ( )
179+ . single ( )
179180 . expect ( "There is only ever one primary window" ) ;
180181 active_cam. set_if_neq ( ActiveCameraData {
181182 // Set the entity to the entity ID of the camera you want to control. In this case, it's
@@ -277,7 +278,7 @@ fn show_plot(
277278 . add ( egui:: Slider :: new ( & mut opacity_threshold. 0 , 0.01 ..=1.0 ) . text ( "Opacity Threshold" ) )
278279 . changed ( )
279280 {
280- if let Ok ( ( mut instance_data, mut mesh3d) ) = query. get_single_mut ( ) {
281+ if let Ok ( ( mut instance_data, mut mesh3d) ) = query. single_mut ( ) {
281282 instance_data. instances = instances;
282283 mesh3d. 0 = new_mesh;
283284 instance_data
@@ -291,7 +292,7 @@ fn main() {
291292 App :: new ( )
292293 . add_plugins ( (
293294 DefaultPlugins ,
294- EguiPlugin ,
295+ EguiPlugin { enable_multipass_for_primary_context : false } ,
295296 VoxelMaterialPlugin ,
296297 PanOrbitCameraPlugin ,
297298 ) )
0 commit comments