diff options
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 1 | ||||
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 15 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/bsdf_oren_nayar.h | 10 |
3 files changed, 7 insertions, 19 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index cfff7485e61..2a7a6f4ca65 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -62,6 +62,7 @@ include_directories( if(WITH_CYCLES_BLENDER) add_subdirectory(blender) + add_definitions(-DBLENDER_PLUGIN) endif(WITH_CYCLES_BLENDER) add_subdirectory(app) 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) |