Negative alpha out of renderlayers #32598

Closed
opened 2012-09-19 22:43:49 +02:00 by Daniel Salazar · 5 comments
Member

%%%Due to AA filters renderlayers can return negative Alpha and RGB pixels on the borders of objects.

This negative pixels are the root of all kinds of problems that get solved by clamping them in the compositor. But first a question, is there any circumstance where we would need/like those negative values out of the renderlayer? What is a negative alpha? more transparent than transparent?

See the white border around the sphere (press F12)
https://dl.dropbox.com/u/255376/Blender-Compositing/Strand-Render-error.blend

And this is how it gets fixed, a ton of nodes i you ask me just to clamp the values
https://dl.dropbox.com/u/255376/Blender-Compositing/Strand-Render-Fix-proper.blend

There are a few incorrect solutions to this problem that I and many people have used, the first is recurring to FSA. FSA does the filtering after the composition and that seems to do the trick, however if you save your result to EXR files for later re-composition this EXR files will still have the negative values baked in and will result in the same trouble again, forcing us to clamp

The worst solution is to use dilate/erode nodes to choke the alpha, and yet people do this because it's hard to realize that the renderlayer is outputting this garbage pixels

Back to the begging, is there a reason why we would not want to clamp this nastiness right out of the renderer?%%%

%%%Due to AA filters renderlayers can return negative Alpha and RGB pixels on the borders of objects. This negative pixels are the root of all kinds of problems that get solved by *clamping* them in the compositor. But first a question, is there any circumstance where we would need/like those negative values out of the renderlayer? What is a negative alpha? more transparent than transparent? See the white border around the sphere (press F12) https://dl.dropbox.com/u/255376/Blender-Compositing/Strand-Render-error.blend And this is how it gets fixed, a ton of nodes i you ask me just to clamp the values https://dl.dropbox.com/u/255376/Blender-Compositing/Strand-Render-Fix-proper.blend There are a few *incorrect* solutions to this problem that I and many people have used, the first is recurring to FSA. FSA does the filtering after the composition and that seems to do the trick, however if you save your result to EXR files for later re-composition this EXR files will still have the negative values baked in and will result in the same trouble again, forcing us to clamp The worst solution is to use dilate/erode nodes to choke the alpha, and yet people do this because it's hard to realize that the renderlayer is outputting this garbage pixels Back to the begging, is there a reason why we would not want to clamp this nastiness right out of the renderer?%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%Committed a clamping fix now, note that in this .blend file you still need to use full sample to fix the white border.%%%

%%%Committed a clamping fix now, note that in this .blend file you still need to use full sample to fix the white border.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

%%%Thank you very much!%%%

%%%Thank you very much!%%%

%%%@brecht:
Thank you! This gave me tons of headaches.
Regarding the problem with the strand renderer, in this example where emitter and hair are in different render layers it's not a bug, since the rendered strands' alpha that is both correlated and uncorrelated to the emitter's alpha (some strands are in front of the emitter and some of them behind), and consequently the alpha-over operation fails for correlated portion of the alpha channel.
As you pointed out, FSA fixes that, but there's another way to get a correct compositing of strands: adding both alphas, then setting the resulting alpha to the predivided alpha-over result. That's what was done in the second example file linked, but in that case the alphas had to be clamped to give proper results. Now with your fix those ramps can be taken away, making simpler composites and more importantly, getting more predictable results when dealing with alphas.
Thanks for that! :-)%%%

%%%@brecht: Thank you! This gave me tons of headaches. Regarding the problem with the strand renderer, in this example where emitter and hair are in different render layers it's not a bug, since the rendered strands' alpha that is both correlated and uncorrelated to the emitter's alpha (some strands are in front of the emitter and some of them behind), and consequently the alpha-over operation fails for correlated portion of the alpha channel. As you pointed out, FSA fixes that, but there's another way to get a correct compositing of strands: adding both alphas, then setting the resulting alpha to the predivided alpha-over result. That's what was done in the second example file linked, but in that case the alphas had to be clamped to give proper results. Now with your fix those ramps can be taken away, making simpler composites and more importantly, getting more predictable results when dealing with alphas. Thanks for that! :-)%%%
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
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
3 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#32598
No description provided.