diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d07576..e4f97fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 3.3.0 - 2021-05-07 + +### Changed + +- When typing values into spinboxes, the change only takes effect after pressing + enter or moving focus elsewhere. +- Increased maximum value of image brightness slider + +### Fixed + +- Fixed bug where typing decimals into spinboxes wasn't working +- Fixed bug where sky was shown a second time outside field of view with + equidistant and equal area camera projections +- Fixed missing prism face distances from save files +- Fixed bug with slightly incorrect crystal geometry causing uneven brightness + distribution with Parry crystal halos ## 3.2.0 - 2021-03-24 @@ -13,20 +31,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fixed bug where pyramid apex angle was set incorrectly based on crystal edge angle rather than face angle +- Fixed bug where pyramid apex angle was set incorrectly based on crystal edge + angle rather than face angle ## 3.1.0 - 2021-02-21 ### Changed - Improved logging and error messages in case shader compilation fails -- Population weight was changed from an integer to a decimal number for more granular control +- Population weight was changed from an integer to a decimal number for more + granular control ## 3.0.0 - 2021-02-21 ### Added -- Created a realistic sky and sun model based on Hosek-Wilkie and Preetham papers +- Created a realistic sky and sun model based on Hosek-Wilkie and Preetham + papers - Simulation rate shown in status bar - Ice crystals now have adjustable pyramidal caps - Possibility to save and load simulations @@ -37,13 +58,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Forced application to use native desktop OpenGL instead of ANGLE or software renderer +- Forced application to use native desktop OpenGL instead of ANGLE or software + renderer - Build system switched to qmake from CMake - Rewrote most of the GUI code to use Qt model/view architecture - Triangle normals are now cached during raytracing - The settings groups in the side panel are now collapsible - Adjusting sliders with arrow kys now uses smaller steps -- Light is now allowed to bounce inside ice crystal for a 100 times instead of 10 +- Light is now allowed to bounce inside ice crystal for a 100 times instead + of 10 ### Fixed @@ -88,14 +111,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Disabled "Remove population" button when there is only one population in simulation +- Disabled "Remove population" button when there is only one population in + simulation - Added multiple crystal populations by default ## 2.1.1 - 2019-07-08 ### Fixed -- Fixed bug where removing the only crystal population caused the UI controls not to work anymore +- Fixed bug where removing the only crystal population caused the UI controls + not to work anymore ## 2.1.0 - 2019-07-07 @@ -108,11 +133,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Made sidebar scrollable when the window is small enough - Made UI show field of view in degrees -- Limited field of view for stereographic, rectilinear and orthographic projections +- Limited field of view for stereographic, rectilinear and orthographic + projections ### Fixed -- Fixed bug where field of view sometimes did not update correctly when choosing a new projection +- Fixed bug where field of view sometimes did not update correctly when choosing + a new projection ## 2.0.0 - 2019-07-02 diff --git a/appveyor.yml b/appveyor.yml index 6da6a19..44e1799 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: "3.2.0-{build}" +version: "3.3.0-{build}" branches: only: - master diff --git a/src/haloray-core/gui/components/sliderSpinBox.cpp b/src/haloray-core/gui/components/sliderSpinBox.cpp index 81f5a62..35a731e 100644 --- a/src/haloray-core/gui/components/sliderSpinBox.cpp +++ b/src/haloray-core/gui/components/sliderSpinBox.cpp @@ -17,6 +17,7 @@ SliderSpinBox::SliderSpinBox(QWidget *parent) : QWidget(parent), m_value(0.0) m_spinBox = new QDoubleSpinBox(); m_spinBox->setSingleStep(0.1); + m_spinBox->setKeyboardTracking(false); auto layout = new QHBoxLayout(this); layout->addWidget(m_slider); diff --git a/src/haloray-core/gui/crystalSettingsWidget.cpp b/src/haloray-core/gui/crystalSettingsWidget.cpp index c86d5e0..953ff5b 100644 --- a/src/haloray-core/gui/crystalSettingsWidget.cpp +++ b/src/haloray-core/gui/crystalSettingsWidget.cpp @@ -185,6 +185,7 @@ void CrystalSettingsWidget::setupUi() m_upperApexAngleSpinBox->setMinimum(0.0); m_upperApexAngleSpinBox->setMaximum(180.0); m_upperApexAngleSpinBox->setSuffix("°"); + m_upperApexAngleSpinBox->setKeyboardTracking(false); m_upperApexHeightAverageSlider = new SliderSpinBox(0.0, 1.0); @@ -194,6 +195,7 @@ void CrystalSettingsWidget::setupUi() m_lowerApexAngleSpinBox->setMinimum(0.0); m_lowerApexAngleSpinBox->setMaximum(180.0); m_lowerApexAngleSpinBox->setSuffix("°"); + m_lowerApexAngleSpinBox->setKeyboardTracking(false); m_lowerApexHeightAverageSlider = new SliderSpinBox(0.0, 1.0); diff --git a/src/haloray-core/gui/generalSettingsWidget.cpp b/src/haloray-core/gui/generalSettingsWidget.cpp index dc87e30..cb0da73 100644 --- a/src/haloray-core/gui/generalSettingsWidget.cpp +++ b/src/haloray-core/gui/generalSettingsWidget.cpp @@ -48,18 +48,21 @@ void GeneralSettingsWidget::setupUi() m_sunDiameterSpinBox->setSingleStep(0.1); m_sunDiameterSpinBox->setMinimum(0.01); m_sunDiameterSpinBox->setMaximum(30.0); + m_sunDiameterSpinBox->setKeyboardTracking(false); m_raysPerFrameSpinBox = new QSpinBox(); m_raysPerFrameSpinBox->setSingleStep(1000); m_raysPerFrameSpinBox->setMinimum(1); m_raysPerFrameSpinBox->setMaximum(m_viewModel->getRaysPerFrameUpperLimit()); m_raysPerFrameSpinBox->setGroupSeparatorShown(true); + m_raysPerFrameSpinBox->setKeyboardTracking(false); m_maximumFramesSpinBox = new QSpinBox(); m_maximumFramesSpinBox->setSingleStep(60); m_maximumFramesSpinBox->setMinimum(1); m_maximumFramesSpinBox->setMaximum(1000000000); m_maximumFramesSpinBox->setGroupSeparatorShown(true); + m_maximumFramesSpinBox->setKeyboardTracking(false); m_multipleScatteringSlider = new SliderSpinBox(); m_multipleScatteringSlider->setMinimum(0.0); diff --git a/src/haloray-core/gui/stateSaver.cpp b/src/haloray-core/gui/stateSaver.cpp index 568b2fc..45a6001 100644 --- a/src/haloray-core/gui/stateSaver.cpp +++ b/src/haloray-core/gui/stateSaver.cpp @@ -23,13 +23,13 @@ void StateSaver::SaveState(QString filename, SimulationEngine *engine, CrystalPo settings.beginGroup("CrystalPopulations"); settings.beginWriteArray("pop"); - for (auto i = 0u; i < crystals->getCount(); ++i) + for (auto popIndex = 0u; popIndex < crystals->getCount(); ++popIndex) { - settings.setArrayIndex(i); - settings.setValue("Weight", crystals->getWeight(i)); - auto population = crystals->get(i); + settings.setArrayIndex(popIndex); + settings.setValue("Weight", crystals->getWeight(popIndex)); + auto population = crystals->get(popIndex); - settings.setValue("Name", QString::fromStdString(crystals->getName(i))); + settings.setValue("Name", QString::fromStdString(crystals->getName(popIndex))); settings.setValue("Enabled", population.enabled); settings.setValue("CaRatioAverage", (double)population.caRatioAverage); @@ -50,6 +50,14 @@ void StateSaver::SaveState(QString filename, SimulationEngine *engine, CrystalPo settings.setValue("LowerApexAngle", (double)population.lowerApexAngle); settings.setValue("LowerApexHeightAverage", (double)population.lowerApexHeightAverage); settings.setValue("LowerApexHeightStd", (double)population.lowerApexHeightStd); + + settings.beginWriteArray("PrismFaceDistances"); + for (auto prismFaceIndex = 0u; prismFaceIndex < 6; ++prismFaceIndex) + { + settings.setArrayIndex(prismFaceIndex); + settings.setValue("Average", (double)population.prismFaceDistances[prismFaceIndex]); + } + settings.endArray(); } settings.endArray(); settings.endGroup(); @@ -92,9 +100,9 @@ void StateSaver::LoadState(QString filename, SimulationStateModel *simState, Cry crystalModel->clear(); auto crystalPopulationCount = settings.beginReadArray("CrystalPopulations/pop"); - for (auto i = 0; i < crystalPopulationCount; ++i) + for (auto popIndex = 0; popIndex < crystalPopulationCount; ++popIndex) { - settings.setArrayIndex(i); + settings.setArrayIndex(popIndex); auto pop = CrystalPopulation::createRandom(); pop.enabled = settings.value("Enabled", pop.enabled).toBool(); @@ -120,6 +128,14 @@ void StateSaver::LoadState(QString filename, SimulationStateModel *simState, Cry auto name = settings.value("Name", "Default name").toString(); double weight = settings.value("Weight", 1.0).toDouble(); + settings.beginReadArray("PrismFaceDistances"); + for (auto prismFaceIndex = 0u; prismFaceIndex < 6; ++prismFaceIndex) + { + settings.setArrayIndex(prismFaceIndex); + pop.prismFaceDistances[prismFaceIndex] = settings.value("Average", pop.prismFaceDistances[prismFaceIndex]).toFloat(); + } + settings.endArray(); + crystalModel->addRow(pop, weight, name); } settings.endArray(); diff --git a/src/haloray-core/gui/viewSettingsWidget.cpp b/src/haloray-core/gui/viewSettingsWidget.cpp index e04b746..29d72bb 100644 --- a/src/haloray-core/gui/viewSettingsWidget.cpp +++ b/src/haloray-core/gui/viewSettingsWidget.cpp @@ -66,7 +66,7 @@ void ViewSettingsWidget::setupUi() m_brightnessSlider = new SliderSpinBox(); m_brightnessSlider->setMinimum(0.1); - m_brightnessSlider->setMaximum(15.0); + m_brightnessSlider->setMaximum(30.0); m_hideSubHorizonCheckBox = new QCheckBox(); diff --git a/src/haloray-core/resources/shaders/raytrace.glsl b/src/haloray-core/resources/shaders/raytrace.glsl index 20da1b8..1d63cb8 100644 --- a/src/haloray-core/resources/shaders/raytrace.glsl +++ b/src/haloray-core/resources/shaders/raytrace.glsl @@ -130,11 +130,11 @@ ivec3 triangles[] = ivec3[]( ivec3(15, 16, 10), // Face 7 (prism) - ivec3(10, 16, 17), + ivec3(10, 16, 11), ivec3(16, 17, 11), // Face 8 (prism) - ivec3(11, 17, 12), + ivec3(11, 17, 6), ivec3(17, 12, 6) ); diff --git a/src/haloray-core/resources/shaders/sky.glsl b/src/haloray-core/resources/shaders/sky.glsl index 980af45..fa0c7d4 100644 --- a/src/haloray-core/resources/shaders/sky.glsl +++ b/src/haloray-core/resources/shaders/sky.glsl @@ -286,6 +286,8 @@ void main(void) projectedAngle = asin(polar.x / camera.focalLength); } + if (projectedAngle > PI) return; + float x = sin(projectedAngle) * cos(polar.y); float y = sin(projectedAngle) * sin(polar.y); float z = -cos(projectedAngle);