diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-04-25 14:00:35 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-04-25 14:05:23 +0400 |
commit | 005dabbd9ad51b75aef260168c81d5a826d4eb4f (patch) | |
tree | cf65862b2f2f685cc587c80b7311bd87f87d6962 /source/blender/compositor/operations/COM_ViewerOperation.cpp | |
parent | 1eb13519768f5735c9931fec0da07d92155796f1 (diff) |
Fix T39799: Backdrop (compositor) ignores alpha.
This issue is because of a somewhat "special" behavior in old code, which got lost during rB09874df:
There was a variant of the `relinkConnections` function which would leave the socket completely unconnected. This is not a valid state really (given that each unconnected input must otherwise connected to a constant `Set` type node), but was used as a way to distinguish connected alpha/depth sockets in composite and viewer output nodes.
https://developer.blender.org/diffusion/B/browse/master/source/blender/compositor/intern/COM_InputSocket.cpp;28a829893c702918afc5ac1945a06eaefa611594$69
After the large cleanup patch ({D309}) every socket is now automatically connected to a constant, such that `getInputSocketReader` will never return a NULL pointer. This breaks the previous test method, which needs to be replaced by more explicit flags. Luckily this was done only for very few output nodes (Composite, Viewer, Output-File). These now use the regular SetValueOperation default in case "use alpha" is disabled, but set this to an explicit 1.0 value instead of mapping to the node socket.
Diffstat (limited to 'source/blender/compositor/operations/COM_ViewerOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ViewerOperation.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp index 6579eb268a6..53c0acd781a 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp @@ -48,7 +48,7 @@ ViewerOperation::ViewerOperation() : NodeOperation() this->m_doDepthBuffer = false; this->m_viewSettings = NULL; this->m_displaySettings = NULL; - this->m_ignoreAlpha = false; + this->m_useAlphaInput = false; this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_VALUE); @@ -101,19 +101,12 @@ void ViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber) for (y = y1; y < y2 && (!breaked); y++) { for (x = x1; x < x2; x++) { this->m_imageInput->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST); - if (this->m_ignoreAlpha) { - buffer[offset4 + 3] = 1.0f; - } - else { - if (this->m_alphaInput != NULL) { - this->m_alphaInput->readSampled(alpha, x, y, COM_PS_NEAREST); - buffer[offset4 + 3] = alpha[0]; - } - } - if (m_depthInput) { - this->m_depthInput->readSampled(depth, x, y, COM_PS_NEAREST); - depthbuffer[offset] = depth[0]; + if (this->m_useAlphaInput) { + this->m_alphaInput->readSampled(alpha, x, y, COM_PS_NEAREST); + buffer[offset4 + 3] = alpha[0]; } + this->m_depthInput->readSampled(depth, x, y, COM_PS_NEAREST); + depthbuffer[offset] = depth[0]; offset ++; offset4 += 4; |