Scalar Group Node Output is One Pixel Large #48297

Open
opened 2016-04-28 07:07:06 +02:00 by Sofus Rose · 14 comments

System Information
uname -r: 4.3.0-1-amd64
Debian 8 testing (sid)

Blender Version
Broken: 2.77a (official tar'ed build from blender.org)

Short description of error
My compositing node system relies extensively on nodegroups, sometimes nested several layers deep. Sometimes, these nodegroups need to process not a bitmap, but simply an individual scalar value - which might be inputted using the RGB node, or the Value node. It's when outputting a scalar from a nodegroup that it breaks; the output value is a bitmap that is one pixel large.

I suspect that any person or studio interested in creating a nested node system for their own ease of use will run into this issue!

Exact steps for others to reproduce the error

  1. Load compositing scene.

  2. Create 2 Math nodes. Put each in its own nodegroup.

  3. Let each nodegroup have one input and one output, passing through the Math node's first input within each group. In both cases set the Math node to Multiply, and the second input to 1.

  4. Pass in the value 1 for the first nodegroup, and let the output of nodegroup 1 become the input of nodegroup 2.

  5. Find any image, and plug it into the first input of a color Multiply node. In input 2, plug in the output of nodegroup 2.

  6. Notice as a single pixel in the image remains unchanged, as the rest of the image becomes black.

I attached screenshots to better illustrate the setup:

Screenshot from 2016-04-28 01-04-01.png
Screenshot from 2016-04-28 01-04-04.png
Screenshot from 2016-04-28 01-06-48.png

**System Information** uname -r: 4.3.0-1-amd64 Debian 8 testing (sid) **Blender Version** Broken: 2.77a (official tar'ed build from blender.org) **Short description of error** My compositing node system relies extensively on nodegroups, sometimes nested several layers deep. Sometimes, these nodegroups need to process not a bitmap, but simply an individual scalar value - which might be inputted using the RGB node, or the Value node. It's when outputting a scalar from a nodegroup that it breaks; the output value is a bitmap that is one pixel large. I suspect that any person or studio interested in creating a nested node system for their own ease of use will run into this issue! **Exact steps for others to reproduce the error** 1. Load compositing scene. 2. Create 2 Math nodes. Put each in its own nodegroup. 3. Let each nodegroup have one input and one output, passing through the Math node's first input within each group. In both cases set the Math node to Multiply, and the second input to 1. 4. Pass in the value 1 for the first nodegroup, and let the output of nodegroup 1 become the input of nodegroup 2. 5. Find any image, and plug it into the first input of a color Multiply node. In input 2, plug in the output of nodegroup 2. 6. Notice as a single pixel in the image remains unchanged, as the rest of the image becomes black. I attached screenshots to better illustrate the setup: ![Screenshot from 2016-04-28 01-04-01.png](https://archive.blender.org/developer/F307366/Screenshot_from_2016-04-28_01-04-01.png) ![Screenshot from 2016-04-28 01-04-04.png](https://archive.blender.org/developer/F307365/Screenshot_from_2016-04-28_01-04-04.png) ![Screenshot from 2016-04-28 01-06-48.png](https://archive.blender.org/developer/F307371/Screenshot_from_2016-04-28_01-06-48.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Darkfie9825

Added subscriber: @Darkfie9825

#93013 was marked as duplicate of this issue

#93013 was marked as duplicate of this issue

Added subscriber: @mont29

Added subscriber: @mont29

Huummm, seems to have been solved since 2.77a? I cannot confirm that with latest master here, please try the latest build from our buildbot. Otherwise, please attach a .blend, much simpler for us to reproduce and investigate.

Huummm, seems to have been solved since 2.77a? I cannot confirm that with latest master here, please try the latest build from [our buildbot](https://builder.blender.org/download). Otherwise, please attach a .blend, much simpler for us to reproduce and investigate.
Author

Aha! It's a bug with the Buffer Groups option! Bug hunting is fun...

I'll provide a blend:

bug.blend

Turn off Buffer Groups and recomposite, and it'll work perfectly. Turn it back on, and there'll be a single pixel glaring at you!

I tested this with the latest (4AM) build as well; the bug persists.

Aha! It's a bug with the **Buffer Groups** option! Bug hunting is fun... I'll provide a blend: [bug.blend](https://archive.blender.org/developer/F308113/bug.blend) Turn off Buffer Groups and recomposite, and it'll work perfectly. Turn it back on, and there'll be a single pixel glaring at you! I tested this with the latest (4AM) build as well; the bug persists.

Added subscriber: @Sergey

Added subscriber: @Sergey
Jeroen Bakker was assigned by Sergey Sharybin 2016-05-03 15:24:07 +02:00

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker

@Jeroen-Bakker, there are two issues here:

  1. The one which is reported in this repot
  2. If you ungroup second group, then you'll have some nasty race conditions between group buffer read and write operations, causing wrong compo results.

First issue is probably not so hard, but second one i couldn't really fix today and wouldn't mind having some debuging from you ;)

@Jeroen-Bakker, there are two issues here: 1. The one which is reported in this repot 2. If you ungroup second group, then you'll have some nasty race conditions between group buffer read and write operations, causing wrong compo results. First issue is probably not so hard, but second one i couldn't really fix today and wouldn't mind having some debuging from you ;)
Member

Issue seems likely to be caused by ##MathBaseOperation::determineResolution##
it first checks if there are is a connection what can be marked as being important. This is done by determining the resolution with using a dummy preferred resolution of ##(0,0)##.

The Multiply node caches this resolution for next calls. and therefore also returns this. When ##0,0## is returned it is set to ##1,1## by ##WriteBufferOperation::determineResolution##

When commenting out the code at ##MathBaseOperation::determineResolution## the issue is solved, but it impacts the functionality of the node (determining the right output resolution). We need to see how we can really check what path determines the correct output resolution.

This part is also implemented by the ##MixBaseOperation##. Could not find other nodes with this implementation.

We propose that we add a boolean to the ##NodeOperation::determineResolution## method ##bool cache=true##. In the ##MixBaseOperation## and the ##MathBaseOperation## we set cache to false. This way we get the answer we want without influencing the rest of the system. Also need to change the setResolution for this one.

@Sergey, what do you think about this solution?

Issue seems likely to be caused by ##MathBaseOperation::determineResolution## it first checks if there are is a connection what can be marked as being important. This is done by determining the resolution with using a dummy preferred resolution of ##(0,0)##. The Multiply node caches this resolution for next calls. and therefore also returns this. When ##0,0## is returned it is set to ##1,1## by ##WriteBufferOperation::determineResolution## When commenting out the code at ##MathBaseOperation::determineResolution## the issue is solved, but it impacts the functionality of the node (determining the right output resolution). We need to see how we can really check what path determines the correct output resolution. This part is also implemented by the ##MixBaseOperation##. Could not find other nodes with this implementation. We propose that we add a boolean to the ##NodeOperation::determineResolution## method ##bool cache=true##. In the ##MixBaseOperation## and the ##MathBaseOperation## we set cache to false. This way we get the answer we want without influencing the rest of the system. Also need to change the setResolution for this one. @Sergey, what do you think about this solution?

Not really fan of that. It's just some corner-case complication over the system which is already really unclear. Unless you can come up with really strict rule of how determineResolution() should behave, when to cache and when not i;m not really fan of such hacks.

Why can't we just change fallback resolution to (1, 1) ? Or if some nodes really don't need to cache resolution, overload their isResolutionSet()?

Also, be aware that resolution is is caching for a reason -- with a complex enough nodes setup it might take forever to calculate resolution, since this part of the code is actually an exponential complexity.

Not really fan of that. It's just some corner-case complication over the system which is already really unclear. Unless you can come up with really strict rule of how `determineResolution()` should behave, when to cache and when not i;m not really fan of such hacks. Why can't we just change fallback resolution to `(1, 1)` ? Or if some nodes really don't need to cache resolution, overload their `isResolutionSet()`? Also, be aware that resolution is is caching for a reason -- with a complex enough nodes setup it might take forever to calculate resolution, since this part of the code is actually an exponential complexity.

Added subscriber: @DoomScream

Added subscriber: @DoomScream

Removed subscriber: @DoomScream

Removed subscriber: @DoomScream
Jeroen Bakker was unassigned by Dalai Felinto 2019-12-23 16:37:08 +01:00
Member

Added subscribers: @RealJayJobes, @lichtwerk

Added subscribers: @RealJayJobes, @lichtwerk
Philipp Oeser removed the
Interest
VFX & Video
label 2023-02-10 09:32:15 +01:00
Sign in to join this conversation.
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
7 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#48297
No description provided.