@@ -442,6 +442,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
442442 plModelLoaderData tLoaderData0 = {0 };
443443 gptModelLoader -> load_gltf (ptAppData -> ptComponentLibrary , "/models/gltf/humanoid/model.gltf" , NULL , & tLoaderData0 );
444444 gptModelLoader -> load_gltf (ptAppData -> ptComponentLibrary , "/gltf/Sponza/glTF/Sponza.gltf" , NULL , & tLoaderData0 );
445+ // gptModelLoader->load_gltf(ptAppData->ptComponentLibrary, "/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf", NULL, &tLoaderData0);
445446 gptRenderer -> add_drawable_objects_to_scene (ptAppData -> ptScene , tLoaderData0 .uObjectCount , tLoaderData0 .atObjects );
446447 gptModelLoader -> free_data (& tLoaderData0 );
447448 gptRenderer -> finalize_scene (ptAppData -> ptScene );
@@ -801,16 +802,18 @@ pl__show_editor_window(plAppData* ptAppData)
801802 gptStarter -> deactivate_vsync ();
802803 }
803804
804- bool abTonemap [ 3 ] = { 0 };
805+
805806 static const char * apcTonemapText [] = {
806807 "None" ,
808+ "Simple" ,
807809 "ACES" ,
808810 "Reinhard" ,
809811 };
812+ bool abTonemap [PL_ARRAYSIZE (apcTonemapText )] = {0 };
810813 abTonemap [ptRuntimeOptions -> tTonemapMode ] = true;
811814 if (gptUI -> begin_combo ("Tonemapping" , apcTonemapText [ptRuntimeOptions -> tTonemapMode ], PL_UI_COMBO_FLAGS_HEIGHT_REGULAR ))
812815 {
813- for (uint32_t i = 0 ; i < 3 ; i ++ )
816+ for (uint32_t i = 0 ; i < PL_ARRAYSIZE ( apcTonemapText ) ; i ++ )
814817 {
815818 if (gptUI -> selectable (apcTonemapText [i ], & abTonemap [i ], 0 ))
816819 {
@@ -820,14 +823,53 @@ pl__show_editor_window(plAppData* ptAppData)
820823 }
821824 gptUI -> end_combo ();
822825 }
826+
827+ bool bReloadShaders = false;
828+
829+
830+ static const char * apcShaderDebugModeText [] = {
831+ "None" ,
832+ "Base Color" ,
833+ "Metallic" ,
834+ "Roughness" ,
835+ "Alpha" ,
836+ "Emissive" ,
837+ "Occlusion" ,
838+ "Shading Normal" ,
839+ "Texture Normal" ,
840+ "Geometry Normal" ,
841+ "Geometry Tangent" ,
842+ "Geometry Bitangent" ,
843+ "UV 0"
844+ };
845+ bool abShaderDebugMode [PL_ARRAYSIZE (apcShaderDebugModeText )] = {0 };
846+ abShaderDebugMode [ptRuntimeOptions -> tShaderDebugMode ] = true;
847+ if (gptUI -> begin_combo ("Shader Debug Mode" , apcShaderDebugModeText [ptRuntimeOptions -> tShaderDebugMode ], PL_UI_COMBO_FLAGS_HEIGHT_REGULAR ))
848+ {
849+ for (uint32_t i = 0 ; i < PL_ARRAYSIZE (apcShaderDebugModeText ); i ++ )
850+ {
851+ if (gptUI -> selectable (apcShaderDebugModeText [i ], & abShaderDebugMode [i ], 0 ))
852+ {
853+ bReloadShaders = true;
854+ if (i == 0 )
855+ ptRuntimeOptions -> tTonemapMode = PL_TONEMAP_MODE_SIMPLE ;
856+ else
857+ ptRuntimeOptions -> tTonemapMode = PL_TONEMAP_MODE_NONE ;
858+ ptRuntimeOptions -> tShaderDebugMode = i ;
859+ gptUI -> close_current_popup ();
860+ }
861+ }
862+ gptUI -> end_combo ();
863+ }
864+
823865 gptUI -> slider_float ("Exposure" , & ptRuntimeOptions -> fExposure , 0.0f , 3.0f , 0 );
824866 gptUI -> slider_float ("Brightness" , & ptRuntimeOptions -> fBrightness , -1.0f , 1.0f , 0 );
825867 gptUI -> slider_float ("Contrast" , & ptRuntimeOptions -> fContrast , 0.0f , 2.0f , 0 );
826868 gptUI -> slider_float ("Saturation" , & ptRuntimeOptions -> fSaturation , 0.0f , 2.0f , 0 );
827869
828870 gptUI -> checkbox ("Show Origin" , & ptRuntimeOptions -> bShowOrigin );
829871 gptUI -> checkbox ("Show BVH" , & ptAppData -> bShowBVH );
830- bool bReloadShaders = false;
872+
831873 if (gptUI -> checkbox ("Wireframe" , & ptRuntimeOptions -> bWireframe )) bReloadShaders = true;
832874 if (gptUI -> checkbox ("MultiViewport Shadows" , & ptRuntimeOptions -> bMultiViewportShadows )) bReloadShaders = true;
833875 if (gptUI -> checkbox ("Image Based Lighting" , & ptRuntimeOptions -> bImageBasedLighting )) bReloadShaders = true;
0 commit comments