@@ -78,7 +78,6 @@ Index of this file:
7878#include "pl_compress_ext.h"
7979#include "pl_script_ext.h"
8080#include "pl_terrain_ext.h"
81- #include "pl_terrain_processor_ext.h"
8281
8382// shaders
8483#include "pl_shader_interop_renderer.h" // PL_MESH_FORMAT_FLAG_XXXX
@@ -125,7 +124,6 @@ const plCompressI* gptCompress = NULL;
125124const plMaterialI * gptMaterial = NULL ;
126125const plScriptI * gptScript = NULL ;
127126const plTerrainI * gptTerrain = NULL ;
128- const plTerrainProcessorI * gptTerrainProcessor = NULL ;
129127
130128#define PL_ALLOC (x ) gptMemory->tracked_realloc(NULL, (x), __FILE__, __LINE__)
131129#define PL_REALLOC (x , y ) gptMemory->tracked_realloc((x), (y), __FILE__, __LINE__)
@@ -251,6 +249,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
251249 gptVfs -> mount_directory ("/gltf" , "../data/glTF-Sample-Assets-main/Models" , PL_VFS_MOUNT_FLAGS_NONE );
252250 gptVfs -> mount_directory ("/fonts" , "../data/pilotlight-assets-master/fonts" , PL_VFS_MOUNT_FLAGS_NONE );
253251 gptVfs -> mount_directory ("/environments" , "../data/pilotlight-assets-master/environments" , PL_VFS_MOUNT_FLAGS_NONE );
252+ gptVfs -> mount_directory ("/textures" , "../data/pilotlight-assets-master/terrain" , PL_VFS_MOUNT_FLAGS_NONE );
254253 gptVfs -> mount_directory ("/shaders" , "../shaders" , PL_VFS_MOUNT_FLAGS_NONE );
255254 gptVfs -> mount_directory ("/shader-temp" , "../shader-temp" , PL_VFS_MOUNT_FLAGS_NONE );
256255
@@ -424,24 +423,36 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
424423 ptAppData -> ptScene = gptRenderer -> create_scene (tSceneInit );
425424 ptAppData -> ptView = gptRenderer -> create_view (ptAppData -> ptScene , ptIO -> tMainViewportSize );
426425
426+ // float fXOffset = -330.0f;
427+ // float fYOffset = 87.0f;
428+ // float fZOffset = -330.0f;
429+
430+ // float fXOffset = -30.0f;
431+ // float fYOffset = 0.1f;
432+ // float fZOffset = 0.0f;
433+
434+ float fXOffset = -30.0f ;
435+ float fYOffset = 0.1f ;
436+ float fZOffset = 0.0f ;
437+
427438 // create main camera
428439 plCamera * ptMainCamera = NULL ;
429- ptAppData -> tMainCamera = gptCamera -> create_perspective (ptAppData -> ptComponentLibrary , "main camera" , pl_create_vec3_d (-4.012 , 2.984 , -1.109 ), PL_PI_3 , ptIO -> tMainViewportSize .x / ptIO -> tMainViewportSize .y , 0.1f , 30 .0f , true, & ptMainCamera );
430- gptCamera -> set_pitch_yaw (ptMainCamera , -0.465f , 1.341f );
440+ ptAppData -> tMainCamera = gptCamera -> create_perspective (ptAppData -> ptComponentLibrary , "main camera" , pl_create_vec3_d (fXOffset - 4.012 , fYOffset + 2.984 , fZOffset - 1.109 ), PL_PI_3 , ptIO -> tMainViewportSize .x / ptIO -> tMainViewportSize .y , 0.1f , 650 .0f , true, & ptMainCamera );
441+ gptCamera -> set_pitch_yaw (ptMainCamera , 0.0f , PL_PI_2 );
431442 gptCamera -> update (ptMainCamera );
432443 gptScript -> attach (ptAppData -> ptComponentLibrary , "pl_script_camera" , PL_SCRIPT_FLAG_PLAYING | PL_SCRIPT_FLAG_RELOADABLE , ptAppData -> tMainCamera , NULL );
433444
434445 // create secondary camera
435446 plCamera * ptSecondaryCamera = NULL ;
436- ptAppData -> tSecondaryCamera = gptCamera -> create_perspective (ptAppData -> ptComponentLibrary , "secondary camera" , pl_create_vec3_d (-4.012f , 2.984f , -1.109f ), PL_PI_3 , 1.0f , 0.1f , 20.0f , true, & ptSecondaryCamera );
447+ ptAppData -> tSecondaryCamera = gptCamera -> create_perspective (ptAppData -> ptComponentLibrary , "secondary camera" , pl_create_vec3_d (fXOffset - 4.012f , fYOffset + 2.984f , fZOffset - 1.109f ), PL_PI_3 , 1.0f , 0.1f , 20.0f , true, & ptSecondaryCamera );
437448 gptCamera -> set_pitch_yaw (ptSecondaryCamera , -0.465f , 1.341f );
438449 gptCamera -> update (ptSecondaryCamera );
439450 plTransformComponent * ptSecondaryCameraTransform = (plTransformComponent * )gptEcs -> add_component (ptAppData -> ptComponentLibrary , gptEcs -> get_ecs_type_key_transform (), ptAppData -> tSecondaryCamera );
440- ptSecondaryCameraTransform -> tTranslation = pl_create_vec3 (-4.012f , 2.984f , -1.109f );
451+ ptSecondaryCameraTransform -> tTranslation = pl_create_vec3 (fXOffset - 4.012f , fYOffset + 2.984f , fZOffset - 1.109f );
441452
442453 plEnvironmentProbeComponent * ptProbe = NULL ;
443454 plVec3 atProbeLocations [] = {
444- pl_create_vec3 (0.0f , 3.0f , 0.0f ),
455+ pl_create_vec3 (fXOffset + 0.0f , fYOffset + 3.0f , fZOffset + 0.0f ),
445456 // pl_create_vec3(-8.7f, 1.5f, 0.0f),
446457 // pl_create_vec3(8.8f, 1.5f, 0.0f),
447458 };
@@ -463,30 +474,30 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
463474 ptLight -> uCascadeCount = 4 ;
464475 ptLight -> fIntensity = 18.0f ;
465476 ptLight -> uShadowResolution = 1024 * 2 ;
466- ptLight -> afCascadeSplits [0 ] = 0.05f ;
467- ptLight -> afCascadeSplits [1 ] = 0.15f ;
468- ptLight -> afCascadeSplits [2 ] = 0.25f ;
477+ ptLight -> afCascadeSplits [0 ] = 0.005f ;
478+ ptLight -> afCascadeSplits [1 ] = 0.020f ;
479+ ptLight -> afCascadeSplits [2 ] = 0.10f ;
469480 ptLight -> afCascadeSplits [3 ] = 1.00f ;
470481 ptLight -> tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER ;
471482
472- plEntity tPointLight = gptRenderer -> create_point_light (ptAppData -> ptComponentLibrary , "point light" , pl_create_vec3 (9.316f , 1.497f , -1.042f ), & ptLight );
483+ plEntity tPointLight = gptRenderer -> create_point_light (ptAppData -> ptComponentLibrary , "point light" , pl_create_vec3 (fXOffset + 9.316f , fYOffset + 1.497f , fZOffset - 1.042f ), & ptLight );
473484 ptLight -> uShadowResolution = 512 ;
474485 ptLight -> tColor = (plVec3 ){0.0f , 1.0f , 0.0f };
475486 ptLight -> tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER ;
476487 plTransformComponent * ptPLightTransform = (plTransformComponent * )gptEcs -> add_component (ptAppData -> ptComponentLibrary , gptEcs -> get_ecs_type_key_transform (), tPointLight );
477- ptPLightTransform -> tTranslation = pl_create_vec3 (9.316f , 1.497f , -1.042f );
488+ ptPLightTransform -> tTranslation = pl_create_vec3 (fXOffset + 9.316f , fYOffset + 1.497f , fZOffset - 1.042f );
478489
479- plEntity tSpotLight = gptRenderer -> create_spot_light (ptAppData -> ptComponentLibrary , "spot light" , pl_create_vec3 (0.0f , 3.27f , -1.5f ), pl_create_vec3 (0.0 , -0.390f , 0.368f ), & ptLight );
490+ plEntity tSpotLight = gptRenderer -> create_spot_light (ptAppData -> ptComponentLibrary , "spot light" , pl_create_vec3 (fXOffset + 0.0f , fYOffset + 3.27f , fZOffset - 1.5f ), pl_create_vec3 (0.0 , -0.390f , 0.368f ), & ptLight );
480491 ptLight -> uShadowResolution = 512 ;
481492 ptLight -> tColor = (plVec3 ){1.0f , 0.0f , 1.0f };
482493 ptLight -> fRange = 10.0f ;
483494 ptLight -> fRadius = 0.025f ;
484495 ptLight -> fIntensity = 20.0f ;
485496 ptLight -> tFlags |= PL_LIGHT_FLAG_CAST_SHADOW | PL_LIGHT_FLAG_VISUALIZER ;
486497 plTransformComponent * ptSLightTransform = (plTransformComponent * )gptEcs -> add_component (ptAppData -> ptComponentLibrary , gptEcs -> get_ecs_type_key_transform (), tSpotLight );
487- ptSLightTransform -> tTranslation = pl_create_vec3 (0.0f , 3.27f , -1.5f );
498+ ptSLightTransform -> tTranslation = pl_create_vec3 (fXOffset + 0.0f , fYOffset + 3.27f , fZOffset - 1.5f );
488499
489- plEntity tPointLight2 = gptRenderer -> create_point_light (ptAppData -> ptComponentLibrary , "point light2" , pl_create_vec3 (-6.316f , 1.497f , -1.042f ), & ptLight );
500+ plEntity tPointLight2 = gptRenderer -> create_point_light (ptAppData -> ptComponentLibrary , "point light2" , pl_create_vec3 (fXOffset - 6.316f , fYOffset + 1.497f , fZOffset - 1.042f ), & ptLight );
490501 ptLight -> tColor = (plVec3 ){1.0f , 1.0f , 1.0f };
491502 ptLight -> tFlags |= PL_LIGHT_FLAG_VISUALIZER ;
492503
@@ -499,10 +510,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
499510
500511 plModelLoaderData tLoaderData0 = {0 };
501512 plModelLoaderData tLoaderData1 = {0 };
502- plMat4 tModelTranslation = pl_mat4_translate_xyz (0.0f , 0.0f , 0.0f );
513+ plMat4 tModelTranslation = pl_mat4_translate_xyz (fXOffset , fYOffset , fZOffset );
503514 gptModelLoader -> load_gltf (ptAppData -> ptComponentLibrary , "/models/gltf/humanoid/model.gltf" , & tModelTranslation , & tLoaderData1 );
504515 // gptModelLoader->load_gltf(ptAppData->ptComponentLibrary, "/models/gltf/humanoid/floor.gltf", &tModelTranslation, &tLoaderData1);
505- gptModelLoader -> load_gltf (ptAppData -> ptComponentLibrary , "/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf" , & tModelTranslation , & tLoaderData0 );
516+ // gptModelLoader->load_gltf(ptAppData->ptComponentLibrary, "/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf", &tModelTranslation, &tLoaderData0);
506517 gptModelLoader -> load_gltf (ptAppData -> ptComponentLibrary , "/gltf/Sponza/glTF/Sponza.gltf" , & tModelTranslation , & tLoaderData0 );
507518 // gptModelLoader->load_gltf(ptAppData->ptComponentLibrary, "/models/gltf/sort.gltf", &tModelTranslation, &tLoaderData0);
508519 // plMat4 tRotation = pl_mat4_rotate_xyz(-PL_PI_2, 0.0f, 1.0f, 0.0f);
@@ -1229,7 +1240,6 @@ pl__load_apis(plApiRegistryI* ptApiRegistry)
12291240 gptMaterial = pl_get_api_latest (ptApiRegistry , plMaterialI );
12301241 gptScript = pl_get_api_latest (ptApiRegistry , plScriptI );
12311242 gptTerrain = pl_get_api_latest (ptApiRegistry , plTerrainI );
1232- gptTerrainProcessor = pl_get_api_latest (ptApiRegistry , plTerrainProcessorI );
12331243}
12341244
12351245
0 commit comments