@@ -8,7 +8,7 @@ use bevy::prelude::{
8
8
DetectChangesMut , Handle , Image , Mesh , Mesh3d , Query , Res , ResMut , Resource , Transform , Update ,
9
9
Window , With ,
10
10
} ;
11
- use bevy:: render:: camera:: RenderTarget ;
11
+ use bevy:: render:: camera:: { ImageRenderTarget , RenderTarget } ;
12
12
use bevy:: render:: render_resource:: {
13
13
Extent3d , TextureDescriptor , TextureDimension , TextureFormat , TextureUsages ,
14
14
} ;
@@ -119,6 +119,7 @@ fn voxel_plot_setup(
119
119
commands. insert_resource ( AmbientLight {
120
120
color : Color :: WHITE ,
121
121
brightness : 2.0 , // Increase this to wash out shadows
122
+ affects_lightmapped_meshes : false ,
122
123
} ) ;
123
124
124
125
let size = Extent3d {
@@ -160,7 +161,7 @@ fn voxel_plot_setup(
160
161
// render before the "main pass" camera
161
162
clear_color : ClearColorConfig :: Custom ( Color :: srgba ( 1.0 , 1.0 , 1.0 , 0.0 ) ) ,
162
163
order : -1 ,
163
- target : RenderTarget :: Image ( image_handle. clone ( ) ) ,
164
+ target : RenderTarget :: Image ( ImageRenderTarget :: from ( image_handle. clone ( ) ) ) ,
164
165
..default ( )
165
166
} ,
166
167
Transform :: from_translation ( Vec3 :: new ( 0.0 , -150.0 , 15.0 ) )
@@ -175,7 +176,7 @@ fn voxel_plot_setup(
175
176
// Note: you probably want to update the `viewport_size` and `window_size` whenever they change,
176
177
// I haven't done this here for simplicity.
177
178
let primary_window = windows
178
- . get_single ( )
179
+ . single ( )
179
180
. expect ( "There is only ever one primary window" ) ;
180
181
active_cam. set_if_neq ( ActiveCameraData {
181
182
// 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(
277
278
. add ( egui:: Slider :: new ( & mut opacity_threshold. 0 , 0.01 ..=1.0 ) . text ( "Opacity Threshold" ) )
278
279
. changed ( )
279
280
{
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 ( ) {
281
282
instance_data. instances = instances;
282
283
mesh3d. 0 = new_mesh;
283
284
instance_data
@@ -291,7 +292,7 @@ fn main() {
291
292
App :: new ( )
292
293
. add_plugins ( (
293
294
DefaultPlugins ,
294
- EguiPlugin ,
295
+ EguiPlugin { enable_multipass_for_primary_context : false } ,
295
296
VoxelMaterialPlugin ,
296
297
PanOrbitCameraPlugin ,
297
298
) )
0 commit comments