diff --git a/3d-viewer/3d_canvas/board_adapter.h b/3d-viewer/3d_canvas/board_adapter.h index 32fbd96c6f..dbccded218 100644 --- a/3d-viewer/3d_canvas/board_adapter.h +++ b/3d-viewer/3d_canvas/board_adapter.h @@ -646,6 +646,14 @@ public: SFVEC3D m_SilkScreenColorTop; ///< in realistic mode: SilkScreen color ( top ) SFVEC3D m_CopperColor; ///< in realistic mode: copper color + // Raytracing light colors + + SFVEC3F m_raytrace_lightColorCamera; + SFVEC3F m_raytrace_lightColorTop; + SFVEC3F m_raytrace_lightColorBottom; + + std::vector m_raytrace_lightColor; + std::vector m_raytrace_lightSphericalCoords; private: diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp index 590c18bcc7..c0dde6e722 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp @@ -941,67 +941,44 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER* aStatusReporter, REPORTER* aWarnin // ///////////////////////////////////////////////////////////////////////// m_lights.Clear(); - // This will work as the front camera light. - const float light_camera_intensity = 0.20f; - const float light_top_bottom = 0.25f; - const float light_directional_intensity = ( 1.0f - ( light_camera_intensity + - light_top_bottom * 0.5f ) ) / 4.0f; + auto IsColorZero = [] ( const SFVEC3F& aSource ) + { + return ( ( aSource.r < ( 1.0f / 255.0f ) ) && + ( aSource.g < ( 1.0f / 255.0f ) ) && + ( aSource.b < ( 1.0f / 255.0f ) ) ); + }; m_camera_light = new CDIRECTIONALLIGHT( SFVEC3F( 0.0f, 0.0f, 0.0f ), - SFVEC3F( light_camera_intensity ) ); + m_boardAdapter.m_raytrace_lightColorCamera ); m_camera_light->SetCastShadows( false ); - m_lights.Add( m_camera_light ); - // Option 1 - using Point Lights + if( !IsColorZero( m_boardAdapter.m_raytrace_lightColorCamera ) ) + m_lights.Add( m_camera_light ); - const SFVEC3F &boarCenter = m_boardAdapter.GetBBox3DU().GetCenter(); + const SFVEC3F& boardCenter = m_boardAdapter.GetBBox3DU().GetCenter(); - m_lights.Add( new CPOINTLIGHT( SFVEC3F( boarCenter.x, boarCenter.y, +RANGE_SCALE_3D * 2.0f ), - SFVEC3F( light_top_bottom ) ) ); + if( !IsColorZero( m_boardAdapter.m_raytrace_lightColorTop ) ) + m_lights.Add( new CPOINTLIGHT( SFVEC3F( boardCenter.x, boardCenter.y, +RANGE_SCALE_3D * 2.0f ), + m_boardAdapter.m_raytrace_lightColorTop ) ); - m_lights.Add( new CPOINTLIGHT( SFVEC3F( boarCenter.x, boarCenter.y, -RANGE_SCALE_3D * 2.0f ), - SFVEC3F( light_top_bottom ) ) ); + if( !IsColorZero( m_boardAdapter.m_raytrace_lightColorBottom ) ) + m_lights.Add( new CPOINTLIGHT( SFVEC3F( boardCenter.x, boardCenter.y, -RANGE_SCALE_3D * 2.0f ), + m_boardAdapter.m_raytrace_lightColorBottom ) ); + wxASSERT( m_boardAdapter.m_raytrace_lightColor.size() + == m_boardAdapter.m_raytrace_lightSphericalCoords.size() ); - // http://www.flashandmath.com/mathlets/multicalc/coords/shilmay23fin.html + for( size_t i = 0; i < m_boardAdapter.m_raytrace_lightColor.size(); ++i ) + { + if( !IsColorZero( m_boardAdapter.m_raytrace_lightColor[i] ) ) + { + const SFVEC2F sc = m_boardAdapter.m_raytrace_lightSphericalCoords[i]; - // Option 2 - Top/Bottom direction lights - /* - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 0.03f, - glm::pi() * 0.25f ), - SFVEC3F( light_top_bottom ) ) ); - - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 0.97f, - glm::pi() * 1.25f ), - SFVEC3F( light_top_bottom ) ) ); - */ - - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 1.0f / 8.0f, - glm::pi() * 1 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 1.0f / 8.0f, - glm::pi() * 3 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 1.0f / 8.0f, - glm::pi() * 5 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 1.0f / 8.0f, - glm::pi() * 7 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - - - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 7.0f / 8.0f, - glm::pi() * 1 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 7.0f / 8.0f, - glm::pi() * 3 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 7.0f / 8.0f, - glm::pi() * 5 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); - m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * 7.0f / 8.0f, - glm::pi() * 7 / 4.0f ), - SFVEC3F( light_directional_intensity ) ) ); + m_lights.Add( new CDIRECTIONALLIGHT( SphericalToCartesian( glm::pi() * sc.x, + glm::pi() * sc.y ), + m_boardAdapter.m_raytrace_lightColor[i] ) ); + } + } // Create an accelerator @@ -1458,30 +1435,8 @@ void C3D_RENDER_RAYTRACING::add_3D_models( const S3DMODEL *a3DModel, CBLINN_PHONG_MATERIAL &blinnMaterial = (*materialVector)[imat]; - SFVEC3F ambient; - - if( m_boardAdapter.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) ) - { - // apply a gain to the (dark) ambient colors - - // http://www.fooplot.com/#W3sidHlwZSI6MCwiZXEiOiIoKHgrMC4yMCleKDEvMi4wMCkpLTAuMzUiLCJjb2xvciI6IiMwMDAwMDAifSx7InR5cGUiOjAsImVxIjoieCIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMCwid2luZG93IjpbIi0xLjI0OTUwNTMzOTIyMzYyIiwiMS42Nzc4MzQ0MTg1NjcxODQzIiwiLTAuNDM1NTA0NjQyODEwOTMwMjYiLCIxLjM2NTkzNTIwODEzNzI1OCJdLCJzaXplIjpbNjQ5LDM5OV19XQ-- - // ambient = glm::max( (glm::pow((material.m_Ambient + 0.20f), SFVEC3F(1.0f / 2.00f)) - SFVEC3F(0.35f)), material.m_Ambient ); - - // http://www.fooplot.com/#W3sidHlwZSI6MCwiZXEiOiIoKHgrMC4yMCleKDEvMS41OCkpLTAuMzUiLCJjb2xvciI6IiMwMDAwMDAifSx7InR5cGUiOjAsImVxIjoieCIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMCwid2luZG93IjpbIi0xLjI0OTUwNTMzOTIyMzYyIiwiMS42Nzc4MzQ0MTg1NjcxODQzIiwiLTAuNDM1NTA0NjQyODEwOTMwMjYiLCIxLjM2NTkzNTIwODEzNzI1OCJdLCJzaXplIjpbNjQ5LDM5OV19XQ-- - //ambient = glm::max( (glm::pow((material.m_Ambient + 0.20f), SFVEC3F(1.0f / 1.58f)) - SFVEC3F(0.35f)), material.m_Ambient ); - - // http://www.fooplot.com/#W3sidHlwZSI6MCwiZXEiOiIoKHgrMC4yMCleKDEvMS41NCkpLTAuMzQiLCJjb2xvciI6IiMwMDAwMDAifSx7InR5cGUiOjAsImVxIjoieCIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMCwid2luZG93IjpbIi0yLjcyMTA5NTg0MjA1MDYwNSIsIjEuODUyODcyNTI5NDk3NTIyMyIsIi0xLjQyMTM3NjAxOTkyOTA4MDYiLCIxLjM5MzM3Mzc0NzE3NzQ2MTIiXSwic2l6ZSI6WzY0OSwzOTldfV0- - ambient = ConvertSRGBToLinear( - glm::pow((material.m_Ambient + 0.30f), SFVEC3F(1.0f / 1.54f)) - SFVEC3F(0.34f) ); - } - else - { - ambient = ConvertSRGBToLinear( material.m_Ambient ); - } - - blinnMaterial = CBLINN_PHONG_MATERIAL( - ambient, + ConvertSRGBToLinear( material.m_Ambient ), ConvertSRGBToLinear( material.m_Emissive ), ConvertSRGBToLinear( material.m_Specular ), material.m_Shininess * 180.0f, diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp index 1248da78b5..bd8b600b0e 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp @@ -1671,7 +1671,7 @@ SFVEC3F C3D_RENDER_RAYTRACING::shadeHit( const SFVEC3F &aBgColor, const SFVEC3F diffuseColorObj = aHitInfo.pHitObject->GetDiffuseColor( aHitInfo ); - SFVEC3F outColor = objMaterial->GetEmissiveColor(); + SFVEC3F outColor = objMaterial->GetEmissiveColor() + objMaterial->GetAmbientColor(); const LIST_LIGHT &lightList = m_lights.GetList(); @@ -1771,37 +1771,13 @@ SFVEC3F C3D_RENDER_RAYTRACING::shadeHit( const SFVEC3F &aBgColor, shadow_att_factor_sum += shadow_att_factor_light; } - if( !m_boardAdapter.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) ) - { - outColor += objMaterial->Shade( aRay, - aHitInfo, - NdotL, - diffuseColorObj, - vectorToLight, - colorOfLight, - shadow_att_factor_light ); - } - else - { - // This is a render hack in order to compensate for the lack of - // ambient and too much darkness when using post process shader - // It will calculate as it was not in shadow - outColor += objMaterial->Shade( aRay, - aHitInfo, - NdotL, - diffuseColorObj, - vectorToLight, - colorOfLight, - // The sampled point will be darkshaded by the post - // processing, so here it compensates to not shadow - // so much - glm::mix( 0.75f, 1.0f, shadow_att_factor_light ) - ); - } - } - else - { - outColor += objMaterial->GetAmbientColor(); + outColor += objMaterial->Shade( aRay, + aHitInfo, + NdotL, + diffuseColorObj, + vectorToLight, + colorOfLight, + shadow_att_factor_light ); } // Only use the headlight for preview diff --git a/3d-viewer/3d_viewer/3d_viewer_settings.cpp b/3d-viewer/3d_viewer/3d_viewer_settings.cpp index b5468996de..d4062f380f 100644 --- a/3d-viewer/3d_viewer/3d_viewer_settings.cpp +++ b/3d-viewer/3d_viewer/3d_viewer_settings.cpp @@ -88,6 +88,52 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() m_params.emplace_back( new PARAM( "render.raytrace_shadows", &m_Render.raytrace_shadows, true ) ); + m_params.emplace_back( new PARAM( "render.raytrace_lightColorCamera", + &m_Render.raytrace_lightColorCamera, + COLOR4D( 0.2, 0.2, 0.2, 1.0 ) ) ); + + m_params.emplace_back( new PARAM( "render.raytrace_lightColorTop", + &m_Render.raytrace_lightColorTop, + COLOR4D( 0.247, 0.247, 0.247, 1.0 ) ) ); + + m_params.emplace_back( new PARAM( "render.raytrace_lightColorBottom", + &m_Render.raytrace_lightColorBottom, + COLOR4D( 0.247, 0.247, 0.247, 1.0 ) ) ); + + std::vector default_colors = + { + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ), + COLOR4D( 0.168, 0.168, 0.168, 1.0 ) + }; + + m_params.emplace_back( new PARAM_LIST( "render.raytrace_lightColor", + &m_Render.raytrace_lightColor, + default_colors ) ); + + std::vector default_elevation = + { + 67, 67, 67, 67, -67, -67, -67, -67, + }; + + m_params.emplace_back( new PARAM_LIST( "render.raytrace_lightElevation", + &m_Render.raytrace_lightElevation, + default_elevation ) ); + + std::vector default_azimuth = + { + 45, 135, 225, 315, 45, 135, 225, 315, + }; + + m_params.emplace_back( new PARAM_LIST( "render.raytrace_lightAzimuth", + &m_Render.raytrace_lightAzimuth, + default_azimuth ) ); + m_params.emplace_back( new PARAM( "render.realistic", &m_Render.realistic, true ) ); m_params.emplace_back( new PARAM( "render.show_adhesive", &m_Render.show_adhesive, true ) ); diff --git a/3d-viewer/3d_viewer/3d_viewer_settings.h b/3d-viewer/3d_viewer/3d_viewer_settings.h index 059cf3c4fb..27c87cb5f3 100644 --- a/3d-viewer/3d_viewer/3d_viewer_settings.h +++ b/3d-viewer/3d_viewer/3d_viewer_settings.h @@ -23,7 +23,7 @@ #include #include - +#include class EDA_3D_VIEWER_SETTINGS : public APP_SETTINGS_BASE { @@ -48,6 +48,14 @@ public: bool raytrace_reflections; bool raytrace_refractions; bool raytrace_shadows; + + KIGFX::COLOR4D raytrace_lightColorCamera; + KIGFX::COLOR4D raytrace_lightColorTop; + KIGFX::COLOR4D raytrace_lightColorBottom; + std::vector raytrace_lightColor; + std::vector raytrace_lightElevation; // -90 .. 90 + std::vector raytrace_lightAzimuth; // 0 .. 359 + bool realistic; bool show_adhesive; bool show_axis; diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp index 97f2995141..fff85ace24 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option.cpp @@ -144,6 +144,45 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow() m_checkBoxRaytracing_antiAliasing->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_ANTI_ALIASING ) ); m_checkBoxRaytracing_proceduralTextures->SetValue( m_settings.GetFlag( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES ) ); + auto Transfer_color = [] ( const SFVEC3F& aSource, wxColourPickerCtrl *aTarget ) + { + aTarget->SetColour( wxColour( aSource.r * 255, + aSource.g * 255, + aSource.b * 255, 255 ) ); + }; + + Transfer_color( m_settings.m_raytrace_lightColorCamera, m_colourPickerCameraLight ); + Transfer_color( m_settings.m_raytrace_lightColorTop, m_colourPickerTopLight ); + Transfer_color( m_settings.m_raytrace_lightColorBottom, m_colourPickerBottomLight ); + + Transfer_color( m_settings.m_raytrace_lightColor[0], m_colourPickerLight1 ); + Transfer_color( m_settings.m_raytrace_lightColor[1], m_colourPickerLight2 ); + Transfer_color( m_settings.m_raytrace_lightColor[2], m_colourPickerLight3 ); + Transfer_color( m_settings.m_raytrace_lightColor[3], m_colourPickerLight4 ); + + Transfer_color( m_settings.m_raytrace_lightColor[4], m_colourPickerLight5 ); + Transfer_color( m_settings.m_raytrace_lightColor[5], m_colourPickerLight6 ); + Transfer_color( m_settings.m_raytrace_lightColor[6], m_colourPickerLight7 ); + Transfer_color( m_settings.m_raytrace_lightColor[7], m_colourPickerLight8 ); + + m_spinCtrlLightElevation1->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[0].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation2->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[1].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation3->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[2].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation4->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[3].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation5->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[4].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation6->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[5].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation7->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[6].x * 180.0f - 90.0f ) ); + m_spinCtrlLightElevation8->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[7].x * 180.0f - 90.0f ) ); + + m_spinCtrlLightAzimuth1->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[0].y * 180.0f ) ); + m_spinCtrlLightAzimuth2->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[1].y * 180.0f ) ); + m_spinCtrlLightAzimuth3->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[2].y * 180.0f ) ); + m_spinCtrlLightAzimuth4->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[3].y * 180.0f ) ); + m_spinCtrlLightAzimuth5->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[4].y * 180.0f ) ); + m_spinCtrlLightAzimuth6->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[5].y * 180.0f ) ); + m_spinCtrlLightAzimuth7->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[6].y * 180.0f ) ); + m_spinCtrlLightAzimuth8->SetValue( (int)( m_settings.m_raytrace_lightSphericalCoords[7].y * 180.0f ) ); + // Camera Options m_checkBoxEnableAnimation->SetValue( m_canvas->AnimationEnabledGet() ); m_sliderAnimationSpeed->SetValue( m_canvas->MovingSpeedMultiplierGet() ); @@ -199,6 +238,55 @@ bool DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow() m_settings.SetFlag( FL_RENDER_RAYTRACING_ANTI_ALIASING, m_checkBoxRaytracing_antiAliasing->GetValue() ); m_settings.SetFlag( FL_RENDER_RAYTRACING_PROCEDURAL_TEXTURES, m_checkBoxRaytracing_proceduralTextures->GetValue() ); + auto Transfer_color = [] ( SFVEC3F& aTarget, wxColourPickerCtrl *aSource ) + { + const wxColour color = aSource->GetColour(); + + aTarget = SFVEC3F( color.Red() / 255.0f, + color.Green() / 255.0f, + color.Blue() / 255.0f ); + }; + + Transfer_color( m_settings.m_raytrace_lightColorCamera, m_colourPickerCameraLight ); + Transfer_color( m_settings.m_raytrace_lightColorTop, m_colourPickerTopLight ); + Transfer_color( m_settings.m_raytrace_lightColorBottom, m_colourPickerBottomLight ); + + Transfer_color( m_settings.m_raytrace_lightColor[0], m_colourPickerLight1 ); + Transfer_color( m_settings.m_raytrace_lightColor[1], m_colourPickerLight2 ); + Transfer_color( m_settings.m_raytrace_lightColor[2], m_colourPickerLight3 ); + Transfer_color( m_settings.m_raytrace_lightColor[3], m_colourPickerLight4 ); + Transfer_color( m_settings.m_raytrace_lightColor[4], m_colourPickerLight5 ); + Transfer_color( m_settings.m_raytrace_lightColor[5], m_colourPickerLight6 ); + Transfer_color( m_settings.m_raytrace_lightColor[6], m_colourPickerLight7 ); + Transfer_color( m_settings.m_raytrace_lightColor[7], m_colourPickerLight8 ); + + m_settings.m_raytrace_lightSphericalCoords[0].x = ( m_spinCtrlLightElevation1->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[1].x = ( m_spinCtrlLightElevation2->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[2].x = ( m_spinCtrlLightElevation3->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[3].x = ( m_spinCtrlLightElevation4->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[4].x = ( m_spinCtrlLightElevation5->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[5].x = ( m_spinCtrlLightElevation6->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[6].x = ( m_spinCtrlLightElevation7->GetValue() + 90.0f ) / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[7].x = ( m_spinCtrlLightElevation8->GetValue() + 90.0f ) / 180.0f; + + m_settings.m_raytrace_lightSphericalCoords[0].y = m_spinCtrlLightAzimuth1->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[1].y = m_spinCtrlLightAzimuth2->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[2].y = m_spinCtrlLightAzimuth3->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[3].y = m_spinCtrlLightAzimuth4->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[4].y = m_spinCtrlLightAzimuth5->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[5].y = m_spinCtrlLightAzimuth6->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[6].y = m_spinCtrlLightAzimuth7->GetValue() / 180.0f; + m_settings.m_raytrace_lightSphericalCoords[7].y = m_spinCtrlLightAzimuth8->GetValue() / 180.0f; + + for( size_t i = 0; i < m_settings.m_raytrace_lightSphericalCoords.size(); ++i ) + { + m_settings.m_raytrace_lightSphericalCoords[i].x = glm::clamp( m_settings.m_raytrace_lightSphericalCoords[i].x, + 0.0f, 1.0f ); + + m_settings.m_raytrace_lightSphericalCoords[i].y = glm::clamp( m_settings.m_raytrace_lightSphericalCoords[i].y, + 0.0f, 2.0f ); + } + // Camera Options m_canvas->AnimationEnabledSet( m_checkBoxEnableAnimation->GetValue() ); m_canvas->MovingSpeedMultiplierSet( m_sliderAnimationSpeed->GetValue() ); diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp index 27645f77ac..71b8411055 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jul 15 2020) +// C++ code generated with wxFormBuilder (version 3.9.0 Aug 13 2020) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -100,7 +100,7 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi fgSizer3DVisibility->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - fgSizer3DVisibility->Add( 0, 0, 1, wxRIGHT|wxLEFT, 10 ); + fgSizer3DVisibility->Add( 0, 0, 1, wxLEFT|wxRIGHT, 10 ); m_bitmap3DshapesTH = new wxStaticBitmap( sbSizer3DVis->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3DVisibility->Add( m_bitmap3DshapesTH, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -391,16 +391,17 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi wxBoxSizer* bSizerRaytracing; bSizerRaytracing = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer8; - bSizer8 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer12; + bSizer12 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizerRaytracingRenderOptions; sbSizerRaytracingRenderOptions = new wxStaticBoxSizer( new wxStaticBox( m_panelRaytracing, wxID_ANY, _("Raytracing Render Options") ), wxVERTICAL ); + sbSizerRaytracingRenderOptions->SetMinSize( wxSize( -1,32 ) ); wxFlexGridSizer* fgSizer9; fgSizer9 = new wxFlexGridSizer( 4, 4, 0, 0 ); fgSizer9->SetFlexibleDirection( wxBOTH ); - fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE ); fgSizer9->Add( 0, 0, 1, wxLEFT|wxRIGHT, 5 ); @@ -452,13 +453,222 @@ DIALOG_3D_VIEW_OPTIONS_BASE::DIALOG_3D_VIEW_OPTIONS_BASE( wxWindow* parent, wxWi fgSizer9->Add( m_checkBoxRaytracing_postProcessing, 0, wxALL, 5 ); - sbSizerRaytracingRenderOptions->Add( fgSizer9, 1, wxALL|wxEXPAND, 5 ); + sbSizerRaytracingRenderOptions->Add( fgSizer9, 1, wxALL, 5 ); - bSizer8->Add( sbSizerRaytracingRenderOptions, 1, wxALL|wxEXPAND, 5 ); + bSizer12->Add( sbSizerRaytracingRenderOptions, 0, wxALL|wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizerRaytracingLightConfiguration; + sbSizerRaytracingLightConfiguration = new wxStaticBoxSizer( new wxStaticBox( m_panelRaytracing, wxID_ANY, _("Lights configuration") ), wxVERTICAL ); + + wxBoxSizer* bSizer11; + bSizer11 = new wxBoxSizer( wxHORIZONTAL ); - bSizerRaytracing->Add( bSizer8, 1, wxALL|wxEXPAND, 5 ); + bSizer11->Add( 0, 0, 1, 0, 5 ); + + m_staticText17 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Ambient Camera Light"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText17->Wrap( -1 ); + bSizer11->Add( m_staticText17, 0, wxALL, 5 ); + + m_colourPickerCameraLight = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxColour( 51, 51, 51 ), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE ); + bSizer11->Add( m_colourPickerCameraLight, 0, 0, 5 ); + + + bSizer11->Add( 0, 0, 1, 0, 5 ); + + + sbSizerRaytracingLightConfiguration->Add( bSizer11, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer13; + bSizer13 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer13->Add( 0, 0, 1, 0, 5 ); + + m_staticText5 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Top Light"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText5->Wrap( -1 ); + bSizer13->Add( m_staticText5, 0, wxALL, 5 ); + + m_colourPickerTopLight = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxColour( 63, 63, 63 ), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE ); + bSizer13->Add( m_colourPickerTopLight, 0, 0, 5 ); + + + bSizer13->Add( 0, 0, 1, 0, 5 ); + + m_staticText6 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Bottom Light"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText6->Wrap( -1 ); + bSizer13->Add( m_staticText6, 0, wxALL, 5 ); + + m_colourPickerBottomLight = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxColour( 63, 63, 63 ), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE ); + bSizer13->Add( m_colourPickerBottomLight, 0, 0, 5 ); + + + bSizer13->Add( 0, 0, 1, 0, 5 ); + + + sbSizerRaytracingLightConfiguration->Add( bSizer13, 1, wxEXPAND, 5 ); + + wxFlexGridSizer* fgSizer11; + fgSizer11 = new wxFlexGridSizer( 0, 9, 0, 0 ); + fgSizer11->SetFlexibleDirection( wxBOTH ); + fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + + fgSizer11->Add( 0, 0, 1, 0, 5 ); + + + fgSizer11->Add( 0, 0, 1, 0, 5 ); + + m_staticText20 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Elevation °"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20->Wrap( -1 ); + fgSizer11->Add( m_staticText20, 0, wxALL, 5 ); + + m_staticText18 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Azimuth °"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText18->Wrap( -1 ); + fgSizer11->Add( m_staticText18, 0, wxALL, 5 ); + + + fgSizer11->Add( 0, 0, 1, 0, 5 ); + + + fgSizer11->Add( 0, 0, 1, 0, 5 ); + + + fgSizer11->Add( 0, 0, 1, 0, 5 ); + + m_staticText27 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Elevation °"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText27->Wrap( -1 ); + fgSizer11->Add( m_staticText27, 0, wxALL, 5 ); + + m_staticText28 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("Azimuth °"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText28->Wrap( -1 ); + fgSizer11->Add( m_staticText28, 0, wxALL, 5 ); + + m_staticText21 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + fgSizer11->Add( m_staticText21, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight1 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight1, 0, wxALL, 5 ); + + m_spinCtrlLightElevation1 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 90, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation1, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth1 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth1, 0, wxALL, 1 ); + + + fgSizer11->Add( 0, 0, 1, wxALL, 5 ); + + m_staticText22 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("5"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText22->Wrap( -1 ); + fgSizer11->Add( m_staticText22, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight5 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight5, 0, wxALL, 5 ); + + m_spinCtrlLightElevation5 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 10, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation5, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth5 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth5, 0, wxALL, 1 ); + + m_staticText23 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("2"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText23->Wrap( -1 ); + fgSizer11->Add( m_staticText23, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight2 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight2, 0, wxALL, 5 ); + + m_spinCtrlLightElevation2 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 90, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation2, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth2 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth2, 0, wxALL, 1 ); + + + fgSizer11->Add( 0, 0, 1, wxALL, 5 ); + + m_staticText24 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("6"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText24->Wrap( -1 ); + fgSizer11->Add( m_staticText24, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight6 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight6, 0, wxALL, 5 ); + + m_spinCtrlLightElevation6 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 10, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation6, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth6 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth6, 0, wxALL, 1 ); + + m_staticText25 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("3"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText25->Wrap( -1 ); + fgSizer11->Add( m_staticText25, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight3 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight3, 0, wxALL, 5 ); + + m_spinCtrlLightElevation3 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 90, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation3, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth3 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth3, 0, wxALL, 1 ); + + + fgSizer11->Add( 0, 0, 1, wxALL, 5 ); + + m_staticText26 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("7"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText26->Wrap( -1 ); + fgSizer11->Add( m_staticText26, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight7 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight7, 0, wxALL, 5 ); + + m_spinCtrlLightElevation7 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 10, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation7, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth7 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth7, 0, wxALL, 1 ); + + m_staticText171 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("4"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText171->Wrap( -1 ); + fgSizer11->Add( m_staticText171, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight4 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight4, 0, wxALL, 5 ); + + m_spinCtrlLightElevation4 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 90, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation4, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth4 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth4, 0, wxALL, 1 ); + + + fgSizer11->Add( 0, 0, 1, wxALL|wxEXPAND, 5 ); + + m_staticText181 = new wxStaticText( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, _("8"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText181->Wrap( -1 ); + fgSizer11->Add( m_staticText181, 0, wxALIGN_CENTER|wxALL, 5 ); + + m_colourPickerLight8 = new wxColourPickerCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, *wxBLACK, wxDefaultPosition, wxSize( -1,-1 ), wxCLRP_DEFAULT_STYLE ); + fgSizer11->Add( m_colourPickerLight8, 0, wxALL, 5 ); + + m_spinCtrlLightElevation8 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS, -90, 10, 0 ); + fgSizer11->Add( m_spinCtrlLightElevation8, 0, wxALL, 1 ); + + m_spinCtrlLightAzimuth8 = new wxSpinCtrl( sbSizerRaytracingLightConfiguration->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 124,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 ); + fgSizer11->Add( m_spinCtrlLightAzimuth8, 0, wxALL, 1 ); + + + sbSizerRaytracingLightConfiguration->Add( fgSizer11, 0, wxALL|wxEXPAND, 5 ); + + + bSizer12->Add( sbSizerRaytracingLightConfiguration, 1, wxALL|wxEXPAND, 5 ); + + + bSizerRaytracing->Add( bSizer12, 1, wxALL|wxEXPAND, 5 ); m_panelRaytracing->SetSizer( bSizerRaytracing ); diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp index 19e0a9e64b..072a878c54 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.fbp @@ -14,6 +14,7 @@ dialog_3D_view_option_base 1000 none + 1 dialog_3D_view_option_base @@ -25,6 +26,7 @@ 1 1 UI + 0 0 0 @@ -184,11 +186,11 @@ bSizeLeft wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + wxID_ANY Render Options @@ -895,11 +897,11 @@ - + 5 wxALL|wxEXPAND 0 - + wxID_ANY 3D Model Visibility @@ -925,7 +927,7 @@ 0 10 - wxRIGHT|wxLEFT + wxLEFT|wxRIGHT 1 0 @@ -1387,16 +1389,16 @@ 5 wxALL|wxEXPAND 0 - + bSizerRight wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + wxID_ANY Board Layers @@ -1404,11 +1406,11 @@ wxVERTICAL 1 none - + 5 wxEXPAND 0 - + 3 wxBOTH @@ -1952,11 +1954,11 @@ - + 5 wxALL|wxEXPAND 0 - + wxID_ANY User Layers (not shown in realistic mode) @@ -1964,11 +1966,11 @@ wxVERTICAL 1 none - + 5 wxEXPAND 0 - + 3 wxBOTH @@ -2248,11 +2250,11 @@ - + 5 wxALL|wxEXPAND 0 - + wxID_ANY Camera Options @@ -2260,20 +2262,20 @@ wxVERTICAL 1 none - + 5 wxEXPAND 1 - + bSizerRotAngle wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxALL 0 - + 1 1 1 @@ -2330,11 +2332,11 @@ -1 - + 5 wxALIGN_CENTER_VERTICAL|wxALL 0 - + 1 1 1 @@ -2394,11 +2396,11 @@ - + 5 wxALIGN_CENTER_VERTICAL|wxALL 0 - + 1 1 1 @@ -2457,11 +2459,11 @@ - + 5 wxEXPAND | wxALL 0 - + 1 1 1 @@ -2580,20 +2582,20 @@ OnCheckEnableAnimation - + 5 wxEXPAND 1 - + bSizerSlider wxHORIZONTAL none - + 5 wxALIGN_CENTER_VERTICAL|wxALL 0 - + 1 1 1 @@ -2650,11 +2652,11 @@ -1 - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -2728,7 +2730,7 @@ OpenGL 0 - + 1 1 1 @@ -2779,16 +2781,16 @@ wxTAB_TRAVERSAL - + bSizerOpenGL wxHORIZONTAL none - + 5 wxALL|wxEXPAND 1 - + bSizer7 wxVERTICAL @@ -3532,7 +3534,7 @@ Raytracing 0 - + 1 1 1 @@ -3583,35 +3585,35 @@ wxTAB_TRAVERSAL - + bSizerRaytracing wxVERTICAL none - + 5 wxALL|wxEXPAND 1 - + - bSizer8 + bSizer12 wxVERTICAL none - + 5 wxALL|wxEXPAND - 1 + 0 wxID_ANY Raytracing Render Options - + -1,32 sbSizerRaytracingRenderOptions wxVERTICAL 1 none 5 - wxALL|wxEXPAND + wxALL 1 4 @@ -3621,7 +3623,7 @@ 0 fgSizer9 - wxFLEX_GROWMODE_SPECIFIED + wxFLEX_GROWMODE_NONE none 4 0 @@ -4147,6 +4149,2800 @@ + + 5 + wxALL|wxEXPAND + 1 + + wxID_ANY + Lights configuration + -1,-1 + sbSizerRaytracingLightConfiguration + wxVERTICAL + 1 + none + + 5 + wxEXPAND + 1 + + -1,-1 + bSizer11 + wxHORIZONTAL + none + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Ambient Camera Light + 0 + + 0 + + + 0 + + 1 + m_staticText17 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 51,51,51 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerCameraLight + 1 + + + protected + 1 + + Resizable + 1 + + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + + 1 + + 0 + protected + 0 + + + + + + 5 + wxEXPAND + 1 + + -1,-1 + bSizer13 + wxHORIZONTAL + none + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Top Light + 0 + + 0 + + + 0 + + 1 + m_staticText5 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 63,63,63 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerTopLight + 1 + + + protected + 1 + + Resizable + 1 + + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Bottom Light + 0 + + 0 + + + 0 + + 1 + m_staticText6 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + 63,63,63 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerBottomLight + 1 + + + protected + 1 + + Resizable + 1 + + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + + 1 + + 0 + protected + 0 + + + + + + 5 + wxALL|wxEXPAND + 0 + + 9 + wxBOTH + + + 0 + + fgSizer11 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 0 + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Elevation ° + 0 + + 0 + + + 0 + + 1 + m_staticText20 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Azimuth ° + 0 + + 0 + + + 0 + + 1 + m_staticText18 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Elevation ° + 0 + + 0 + + + 0 + + 1 + m_staticText27 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Azimuth ° + 0 + + 0 + + + 0 + + 1 + m_staticText28 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 1 + 0 + + 0 + + + 0 + + 1 + m_staticText21 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight1 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 90 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation1 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth1 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALL + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 5 + 0 + + 0 + + + 0 + + 1 + m_staticText22 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight5 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 10 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation5 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth5 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 2 + 0 + + 0 + + + 0 + + 1 + m_staticText23 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight2 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 90 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation2 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth2 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALL + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 6 + 0 + + 0 + + + 0 + + 1 + m_staticText24 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight6 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 10 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation6 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth6 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 3 + 0 + + 0 + + + 0 + + 1 + m_staticText25 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight3 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 90 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation3 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth3 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALL + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 7 + 0 + + 0 + + + 0 + + 1 + m_staticText26 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight7 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 10 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation7 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth7 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 4 + 0 + + 0 + + + 0 + + 1 + m_staticText171 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight4 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 90 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation4 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth4 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 8 + 0 + + 0 + + + 0 + + 1 + m_staticText181 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_colourPickerLight8 + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + wxCLRP_DEFAULT_STYLE + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 10 + + 0 + + -90 + + 0 + + 1 + m_spinCtrlLightElevation8 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS + ; ; forward_declare + 0 + + + + + + + + + 1 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + 0 + 359 + + 0 + + 0 + + 0 + + 1 + m_spinCtrlLightAzimuth8 + 1 + + + protected + 1 + + Resizable + 1 + 124,-1 + wxSP_ARROW_KEYS|wxSP_WRAP + ; ; forward_declare + 0 + + + + + + + + + + + diff --git a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h index 67d602d9b9..b473803c93 100644 --- a/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h +++ b/3d-viewer/3d_viewer/dialogs/dialog_3D_view_option_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jul 15 2020) +// C++ code generated with wxFormBuilder (version 3.9.0 Aug 13 2020) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,48 @@ class DIALOG_3D_VIEW_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_checkBoxRaytracing_showReflections; wxCheckBox* m_checkBoxRaytracing_antiAliasing; wxCheckBox* m_checkBoxRaytracing_postProcessing; + wxStaticText* m_staticText17; + wxColourPickerCtrl* m_colourPickerCameraLight; + wxStaticText* m_staticText5; + wxColourPickerCtrl* m_colourPickerTopLight; + wxStaticText* m_staticText6; + wxColourPickerCtrl* m_colourPickerBottomLight; + wxStaticText* m_staticText20; + wxStaticText* m_staticText18; + wxStaticText* m_staticText27; + wxStaticText* m_staticText28; + wxStaticText* m_staticText21; + wxColourPickerCtrl* m_colourPickerLight1; + wxSpinCtrl* m_spinCtrlLightElevation1; + wxSpinCtrl* m_spinCtrlLightAzimuth1; + wxStaticText* m_staticText22; + wxColourPickerCtrl* m_colourPickerLight5; + wxSpinCtrl* m_spinCtrlLightElevation5; + wxSpinCtrl* m_spinCtrlLightAzimuth5; + wxStaticText* m_staticText23; + wxColourPickerCtrl* m_colourPickerLight2; + wxSpinCtrl* m_spinCtrlLightElevation2; + wxSpinCtrl* m_spinCtrlLightAzimuth2; + wxStaticText* m_staticText24; + wxColourPickerCtrl* m_colourPickerLight6; + wxSpinCtrl* m_spinCtrlLightElevation6; + wxSpinCtrl* m_spinCtrlLightAzimuth6; + wxStaticText* m_staticText25; + wxColourPickerCtrl* m_colourPickerLight3; + wxSpinCtrl* m_spinCtrlLightElevation3; + wxSpinCtrl* m_spinCtrlLightAzimuth3; + wxStaticText* m_staticText26; + wxColourPickerCtrl* m_colourPickerLight7; + wxSpinCtrl* m_spinCtrlLightElevation7; + wxSpinCtrl* m_spinCtrlLightAzimuth7; + wxStaticText* m_staticText171; + wxColourPickerCtrl* m_colourPickerLight4; + wxSpinCtrl* m_spinCtrlLightElevation4; + wxSpinCtrl* m_spinCtrlLightAzimuth4; + wxStaticText* m_staticText181; + wxColourPickerCtrl* m_colourPickerLight8; + wxSpinCtrl* m_spinCtrlLightElevation8; + wxSpinCtrl* m_spinCtrlLightAzimuth8; wxStaticLine* m_staticlineH; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index a1c0f023ba..33e638992f 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -404,12 +404,13 @@ void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg ) COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); - auto set_color = [] ( const COLOR4D& aColor, SFVEC3D& aTarget ) - { - aTarget.r = aColor.r; - aTarget.g = aColor.g; - aTarget.b = aColor.b; - }; + auto set_color = + [] ( const COLOR4D& aColor, SFVEC3D& aTarget ) + { + aTarget.r = aColor.r; + aTarget.g = aColor.g; + aTarget.b = aColor.b; + }; set_color( colors->GetColor( LAYER_3D_BACKGROUND_BOTTOM ), m_boardAdapter.m_BgColorBot ); set_color( colors->GetColor( LAYER_3D_BACKGROUND_TOP ), m_boardAdapter.m_BgColorTop ); @@ -423,6 +424,26 @@ void EDA_3D_VIEWER::LoadSettings( APP_SETTINGS_BASE *aCfg ) if( cfg ) { + m_boardAdapter.m_raytrace_lightColorCamera = m_boardAdapter.GetColor( cfg->m_Render.raytrace_lightColorCamera ); + m_boardAdapter.m_raytrace_lightColorTop = m_boardAdapter.GetColor( cfg->m_Render.raytrace_lightColorTop ); + m_boardAdapter.m_raytrace_lightColorBottom = m_boardAdapter.GetColor( cfg->m_Render.raytrace_lightColorBottom ); + + m_boardAdapter.m_raytrace_lightColor.resize( cfg->m_Render.raytrace_lightColor.size() ); + m_boardAdapter.m_raytrace_lightSphericalCoords.resize( cfg->m_Render.raytrace_lightColor.size() ); + + for( size_t i = 0; i < cfg->m_Render.raytrace_lightColor.size(); ++i ) + { + m_boardAdapter.m_raytrace_lightColor[i] = m_boardAdapter.GetColor( cfg->m_Render.raytrace_lightColor[i] ); + + SFVEC2F sphericalCoord = SFVEC2F( ( cfg->m_Render.raytrace_lightElevation[i] + 90.0f ) / 180.0f, + cfg->m_Render.raytrace_lightAzimuth[i] / 180.0f ); + + sphericalCoord.x = glm::clamp( sphericalCoord.x, 0.0f, 1.0f ); + sphericalCoord.y = glm::clamp( sphericalCoord.y, 0.0f, 2.0f ); + + m_boardAdapter.m_raytrace_lightSphericalCoords[i] = sphericalCoord; + } + #define TRANSFER_SETTING( flag, field ) m_boardAdapter.SetFlag( flag, cfg->m_Render.field ) TRANSFER_SETTING( FL_USE_REALISTIC_MODE, realistic ); @@ -494,10 +515,11 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg ) COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); - auto save_color = [colors] ( SFVEC3D& aSource, LAYER_3D_ID aTarget ) - { - colors->SetColor( aTarget, COLOR4D( aSource.r, aSource.g, aSource.b, 1.0 ) ); - }; + auto save_color = + [colors] ( SFVEC3D& aSource, LAYER_3D_ID aTarget ) + { + colors->SetColor( aTarget, COLOR4D( aSource.r, aSource.g, aSource.b, 1.0 ) ); + }; save_color( m_boardAdapter.m_BgColorBot, LAYER_3D_BACKGROUND_BOTTOM ); save_color( m_boardAdapter.m_BgColorTop, LAYER_3D_BACKGROUND_TOP ); @@ -514,6 +536,26 @@ void EDA_3D_VIEWER::SaveSettings( APP_SETTINGS_BASE *aCfg ) if( cfg ) { + + auto save_color = + [] ( const SFVEC3F& aSource, COLOR4D& aTarget ) + { + aTarget = COLOR4D( aSource.r, aSource.g, aSource.b, 1.0 ); + }; + + save_color( m_boardAdapter.m_raytrace_lightColorCamera, cfg->m_Render.raytrace_lightColorCamera ); + + save_color( m_boardAdapter.m_raytrace_lightColorTop, cfg->m_Render.raytrace_lightColorTop ); + save_color( m_boardAdapter.m_raytrace_lightColorBottom, cfg->m_Render.raytrace_lightColorBottom ); + + for( size_t i = 0; i < cfg->m_Render.raytrace_lightColor.size(); ++i ) + { + save_color( m_boardAdapter.m_raytrace_lightColor[i], cfg->m_Render.raytrace_lightColor[i] ); + + cfg->m_Render.raytrace_lightElevation[i] = (int)( m_boardAdapter.m_raytrace_lightSphericalCoords[i].x * 180.0f - 90.0f ); + cfg->m_Render.raytrace_lightAzimuth[i] = (int)( m_boardAdapter.m_raytrace_lightSphericalCoords[i].y * 180.0f ); + } + #define TRANSFER_SETTING( field, flag ) cfg->m_Render.field = m_boardAdapter.GetFlag( flag ) cfg->m_Render.engine = static_cast( m_boardAdapter.RenderEngineGet() );