Page MenuHome

Color spill error: average algorithm
Closed, ResolvedPublic

Description

System Information
windows7 64
ASUS ATI Radeon HD6870

Blender Version
Broken: (2.75 and all earlier - working with bug

2.75.4(b9ce21f) - working with bug, but with other behavior)

Worked: (None)

Short description of error
thank you for resolving mess in limiting channel settings(in simple algorithm) T45647
but we have incorrect working of limiting channel settings(in average algorithm)






Exact steps for others to reproduce the error

open, render, and repeat my test

Related Objects

Event Timeline

Alexey (Inwader77) set Type to Bug.
Alexey (Inwader77) created this task.
Alexey (Inwader77) raised the priority of this task from to Needs Triage by Developer.

Actually, changing the algorithm in the drop down menu has no effect. There seems to be some virtual function calls shenanigans happening here: it feels like since ColorSpillAverageOperation does not re-implement executePixelSampled, ColorSpillOperation::executePixelSampled is called which in turn calls ColorSpillOperation::calculateMapValue and not ColorSpillAverageOperation::calculateMapValue because ColorSpillOperation::calculateMapValue is not virtual. I might be explaining this wrong or confusingly.

The most straightforward fix would be to make ColorSpillOperation::calculateMapValue virtual, like so:

diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.h b/source/blender/compositor/operations/COM_ColorSpillOperation.h
index f9dc9ef..c1300d5 100644
--- a/source/blender/compositor/operations/COM_ColorSpillOperation.h
+++ b/source/blender/compositor/operations/COM_ColorSpillOperation.h
@@ -54,7 +54,7 @@ public:
        void setSettings(NodeColorspill *nodeColorSpill) { this->m_settings = nodeColorSpill; }
        void setSpillChannel(int channel) { this->m_spillChannel = channel; }
        
-       float calculateMapValue(float fac, float *input);
+       virtual float calculateMapValue(float fac, float *input);
 };
 
 class ColorSpillAverageOperation : public ColorSpillOperation {