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
194 changes: 190 additions & 4 deletions PARITY.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions TICKETS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,43 @@ Requests waiting or in progress, newest detail kept. Move to Done with the date
- C++ plug-in kit (agent).

## Waiting
- Viewport reflections and refraction (#302, 25/11/2026): screen-space reflections for objects, a mirrored draw for the
widest flat ground mesh, roughness blur, and glass read from a behind-glass draw. Left: a reflection of something the
view does not show falls back to the sky; only the widest flat mesh at the world's ground is mirrored; no
transmission depth (the lookup distance stands in, and the glass is bent as a lens rather than traced through its
back faces); the sky dome is not drawn as the viewport's background; the viewport frames about 12% tighter than the
Render View at the same focal length; and Harold reflects one large single-face floor onto itself, so the parity
floors are subdivided. The suite and its capture steps are in `tools/render_parity/README.md`. 25/11/2026: the
reflection gather is a low-passed mip chain with a fixed disc and outlier clamp, and the planar and screen-space
tiers share a brightness and blur with weights that sum to one. 26/11/2026: the planar pass now mirrors the models
about the floor's top plane with the main camera and lights, shades them with the real model's normals, and the
composite uses the planar image's alpha rather than its lightness, so the mirror is a complete lit sphere anchored
under the real one at the shot, low, high and off-axis views instead of a black crescent away from the shot camera.
26/11/2026: the bounce light clamps its ray radiance, decorrelates its sequence and is low-passed along each axis in
its own quad passes before the picture reads it, and the reflection gather starts from a half-resolution mip instead
of an eighth with linear planar sampling; the square texels are gone in every bounce/reflection combination and the
mirrored edge is smooth. `modelEditor -bounceLight` and `-ambientOcclusion` drive the two lighting toggles from
scripts. The shape follows EEVEE: a full-viewport planar probe with its own depth, a `select_probe`-style normal
score, planar/alpha coverage, a roughness-to-level prefiltered gather, and a filtered screen-space irradiance field
for the bounce instead of raw stochastic samples. Left of that design: EEVEE's world clip plane at the probe's plane
(the suite's geometry never crosses it) and temporal reprojection of the indirect term.
- Point-light shadows and glass (#302, 26/11/2026): the cube path now has a slope-scaled depth slack and fixed
bilinear taps instead of one texel (a 4 by 4 grid for a point light, a sixteen-tap disc for an area light), and
transmissive shapes no longer cast an opaque shadow, so the
dielectric_glass floor's blocky glass shadows and the black glass behind them are gone; the glass keeps a floor of
its own colour where the background is dark. Verified far, mid and close, two angles each, and grazing; the far
view is clean. Left: the glass refraction is still a lens-bend approximation, so its transparency is flatter than
the Render View's, and a point light's shadow is still small-penumbra because the light has no size.
- Realtime motion polish (#302, 26/11/2026): `tools/render_parity/motion_capture.py` checks one session with every
feature on over an orbit, a dolly, a low terminator sweep and twelve still frames. The bounce, reflection and AO
terms are temporally stable (still frames are bit-identical, no frame-diff spikes) and show no speckle or tier pop.
Pass one widened the shadow map's PCF to 5 by 5 with a bilinear sampler, which softens the cast edge that crawled
at close range. Pass two re-ran all four captures from a fresh session: every frame was bit-identical to pass one's
and the contact shadow stayed attached, so nothing remained to fix. Left: a one-pixel MSAA rim on a silhouette, the grid's smooth lines reading over a sphere at
grazing angles, and the reflection's sharp horizon on a smooth sphere, which is the scene's own image.
Left: the sky dome is still not drawn as the viewport's background, the viewport frames about 12% tighter than the
Render View, only the widest flat ground mesh is mirrored, and a point light close to a large floor can leave a cube
shadow seam.
- Script Editor completion (25/11/2026): the feature is in (PARITY.md, docs/SCRIPT_EDITOR_COMPLETION.md). Left: object
path completion; a Quick Help side bar; completion across a multi-line expression; type inference for an arbitrary
expression before a dot; docstrings for the Python API's members, which the embedded modules do not carry;
Expand Down
39 changes: 37 additions & 2 deletions app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
#include "widgets.h"
#include <QCommandLineParser>
#include <QFile>
#include <QImage>
#include <QScreen>
#include <QJsonObject>
#include <QJsonDocument>
#include <QPalette>
#include <QStyleFactory>
#include <QTimer>
#include "viewport.h"
#ifdef Q_OS_WIN
#include <windows.h>
#endif
Expand Down Expand Up @@ -130,9 +133,11 @@ int main(int argc, char** argv) {
args.addHelpOption();
QCommandLineOption script({"s", "script"}, "Run a MEL file at start.", "file");
QCommandLineOption shot("screenshot", "Save a screenshot of the window after start-up and quit.", "png");
QCommandLineOption viewport("viewport-screenshot", "Save the first visible viewport after start-up and quit.", "png");
QCommandLineOption batch("batch", "No window: run the scene and scripts given, then exit with their status.");
args.addOption(script);
args.addOption(shot);
args.addOption(viewport);
args.addOption(batch);
args.addPositionalArgument("scene", "Scene to open.");
args.process(app);
Expand All @@ -156,11 +161,15 @@ int main(int argc, char** argv) {
aztek_set_main_window(static_cast<QMainWindow*>(&w));
// The saved size and panels before the window is shown. Restoring them after show resized the window under the splash,
// and under XWayland on a scaled screen the parts drawn at the old size stayed on screen (#225).
if (!args.isSet(shot)) w.restore_saved_window();
if (!args.isSet(shot) && !args.isSet(viewport)) w.restore_saved_window();
// A viewport capture is compared with a render frame: a fixed window keeps its size the same every time.
if (args.isSet(viewport)) w.resize(1280, 800);
// Keep the viewport hidden while the first-run dialog processes events. On macOS, presenting a frame here can
// block the dialog while Metal waits for a drawable. Script and screenshot runs skip the prompt.
if (!args.isSet(script) && !args.isSet(shot)) az::ask_user_folder_at_first_start(&w, splash);
if (!args.isSet(script) && !args.isSet(shot) && !args.isSet(viewport)) az::ask_user_folder_at_first_start(&w, splash);
w.show();
// A parity capture is one view, made before the start-up script so the script's lookThru reaches it.
if (args.isSet(viewport)) w.panels()->set_layout(0);
if (splash) {
splash->finish(&w);
delete splash;
Expand All @@ -174,6 +183,32 @@ int main(int argc, char** argv) {
aztek_startup_scripts();
if (!args.positionalArguments().isEmpty()) w.open_file(args.positionalArguments().first());
w.run_startup(args.value(script), args.value(shot));
if (!args.value(viewport).isEmpty()) {
const QString path = args.value(viewport);
QTimer::singleShot(1500, &w, [&w, path] {
for (az::ViewportWidget* v : w.panels()->views()) {
if (!v->isVisible()) continue;
// A parity capture is the picture alone: the Realtime renderer, no grid over it.
v->set("renderer", "\"realtime\"");
v->set("grid", "false");
v->set("viewCubeVisible", "false");
// The picture alone: no light or camera icons, handles or selection highlights over it. Textures show,
// as the Render View draws them.
v->set("disp", "{\"lights\":false,\"cameras\":false,\"manipulators\":false,\"highlight\":false,\"filmGate\":false,\"resGate\":false,\"safeAction\":false,\"textured\":true,\"depthOfField\":true}");
// The Render View clears to black; the viewport's own background is grey, so a parity capture clears to
// black too.
v->set("background", "0.0");
// The host writes a PPM; the picture is kept as the format the path names.
QString tmp = path + ".ppm";
if (v->capture(tmp)) {
QImage(tmp).save(path);
QFile::remove(tmp);
}
break;
}
qApp->quit();
});
}
int rc = app.exec();
aztek_exiting();
return rc;
Expand Down
Loading
Loading