Fullframe compositor: unify behavior of size inference with realtime-compositor #114755
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114755
Loading…
Reference in New Issue
No description provided.
Delete Branch "zazizizou/blender:com-unify-size-inference"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make size inference consistent with the viewport compositor (from a user's perspective). This patch uses constat folding to create a constant output out of constant inputs. This is consistent with the results of the realtime compositor.
Example with translate node:
Notice how previously the translate node infers its cavas size from the viewer node first, and then applies translation. Now, since the input is constant there is no translation to be made, and the final render result is therefore not translated. This applies to all other nodes included in this patch.
Following nodes are not included in this patch because they need further refactoring or discussion:
@blender-bot build
Such constant folding only happens when the values are known at compile-time, correct?
So if a single value is computed at runtime, from a reduction operation like the Levels node, the behavior will revert to its original method, right?
Constant folding of the node graph happens every time
COM_execute()
gets called. It replaces operations such asTranslateOperation
withConstantOperation
at runtime, right after building the graph when all inputs are constant. Here constant means the input (and therefore output) does not vary across xy-coordinates.The interesting function is
ConstantOperation *ConstantFolder::fold_operation(NodeOperation *operation)
inCOM_ConstantFolder.cc
All unit tests are passing for this patch so the current behavior, where an image input is connected to the node, remains the same.
By compile time, I meant the node tree conversion to operations. Does it work as expected when using the Levels node as I mentioned?
Not sure if this answers your question, but levels is not included in this patch, so when connected to an image it will behave as before, but when it's input is not connected to an input it will behave like the realtime compositor when connected to a translate node:
connected:
not connected:
I am talking about this setup. The Levels node outputs a single value, yet, it is treated as an image by the translate node. So my point is that constant folding can't really be used to achieve that behavior in all cases. Or maybe I misunderstand your intention, what do you think?
That's the setup I tried to demonstrate in my previous post. For some reason images are not showing properly...
I don't think we can cover that case using the way constant folding is implemented now, but I think it should be possible to achieve the result we want with a relatively small change, e.g. by adding a dummy constant operation between
CalculateMeanOperation
and output of Levels node, or by supporting non-constant input and constant output inConstantFolder
. I haven't looked much into that yet.This patch includes only the straightforward nodes where only one line of code is needed. I plan to unify the behavior of the rest in separate patches, though I am not sure constant folding is the way to go for all the other nodes
I am generally skeptical about the existence of constant folding for the compositor, but I can accept it for now. Just one question, does it make sense to set
can_be_constant
to true by default and instead exempt nodes from constant folding?That could work too, I was hoping this way shows the behavior more explicitly in operations. I don't have a strong opinion though, either way is fine for me.
I think we should go with that route, since our target is that all nodes could produce constant values.
Ideally we shouldn't need that flag at all, since all operations can be constant, and the flag
is_constant_operation
exists for operations that are definately constant.I will refactor in a later patch.