Revision: 48079
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48079
Author:   campbellbarton
Date:     2012-06-19 13:48:19 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r48070:48078

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48070

Modified Paths:
--------------
    
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
    branches/soc-2011-tomato/source/blender/compositor/nodes/COM_DefocusNode.cpp
    
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
    
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
    
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-48070
   + 
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-48078

Modified: 
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_BokehBlurNode.cpp  
    2012-06-19 13:20:06 UTC (rev 48078)
+++ 
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_BokehBlurNode.cpp  
    2012-06-19 13:48:19 UTC (rev 48079)
@@ -37,24 +37,24 @@
 
 void BokehBlurNode::convertToOperations(ExecutionSystem *graph, 
CompositorContext *context)
 {
-       Object *camob = context->getScene()->camera;
+//     Object *camob = context->getScene()->camera;
 
-       if (this->getInputSocket(2)->isConnected()) {
-               VariableSizeBokehBlurOperation *operation = new 
VariableSizeBokehBlurOperation();
-               ConvertDepthToRadiusOperation *converter = new 
ConvertDepthToRadiusOperation();
-               converter->setfStop(this->getbNode()->custom3);
-               converter->setCameraObject(camob);
-               operation->setMaxBlur((int)this->getbNode()->custom4);
-               operation->setQuality(context->getQuality());
-               
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, 
graph);
-               
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, 
graph);
-               
this->getInputSocket(2)->relinkConnections(converter->getInputSocket(0), 2, 
graph);
-               addLink(graph, converter->getOutputSocket(), 
operation->getInputSocket(2));
-               graph->addOperation(operation);
-               graph->addOperation(converter);
-               
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
-       }
-       else {
+//     if (this->getInputSocket(2)->isConnected()) {
+//             VariableSizeBokehBlurOperation *operation = new 
VariableSizeBokehBlurOperation();
+//             ConvertDepthToRadiusOperation *converter = new 
ConvertDepthToRadiusOperation();
+//             converter->setfStop(this->getbNode()->custom3);
+//             converter->setCameraObject(camob);
+//             operation->setMaxBlur((int)this->getbNode()->custom4);
+//             operation->setQuality(context->getQuality());
+//             
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, 
graph);
+//             
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, 
graph);
+//             
this->getInputSocket(2)->relinkConnections(converter->getInputSocket(0), 2, 
graph);
+//             addLink(graph, converter->getOutputSocket(), 
operation->getInputSocket(2));
+//             graph->addOperation(operation);
+//             graph->addOperation(converter);
+//             
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
+//     }
+//     else {
                BokehBlurOperation *operation = new BokehBlurOperation();
                
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, 
graph);
                
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, 
graph);
@@ -63,5 +63,5 @@
                operation->setQuality(context->getQuality());
                graph->addOperation(operation);
                
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
-       }
+//     }
 }

Modified: 
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_DefocusNode.cpp
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_DefocusNode.cpp    
    2012-06-19 13:20:06 UTC (rev 48078)
+++ 
branches/soc-2011-tomato/source/blender/compositor/nodes/COM_DefocusNode.cpp    
    2012-06-19 13:48:19 UTC (rev 48079)
@@ -96,6 +96,7 @@
        operation->setThreshold(data->bthresh);
        addLink(graph, bokeh->getOutputSocket(), operation->getInputSocket(1));
        addLink(graph, radiusOperation->getOutputSocket(), 
operation->getInputSocket(2));
+       addLink(graph, 
radiusOperation->getInputSocket(0)->getConnection()->getFromSocket(), 
operation->getInputSocket(3));
        if (data->gamco) {
                GammaCorrectOperation *correct = new GammaCorrectOperation();
                GammaUncorrectOperation *inverse = new 
GammaUncorrectOperation();

Modified: 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
 2012-06-19 13:20:06 UTC (rev 48078)
+++ 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
 2012-06-19 13:48:19 UTC (rev 48079)
@@ -47,9 +47,9 @@
        drg = 4.f * (kg - kr);
        dgb = 4.f * (kb - kg);
 
-       kr4 = kr * 4;
+       kr4 = kr * 4.f;
        kg4 = kg * 4.f;
-       kb4 *= kb * 4.f;
+       kb4 = kb * 4.f;
        cx = 0.5f * (float)getWidth();
        cy = 0.5f * (float)getHeight();
 

Modified: 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
        2012-06-19 13:20:06 UTC (rev 48078)
+++ 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
        2012-06-19 13:48:19 UTC (rev 48079)
@@ -31,15 +31,17 @@
 {
        this->addInputSocket(COM_DT_COLOR);
        this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE); // do not resize 
the bokeh image.
-       this->addInputSocket(COM_DT_VALUE);
+       this->addInputSocket(COM_DT_VALUE); // radius
+       this->addInputSocket(COM_DT_VALUE); // depth
        this->addOutputSocket(COM_DT_COLOR);
        this->setComplex(true);
 
        this->inputProgram = NULL;
        this->inputBokehProgram = NULL;
        this->inputSizeProgram = NULL;
+       this->inputDepthProgram = NULL;
        this->maxBlur = 32.0f;
-       this->threshold = 0.0f;
+       this->threshold = 1.0f;
 }
 
 
