File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/plugins/minimal_scene Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -762,11 +762,12 @@ std::string GzRenderer::Initialize(RenderThreadRhi &_rhi)
762762 scene->SetSkyEnabled (true );
763763 }
764764
765- if (!scene->SetShadowTextureSize (rendering::LightType::DIRECTIONAL,
766- this ->directionalLightTextureSize ))
765+ if (this ->directionalLightTextureSize .has_value () &&
766+ !scene->SetShadowTextureSize (rendering::LightType::DIRECTIONAL,
767+ *this ->directionalLightTextureSize ))
767768 {
768769 gzerr << " Unable to set directional light shadow <texture_size> to '"
769- << this ->directionalLightTextureSize
770+ << * this ->directionalLightTextureSize
770771 << " '. Using default texture size of "
771772 << scene->ShadowTextureSize (rendering::LightType::DIRECTIONAL)
772773 << std::endl;
Original file line number Diff line number Diff line change 2020
2121#include < string>
2222#include < memory>
23+ #include < optional>
2324
2425#include < gz/common/KeyEvent.hh>
2526#include < gz/common/MouseEvent.hh>
@@ -240,7 +241,7 @@ namespace gz::gui::plugins
240241 public: bool skyEnable = false ;
241242
242243 // / \brief Shadow texture size for directional light
243- public: unsigned int directionalLightTextureSize = 2048u ;
244+ public: std::optional< unsigned int > directionalLightTextureSize;
244245
245246 // / \brief Horizontal FOV of the camera;
246247 public: math::Angle cameraHFOV = math::Angle(M_PI * 0.5 );
You can’t perform that action at this time.
0 commit comments