nvidia fix, soft shadows

This commit is contained in:
2023-02-13 18:35:25 +03:00
parent c8dcd5e9c0
commit 36540468dc
17 changed files with 358 additions and 107 deletions

View File

@@ -30,12 +30,15 @@ ViewEditor::ViewEditor(QWidget * parent): QWidget(parent) {
ui->setupUi(this);
ui->scrollArea->viewport()->setAutoFillBackground(false);
ui->scrollAreaWidgetContents->setAutoFillBackground(false);
view = nullptr;
active = true;
ui->checkCameraLight->setCheckState(Qt::PartiallyChecked);
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
ui->spinDepthStart->setStepType(QAbstractSpinBox::AdaptiveDecimalStepType);
#endif
for (int i = 6; i <= 13; ++i) {
QSize sz(pow2(i), pow2(i));
ui->comboMapSizeTexture->addItem(QString::number(sz.width()), sz);
ui->comboMapSizeShadow->addItem(QString::number(sz.width()), sz);
}
}
@@ -45,8 +48,8 @@ void ViewEditor::assignQGLView(QGLView * v) {
active = false;
ui->spinFOV->setValue(view->FOV());
ui->spinDepthStart->setValue(view->depthStart());
ui->groupHoverHalo->setChecked(view->isHoverHaloEnabled());
ui->groupSelectionHalo->setChecked(view->isSelectionHaloEnabled());
ui->checkHoverHalo->setChecked(view->isHoverHaloEnabled());
ui->checkSelectionHalo->setChecked(view->isSelectionHaloEnabled());
ui->spinHoverHaloFill->setValue(view->hoverHaloFillAlpha());
ui->spinSelectionHaloFill->setValue(view->selectionHaloFillAlpha());
ui->colorHoverHalo->setColor(view->hoverHaloColor());
@@ -61,6 +64,18 @@ void ViewEditor::assignQGLView(QGLView * v) {
ui->colorFogBack->setColor(view->fogColor());
ui->spinFogDecay->setValue(view->fogDecay());
ui->spinFogDensity->setValue(view->fogDensity());
ui->checkSoftShadows->setChecked(view->softShadows());
ui->spinSoftShadowSamples->setValue(view->softShadowsSamples());
auto setMapSize = [](QComboBox * combo, QSize sz) {
for (int i = 0; i < combo->count(); ++i) {
if (combo->itemData(i).toSize() == sz) {
combo->setCurrentIndex(i);
break;
}
}
};
setMapSize(ui->comboMapSizeTexture, view->textureMapSize());
setMapSize(ui->comboMapSizeShadow, view->shadowMapSize());
active = true;
}
@@ -99,13 +114,20 @@ void ViewEditor::on_comboViewRenderMode_currentIndexChanged(int val) {
}
void ViewEditor::on_groupHoverHalo_clicked(bool val) {
void ViewEditor::on_groupHalos_clicked(bool val) {
if (!view || !active) return;
view->setHoverHaloEnabled(val && ui->checkHoverHalo->isChecked());
view->setSelectionHaloEnabled(val && ui->checkSelectionHalo->isChecked());
}
void ViewEditor::on_checkHoverHalo_clicked(bool val) {
if (!view || !active) return;
view->setHoverHaloEnabled(val);
}
void ViewEditor::on_groupSelectionHalo_clicked(bool val) {
void ViewEditor::on_checkSelectionHalo_clicked(bool val) {
if (!view || !active) return;
view->setSelectionHaloEnabled(val);
}
@@ -201,6 +223,30 @@ void ViewEditor::on_spinFogDecay_valueChanged(double arg1) {
}
void ViewEditor::on_comboMapSizeTexture_currentIndexChanged(int index) {
if (!view || !active) return;
view->setTextureMapSize(ui->comboMapSizeTexture->itemData(index).toSize());
}
void ViewEditor::on_comboMapSizeShadow_currentIndexChanged(int index) {
if (!view || !active) return;
view->setShadowMapSize(ui->comboMapSizeShadow->itemData(index).toSize());
}
void ViewEditor::on_checkSoftShadows_clicked(bool arg1) {
if (!view || !active) return;
view->setSoftShadows(arg1);
}
void ViewEditor::on_spinSoftShadowSamples_valueChanged(double arg1) {
if (!view || !active) return;
view->setSoftShadowsSamples(arg1);
}
void ViewEditor::on_checkVSync_clicked(bool val) {
if (!view || !active) return;
view->setVSync(val);