WIP: do the 1/2 pixel translation only in RealizeOnDomainOperation #124841

Closed
Bill-Spitzak wants to merge 5 commits from Bill-Spitzak:resolveshift into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

If the input and output domains don't match even/odd parity of sizes, perform a 1/2 pixel shift so that there is no unexpected filtering.

This patch includes my fix for #124133

If the input and output domains don't match even/odd parity of sizes, perform a 1/2 pixel shift so that there is no unexpected filtering. This patch includes my fix for #124133
Bill-Spitzak added 5 commits 2024-07-17 06:35:16 +02:00
Previously there would always be a 1/2 pixel shift if the input and output
domains did not match even/odd sizes, this shift was always in the same
direction no matter which one was odd. All this made transforms somewhat
inaccurate and made viewport scaling look incorrect.
This changes the glsl realize_on_domain code to take a matrix that goes
directly between spaces where 0,0 is in the lower-left corner of the output
and input domains. Simplifies the math and allows more analysis to be done
of the transform.
Minor optimization. As the current filters are interpolating, if the samples
are all in the middle of the pixel and the derivative between samples is 1
then the Nearest filter can be used.
These are adjusted to match the locations used by the GPU compositor,
which I believe is correct. Mostly this means adding .5 to the output
point before the transform, and subtracting .5 to get the input point.

I also fixed the Scale Absolute bounding box to produce the requested
size. Rounding errors were causing it to produce larger sizes.

COM_Translate is unchanged as the position is correct. However it is
putting transparent rows of pixel on the bottom and left edges of the
output rather than the correct value, I was unable to figure out the
cause of this.
This is the transform that is automatically triggered when Domains
don't match. In this case the user probably is not expecting any
filtering due to pixel centers not aligning.

NYI for the CPU compositor.
Bill-Spitzak requested review from Omar Emara 2024-07-17 06:35:52 +02:00
Author
Contributor

I have been using it like this for a while and it seems to be working well.

I have been using it like this for a while and it seems to be working well.
Author
Contributor

I have merged this change into the main patch #124381 as that results in the minimal change of behavior.

I have merged this change into the main patch https://projects.blender.org/blender/blender/pulls/124381 as that results in the minimal change of behavior.
Bill-Spitzak closed this pull request 2024-07-19 22:49:00 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#124841
No description provided.