[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58641] branches/soc-2013-cycles_volume: - added methods to check if texture is a gdb file;
Rafael Campos
rafaelcdn at gmail.com
Sat Jul 27 02:58:58 CEST 2013
Revision: 58641
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58641
Author: jehuty
Date: 2013-07-27 00:58:57 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
- added methods to check if texture is a gdb file;
- cleaned up the files after moving the volume class to cycles/kernel/textures from cycles/kernel/osl;
Modified Paths:
--------------
branches/soc-2013-cycles_volume/CMakeLists.txt
branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.cpp
branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.h
branches/soc-2013-cycles_volume/intern/cycles/kernel/textures/openvdb_volume.cpp
branches/soc-2013-cycles_volume/intern/cycles/kernel/textures/openvdb_volume.h
branches/soc-2013-cycles_volume/intern/cycles/openvdb_app/CMakeLists.txt
branches/soc-2013-cycles_volume/intern/cycles/openvdb_app/cycles_openvdb_test.cpp
Removed Paths:
-------------
branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.cpp
branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.h
Modified: branches/soc-2013-cycles_volume/CMakeLists.txt
===================================================================
--- branches/soc-2013-cycles_volume/CMakeLists.txt 2013-07-27 00:55:20 UTC (rev 58640)
+++ branches/soc-2013-cycles_volume/CMakeLists.txt 2013-07-27 00:58:57 UTC (rev 58641)
@@ -1891,7 +1891,6 @@
set(REDCODE_INC ${REDCODE})
endif()
-<<<<<<< .working
if(WITH_CYCLES_OPENVDB)
set(OPENVDB_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/openvdb/internal")
@@ -1899,8 +1898,9 @@
#-----------------------------------------------------------------------------
# Blender WebPlugin
-=======
->>>>>>> .merge-right.r58632
+
+if(WITH_WEBPLUGIN)
+ set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
set(WITH_PLAYER ON)
@@ -1999,7 +1999,6 @@
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull) # C only
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
- ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2026,7 +2025,6 @@
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
- ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2077,20 +2075,6 @@
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
- ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
-
- ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
- ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
- ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
- ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
- ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
-
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
Deleted: branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.cpp
===================================================================
--- branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.cpp 2013-07-27 00:55:20 UTC (rev 58640)
+++ branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.cpp 2013-07-27 00:58:57 UTC (rev 58641)
@@ -1,76 +0,0 @@
-/*
- * Copyright 2013, 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.
- */
-
-#include "openvdb_volume.h"
-
-CCL_NAMESPACE_BEGIN
-
-/* static ustrings */
-ustring OpenVDBUtil::u_openvdb_file_extension(".vdb");
-
-void OpenVDBUtil::initialize_library()
-{ //any additional configuration needed?
- openvdb::initialize();
-}
-
-bool OpenVDBUtil::open_file(OIIO::ustring filename, OpenVDBVolume &vdb_volume)
-{
- openvdb::io::File file(filename.string());
-
- file.open();
- openvdb::GridPtrVecPtr grids = file.getGrids();
-
- file.close();
-
- // Build OpenVDBVolume
- //OpenVDBVolume vdb_volume(file, grids);
-
- //return vdb_volume;
- return true;
-}
-
-bool OpenVDBUtil::is_openvdb_volume_file(OIIO::ustring filename)
-{
-
-
- if (filename.substr(filename.length() - u_openvdb_file_extension.length(),
- u_openvdb_file_extension.length()) == u_openvdb_file_extension)
- return true;
- else
- return false;
-}
-
-bool OpenVDBUtil::is_openvdb_volume_file(OIIO::ustring filename, ustring &openvdb_version)
-{
- if (is_openvdb_volume_file(filename))
- {
- openvdb::io::File file(filename.string());
- file.open();
-
- openvdb_version.empty();
- openvdb_version = file.version();
-
- if(openvdb_version.length() > 0)
- return true;
- }
-
- return false;
-}
-
-
-CCL_NAMESPACE_END
\ No newline at end of file
Deleted: branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.h
===================================================================
--- branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.h 2013-07-27 00:55:20 UTC (rev 58640)
+++ branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/openvdb_volume.h 2013-07-27 00:58:57 UTC (rev 58641)
@@ -1,71 +0,0 @@
-/*
- * Copyright 2013, 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.
- */
-
-#ifndef __OPENVDB_VOLUME_H__
-#define __OPENVDB_VOLUME_H__
-
-#include <openvdb/openvdb.h>
-#include <OSL/oslexec.h>
-
-CCL_NAMESPACE_BEGIN
-
-using namespace OIIO;
-
-typedef enum eOpenVDBGridType
-{
- OPENVDB_GRID_TYPE_NOT_SET,
- OPENVDB_GRID_TYPE_FLOAT,
- OPENVDB_GRID_TYPE_INT32,
- OPENVDB_GRID_TYPE_INT64,
- OPENVDB_GRID_TYPE_VEC3F
-} eOpenVDBGridType;
-
-typedef struct OpenVDBVolume { //increasingly, it seems OpenVDBVolume should actually be OpenVDBVolumeCollection; checking with Brecht.
- //TODO: wip: handles for file, sampling mechanism and pointer to grid(s): each file might contain more than 1 grid;
- openvdb::io::File file;
- openvdb::GridPtrVecPtr grids;
-
-
-} OpenVDBVolume;
-
-class OpenVDBVolumeAccessor {
-public:
-private:
- openvdb::GridBase::Ptr grid;
- eOpenVDBGridType grid_type; // Is this really necessary? Check OpenVDB's generic programming guidelines.
-
-};
-
-class OpenVDBUtil
-{
-public:
- static void initialize_library();
- static bool open_file(OIIO::ustring filename, OpenVDBVolume &vdb_volume);
- static bool is_openvdb_volume_file(OIIO::ustring filename);
- static bool is_openvdb_volume_file(OIIO::ustring filename, ustring &openvdb_version);
-
- static ustring u_openvdb_file_extension;
-private:
- int i;
-};
-
-
-
-CCL_NAMESPACE_END
-
-#endif /* __OPENVDB_VOLUME_H__ */
\ No newline at end of file
Modified: branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.cpp
===================================================================
--- branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.cpp 2013-07-27 00:55:20 UTC (rev 58640)
+++ branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.cpp 2013-07-27 00:58:57 UTC (rev 58641)
@@ -790,9 +790,14 @@
const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy,
const OSL::Vec3 &dPdz, float *result)
{
-
+/*
//Are we dealing with an OpenVDB volume file?
-
+ if (ccl::OpenVDBUtil::is_vdb_volume_file(filename))
+ {
+ // TODO:
+ // - check if file is open and mapped;
+ // - perform lookup;
+ } */
OSL::TextureSystem *ts = osl_ts;
bool status = ts->texture3d(filename, options, P, dPdx, dPdy, dPdz, result);
Modified: branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.h
===================================================================
--- branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.h 2013-07-27 00:55:20 UTC (rev 58640)
+++ branches/soc-2013-cycles_volume/intern/cycles/kernel/osl/osl_services.h 2013-07-27 00:58:57 UTC (rev 58641)
@@ -30,6 +30,8 @@
#include <OSL/oslexec.h>
#include <OSL/oslclosure.h>
+//#include <textures/openvdb_volume.h>
+
CCL_NAMESPACE_BEGIN
class Object;
Modified: branches/soc-2013-cycles_volume/intern/cycles/kernel/textures/openvdb_volume.cpp
===================================================================
--- branches/soc-2013-cycles_volume/intern/cycles/kernel/textures/openvdb_volume.cpp 2013-07-27 00:55:20 UTC (rev 58640)
+++ branches/soc-2013-cycles_volume/intern/cycles/kernel/textures/openvdb_volume.cpp 2013-07-27 00:58:57 UTC (rev 58641)
@@ -28,6 +28,7 @@
openvdb::initialize();
}
+
bool OpenVDBUtil::open_file(OIIO::ustring filename, OpenVDBVolume &vdb_volume)
{
openvdb::io::File file(filename.string());
@@ -42,35 +43,46 @@
//return vdb_volume;
return true;
-}
+}
-bool OpenVDBUtil::is_openvdb_volume_file(OIIO::ustring filename)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list