Stencil error

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Peter Wassink
Posts: 4283
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Stencil error

Post by Peter Wassink »

This is another one of these issues that keeps manifesting itself.

it has to do with adding opacities along the antialiased edges of a mask
After aplying The layer stencil you are left with visible 'cracks'


if i have a single stencil layer
first i use it positive on a layer, resulting in the bottom black triangle(in my example)
then i use it negative mode, resulting in the top black triangle.

now you would expect, when both layers are on, that the result you get is 100% closed edges.... but they are not
the mask has Anti-Alias so i would think an edge pixel that f.i. is 20% translucent, will give me 20% black in the positve and 80% black in the negative.

I think the underlying problem is that when you add 80% opacity to a 20% opacity layer it does not add up to 100%.
stencil edges not perfect.jpg
stencil edges not perfect.jpg (55.32 KiB) Viewed 5128 times

this is the what the 'crack' looks like at 100%;
100% crack.jpg
100% crack.jpg (1.58 KiB) Viewed 5127 times
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Xavier
Posts: 1852
Joined: 01 Oct 2019, 11:08

Re: Stencil error

Post by Xavier »

So let me check if I understood properly : you would expect the layers to blend into one unique black square, is it correct ?

Or could we do try another way :
* what do you expect to get ?
* what is wrong in what you get currently ?
User avatar
Peter Wassink
Posts: 4283
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Stencil error

Post by Peter Wassink »

when i cut an image ( the black square) in half,
using a single (Anti-Aliased) Mask (the green triangle)
i expect that the two resulting halves perfectly line up.
And do not leave a hole between them (that thin white line you see in the bottom inage)
so... i expect the two masked out parts to combine back into a perfect black square

The mask itself does cut it perfectly, so a single 20% opacity pixel one side matches with the 80% opacity pixel in the other.
The problem is that TVPaint does not display the combined two pixels as 100%

maybe this is mathematically correct but it is not what you would expect or always want.
because at some level, logic suggests that combining a 80% and a 20% opacity pixel results in 100% covered pixel...
but as i works now: 50%+50%=75% 75%+50%=88% etc...

i don't know a solution

it probably requires a different approach in getting the resulting opacity of overlaying pixels...

This might be doable with a blendmode... i tried all blendmodes and they do effect the way the gap looks.
So i imagine it would be possible to create a blendmode that adds up the separate opacities to a 100%


i demonstrated the influence of blendmodes on the edge:
f.i. "sub" makes the hole go away... but unfortunately it makes the lower part more dark
Attachments
blendmode effect on cutting-edge.mp4
(13.32 MiB) Downloaded 546 times
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
User avatar
schwarzgrau
Posts: 1238
Joined: 23 Jan 2012, 22:08
Location: Offenbach / Germany
Contact:

Re: Stencil error

Post by schwarzgrau »

The problem as I understand it isn't a TVPaint problem, more something like a transparency problem in anti aliased edges. The reason you get this halo is cause 50% transparency and 50% transparency don't make 100% if you overlay them.

This video is for After Effects, but the first two minutes explain the problem


In After Effects there is a blending mode called "Alpha Add" which fixes this issue. Maybe this could be added to TVPaint in a future release?
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Cintiq 22HD
Windows 11 22H2 / TVP 11.7.0 PRO WIBU / Mobile Studio Pro 16" (2019)
Android 13 / TVP 11.7.0 / Galaxy Tab 7 FE
INSTAGRAM
User avatar
Peter Wassink
Posts: 4283
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Stencil error

Post by Peter Wassink »

Yes, thanks!
please add "Alpha Add" blend mode to fix this issue.
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Post Reply