[Bf-blender-cvs] [f3400eb] openvdb: Merge branch 'master' into openvdb

Kévin Dietrich noreply at git.blender.org
Sun Nov 13 21:44:28 CET 2016


Commit: f3400ebb90760d0ee36190d915df4ca60f089fc2
Author: Kévin Dietrich
Date:   Wed Jun 22 19:25:38 2016 +0200
Branches: openvdb
https://developer.blender.org/rBf3400ebb90760d0ee36190d915df4ca60f089fc2

Merge branch 'master' into openvdb

Conflicts:
	intern/cycles/app/cycles_xml.cpp

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



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

diff --cc intern/cycles/kernel/kernel_globals.h
index 6fb563f,8e66a3a..d8c4b7c
--- a/intern/cycles/kernel/kernel_globals.h
+++ b/intern/cycles/kernel/kernel_globals.h
@@@ -39,12 -37,11 +39,14 @@@ struct VolumeStep
  typedef struct KernelGlobals {
  	texture_image_uchar4 texture_byte4_images[TEX_NUM_BYTE4_CPU];
  	texture_image_float4 texture_float4_images[TEX_NUM_FLOAT4_CPU];
+ 	texture_image_half4 texture_half4_images[TEX_NUM_HALF4_CPU];
  	texture_image_float texture_float_images[TEX_NUM_FLOAT_CPU];
  	texture_image_uchar texture_byte_images[TEX_NUM_BYTE_CPU];
+ 	texture_image_half texture_half_images[TEX_NUM_HALF_CPU];
  
 +	float_volume *float_volumes[MAX_VOLUME];
 +	float3_volume *float3_volumes[MAX_VOLUME];
 +
  #  define KERNEL_TEX(type, ttype, name) ttype name;
  #  define KERNEL_IMAGE_TEX(type, ttype, name)
  #  include "kernel_textures.h"
diff --cc intern/cycles/render/nodes.cpp
index d61f14d,5e53b66..03db2e7
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@@ -19,9 -19,9 +19,10 @@@
  #include "nodes.h"
  #include "scene.h"
  #include "svm.h"
+ #include "svm_color_util.h"
  #include "svm_math_util.h"
  #include "osl.h"
 +#include "volume.h"
  
  #include "util_sky_model.h"
  #include "util_foreach.h"
@@@ -4724,53 -5326,4 +5327,65 @@@ void TangentNode::compile(OSLCompiler& 
  	compiler.add(this, "node_tangent"); 
  }
  
++NODE_DEFINE(OpenVDBNode)
++{
++	NodeType* type = NodeType::add("openvdb", create, NodeType::SHADER);
++
++	SOCKET_STRING(filename, "Filename", ustring(""));
++
++	static NodeEnum sampling_enum;
++	sampling_enum.insert("point", OPENVDB_SAMPLE_POINT);
++	sampling_enum.insert("box", OPENVDB_SAMPLE_BOX);
++	SOCKET_ENUM(sampling, "Sampling", sampling_enum, OPENVDB_SAMPLE_POINT);
++
++	return type;
++}
++
 +OpenVDBNode::OpenVDBNode()
- : ShaderNode("openvdb")
++: ShaderNode(node_type)
 +{
- 	filename = "";
 +	volume_manager = NULL;
- 	sampling = OPENVDB_SAMPLE_POINT;
 +}
 +
 +void OpenVDBNode::attributes(Shader *shader, AttributeRequestSet *attributes)
 +{
 +	ShaderNode::attributes(shader, attributes);
 +}
 +
 +void OpenVDBNode::compile(SVMCompiler& compiler)
 +{
 +	volume_manager = compiler.volume_manager;
 +
 +	for(size_t i = 0; i < outputs.size(); ++i) {
 +		ShaderOutput *out = outputs[i];
 +
 +		if(out->links.empty()) {
 +			continue;
 +		}
 +
 +		int type = NODE_VDB_FLOAT;
 +
 +		if(out->type == SHADER_SOCKET_VECTOR || out->type == SHADER_SOCKET_COLOR) {
 +			type = NODE_VDB_FLOAT3;
 +		}
 +
 +		grid_slot = volume_manager->add_volume(filename.string(),
 +		                                       output_names[i].string(),
 +		                                       sampling, type);
 +
 +		if(grid_slot == -1) {
 +			continue;
 +		}
 +
 +		compiler.stack_assign(out);
 +
 +		compiler.add_node(NODE_OPENVDB,
 +		                  compiler.encode_uchar4(grid_slot, type, out->stack_offset, sampling));
 +	}
 +}
 +
 +void OpenVDBNode::compile(OSLCompiler& /*compiler*/)
 +{
 +}
 +
  CCL_NAMESPACE_END
diff --cc intern/cycles/render/nodes.h
index 03afaec,3245fdf..2d66b1e
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@@ -1014,35 -962,10 +963,24 @@@ public
  
  	NodeTangentDirectionType direction_type;
  	NodeTangentAxis axis;
- 	static NodeEnum direction_type_enum;
- 	static NodeEnum axis_enum;
- 
  	ustring attribute;
- 
- 	virtual bool equals(const ShaderNode *other)
- 	{
- 		const TangentNode *tangent_node = (const TangentNode*)other;
- 		return ShaderNode::equals(other) &&
- 		       direction_type == tangent_node->direction_type &&
- 		       axis == tangent_node->axis &&
- 		       attribute == tangent_node->attribute;
- 	}
+ 	float3 normal_osl;
  };
  
 +class OpenVDBNode : public ShaderNode {
 +public:
 +	SHADER_NODE_CLASS(OpenVDBNode)
 +	void attributes(Shader *shader, AttributeRequestSet *attributes);
 +	bool has_spatial_varying() { return true; }
 +
 +	ustring filename;
 +	VolumeManager *volume_manager;
 +
 +	int grid_slot;
 +	int sampling;
 +	vector<ustring> output_names;
 +};
 +
  CCL_NAMESPACE_END
  
  #endif /* __NODES_H__ */




More information about the Bf-blender-cvs mailing list