@@ -48,6 +50,7 @@
        this->inputProgram = getInputSocketReader(0);
        this->inputBokehProgram = getInputSocketReader(1);
        this->inputSizeProgram = getInputSocketReader(2);
+       this->inputDepthProgram = getInputSocketReader(3);
        QualityStepHelper::initExecution(COM_QH_INCREASE);
 }
 
@@ -56,6 +59,7 @@
        float readColor[4];
        float bokeh[4];
        float tempSize[4];
+       float tempDepth[4];
        float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
        float color_accum[4]      = {0.0f, 0.0f, 0.0f, 0.0f};
 
@@ -64,33 +68,36 @@
        int minx = x - maxBlur;
        int maxx = x + maxBlur;
        {
+               inputSizeProgram->read(tempSize, x, y, COM_PS_NEAREST, 
inputBuffers);
+               inputDepthProgram->read(tempDepth, x, y, COM_PS_NEAREST, 
inputBuffers);
                inputProgram->read(readColor, x, y, COM_PS_NEAREST, 
inputBuffers);
-               color_accum[0] += readColor[0];
-               color_accum[1] += readColor[1];
-               color_accum[2] += readColor[2];
-               color_accum[3] += readColor[3];
                add_v4_v4(color_accum, readColor);
-               add_v3_fl(multiplier_accum, 1.0f);
+               add_v4_fl(multiplier_accum, 1.0f);
+               float sizeCenter = tempSize[0];
+               float centerDepth = tempDepth[0]+threshold;
                
                for (int ny = miny; ny < maxy; ny += 
QualityStepHelper::getStep()) {
                        for (int nx = minx; nx < maxx; nx += 
QualityStepHelper::getStep()) {
                                if (nx >= 0 && nx < this->getWidth() && ny >= 0 
&& ny < getHeight()) {
+                                       inputDepthProgram->read(tempDepth, nx, 
ny, COM_PS_NEAREST, inputBuffers);
                                        inputSizeProgram->read(tempSize, nx, 
ny, COM_PS_NEAREST, inputBuffers);
                                        float size = tempSize[0];
-//                                     size += this->threshold;
-                                       float dx = nx - x;
-                                       float dy = ny - y;
-                                       if (nx == x && ny == y) {
-                                               /* pass */
+                                       if (tempDepth[0] < centerDepth) {
+                                               if ((sizeCenter > threshold && 
size > threshold) || size <= threshold) {
+                                                       float dx = nx - x;
+                                                       float dy = ny - y;
+                                                       if (nx == x && ny == y) 
{
+                                                       }
+                                                       else if (size >= 
fabsf(dx) && size >= fabsf(dy)) {
+                                                               float u = 256 + 
dx * 256 / size;
+                                                               float v = 256 + 
dy * 256 / size;
+                                                               
inputBokehProgram->read(bokeh, u, v, COM_PS_NEAREST, inputBuffers);
+                                                               
inputProgram->read(readColor, nx, ny, COM_PS_NEAREST, inputBuffers);
+                                                               
madd_v4_v4v4(color_accum, bokeh, readColor);
+                                                               
add_v4_v4(multiplier_accum, bokeh);
+                                                       }
+                                               }
                                        }
-                                       else if (size >= fabsf(dx) && size >= 
fabsf(dy)) {
-                                               float u = 256 + dx * 256 / size;
-                                               float v = 256 + dy * 256 / size;
-                                               inputBokehProgram->read(bokeh, 
u, v, COM_PS_NEAREST, inputBuffers);
-                                               inputProgram->read(readColor, 
nx, ny, COM_PS_NEAREST, inputBuffers);
-                                               madd_v4_v4v4(color_accum, 
bokeh, readColor);
-                                               add_v4_v4(multiplier_accum, 
bokeh);
-                                       }
                                }
                        }
                }
@@ -132,6 +139,10 @@
        if (operation->determineDependingAreaOfInterest(&bokehInput, 
readOperation, output) ) {
                return true;
        }
+       operation = getInputOperation(3);
+       if (operation->determineDependingAreaOfInterest(&newInput, 
readOperation, output) ) {
+               return true;
+       }
        operation = getInputOperation(0);
        if (operation->determineDependingAreaOfInterest(&newInput, 
readOperation, output) ) {
                return true;

Modified: 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
  2012-06-19 13:20:06 UTC (rev 48078)
+++ 
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
  2012-06-19 13:48:19 UTC (rev 48079)
@@ -32,6 +32,7 @@
        SocketReader *inputProgram;
        SocketReader *inputBokehProgram;
        SocketReader *inputSizeProgram;
+       SocketReader *inputDepthProgram;
 
 public:
        VariableSizeBokehBlurOperation();


Property changes on: 
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to