Skip to content

Commit 41658f4

Browse files
committed
Merge branch 'release/3.1.0'
2 parents 89a159c + ddaec51 commit 41658f4

File tree

15 files changed

+86
-44
lines changed

15 files changed

+86
-44
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 3.1.0 - 2021-02-21
9+
10+
### Changed
11+
12+
- Improved logging and error messages in case shader compilation fails
13+
- Population weight was changed from an integer to a decimal number for more granular control
14+
815
## 3.0.0 - 2021-02-21
916

1017
### Added

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Here are some general settings for the whole simulation.
5757
HaloRay allows you to simulate multiple different ice crystal populations
5858
simultaneously. You give each population a name for easier reference by typing
5959
in the **Crystal population** dropdown menu. Each population has a relative
60-
weight, which can be changed by adjusting the **Population weight** spin box.
61-
For example, giving weights 1 and 3 to two crystal populations respectively
60+
weight, which can be changed by adjusting the **Population weight** slider.
61+
For example, giving weights 1.0 and 3.0 to two crystal populations respectively
6262
would trace three times as many rays through the latter population than the
6363
former. It is also possible to enable or disable a crystal population
6464
temporarily with the **Population enabled** checkbox.

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.0.0-{build}"
1+
version: "3.1.0-{build}"
22
branches:
33
only:
44
- master
@@ -24,6 +24,6 @@ deploy:
2424
description: ""
2525
skip_tags: true
2626
auth_token:
27-
secure: pb9keaNklmNgmLaw1doReZDdP5Oh/pLZPdwjt+anpcoi34MyqAbFoJbiHJMcWkgD
27+
secure: qxadIRLRDKo8Tji0y+kZ03BIbNPJzdmp2HkzE6+G5lp1xtRCoeSpp6c4m4KU99D4
2828
on:
2929
branch: master

src/haloray-core/gui/crystalSettingsWidget.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ CrystalSettingsWidget::CrystalSettingsWidget(CrystalModel *model, QWidget *paren
5353
m_mapper->addMapping(m_lowerApexAngleSpinBox, CrystalModel::LowerApexAngle);
5454
m_mapper->addMapping(m_lowerApexHeightAverageSlider, CrystalModel::LowerApexHeightAverage);
5555
m_mapper->addMapping(m_lowerApexHeightStdSlider, CrystalModel::LowerApexHeightStd);
56-
m_mapper->addMapping(m_weightSpinBox, CrystalModel::PopulationWeight);
56+
m_mapper->addMapping(m_weightSlider, CrystalModel::PopulationWeight);
5757
m_mapper->addMapping(m_populationEnabledCheckBox, CrystalModel::Enabled);
5858
m_mapper->addMapping(m_populationComboBox, CrystalModel::PopulationName, "currentText");
5959
for (auto i = 0; i < 6; ++i)
@@ -69,7 +69,7 @@ CrystalSettingsWidget::CrystalSettingsWidget(CrystalModel *model, QWidget *paren
6969
to the submit slot of the mapper.
7070
*/
7171
connect(m_populationEnabledCheckBox, &QCheckBox::toggled, m_mapper, &QDataWidgetMapper::submit, Qt::QueuedConnection);
72-
connect(m_weightSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), m_mapper, &QDataWidgetMapper::submit, Qt::QueuedConnection);
72+
connect(m_weightSlider, &SliderSpinBox::valueChanged, m_mapper, &QDataWidgetMapper::submit, Qt::QueuedConnection);
7373
connect(m_caRatioSlider, &SliderSpinBox::valueChanged, m_mapper, &QDataWidgetMapper::submit, Qt::QueuedConnection);
7474
connect(m_caRatioStdSlider, &SliderSpinBox::valueChanged, m_mapper, &QDataWidgetMapper::submit, Qt::QueuedConnection);
7575
connect(m_tiltDistributionComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), m_mapper, &QDataWidgetMapper::submit, Qt::QueuedConnection);
@@ -199,9 +199,7 @@ void CrystalSettingsWidget::setupUi()
199199

200200
m_lowerApexHeightStdSlider = new SliderSpinBox(0.0, 5.0);
201201

202-
m_weightSpinBox = new QSpinBox();
203-
m_weightSpinBox->setMinimum(0);
204-
m_weightSpinBox->setMaximum(10000);
202+
m_weightSlider = new SliderSpinBox(0.0, 20.0);
205203

