@@ -2213,8 +2213,8 @@ pl_renderer_outline_entities(plScene* ptScene, uint32_t uCount, plEntity* atEnti
22132213 iTextureMappingFlags ,
22142214 ptMaterial -> tFlags ,
22152215 iObjectRenderingFlags ,
2216- pl_sb_capacity (ptScene -> sbtLightData ),
2217- pl_sb_capacity (ptScene -> sbtProbeData ),
2216+ pl_sb_size (ptScene -> sbtLightData ),
2217+ pl_sb_size (ptScene -> sbtProbeData ),
22182218 gptData -> tRuntimeOptions .tShaderDebugMode
22192219 };
22202220
@@ -2337,7 +2337,7 @@ pl_renderer_reload_scene_shaders(plScene* ptScene)
23372337 int aiLightingConstantData [] = {iSceneWideRenderingFlags , gptData -> tRuntimeOptions .tShaderDebugMode , 0 };
23382338 ptScene -> tLightingShader = gptShaderVariant -> get_shader ("deferred_lighting" , NULL , NULL , aiLightingConstantData , & gptData -> tRenderPassLayout );
23392339 ptScene -> tDeferredLightingVolumeShader = gptShaderVariant -> get_shader ("deferred_lighting_volume" , NULL , NULL , aiLightingConstantData , & gptData -> tRenderPassLayout );
2340- aiLightingConstantData [2 ] = pl_sb_capacity (ptScene -> sbtProbeData );
2340+ aiLightingConstantData [2 ] = pl_sb_size (ptScene -> sbtProbeData );
23412341 ptScene -> tProbeLightingShader = gptShaderVariant -> get_shader ("deferred_lighting" , NULL , NULL , aiLightingConstantData , & gptData -> tRenderPassLayout );
23422342 aiLightingConstantData [0 ] = gptData -> tRuntimeOptions .bPunctualLighting ? (PL_RENDERING_FLAG_USE_PUNCTUAL | PL_RENDERING_FLAG_SHADOWS ) : 0 ;
23432343 aiLightingConstantData [2 ] = 0 ;
@@ -2453,7 +2453,7 @@ pl_renderer_finalize_scene(plScene* ptScene)
24532453 int aiLightingConstantData [] = {iSceneWideRenderingFlags , gptData -> tRuntimeOptions .tShaderDebugMode , 0 };
24542454 ptScene -> tLightingShader = gptShaderVariant -> get_shader ("deferred_lighting" , NULL , NULL , aiLightingConstantData , & gptData -> tRenderPassLayout );
24552455 ptScene -> tDeferredLightingVolumeShader = gptShaderVariant -> get_shader ("deferred_lighting_volume" , NULL , NULL , aiLightingConstantData , & gptData -> tRenderPassLayout );
2456- aiLightingConstantData [2 ] = pl_sb_capacity (ptScene -> sbtProbeData );
2456+ aiLightingConstantData [2 ] = pl_sb_size (ptScene -> sbtProbeData );
24572457 ptScene -> tProbeLightingShader = gptShaderVariant -> get_shader ("deferred_lighting" , NULL , NULL , aiLightingConstantData , & gptData -> tRenderPassLayout );
24582458 aiLightingConstantData [0 ] = gptData -> tRuntimeOptions .bPunctualLighting ? (PL_RENDERING_FLAG_USE_PUNCTUAL | PL_RENDERING_FLAG_SHADOWS ) : 0 ;
24592459 aiLightingConstantData [2 ] = 0 ;
@@ -3013,7 +3013,13 @@ pl_renderer_prepare_view(plView* ptView, plCamera* ptCamera)
30133013 plEnvironmentProbeData * ptProbe = & ptScene -> sbtProbeData [uProbeIndex ];
30143014 plEnvironmentProbeComponent * ptProbeComp = gptECS -> get_component (ptScene -> ptComponentLibrary , gptData -> tEnvironmentProbeComponentType , ptProbe -> tEntity );
30153015 plObjectComponent * ptObject = gptECS -> get_component (ptScene -> ptComponentLibrary , gptData -> tObjectComponentType , ptProbe -> tEntity );
3016+ plTransformComponent * ptTransform = gptECS -> get_component (ptScene -> ptComponentLibrary , gptData -> tObjectComponentType , ptObject -> tTransform );
30163017 gptDraw -> add_3d_aabb (ptView -> pt3DDrawList , ptObject -> tAABB .tMin , ptObject -> tAABB .tMax , (plDrawLineOptions ){.uColor = PL_COLOR_32_RGB (0.0f , 1.0f , 0.0f ), .fThickness = 0.02f });
3018+ plSphere tSphere = {
3019+ .fRadius = ptProbeComp -> fRange ,
3020+ .tCenter = ptTransform -> tTranslation
3021+ };
3022+ gptDraw -> add_3d_sphere (ptView -> pt3DDrawList , tSphere , 6 , 6 , (plDrawLineOptions ){.uColor = PL_COLOR_32_LIGHT_GREY , .fThickness = 0.005f });
30173023 }
30183024 }
30193025
@@ -4216,33 +4222,6 @@ pl_renderer_render_view(plView* ptView, plCamera* ptCamera, plCamera* ptCullCame
42164222 pl_end_cpu_sample (gptProfile , 0 );
42174223 }
42184224
4219- {
4220- const plBeginCommandInfo tPostBeginInfo = {
4221- .uWaitSemaphoreCount = 1 ,
4222- .atWaitSempahores = {gptStarter -> get_current_timeline_semaphore ()},
4223- .auWaitSemaphoreValues = {gptStarter -> get_current_timeline_value ()},
4224- };
4225-
4226- plCommandBuffer * ptPostCmdBuffer = gptGfx -> request_command_buffer (ptCmdPool , "tonemap" );
4227- gptGfx -> begin_command_recording (ptPostCmdBuffer , & tPostBeginInfo );
4228-
4229- ptSceneEncoder = gptGfx -> begin_render_pass (ptPostCmdBuffer , ptView -> tFinalRenderPass , NULL );
4230- gptGfx -> set_depth_bias (ptSceneEncoder , 0.0f , 0.0f , 0.0f );
4231- gptDrawBackend -> submit_3d_drawlist (ptView -> pt3DDrawList , ptSceneEncoder , tDimensions .x , tDimensions .y , & tMVP , PL_DRAW_FLAG_REVERSE_Z_DEPTH | PL_DRAW_FLAG_DEPTH_TEST , 1 );
4232- gptDrawBackend -> submit_3d_drawlist (ptView -> pt3DSelectionDrawList , ptSceneEncoder , tDimensions .x , tDimensions .y , & tMVP , PL_DRAW_FLAG_REVERSE_Z_DEPTH | PL_DRAW_FLAG_DEPTH_TEST , 1 );
4233- gptGfx -> end_render_pass (ptSceneEncoder );
4234-
4235- gptGfx -> end_command_recording (ptPostCmdBuffer );
4236-
4237- const plSubmitInfo tPostSubmitInfo = {
4238- .uSignalSemaphoreCount = 1 ,
4239- .atSignalSempahores = {gptStarter -> get_current_timeline_semaphore ()},
4240- .auSignalSemaphoreValues = {gptStarter -> increment_current_timeline_value ()}
4241- };
4242- gptGfx -> submit_command_buffer (ptPostCmdBuffer , & tPostSubmitInfo );
4243- gptGfx -> return_command_buffer (ptPostCmdBuffer );
4244- }
4245-
42464225 {
42474226 const plBindGroupDesc tTonemapBGDesc = {
42484227 .ptPool = gptData -> aptTempGroupPools [gptGfx -> get_current_frame_index ()],
@@ -4327,6 +4306,33 @@ pl_renderer_render_view(plView* ptView, plCamera* ptCamera, plCamera* ptCullCame
43274306 gptGfx -> return_command_buffer (ptPostCmdBuffer );
43284307 }
43294308
4309+ {
4310+ const plBeginCommandInfo tPostBeginInfo = {
4311+ .uWaitSemaphoreCount = 1 ,
4312+ .atWaitSempahores = {gptStarter -> get_current_timeline_semaphore ()},
4313+ .auWaitSemaphoreValues = {gptStarter -> get_current_timeline_value ()},
4314+ };
4315+
4316+ plCommandBuffer * ptPostCmdBuffer = gptGfx -> request_command_buffer (ptCmdPool , "tonemap" );
4317+ gptGfx -> begin_command_recording (ptPostCmdBuffer , & tPostBeginInfo );
4318+
4319+ ptSceneEncoder = gptGfx -> begin_render_pass (ptPostCmdBuffer , ptView -> tFinalRenderPass , NULL );
4320+ gptGfx -> set_depth_bias (ptSceneEncoder , 0.0f , 0.0f , 0.0f );
4321+ gptDrawBackend -> submit_3d_drawlist (ptView -> pt3DDrawList , ptSceneEncoder , tDimensions .x , tDimensions .y , & tMVP , PL_DRAW_FLAG_REVERSE_Z_DEPTH | PL_DRAW_FLAG_DEPTH_TEST , 1 );
4322+ gptDrawBackend -> submit_3d_drawlist (ptView -> pt3DSelectionDrawList , ptSceneEncoder , tDimensions .x , tDimensions .y , & tMVP , PL_DRAW_FLAG_REVERSE_Z_DEPTH | PL_DRAW_FLAG_DEPTH_TEST , 1 );
4323+ gptGfx -> end_render_pass (ptSceneEncoder );
4324+
4325+ gptGfx -> end_command_recording (ptPostCmdBuffer );
4326+
4327+ const plSubmitInfo tPostSubmitInfo = {
4328+ .uSignalSemaphoreCount = 1 ,
4329+ .atSignalSempahores = {gptStarter -> get_current_timeline_semaphore ()},
4330+ .auSignalSemaphoreValues = {gptStarter -> increment_current_timeline_value ()}
4331+ };
4332+ gptGfx -> submit_command_buffer (ptPostCmdBuffer , & tPostSubmitInfo );
4333+ gptGfx -> return_command_buffer (ptPostCmdBuffer );
4334+ }
4335+
43304336 // update stats
43314337 static double * pdVisibleOpaqueObjects = NULL ;
43324338 static double * pdVisibleTransparentObjects = NULL ;
0 commit comments