Page MenuHome

Scalar Group Node Output is One Pixel Large
Open, Confirmed, MediumPublic

Description

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.
  1. 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:



Details

Type
Bug

Event Timeline

Sofus Rose (Darkfie9825) set Type to Bug.
Sofus Rose (Darkfie9825) created this task.
Sofus Rose (Darkfie9825) raised the priority of this task from to Needs Triage by Developer.
Bastien Montagne (mont29) triaged this task as Needs Information from User priority.

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.

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

I'll provide a 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.

Sergey Sharybin (sergey) raised the priority of this task from Needs Information from User to Confirmed, Medium.

@Jeroen Bakker (jbakker), 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 ;)

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 Sharybin (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.