Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2016-11-23 18:50:49 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-11-23 18:50:49 +0300
commit4842cc017c3bb7df2070c2f96605190ff88e6a2e (patch)
tree5d27678b32f73726f6b585337aa3cb79d3b48797 /intern
parentfaf74d1d2db9f243ce8511011bea3511570ee41a (diff)
Removed the deprecated OpenVDB shader node for direct loading of .vdb files.
This node was already disabled. All vdb data should eventually be loaded through the Cycles sync procedure as object data. Specialized nodes for accessing voxel data may eventually be added again for convenience, but these would just be advanced attribute nodes.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_shader.cpp37
-rw-r--r--intern/cycles/kernel/CMakeLists.txt1
-rw-r--r--intern/cycles/kernel/svm/svm.h6
-rw-r--r--intern/cycles/kernel/svm/svm_openvdb.h46
-rw-r--r--intern/cycles/kernel/svm/svm_types.h6
-rw-r--r--intern/cycles/render/nodes.cpp71
-rw-r--r--intern/cycles/render/nodes.h17
-rw-r--r--intern/cycles/render/volume.cpp104
-rw-r--r--intern/cycles/render/volume.h12
9 files changed, 0 insertions, 300 deletions
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index f0eea66fb02..f63f94ab37a 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -845,43 +845,6 @@ static ShaderNode *add_node(Scene *scene,
transform_inverse(get_transform(b_ob.matrix_world()));
}
}
- else if(b_node.is_a(&RNA_ShaderNodeOpenVDB)) {
- BL::ShaderNodeOpenVDB b_vdb_node(b_node);
- OpenVDBNode *vdb_node = new OpenVDBNode();
- vdb_node->filename = b_vdb_node.filename();
- vdb_node->sampling = b_vdb_node.sampling();
-
- /* TODO(kevin) */
- if(b_vdb_node.source() == BL::ShaderNodeOpenVDB::source_SEQUENCE) {
- string filename = b_vdb_node.filename();
- string basename = filename.substr(0, filename.size() - 8);
- stringstream ss;
- ss << b_scene.frame_current();
- string frame = ss.str();
- frame.insert(frame.begin(), 4 - frame.size(), '0');
-
- vdb_node->filename = ustring::format("%s%s.vdb", basename, frame);
- }
-
- BL::Node::outputs_iterator b_output;
-
- vdb_node->output_sockets.resize(b_vdb_node.outputs.length());
- int i = 0;
- for(b_vdb_node.outputs.begin(b_output); b_output != b_vdb_node.outputs.end(); ++b_output, ++i) {
- SocketType &socket = vdb_node->output_sockets.at(i);
- socket.name = ustring(b_output->name());
- socket.ui_name = ustring(b_output->name());
- socket.type = convert_socket_type(*b_output);
- socket.struct_offset = 0;
- socket.default_value = NULL;
- socket.enum_values = NULL;
- socket.node_type = NULL;
- socket.flags = SocketType::LINKABLE;
- vdb_node->outputs.push_back(new ShaderOutput(socket, vdb_node));
- }
-
- node = vdb_node;
- }
if(node) {
node->name = b_node.name();
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 105207311c9..5322f6abee1 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -143,7 +143,6 @@ set(SRC_SVM_HEADERS
svm/svm_noise.h
svm/svm_noisetex.h
svm/svm_normal.h
- svm/svm_openvdb.h
svm/svm_ramp.h
svm/svm_ramp_util.h
svm/svm_sepcomb_hsv.h
diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h
index f7ce0c8e0e3..88ec7fe6fcc 100644
--- a/intern/cycles/kernel/svm/svm.h
+++ b/intern/cycles/kernel/svm/svm.h
@@ -169,7 +169,6 @@ CCL_NAMESPACE_END
#include "svm_wave.h"
#include "svm_math.h"
#include "svm_mix.h"
-#include "svm_openvdb.h"
#include "svm_ramp.h"
#include "svm_sepcomb_hsv.h"
#include "svm_sepcomb_vector.h"
@@ -462,11 +461,6 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ccl_a
break;
# endif /* NODES_FEATURE(NODE_FEATURE_VOLUME) */
#endif /* NODES_GROUP(NODE_GROUP_LEVEL_3) */
-#ifdef __OPENVDB__
- case NODE_OPENVDB:
- svm_node_openvdb(kg, sd, stack, node);
- break;
-#endif
case NODE_END:
return;
default:
diff --git a/intern/cycles/kernel/svm/svm_openvdb.h b/intern/cycles/kernel/svm/svm_openvdb.h
deleted file mode 100644
index 3b82e76a148..00000000000
--- a/intern/cycles/kernel/svm/svm_openvdb.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2015 Blender Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-CCL_NAMESPACE_BEGIN
-
-#ifdef __OPENVDB__
-
-ccl_device void svm_node_openvdb(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node)
-{
- float3 co = ccl_fetch(sd, P);
- uint type, out_offset, sampling, slot;
- decode_node_uchar4(node.y, &slot, &type, &out_offset, &sampling);
-
- if(type == NODE_VDB_FLOAT) {
- float out = kernel_tex_voxel_float(slot, co.x, co.y, co.z, sampling);
-
- if(stack_valid(out_offset)) {
- stack_store_float(stack, out_offset, out);
- }
- }
- else if(type == NODE_VDB_FLOAT3) {
- float3 out = kernel_tex_voxel_float3(slot, co.x, co.y, co.z, sampling);
-
- if(stack_valid(out_offset)) {
- stack_store_float3(stack, out_offset, out);
- }
- }
-}
-
-#endif
-
-CCL_NAMESPACE_END
-
diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h
index 9867390f074..5adf7d34f7f 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -132,7 +132,6 @@ typedef enum ShaderNodeType {
NODE_TEX_VOXEL,
NODE_ENTER_BUMP_EVAL,
NODE_LEAVE_BUMP_EVAL,
- NODE_OPENVDB,
} ShaderNodeType;
typedef enum NodeAttributeType {
@@ -377,11 +376,6 @@ typedef enum NodeTexVoxelSpace {
NODE_TEX_VOXEL_SPACE_WORLD = 1,
} NodeTexVoxelSpace;
-typedef enum NodeOpenVDBType {
- NODE_VDB_FLOAT = 0,
- NODE_VDB_FLOAT3 = 1,
-} NodeOpenVDBType;
-
typedef enum ShaderType {
SHADER_TYPE_SURFACE,
SHADER_TYPE_VOLUME,
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index e9b6cdf25d6..f293af3c40a 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -24,16 +24,11 @@
#include "svm_math_util.h"
#include "osl.h"
#include "constant_fold.h"
-#include "volume.h"
#include "util_sky_model.h"
#include "util_foreach.h"
#include "util_transform.h"
-#ifdef WITH_OPENVDB
-#include "../kernel/openvdb/vdb_thread.h"
-#endif
-
CCL_NAMESPACE_BEGIN
/* Texture Mapping */
@@ -5375,70 +5370,4 @@ void TangentNode::compile(OSLCompiler& compiler)
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(node_type)
-{
- volume_manager = NULL;
-}
-
-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() == SocketType::VECTOR || out->type() == SocketType::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::add_output(ustring name, SocketType::Type socket_type)
-{
- const_cast<NodeType*>(type)->register_output(name, name, socket_type);
-}
-
-void OpenVDBNode::compile(OSLCompiler& /*compiler*/)
-{
-}
-
CCL_NAMESPACE_END
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index a16c7ff2efc..eb0f7977dd1 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -27,7 +27,6 @@ CCL_NAMESPACE_BEGIN
class ImageManager;
class Scene;
class Shader;
-class VolumeManager;
/* Texture Mapping */
@@ -980,22 +979,6 @@ public:
float3 normal_osl;
};
-class OpenVDBNode : public ShaderNode {
-public:
- SHADER_NODE_CLASS(OpenVDBNode)
- void attributes(Shader *shader, AttributeRequestSet *attributes);
- bool has_spatial_varying() { return true; }
-
- void add_output(ustring name, SocketType::Type type);
-
- ustring filename;
- VolumeManager *volume_manager;
-
- int grid_slot;
- int sampling;
- vector<SocketType> output_sockets;
-};
-
CCL_NAMESPACE_END
#endif /* __NODES_H__ */
diff --git a/intern/cycles/render/volume.cpp b/intern/cycles/render/volume.cpp
index 0fcb9a9501c..c677f1df576 100644
--- a/intern/cycles/render/volume.cpp
+++ b/intern/cycles/render/volume.cpp
@@ -65,34 +65,6 @@ static inline void catch_exceptions()
#endif
}
-#if 0
-int VolumeManager::add_volume(const string& filename, const string& name, int sampling, int grid_type)
-{
- size_t slot = -1;
-
- if((slot = find_existing_slot(filename, name, sampling, grid_type)) != -1) {
- return slot;
- }
-
- try {
- if(is_openvdb_file(filename)) {
- slot = add_openvdb_volume(filename, name, sampling, grid_type);
- }
-
- add_grid_description(filename, name, sampling, slot);
-
- need_update = true;
- }
- catch(...) {
- catch_exceptions();
- need_update = false;
- slot = -1;
- }
-
- return slot;
-}
-#endif
-
int VolumeManager::add_volume(Volume *volume, const std::string &filename, const std::string &name)
{
size_t slot = -1;
@@ -123,29 +95,6 @@ int VolumeManager::add_volume(Volume *volume, const std::string &filename, const
return slot;
}
-#if 0
-int VolumeManager::find_existing_slot(const string& filename, const string& name, int sampling, int grid_type)
-{
- for(size_t i = 0; i < current_grids.size(); ++i) {
- GridDescription grid = current_grids[i];
-
- if(grid.filename == filename && grid.name == name) {
- if(grid.sampling == sampling) {
- return grid.slot;
- }
- else {
- /* remove the grid description too */
- std::swap(current_grids[i], current_grids.back());
- current_grids.pop_back();
- break;
- }
- }
- }
-
- return -1;
-}
-#endif
-
int VolumeManager::find_existing_slot(Volume *volume, const std::string &filename, const std::string &name)
{
for(size_t i = 0; i < current_grids.size(); ++i) {
@@ -212,46 +161,6 @@ size_t find_empty_slot(Container container)
return slot;
}
-#if 0
-size_t VolumeManager::add_openvdb_volume(const std::string& filename, const std::string& name, int /*sampling*/, int grid_type)
-{
- size_t slot = -1;
-
-#ifdef WITH_OPENVDB
- using namespace openvdb;
-
- io::File file(filename);
- file.open();
-
- if(!file.hasGrid(name)) return -1;
-
- GridBase::Ptr grid = file.readGrid(name);
- if(grid->getGridClass() == GRID_LEVEL_SET) return -1;
-
- if(grid_type == NODE_VDB_FLOAT) {
- slot = find_empty_slot(scalar_grids);
- if (slot == -1)
- return -1;
-
- scalar_grids.insert(scalar_grids.begin() + slot, gridPtrCast<FloatGrid>(grid));
- }
- else if(grid_type == NODE_VDB_FLOAT3) {
- slot = find_empty_slot(vector_grids);
- if (slot == -1)
- return -1;
-
- vector_grids.insert(vector_grids.begin() + slot, gridPtrCast<Vec3SGrid>(grid));
- }
-#else
- (void)filename;
- (void)name;
- (void)grid_type;
-#endif
-
- return slot;
-}
-#endif
-
size_t VolumeManager::add_openvdb_volume(Volume *volume, const std::string &filename, const std::string &name)
{
size_t slot = -1;
@@ -291,19 +200,6 @@ size_t VolumeManager::add_openvdb_volume(Volume *volume, const std::string &file
return slot;
}
-#if 0
-void VolumeManager::add_grid_description(const string& filename, const string& name, int sampling, int slot)
-{
- GridDescription descr;
- descr.filename = filename;
- descr.name = name;
- descr.sampling = sampling;
- descr.slot = slot;
-
- current_grids.push_back(descr);
-}
-#endif
-
void VolumeManager::add_grid_description(Volume *volume, const std::string &filename, const std::string &name, int slot)
{
GridDescription descr;
diff --git a/intern/cycles/render/volume.h b/intern/cycles/render/volume.h
index d08c6527147..0d706629685 100644
--- a/intern/cycles/render/volume.h
+++ b/intern/cycles/render/volume.h
@@ -65,28 +65,16 @@ class VolumeManager {
void delete_volume(int grid_type, int sampling, size_t slot);
-#if 0
- void add_grid_description(const string& filename, const string& name, int sampling, int slot);
-#endif
void add_grid_description(Volume *volume, const string& filename, const string& name, int slot);
-#if 0
- int find_existing_slot(const string& filename, const string& name, int sampling, int grid_type);
-#endif
int find_existing_slot(Volume *volume, const string& filename, const string& name);
bool is_openvdb_file(const string& filename) const;
-#if 0
- size_t add_openvdb_volume(const string& filename, const string& name, int sampling, int grid_type);
-#endif
size_t add_openvdb_volume(Volume *volume, const string& filename, const string& name);
public:
VolumeManager();
~VolumeManager();
-#if 0
- int add_volume(const string& filename, const string& name, int sampling, int grid_type);
-#endif
int add_volume(Volume *volume, const string& filename, const string& name);
int find_density_slot();