@@ -438,6 +438,24 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
438438 plTransformComponent * ptSecondaryCameraTransform = (plTransformComponent * )gptEcs -> add_component (ptAppData -> ptComponentLibrary , gptEcs -> get_ecs_type_key_transform (), ptAppData -> tSecondaryCamera );
439439 ptSecondaryCameraTransform -> tTranslation = pl_create_vec3 (-4.012f , 2.984f , -1.109f );
440440
441+ plEnvironmentProbeComponent * ptProbe = NULL ;
442+ plVec3 atProbeLocations [] = {
443+ pl_create_vec3 (0.0f , 3.0f , 0.0f ),
444+ // pl_create_vec3(-8.7f, 1.5f, 0.0f),
445+ // pl_create_vec3(8.8f, 1.5f, 0.0f),
446+ };
447+
448+ for (uint32_t i = 0 ; i < PL_ARRAYSIZE (atProbeLocations ); i ++ )
449+ {
450+ plEntity tProbeEntity = gptRenderer -> create_environment_probe (ptAppData -> ptComponentLibrary , "Probe" , atProbeLocations [i ], & ptProbe );
451+ ptProbe -> fRange = 30.0f ;
452+ ptProbe -> uResolution = 128 ;
453+ ptProbe -> uSamples = 1024 ;
454+ ptProbe -> uInterval = 6 ;
455+ ptProbe -> tFlags |= PL_ENVIRONMENT_PROBE_FLAGS_INCLUDE_SKY ;
456+ gptRenderer -> add_probe_to_scene (ptAppData -> ptScene , tProbeEntity );
457+ }
458+
441459 // create lights
442460 plLightComponent * ptLight = NULL ;
443461 // plEntity tDirectionLight = gptRenderer->create_directional_light(ptAppData->ptComponentLibrary, "direction light", pl_create_vec3(0.425f, -1.0f, -0.384f), &ptLight);
@@ -453,7 +471,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
453471 plEntity tPointLight = gptRenderer -> create_point_light (ptAppData -> ptComponentLibrary , "point light" , pl_create_vec3 (9.316f , 1.497f , -1.042f ), & ptLight );
454472 ptLight -> uShadowResolution = 512 ;
455473 ptLight -> tColor = (plVec3 ){0.0f , 1.0f , 0.0f };
456- ptLight -> tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER ;
474+ // ptLight->tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER;
457475 plTransformComponent * ptPLightTransform = (plTransformComponent * )gptEcs -> add_component (ptAppData -> ptComponentLibrary , gptEcs -> get_ecs_type_key_transform (), tPointLight );
458476 ptPLightTransform -> tTranslation = pl_create_vec3 (9.316f , 1.497f , -1.042f );
459477
@@ -463,7 +481,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
463481 ptLight -> fRange = 10.0f ;
464482 ptLight -> fRadius = 0.025f ;
465483 ptLight -> fIntensity = 20.0f ;
466- ptLight -> tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER ;
484+ // ptLight->tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER;
467485 plTransformComponent * ptSLightTransform = (plTransformComponent * )gptEcs -> add_component (ptAppData -> ptComponentLibrary , gptEcs -> get_ecs_type_key_transform (), tSpotLight );
468486 ptSLightTransform -> tTranslation = pl_create_vec3 (0.0f , 3.27f , -1.5f );
469487
@@ -504,23 +522,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
504522 // gptRenderer->add_materials_to_scene(ptAppData->ptScene, uMaterialCount, ptMaterialEntities);
505523
506524
507- plEnvironmentProbeComponent * ptProbe = NULL ;
508- plVec3 atProbeLocations [] = {
509- pl_create_vec3 (0.0f , 3.0f , 0.0f ),
510- // pl_create_vec3(-8.7f, 1.5f, 0.0f),
511- // pl_create_vec3(8.8f, 1.5f, 0.0f),
512- };
513525
514- for (uint32_t i = 0 ; i < PL_ARRAYSIZE (atProbeLocations ); i ++ )
515- {
516- plEntity tProbeEntity = gptRenderer -> create_environment_probe (ptAppData -> ptComponentLibrary , "Probe" , atProbeLocations [i ], & ptProbe );
517- ptProbe -> fRange = 30.0f ;
518- ptProbe -> uResolution = 128 ;
519- ptProbe -> uSamples = 1024 ;
520- ptProbe -> uInterval = 6 ;
521- ptProbe -> tFlags |= PL_ENVIRONMENT_PROBE_FLAGS_INCLUDE_SKY ;
522- gptRenderer -> add_probe_to_scene (ptAppData -> ptScene , tProbeEntity );
523- }
524526
525527 bool bResult0 = gptRenderer -> add_drawable_objects_to_scene (ptAppData -> ptScene , tLoaderData0 .uObjectCount , tLoaderData0 .atObjects );
526528 bool bResult1 = gptRenderer -> add_drawable_objects_to_scene (ptAppData -> ptScene , tLoaderData1 .uObjectCount , tLoaderData1 .atObjects );
0 commit comments