206204
for (auto i = 0; i < 6; ++i)
207205
{
@@ -221,7 +219,7 @@ void CrystalSettingsWidget::setupUi()
221219
auto populationSettingsLayout = new QFormLayout(populationSettingsWidget);
222220
populationSettingsLayout->addRow(populationManagementLayout);
223221
populationSettingsLayout->addRow(tr("Population enabled"), m_populationEnabledCheckBox);
224-
populationSettingsLayout->addRow(tr("Population weight"), m_weightSpinBox);
222+
populationSettingsLayout->addRow(tr("Population weight"), m_weightSlider);
225223
mainLayout->addWidget(populationSettingsWidget);
226224

227225
mainLayout->addWidget(tabWidget);

src/haloray-core/gui/crystalSettingsWidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CrystalSettingsWidget : public CollapsibleBox
6464

6565
SliderSpinBox *m_prismFaceDistanceSliders[6];
6666

67-
QSpinBox *m_weightSpinBox;
67+
SliderSpinBox *m_weightSlider;
6868

6969
CrystalModel *m_model;
7070
QDataWidgetMapper *m_mapper;

src/haloray-core/gui/models/crystalModel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ bool CrystalModel::setData(const QModelIndex &index, const QVariant &value, int
147147
crystal.lowerApexHeightStd = value.toFloat();
148148
break;
149149
case PopulationWeight:
150-
m_crystals->setWeight(row, value.toUInt());
150+
m_crystals->setWeight(row, value.toDouble());
151151
break;
152152
case PopulationName:
153153
m_crystals->setName(row, value.toString().toStdString());
@@ -197,7 +197,7 @@ void CrystalModel::addRow(CrystalPopulationPreset preset)
197197
endInsertRows();
198198
}
199199

200-
void CrystalModel::addRow(CrystalPopulation population, unsigned int weight, QString name)
200+
void CrystalModel::addRow(CrystalPopulation population, double weight, QString name)
201201
{
202202
auto row = m_crystals->getCount();
203203
beginInsertRows(QModelIndex(), row, row);

src/haloray-core/gui/models/crystalModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CrystalModel : public QAbstractTableModel
5454
Qt::ItemFlags flags(const QModelIndex &index) const override;
5555

5656
void addRow(CrystalPopulationPreset preset = CrystalPopulationPreset::Random);
57-
void addRow(CrystalPopulation population, unsigned int weight, QString name);
57+
void addRow(CrystalPopulation population, double weight, QString name);
5858
bool removeRow(int row);
5959
void clear();
6060
void setName(int row, QString name);

src/haloray-core/gui/openGLWidget.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,18 @@ void OpenGLWidget::initializeGL()
6767

6868
int maxComputeGroups;
6969
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &maxComputeGroups);
70+
qInfo("Maximum supported number of compute shader workgroups: %i", maxComputeGroups);
7071
const int absoluteMaxRaysPerFrame = 5000000;
7172
int maxRaysPerFrame = std::min(absoluteMaxRaysPerFrame, maxComputeGroups);
7273
m_viewModel->setRaysPerFrameUpperLimit(maxRaysPerFrame);
74+
75+
int maxWorkGroupSizeX;
76+
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &maxWorkGroupSizeX);
77+
int maxWorkGroupSizeY;
78+
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &maxWorkGroupSizeY);
79+
int maxWorkGroupSizeZ;
80+
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &maxWorkGroupSizeZ);
81+
qInfo("Maximum supported compute shader workgroup size: %i, %i, %i", maxWorkGroupSizeX, maxWorkGroupSizeY, maxWorkGroupSizeZ);
7382
}
7483

7584
void OpenGLWidget::mousePressEvent(QMouseEvent *event)

src/haloray-core/gui/stateSaver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ void StateSaver::LoadState(QString filename, SimulationStateModel *simState, Cry
9696
{
9797
settings.setArrayIndex(i);
9898
auto pop = CrystalPopulation::createRandom();
99-
unsigned int weight = settings.value("Weight", 1).toUInt();
10099
pop.enabled = settings.value("Enabled", pop.enabled).toBool();
101100

102101
pop.caRatioAverage = settings.value("CaRatioAverage", pop.caRatioAverage).toFloat();
@@ -119,6 +118,7 @@ void StateSaver::LoadState(QString filename, SimulationStateModel *simState, Cry
119118
pop.lowerApexHeightStd = settings.value("LowerApexHeightStd", pop.lowerApexHeightStd).toFloat();
120119

121120
auto name = settings.value("Name", "Default name").toString();
121+
double weight = settings.value("Weight", 1.0).toDouble();
122122

123123
crystalModel->addRow(pop, weight, name);
124124
}

src/haloray-core/opengl/textureRenderer.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "textureRenderer.h"
22
#include <memory>
33
#include <string>
4+
#include <QtGlobal>
45
#include <stdexcept>
56

67
namespace OpenGL
@@ -9,11 +10,25 @@ namespace OpenGL
910
std::unique_ptr<QOpenGLShaderProgram> TextureRenderer::initializeTexDrawShaderProgram()
1011
{
1112
auto program = std::make_unique<QOpenGLShaderProgram>();
12-
program->addCacheableShaderFromSourceFile(QOpenGLShader::ShaderTypeBit::Vertex, ":/shaders/renderer.vert");
13-
program->addCacheableShaderFromSourceFile(QOpenGLShader::ShaderTypeBit::Fragment, ":/shaders/renderer.frag");
13+
bool vertexShaderCompilationSucceeded = program->addCacheableShaderFromSourceFile(QOpenGLShader::ShaderTypeBit::Vertex, ":/shaders/renderer.vert");
14+
15+
if (vertexShaderCompilationSucceeded == false)
16+
{
17+
qWarning("Texture renderer vertex shader compilation failed");
18+
throw std::runtime_error(program->log().toUtf8());
19+
}
20+
21+
bool fragmentShaderCompilationSucceeded = program->addCacheableShaderFromSourceFile(QOpenGLShader::ShaderTypeBit::Fragment, ":/shaders/renderer.frag");
22+
23+
if (fragmentShaderCompilationSucceeded == false)
24+
{
25+
qWarning("Texture renderer fragment shader compilation failed");
26+
throw std::runtime_error(program->log().toUtf8());
27+
}
1428

1529
if (program->link() == false)
1630
{
31+
qWarning("Texture renderer shader linking failed");
1732
throw std::runtime_error(program->log().toUtf8());
1833
}
1934

0 commit comments

Comments
 (0)