Activity › Forums › Adobe After Effects › Add mode and 32 bit
-
Conrad Olson
October 25, 2013 at 10:04 pmI’ve never had issues using Screen in Nuke with values greater than 1 (assuming we don’t have negative values), and we always work floating point.
—
-
Walter Soyka
October 25, 2013 at 10:23 pmI just looked up the math, and it turns out that Nuke’s screen is non-traditional. Interesting!
Apparently Nuke does not use 1 – ((1-a) * (1-b)) for screen; instead, Nuke uses max(max(a,b), a+b-ab).
This protects against errors over 1, but introduces the possibility of clipping the low end.
Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog – What I’m thinking when my workstation’s thinking
Creative Cow Forum Host: Live & Stage Events -
Todd Kopriva
October 27, 2013 at 1:10 amIf you want us to consider changing the behavior (e.g., by adding an additional blending mode that behaves the way that Nuke’s Add does), let us know with a feature request:
https://www.adobe.com/go/wish> I’m EMMY Nominated for Boardwalk Empire. There is nothing whacky in my project settings.
I didn’t realize that an Emmy nomination conferred infallibility. 😉
———————————————————————————————————
Todd Kopriva, Adobe Systems Incorporated
After Effects quality engineering
After Effects team blog
——————————————————————————————————— -
G. scott Scribner
October 28, 2013 at 6:16 pmYes, nominated, didn’t win … I was just trying to quickly say I know AE well. I rarely work in 32bit though, which is why I didn’t remember that 32bit clip option. I didn’t really know what it did before so I learned something here. Once I understood, it makes sense.
Say, if you’re actually taking feature requests I have a bunch. You guys came to visit one day, asked me give you my list, then left … didn’t seem like you actually wanted to read it. If you do, I will send it.
-
Walter Soyka
October 28, 2013 at 6:16 pm[Walter Soyka] “Apparently Nuke does not use 1 – ((1-a) * (1-b)) for screen; instead, Nuke uses max(max(a,b), a+b-ab). This protects against errors over 1, but introduces the possibility of clipping the low end.”
I presented this last week without explanation. I’ll dive in and show how you can do this in After Effects.
Here’s a screen blend in action:
To perform Screen blending, you invert both inputs, multiply them together, then invert the result:
a and b are our inputs. To invert something — that is, to pivot the whole thing around middle gray (0.5), making white (1) into black (0), and black (0) into white (1), and also remapping all intermediate shades of gray, we can simply subtract the value of the input from white (1).
Inverting white (1-1) gives us black (0). Inverting black (1-0) gives us white (1). Inverting middle gray (1-0.5) gives us middle gray (0.5). Inverting a dark gray (1-0.25) will give us a light gray (0.75).
So, again, we invert both inputs a and b, giving us (1-a) and (1-b) to start with.
Then we multiply these together:
(1-a) * (1-b).Then we invert the result — that is, subtract it from 1:
1 - ( (1-a)*(1-b) )We can build a screen in Ae with a few invert effects and the multiply blend mode:
If you go back to high school algebra, you may remember the technique for binomial multiplication: FOIL (first, outer, inner, last). Although our screen formula explains very clearly what it’s doing, we can simplify it a bit mathematically.
1 - ( (1-a)*(1-b) )
1 - ( 1 - b - a + ab )
1 - 1 + b + a - ab
a+b-abThat a+b-ab should be familiar — it’s in the Nuke math I mentioned above. Let’s look at the Nuke Screen math again:
max(max(a,b), a+b-ab)The max function means “take the larger of two values.” So the Nuke Screen mode translates to English as follows: Take the larger of the larger of a and b and the result of a classic Screen.
More simply put, perform a classic screen, but if either input is brighter, use that instead.
There’s already a simple max function in Ae — it’s the Lighten blend mode. That means we can roll our own Nuke-style Screen, by Screening A over B, then Lightening A and Lightening B over the results:
Using Lighten like this will preserve overbrights in float, but it will clip superblacks in one input if there is regular black (0) in the other, because max(0,-whatever) is always 0. You could use this double Lighten trick with the Add mode in float, too, to preserve overbrights and prevent subtraction on negative values.
Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog – What I’m thinking when my workstation’s thinking
Creative Cow Forum Host: Live & Stage Events -
Todd Kopriva
October 28, 2013 at 7:19 pm> Say, if you’re actually taking feature requests I have a bunch. You guys came to visit one day, asked me give you my list, then left … didn’t seem like you actually wanted to read it. If you do, I will send it.
We’re always taking feature requests. Send them here:
https://www.adobe.com/go/wish———————————————————————————————————
Todd Kopriva, Adobe Systems Incorporated
After Effects quality engineering
After Effects team blog
——————————————————————————————————— -
William Chang
January 25, 2023 at 3:55 amIt’s totally insane how much this thread and your eventual solution has helped me solve this very same issue 10 years later. Thank you
Reply to this Discussion! Login or Sign Up



