@@ -267,18 +267,21 @@ pub async fn run() {
267267 screen. clear ( ClearState :: default ( ) ) ;
268268 match material_type {
269269 MaterialType :: Normal => {
270- screen. write ( || {
271- model. render_with_material (
272- & NormalMaterial :: from_physical_material ( & model. material ) ,
273- & camera,
274- & lights,
275- ) ;
276- plane. render_with_material (
277- & NormalMaterial :: from_physical_material ( & plane. material ) ,
278- & camera,
279- & lights,
280- )
281- } ) ;
270+ screen
271+ . write :: < RendererError > ( || {
272+ model. render_with_material (
273+ & NormalMaterial :: from_physical_material ( & model. material ) ,
274+ & camera,
275+ & lights,
276+ ) ;
277+ plane. render_with_material (
278+ & NormalMaterial :: from_physical_material ( & plane. material ) ,
279+ & camera,
280+ & lights,
281+ ) ;
282+ Ok ( ( ) )
283+ } )
284+ . unwrap ( ) ;
282285 }
283286 MaterialType :: Depth => {
284287 screen. render_with_material (
@@ -289,18 +292,21 @@ pub async fn run() {
289292 ) ;
290293 }
291294 MaterialType :: Orm => {
292- screen. write ( || {
293- model. render_with_material (
294- & ORMMaterial :: from_physical_material ( & model. material ) ,
295- & camera,
296- & lights,
297- ) ;
298- plane. render_with_material (
299- & ORMMaterial :: from_physical_material ( & plane. material ) ,
300- & camera,
301- & lights,
302- )
303- } ) ;
295+ screen
296+ . write :: < RendererError > ( || {
297+ model. render_with_material (
298+ & ORMMaterial :: from_physical_material ( & model. material ) ,
299+ & camera,
300+ & lights,
301+ ) ;
302+ plane. render_with_material (
303+ & ORMMaterial :: from_physical_material ( & plane. material ) ,
304+ & camera,
305+ & lights,
306+ ) ;
307+ Ok ( ( ) )
308+ } )
309+ . unwrap ( ) ;
304310 }
305311 MaterialType :: Position => {
306312 screen. render_with_material (
@@ -319,18 +325,21 @@ pub async fn run() {
319325 ) ;
320326 }
321327 MaterialType :: Color => {
322- screen. write ( || {
323- model. render_with_material (
324- & ColorMaterial :: from_physical_material ( & model. material ) ,
325- & camera,
326- & lights,
327- ) ;
328- plane. render_with_material (
329- & ColorMaterial :: from_physical_material ( & plane. material ) ,
330- & camera,
331- & lights,
332- )
333- } ) ;
328+ screen
329+ . write :: < RendererError > ( || {
330+ model. render_with_material (
331+ & ColorMaterial :: from_physical_material ( & model. material ) ,
332+ & camera,
333+ & lights,
334+ ) ;
335+ plane. render_with_material (
336+ & ColorMaterial :: from_physical_material ( & plane. material ) ,
337+ & camera,
338+ & lights,
339+ ) ;
340+ Ok ( ( ) )
341+ } )
342+ . unwrap ( ) ;
334343 }
335344 MaterialType :: Forward => {
336345 screen. render ( & camera, model. into_iter ( ) . chain ( & plane) , & lights) ;
@@ -343,7 +352,7 @@ pub async fn run() {
343352 ) ;
344353 }
345354 }
346- screen. write ( || gui. render ( ) ) ;
355+ screen. write ( || gui. render ( ) ) . unwrap ( ) ;
347356
348357 FrameOutput :: default ( )
349358 } ) ;
0 commit comments