[Bf-blender-cvs] [1a580ff] cycles_point_density: Cycles point density: Remove constant color output

Sergey Sharybin noreply at git.blender.org
Wed Jul 15 23:40:41 CEST 2015


Commit: 1a580ff7d4320d1dd8d3b9908cc7f3261dd5c668
Author: Sergey Sharybin
Date:   Wed Jul 15 23:35:16 2015 +0200
Branches: cycles_point_density
https://developer.blender.org/rB1a580ff7d4320d1dd8d3b9908cc7f3261dd5c668

Cycles point density: Remove constant color output

It's not really clear which exact color the constant is from the artist
perspective and if constant color is really needed just use RGB input,
it'll give better performance.

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

M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c

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

diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 3908535..30e2c22 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1114,11 +1114,10 @@ enum {
 };
 
 enum {
-	SHD_POINTDENSITY_COLOR_CONSTANT     = 0,
-	SHD_POINTDENSITY_COLOR_PARTAGE      = 1,
-	SHD_POINTDENSITY_COLOR_PARTSPEED    = 2,
-	SHD_POINTDENSITY_COLOR_PARTVEL      = 3,
-	SHD_POINTDENSITY_COLOR_PARTTEX      = 4,
+	SHD_POINTDENSITY_COLOR_PARTAGE   = 1,
+	SHD_POINTDENSITY_COLOR_PARTSPEED = 2,
+	SHD_POINTDENSITY_COLOR_PARTVEL   = 3,
+	SHD_POINTDENSITY_COLOR_PARTTEX   = 4,
 };
 
 #endif
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 3b761cf..c42bfee 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3003,12 +3003,13 @@ static void rna_ShaderNodePointDensity_psys_set(PointerRNA *ptr, PointerRNA valu
 static int point_density_color_source_from_shader(NodeShaderTexPointDensity *shader_point_density)
 {
 	switch (shader_point_density->color_source) {
-		case SHD_POINTDENSITY_COLOR_CONSTANT: return TEX_PD_COLOR_CONSTANT;
 		case SHD_POINTDENSITY_COLOR_PARTAGE: return TEX_PD_COLOR_PARTAGE;
 		case SHD_POINTDENSITY_COLOR_PARTSPEED: return TEX_PD_COLOR_PARTSPEED;
 		case SHD_POINTDENSITY_COLOR_PARTVEL: return TEX_PD_COLOR_PARTVEL;
 		case SHD_POINTDENSITY_COLOR_PARTTEX: return TEX_PD_COLOR_PARTTEX;
-		default: BLI_assert(false); return TEX_PD_COLOR_CONSTANT;
+		default:
+			BLI_assert(!"Unknown color source");
+			return TEX_PD_COLOR_CONSTANT;
 	}
 }
 
@@ -3909,7 +3910,6 @@ static void def_sh_tex_pointdensity(StructRNA *srna)
 	};
 
 	static EnumPropertyItem color_source_items[] = {
-		{SHD_POINTDENSITY_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""},
 		{SHD_POINTDENSITY_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age",
 		                                 "Lifetime mapped as 0.0 - 1.0 intensity"},
 		{SHD_POINTDENSITY_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed",
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c
index 3cdbfac..e431e9c 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c
@@ -48,6 +48,7 @@ static void node_shader_init_tex_pointdensity(bNodeTree *UNUSED(ntree),
 	point_density->resolution = 100;
 	point_density->radius = 0.3f;
 	point_density->space = SHD_POINTDENSITY_SPACE_OBJECT;
+	point_density->color_source = SHD_POINTDENSITY_COLOR_PARTAGE;
 	node->storage = point_density;
 }




More information about the Bf-blender-cvs mailing list