Experimental (PoC): xBR/EPX brick filtering for the iso HD view#316
Draft
noctonca wants to merge 3 commits into
Draft
Experimental (PoC): xBR/EPX brick filtering for the iso HD view#316noctonca wants to merge 3 commits into
noctonca wants to merge 3 commits into
Conversation
…ent) At iso scale 2, filter the brick background with an edge-directed upscaler and composite it over the crisp scaled models at present time. Filter ladder on the `iso epx` console toggle: 0 off, 1 EPX-blend, 2 xBR, 3 xBR supersampled (SSAA). The brick layer is recovered by 2x-downscaling the cached Screen (the nearest-doubled native bricks) and refiltering, so there is no second AffGrille pass to corrupt render state. The composite runs as a scene-level present callback (new SetScenePresentCallback slot, under the console/touch overlays): brick pixels (Log==Screen) take the filtered RGB layer; model pixels are re-converted from Log through PtrPal, since the SDL paletteLUT misses the 216-255 range some objects use and they would otherwise present black. xBR and its YUV edge metric are written from the published algorithm, not ported. 2x interior only; experimental, off by default.
…xperiment Recover the native bricks by downscaling the zoomed Screen by the actual zoom factor (not a hard 2x), filter to 2x native, then bilinear-resample to the display. Zoom == 2 keeps the original direct path (bit-identical), and 3x/4x/etc now filter correctly too. Gate is IsoScale > ISO_SCALE_ONE in both the build and the present composite. Add docs/ISO_XBR_FILTERING.md recording the pipeline, the SDL paletteLUT 216-255 gap and the PtrPal fix, the headless-diagnosis notes, and the optimisation work (preserved on feat/iso-xbr-optimized) with its measured numbers, so it can be resumed later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status: experimental PoC, Draft, not for merge. Stacked on #314 (the iso view-scale foundation); the base will retarget to main if/when that lands. Sharing it so the approach and one engine finding are on record.
What it is
At an iso zoom (
iso scale > 1, from #314) the brick background is nearest-stretched and blocky. This filters that background with an edge-directed upscaler and composites it over the unscaled, crisp 3D models, so the floor and walls smooth out while characters and objects stay sharp.Console toggle (interior, zoom > 1):
How it works
Screenby the zoom factor (no secondAffGrillepass, which corrupts shared render state and makes moving objects draw black).Log == Screen) take the filtered RGB layer; model pixels are re-converted fromLogthroughPtrPal.xBR and its YUV edge metric here are written from the published algorithm, not ported.
One finding worth recording
Going RGB-at-present surfaced a pre-existing engine quirk: the SDL present palette misses the 216-255 range in iso scenes (those entries are black, while
PtrPalholds the real colours, e.g. the translucent ghost's blue). Anything using that range presents black even though it is correct inLog, and--screenshothides it entirely because it savesPtrPal-convertedLog. The composite works around it by re-converting model pixels throughPtrPal. Full write-up indocs/ISO_XBR_FILTERING.md.Scope and status
feat/iso-xbr-optimizedand documented for re-applying once the design settles.Not proposing this for merge.