[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44513] branches/tile/source/blender: TileBranch

Dalai Felinto dfelinto at gmail.com
Wed Feb 29 15:35:54 CET 2012


Hi Jeroen,

I find really strange that we have a node only for that.
Can't we have this integrated in the Input->Image or Input->Movie Clip
nodes?

Or the idea is to allow to change the sampling used in a per 'operation'
basis?
(e.g. I start using Bilinear, do a few node operations and then switch to
Nearest)

Even if that's the case I wonder if we could have this integrated in the
Nodes then (all of them) as an option in the Properties panel.

(and Blender uses Firstword Secondword capitalization style - to be fixed
on Bokeh image, Boke blur and Set sampler)

Cheers,
Dalai


2012/2/28 Jeroen Bakker <j.bakker at atmind.nl>

> Revision: 44513
>
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44513
> Author:   jbakker
> Date:     2012-02-28 12:05:11 +0000 (Tue, 28 Feb 2012)
> Log Message:
> -----------
> TileBranch
>  * Added a sampler node
>
> With the sampler node it is possible to change image sample methods where
> you want.
> Sampler only works for Images & MovieClips
>
>  - At Mind -
>
> Modified Paths:
> --------------
>    branches/tile/source/blender/blenkernel/BKE_node.h
>    branches/tile/source/blender/blenkernel/intern/node.c
>    branches/tile/source/blender/compositor/CMakeLists.txt
>    branches/tile/source/blender/compositor/COM_defines.h
>    branches/tile/source/blender/compositor/intern/COM_Converter.cpp
>    branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp
>    branches/tile/source/blender/compositor/nodes/COM_ImageNode.cpp
>
>  branches/tile/source/blender/compositor/operations/COM_ImageOperation.cpp
>    branches/tile/source/blender/compositor/operations/COM_ImageOperation.h
>
>  branches/tile/source/blender/compositor/operations/COM_MovieClipOperation.cpp
>
>  branches/tile/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
>
>  branches/tile/source/blender/compositor/operations/COM_ReadBufferOperation.h
>
>  branches/tile/source/blender/compositor/operations/COM_SetValueOperation.h
>    branches/tile/source/blender/editors/space_node/drawnode.c
>    branches/tile/source/blender/makesrna/intern/rna_nodetree.c
>    branches/tile/source/blender/makesrna/intern/rna_nodetree_types.h
>    branches/tile/source/blender/nodes/CMakeLists.txt
>    branches/tile/source/blender/nodes/NOD_composite.h
>
> Added Paths:
> -----------
>    branches/tile/source/blender/compositor/nodes/COM_SamplerNode.cpp
>    branches/tile/source/blender/compositor/nodes/COM_SamplerNode.h
>
>  branches/tile/source/blender/compositor/operations/COM_SetSamplerOperation.cpp
>
>  branches/tile/source/blender/compositor/operations/COM_SetSamplerOperation.h
>
>  branches/tile/source/blender/nodes/composite/nodes/node_composite_sampler.c
>
> Modified: branches/tile/source/blender/blenkernel/BKE_node.h
> ===================================================================
> --- branches/tile/source/blender/blenkernel/BKE_node.h  2012-02-28
> 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/blenkernel/BKE_node.h  2012-02-28
> 12:05:11 UTC (rev 44513)
> @@ -670,6 +670,7 @@
>  #define CMP_NODE_SWITCH         318
>
>  #define CMP_NODE_OPENCLTEST     319
> +#define CMP_NODE_SAMPLER        320
>
>  /* channel toggles */
>  #define CMP_CHAN_RGB           1
>
> Modified: branches/tile/source/blender/blenkernel/intern/node.c
> ===================================================================
> --- branches/tile/source/blender/blenkernel/intern/node.c       2012-02-28
> 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/blenkernel/intern/node.c       2012-02-28
> 12:05:11 UTC (rev 44513)
> @@ -1876,6 +1876,7 @@
>        register_node_type_cmp_bokehblur(ttype);
>        register_node_type_cmp_switch(ttype);
>        register_node_type_cmp_opencltest(ttype);
> +       register_node_type_cmp_sampler(ttype);
>  }
>
>  static void registerShaderNodes(bNodeTreeType *ttype)
>
> Modified: branches/tile/source/blender/compositor/CMakeLists.txt
> ===================================================================
> --- branches/tile/source/blender/compositor/CMakeLists.txt      2012-02-28
> 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/compositor/CMakeLists.txt      2012-02-28
> 12:05:11 UTC (rev 44513)
> @@ -261,6 +261,9 @@
>        operations/COM_NormalizeOperation.h
>
>  # Filter nodes
> +       nodes/COM_SamplerNode.cpp
> +       nodes/COM_SamplerNode.h
> +
>                nodes/COM_FilterNode.cpp
>                nodes/COM_FilterNode.h
>                nodes/COM_DilateErode2Node.cpp
> @@ -535,19 +538,21 @@
>        operations/COM_GlareSimpleStarOperation.h
>        operations/COM_GlareStreaksOperation.cpp
>        operations/COM_GlareStreaksOperation.h
> +       operations/COM_SetSamplerOperation.cpp
> +       operations/COM_SetSamplerOperation.h
>
>
>  #Convert operations
> -               operations/COM_IDMaskOperation.cpp
> -               operations/COM_IDMaskOperation.h
> +       operations/COM_IDMaskOperation.cpp
> +       operations/COM_IDMaskOperation.h
>
> -               operations/COM_SeparateChannelOperation.cpp
> -               operations/COM_SeparateChannelOperation.h
> -               operations/COM_CombineChannelsOperation.cpp
> -               operations/COM_CombineChannelsOperation.h
> +       operations/COM_SeparateChannelOperation.cpp
> +       operations/COM_SeparateChannelOperation.h
> +       operations/COM_CombineChannelsOperation.cpp
> +       operations/COM_CombineChannelsOperation.h
>
> -               operations/COM_DotproductOperation.cpp
> -               operations/COM_DotproductOperation.h
> +       operations/COM_DotproductOperation.cpp
> +       operations/COM_DotproductOperation.h
>
>  #    operations/COM_ConvertColorSpaceOperation.h
>  #    operations/COM_ConvertColorSpaceOperation.cpp
> @@ -567,7 +572,6 @@
>        operations/COM_MovieClipOperation.h
>        operations/COM_ConvertColorProfileOperation.cpp
>        operations/COM_ConvertColorProfileOperation.h
> -
>  #     operations/COM_OpenCLKernels.cl.cpp
>  )
>
>
> Modified: branches/tile/source/blender/compositor/COM_defines.h
> ===================================================================
> --- branches/tile/source/blender/compositor/COM_defines.h       2012-02-28
> 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/compositor/COM_defines.h       2012-02-28
> 12:05:11 UTC (rev 44513)
> @@ -91,12 +91,9 @@
>  } OrderOfChunks;
>
>  #define COM_RULE_OF_THIRDS_DIVIDER 100.0f
> -#define COM_MM_MAX_ALLOCATED_MEMORY 1*1024*1024*1024
>
>  #define COM_NUMBER_OF_CHANNELS 4
>
> -#define COM_RM_NORMAL 0
> -#define COM_RM_LINEAR 1
>  #define COM_DEFAULT_RESOLUTION_WIDTH 640
>  #define COM_DEFAULT_RESOLUTION_HEIGHT 480
>
>
> Modified: branches/tile/source/blender/compositor/intern/COM_Converter.cpp
> ===================================================================
> --- branches/tile/source/blender/compositor/intern/COM_Converter.cpp
>  2012-02-28 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/compositor/intern/COM_Converter.cpp
>  2012-02-28 12:05:11 UTC (rev 44513)
> @@ -107,6 +107,7 @@
>  #include "COM_MapValueNode.h"
>  #include "COM_TransformNode.h"
>  #include "COM_Stabilize2dNode.h"
> +#include "COM_SamplerNode.h"
>
>  Node* Converter::convert(bNode *bNode) {
>        Node * node;
> @@ -328,6 +329,9 @@
>        case CMP_NODE_STABILIZE2D:
>                node = new Stabilize2dNode(bNode);
>                break;
> +       case CMP_NODE_SAMPLER:
> +               node = new SamplerNode(bNode);
> +               break;
>        /* not inplemented yet */
>        case CMP_NODE_VECBLUR:
>        case CMP_NODE_DOUBLEEDGEMASK:
>
> Modified:
> branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp
> ===================================================================
> --- branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp
>       2012-02-28 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp
>       2012-02-28 12:05:11 UTC (rev 44513)
> @@ -152,9 +152,6 @@
>                        ReadBufferOperation *readOperation =
> (ReadBufferOperation*)operation;
>                        this->cachedReadOperations.push_back(readOperation);
>                        maxNumber = max(maxNumber,
> readOperation->getOffset());
> -                       if (!this->isComplex()) {
> -                               readOperation->setReadMode(COM_RM_LINEAR);
> -                       }
>                }
>        }
>        maxNumber++;
>
> Modified: branches/tile/source/blender/compositor/nodes/COM_ImageNode.cpp
> ===================================================================
> --- branches/tile/source/blender/compositor/nodes/COM_ImageNode.cpp
> 2012-02-28 11:18:05 UTC (rev 44512)
> +++ branches/tile/source/blender/compositor/nodes/COM_ImageNode.cpp
> 2012-02-28 12:05:11 UTC (rev 44513)
> @@ -42,7 +42,6 @@
>        operation->setImage(image);
>        operation->setImageUser(imageuser);
>        operation->setFramenumber(context->getFramenumber());
> -       operation->setInterpolationMode(context->getQuality() ==
> COM_QUALITY_LOW?COM_IM_NEAREST:COM_IM_LINEAR);
>        graph->addOperation(operation);
>        addPreviewOperation(graph, operation->getOutputSocket(), 9);
>
> @@ -52,7 +51,6 @@
>                alphaOperation->setImage(image);
>                alphaOperation->setImageUser(imageuser);
>                alphaOperation->setFramenumber(context->getFramenumber());
> -               alphaOperation->setInterpolationMode(context->getQuality()
> == COM_QUALITY_LOW?COM_IM_NEAREST:COM_IM_LINEAR);
>
>  alphaImage->relinkConnections(alphaOperation->getOutputSocket());
>                graph->addOperation(alphaOperation);
>        }
>
> Added: branches/tile/source/blender/compositor/nodes/COM_SamplerNode.cpp
> ===================================================================
> --- branches/tile/source/blender/compositor/nodes/COM_SamplerNode.cpp
>                       (rev 0)
> +++ branches/tile/source/blender/compositor/nodes/COM_SamplerNode.cpp
> 2012-02-28 12:05:11 UTC (rev 44513)
> @@ -0,0 +1,48 @@
> +/*
> + * Copyright 2011, Blender Foundation.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software Foundation,
> + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> + *
> + * Contributor:
> + *             Jeroen Bakker
> + *             Monique Dewanchand
> + */
> +
> +#include "COM_SamplerNode.h"
> +#include "DNA_scene_types.h"
> +#include "COM_SetSamplerOperation.h"
> +#include "COM_ExecutionSystem.h"
> +
> +SamplerNode::SamplerNode(bNode *editorNode): Node(editorNode) {
> +}
> +
> +void SamplerNode::convertToOperations(ExecutionSystem *system,
> CompositorContext * context) {
> +       SetSamplerOperation *operation = new SetSamplerOperation();
> +
> this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0),
> true, 0, system);
> +
> this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
> +       bNode* node = this->getbNode();
> +       switch (node->custom1) {
> +       case 0:
> +               operation->setSampler(COM_PS_NEAREST);
> +               break;
> +       case 1:
> +               operation->setSampler(COM_PS_BILINEAR);
> +               break;
> +       case 2:
> +               operation->setSampler(COM_PS_BICUBIC);
> +               break;
> +       }
> +       system->addOperation(operation);
> +}
>
> Added: branches/tile/source/blender/compositor/nodes/COM_SamplerNode.h
> ===================================================================
> --- branches/tile/source/blender/compositor/nodes/COM_SamplerNode.h
>                       (rev 0)
> +++ branches/tile/source/blender/compositor/nodes/COM_SamplerNode.h
> 2012-02-28 12:05:11 UTC (rev 44513)
> @@ -0,0 +1,38 @@
> +/*
> + * Copyright 2011, Blender Foundation.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software Foundation,
> + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
> + *
> + * Contributor:
> + *             Jeroen Bakker
> + *             Monique Dewanchand
> + */
> +
> +#ifndef _COM_SamplerNode_h_
> +#define _COM_SamplerNode_h_
> +
> +#include "COM_Node.h"
> +
> +/**
> +  * @brief SamplerNode
> +  * @ingroup Node
> +  */
> +class SamplerNode: public Node {
> +public:
> +       SamplerNode(bNode *editorNode);
> +       void convertToOperations(ExecutionSystem* graph, CompositorContext
> * context);
> +};
> +
> +#endif
>
> Modified:
> branches/tile/source/blender/compositor/operations/COM_ImageOperation.cpp
> ===================================================================
> ---
> branches/tile/source/blender/compositor/operations/COM_ImageOperation.cpp
> 2012-02-28 11:18:05 UTC (rev 44512)
> +++
> branches/tile/source/blender/compositor/operations/COM_ImageOperation.cpp
> 2012-02-28 12:05:11 UTC (rev 44513)
> @@ -38,12 +38,12 @@
>
>  BaseImageOperation::BaseImageOperation(): NodeOperation() {
>     this->image = NULL;
> +       this->buffer = NULL;
>     this->imageBuffer = NULL;
>     this->imageUser = NULL;
>     this->imagewidth = 0;
>     this->imageheight = 0;
>        this->framenumber = 0;
> -       this->interpolation = COM_IM_NEAREST;
>  }
>  ImageOperation::ImageOperation(): BaseImageOperation() {
>     this->addOutputSocket(COM_DT_COLOR);
> @@ -71,6 +71,7 @@
>  void BaseImageOperation::initExecution() {
>
> @@ Diff output truncated at 10240 characters. @@
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>


More information about the Bf-committers mailing list