Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ __pycache__
build_verify
dist
node_modules
.obsidian
.obsidian
*.app
13 changes: 11 additions & 2 deletions atlas/application/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ Window::Window(const WindowConfiguration &config)
SDL_SetWindowAspectRatio(window, aspectRatio, aspectRatio);
}

this->renderScale = std::clamp(config.renderScale, 0.5f, 1.0f);
this->renderScale = std::clamp(config.renderScale, 0.25f, 1.0f);
this->ssaoRenderScale = std::clamp(config.ssaoScale, 0.25f, 1.0f);
this->useMultisampling = config.multisampling;
this->setEditorControlsEnabled(config.editorControls);
Expand Down Expand Up @@ -4056,7 +4056,7 @@ void Window::setWindowed(const WindowConfiguration &config) {
SDL_Window *window = this->windowRef;
int windowWidth = config.width;
int windowHeight = config.height;
this->renderScale = std::clamp(config.renderScale, 0.5f, 1.0f);
this->renderScale = std::clamp(config.renderScale, 0.25f, 1.0f);
this->ssaoRenderScale = std::clamp(config.ssaoScale, 0.25f, 1.0f);
this->useMultisampling = config.multisampling;
this->setEditorControlsEnabled(config.editorControls);
Expand Down Expand Up @@ -5679,6 +5679,15 @@ void Window::enablePathTracing() {
pathTracer->init();
}

void Window::configurePathTracing(int samplesPerPixel, int bounceLimit,
bool denoising, int accumulationFrames) {
if (pathTracer == nullptr) {
return;
}
pathTracer->configure(samplesPerPixel, bounceLimit, denoising,
accumulationFrames);
}

bool Window::setEditorPathTracingPreview(bool enabled) {
if (pathTracer == nullptr) {
return false;
Expand Down
6 changes: 5 additions & 1 deletion cli/src/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ ssr = false
ssr_quality = 1
ssr_debug = false
use_upscaling = true
upscaling_ratio = 0.5
upscaling_ratio = 0.67
samples_per_pixel = 4
max_bounces = 8
denoising = true
accumulation_frames = 512

[window]
dimensions = [1280, 720]
Expand Down
6 changes: 5 additions & 1 deletion editor/project/projectStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ QString projectConfig(const QString& name,
stream << "ssr_quality = 1\n";
stream << "ssr_debug = false\n";
stream << "use_upscaling = true\n";
stream << "upscaling_ratio = 0.5\n\n";
stream << "upscaling_ratio = 0.67\n";
stream << "samples_per_pixel = 4\n";
stream << "max_bounces = 8\n";
stream << "denoising = true\n";
stream << "accumulation_frames = 512\n\n";
stream << "[window]\n";
stream << "dimensions = [1280, 720]\n";
stream << "mouse_capture = false\n";
Expand Down
245 changes: 236 additions & 9 deletions editor/views/editor/editor.cpp

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions editor/views/editor/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,23 @@ void ViewportPanel::setPathTracingPreview(bool enabled) {
}
}

bool ViewportPanel::applyPathTracingSettings(
int samplesPerPixel, int bounceLimit, bool denoising,
int accumulationFrames, bool upscaling, float internalScale) {
if (runtimeContext == nullptr) {
return false;
}
frameTimer->stop();
const bool applied = runtimeContext->configurePathTracing(
samplesPerPixel, bounceLimit, denoising, accumulationFrames, upscaling,
internalScale);
const bool frameReady = applied && stepRuntime();
if (frameReady && isVisible()) {
frameTimer->start(pbrPreview ? 16 : 1);
}
return applied;
}

void ViewportPanel::setRuntimeControlMode(int mode) {
if (mode < 0 || mode > 3 || runtimeContext == nullptr) {
return;
Expand Down
Loading
Loading