[Bf-blender-cvs] [68a9d80] master: Compositor: Make it work for debug passes other than float

Sergey Sharybin noreply at git.blender.org
Fri Jul 24 17:19:15 CEST 2015


Commit: 68a9d80739b8281f28d18699dff572349f8b536a
Author: Sergey Sharybin
Date:   Fri Jul 24 17:15:55 2015 +0200
Branches: master
https://developer.blender.org/rB68a9d80739b8281f28d18699dff572349f8b536a

Compositor: Make it work for debug passes other than float

===================================================================

M	source/blender/compositor/operations/COM_RenderLayersProg.cpp
M	source/blender/compositor/operations/COM_RenderLayersProg.h
M	source/blender/nodes/composite/nodes/node_composite_image.c

===================================================================

diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp
index ad0ce3a..e7ce50f 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp
@@ -391,8 +391,26 @@ RenderLayersUVOperation::RenderLayersUVOperation() : RenderLayersBaseProg(SCE_PA
 
 /* ******** Debug Render Layers Cycles Operation ******** */
 
+#ifdef WITH_CYCLES_DEBUG
+
 RenderLayersCyclesDebugOperation::RenderLayersCyclesDebugOperation(int pass)
     : RenderLayersBaseProg(pass, 1)
 {
 	this->addOutputSocket(COM_DT_VALUE);
 }
+
+void RenderLayersCyclesDebugOperation::setScene(Scene *scene)
+{
+	RenderLayersBaseProg::setScene(scene);
+	switch (m_scene->r.debug_pass_type) {
+		case RENDER_PASS_DEBUG_BVH_TRAVERSAL_STEPS:
+		case RENDER_PASS_DEBUG_BVH_TRAVERSED_INSTANCES:
+		case RENDER_PASS_DEBUG_RAY_BOUNCES:
+			this->m_elementsize = 1;
+		default:
+			fprintf(stderr, "Unknown element size for debug pass");
+			abort();
+	}
+}
+
+#endif
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.h b/source/blender/compositor/operations/COM_RenderLayersProg.h
index 8930753..edefd9a 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.h
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.h
@@ -41,7 +41,7 @@ extern "C" {
  * @todo: rename to operation.
  */
 class RenderLayersBaseProg : public NodeOperation {
-private:
+protected:
 	/**
 	 * Reference to the scene object.
 	 */
@@ -74,7 +74,6 @@ private:
 	 */
 	const RenderData *m_rd;
 
-protected:
 	/**
 	 * Constructor
 	 */
@@ -213,9 +212,12 @@ public:
 	RenderLayersUVOperation();
 };
 
+#ifdef WITH_CYCLES_DEBUG
 class RenderLayersCyclesDebugOperation : public RenderLayersBaseProg {
 public:
 	RenderLayersCyclesDebugOperation(int pass);
+	void setScene(Scene *scene);
 };
+#endif
 
 #endif
diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c
index 1985037..208c1f8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_image.c
+++ b/source/blender/nodes/composite/nodes/node_composite_image.c
@@ -74,7 +74,7 @@ static bNodeSocketTemplate cmp_node_rlayers_out[] = {
 	{	SOCK_RGBA, 0, N_("Subsurface Indirect"),	0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
 	{	SOCK_RGBA, 0, N_("Subsurface Color"),		0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
 #ifdef WITH_CYCLES_DEBUG
-	{	SOCK_FLOAT, 0, N_("Debug"),		0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+	{	SOCK_RGBA, 0, N_("Debug"),					0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
 #endif
 	{	-1, 0, ""	}
 };




More information about the Bf-blender-cvs mailing list