diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-20 05:14:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-20 05:14:33 +0400 |
commit | 3c8d86e117b54914524cbc49a8678ecaad8671cf (patch) | |
tree | 8101c8b12f888ded58d7e489e7855e754f0cf065 /intern | |
parent | 331dd678c75ba1ef4e714c989c8f1bfae35508c2 (diff) | |
parent | acf30220c9d63e0f060ee69115fe82016de025d4 (diff) |
svn merge ^/trunk/blender -r41961:41998
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 1 | ||||
-rw-r--r-- | intern/cycles/blender/CMakeLists.txt | 14 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 2 | ||||
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 15 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/bsdf_oren_nayar.h | 10 |
5 files changed, 13 insertions, 29 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index cfff7485e61..a85b2ba8c2a 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -61,6 +61,7 @@ include_directories( # Subdirectories if(WITH_CYCLES_BLENDER) + add_definitions(-DBLENDER_PLUGIN) add_subdirectory(blender) endif(WITH_CYCLES_BLENDER) diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index ea46911ce16..e81f02f2090 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -1,11 +1,4 @@ -set(BLENDER_INCLUDE_DIRS - ${CMAKE_SOURCE_DIR}/intern/guardedalloc - ${CMAKE_SOURCE_DIR}/source/blender/makesdna - ${CMAKE_SOURCE_DIR}/source/blender/makesrna - ${CMAKE_SOURCE_DIR}/source/blender/blenloader - ${CMAKE_BINARY_DIR}/source/blender/makesrna/intern) - set(INC ../render ../device @@ -13,15 +6,18 @@ set(INC ../kernel/svm ../util ../subd + ../../../intern/guardedalloc + ../../../source/blender/makesdna + ../../../source/blender/makesrna + ../../../source/blender/blenloader + ${CMAKE_BINARY_DIR}/source/blender/makesrna/intern ) set(INC_SYS - ${BLENDER_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${GLEW_INCLUDE_PATH} ) - set(SRC blender_camera.cpp blender_mesh.cpp diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 00010bb7463..f3ed3b677fb 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -295,7 +295,7 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - return CyclesButtonsPanel.poll(context) and context.mesh or context.curve or context.meta_ball + return CyclesButtonsPanel.poll(context) and (context.mesh or context.curve or context.meta_ball) def draw(self, context): layout = self.layout diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 9037362f1ab..7d12e261068 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -71,21 +71,6 @@ if(WITH_CYCLES_PARTIO) endif() ########################################################################### -# Blender - -if(WITH_CYCLES_BLENDER) - - set(BLENDER_INCLUDE_DIRS - ${CMAKE_SOURCE_DIR}/intern/guardedalloc - ${CMAKE_SOURCE_DIR}/source/blender/makesdna - ${CMAKE_SOURCE_DIR}/source/blender/makesrna - ${CMAKE_SOURCE_DIR}/source/blender/blenloader - ${CMAKE_BINARY_DIR}/source/blender/makesrna/intern) - - add_definitions(-DBLENDER_PLUGIN) -endif() - -########################################################################### # CUDA if(WITH_CYCLES_CUDA_BINARIES) diff --git a/intern/cycles/kernel/svm/bsdf_oren_nayar.h b/intern/cycles/kernel/svm/bsdf_oren_nayar.h index 11dc07e485c..0ad7cad06bb 100644 --- a/intern/cycles/kernel/svm/bsdf_oren_nayar.h +++ b/intern/cycles/kernel/svm/bsdf_oren_nayar.h @@ -70,8 +70,8 @@ __device float3 bsdf_oren_nayar_get_intensity(const ShaderClosure *sc, float3 n, cos_b = nl; } - float sin_a = sqrtf(1.0f - cos_a * cos_a); - float tan_b = sqrtf(1.0f - cos_b * cos_b) / (cos_b + FLT_MIN); + float sin_a = sqrtf(max(1.0f - cos_a * cos_a, 0.0f)); + float tan_b = sqrtf(max(1.0f - cos_b * cos_b, 0.0f)) / max(cos_b, 1e-8f); float is = nl * (sc->data0 + sc->data1 * t * sin_a * tan_b); return make_float3(is, is, is); @@ -84,8 +84,10 @@ __device void bsdf_oren_nayar_setup(ShaderData *sd, ShaderClosure *sc, float sig sigma = clamp(sigma, 0.0f, 1.0f); - sc->data0 = 1.0f / ((1.0f + 0.5f * sigma) * M_PI_F); - sc->data1 = sigma / ((1.0f + 0.5f * sigma) * M_PI_F); + float div = 1.0f / ((1.0f + 0.5f * sigma) * M_PI_F); + + sc->data0 = 1.0f * div; + sc->data1 = sigma * div; } __device void bsdf_oren_nayar_blur(ShaderClosure *sc, float roughness) |