macOS/QuickLook: support rich thumbnail in Finder #107072
@ -19,11 +19,17 @@ set(MATERIALX_EXTRA_ARGS
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
LIST(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_MODULE_EXTENSION=.pyd)
|
||||
list(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_MODULE_EXTENSION=.pyd)
|
||||
else()
|
||||
LIST(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_MODULE_EXTENSION=_d.pyd)
|
||||
list(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_MODULE_EXTENSION=_d.pyd)
|
||||
endif()
|
||||
LIST(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_LIBRARIES=${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib)
|
||||
list(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_LIBRARIES=${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
list(APPEND MATERIALX_EXTRA_ARGS
|
||||
-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--version-script="${CMAKE_SOURCE_DIR}/linux/materialx_symbols_unix.map"
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_materialx
|
||||
|
@ -198,7 +198,7 @@ else()
|
||||
|
||||
set(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
|
||||
set(PLATFORM_CXXFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -std=c++17 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
|
||||
set(PLATFORM_LDFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
|
||||
set(PLATFORM_LDFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES} -headerpad_max_install_names")
|
||||
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
|
||||
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin19.0.0) # OS X 10.15
|
||||
else()
|
||||
|
@ -35,7 +35,6 @@ ExternalProject_Add(external_python_site_packages
|
||||
zstandard==${ZSTANDARD_VERSION}
|
||||
autopep8==${AUTOPEP8_VERSION}
|
||||
pycodestyle==${PYCODESTYLE_VERSION}
|
||||
toml==${TOML_VERSION}
|
||||
meson==${MESON_VERSION}
|
||||
--no-binary :all:
|
||||
)
|
||||
|
@ -36,7 +36,11 @@ ExternalProject_Add(external_tbb
|
||||
|
||||
${PATCH_CMD} -p 1 -d
|
||||
${BUILD_DIR}/tbb/src/external_tbb <
|
||||
${PATCH_DIR}/tbb.diff
|
||||
${PATCH_DIR}/tbb.diff &&
|
||||
|
||||
${PATCH_CMD} -p 1 -d
|
||||
${BUILD_DIR}/tbb/src/external_tbb <
|
||||
${PATCH_DIR}/tbb_1478.diff
|
||||
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/tbb
|
||||
|
@ -287,11 +287,9 @@ set(CYTHON_VERSION 0.29.30)
|
||||
# but built against ZSTD 1.5.1, while we use 1.5.0.
|
||||
set(ZSTANDARD_VERSION 0.16.0)
|
||||
# Auto-format Python source (developer tool, not used by Blender at run-time).
|
||||
set(AUTOPEP8_VERSION 1.6.0)
|
||||
set(AUTOPEP8_VERSION 2.3.1)
|
||||
# Needed by: `autopep8` (so the version doesn't change on rebuild).
|
||||
set(PYCODESTYLE_VERSION 2.8.0)
|
||||
# Needed by: `autopep8` (so the version doesn't change on rebuild).
|
||||
set(TOML_VERSION 0.10.2)
|
||||
set(PYCODESTYLE_VERSION 2.12.1)
|
||||
# Build system for other packages (not used by Blender at run-time).
|
||||
set(MESON_VERSION 0.63.0)
|
||||
|
||||
|
@ -715,7 +715,7 @@ PACKAGES_ALL = (
|
||||
DISTRO_ID_ARCH: "clang", # clang-format is part of the main clang package.
|
||||
},
|
||||
),
|
||||
Package(name="Python", is_mandatory=True, version="3.11.6", version_short="3.11", version_min="3.11", version_mex="3.13",
|
||||
Package(name="Python", is_mandatory=True, version="3.11.9", version_short="3.11", version_min="3.11", version_mex="3.13",
|
||||
sub_packages=PYTHON_SUBPACKAGES,
|
||||
distro_package_names={DISTRO_ID_DEBIAN: "python3-dev",
|
||||
DISTRO_ID_FEDORA: "python3-devel",
|
||||
|
@ -202,9 +202,9 @@ yum -y install jack-audio-connection-kit-devel
|
||||
# Register ROCm packages
|
||||
rm -f /etc/yum.repos.d/rocm.repo
|
||||
tee --append /etc/yum.repos.d/rocm.repo <<EOF
|
||||
[ROCm-6.1.2]
|
||||
name=ROCm6.1.2
|
||||
baseurl=https://repo.radeon.com/rocm/rhel8/6.1.2/main
|
||||
[ROCm-6.1.3]
|
||||
name=ROCm6.1.3
|
||||
baseurl=https://repo.radeon.com/rocm/rhel8/6.1.3/main
|
||||
enabled=1
|
||||
priority=50
|
||||
gpgcheck=1
|
||||
|
@ -0,0 +1,5 @@
|
||||
/* Hide PugiXML symbols until MaterialX is upgraded to 1.39+ */
|
||||
{
|
||||
local:
|
||||
*pugi*;
|
||||
};
|
19
build_files/build_environment/patches/tbb_1478.diff
Normal file
19
build_files/build_environment/patches/tbb_1478.diff
Normal file
@ -0,0 +1,19 @@
|
||||
diff -Naur orig/src/tbbmalloc/proxy.cpp external_tbb/src/tbbmalloc/proxy.cpp
|
||||
--- orig/src/tbbmalloc/proxy.cpp 2024-10-08 14:43:58 -0600
|
||||
+++ external_tbb/src/tbbmalloc/proxy.cpp 2024-10-08 14:48:26 -0600
|
||||
@@ -452,14 +452,12 @@
|
||||
const char* known_bytecodes[] = {
|
||||
#if _WIN64
|
||||
// "========================================================" - 56 symbols
|
||||
+ "E9********CCCC", // multiple - jmp(0xE9) with address followed by empty space (0xCC - INT 3)
|
||||
"4883EC284885C974", // release free()
|
||||
"4883EC284885C975", // release _msize()
|
||||
"4885C974375348", // release free() 8.0.50727.42, 10.0
|
||||
- "E907000000CCCC", // release _aligned_msize(), _aligned_free() ucrtbase.dll
|
||||
"C7442410000000008B", // release free() ucrtbase.dll 10.0.14393.33
|
||||
- "E90B000000CCCC", // release _msize() ucrtbase.dll 10.0.14393.33
|
||||
"48895C24085748", // release _aligned_msize() ucrtbase.dll 10.0.14393.33
|
||||
- "E903000000CCCC", // release _aligned_msize() ucrtbase.dll 10.0.16299.522
|
||||
"48894C24084883EC28BA", // debug prologue
|
||||
"4C894424184889542410", // debug _aligned_msize() 10.0
|
||||
"48894C24084883EC2848", // debug _aligned_free 10.0
|
@ -16,22 +16,22 @@
|
||||
# LIBFRIBIDI_LIBRARY, where to find the Fribidi library.
|
||||
|
||||
# If LIBFRIBIDI_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT LIBFRIBIDI_ROOT_DIR AND NOT $ENV{LIBFRIBIDI_ROOT_DIR} STREQUAL "")
|
||||
SET(LIBFRIBIDI_ROOT_DIR $ENV{LIBFRIBIDI_ROOT_DIR})
|
||||
ENDIF()
|
||||
if(NOT LIBFRIBIDI_ROOT_DIR AND NOT $ENV{LIBFRIBIDI_ROOT_DIR} STREQUAL "")
|
||||
set(LIBFRIBIDI_ROOT_DIR $ENV{LIBFRIBIDI_ROOT_DIR})
|
||||
endif()
|
||||
|
||||
SET(_fribidi_SEARCH_DIRS
|
||||
set(_fribidi_SEARCH_DIRS
|
||||
${LIBFRIBIDI_ROOT_DIR}
|
||||
)
|
||||
|
||||
FIND_PATH(LIBFRIBIDI_INCLUDE_DIR fribidi/fribidi.h
|
||||
find_path(LIBFRIBIDI_INCLUDE_DIR fribidi/fribidi.h
|
||||
HINTS
|
||||
${_fribidi_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIBFRIBIDI_LIBRARY
|
||||
find_library(LIBFRIBIDI_LIBRARY
|
||||
NAMES
|
||||
fribidi
|
||||
HINTS
|
||||
@ -42,16 +42,16 @@ FIND_LIBRARY(LIBFRIBIDI_LIBRARY
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set FRIBIDI_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fribidi DEFAULT_MSG
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Fribidi DEFAULT_MSG
|
||||
LIBFRIBIDI_LIBRARY LIBFRIBIDI_INCLUDE_DIR)
|
||||
|
||||
IF(FRIBIDI_FOUND)
|
||||
SET(LIBFRIBIDI_LIBRARIES ${LIBFRIBIDI_LIBRARY})
|
||||
SET(LIBFRIBIDI_INCLUDE_DIRS ${LIBFRIBIDI_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
if(FRIBIDI_FOUND)
|
||||
set(LIBFRIBIDI_LIBRARIES ${LIBFRIBIDI_LIBRARY})
|
||||
set(LIBFRIBIDI_INCLUDE_DIRS ${LIBFRIBIDI_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
LIBFRIBIDI_INCLUDE_DIR
|
||||
LIBFRIBIDI_LIBRARY
|
||||
)
|
||||
|
@ -16,22 +16,22 @@
|
||||
# LIBHARFBUZZ_LIBRARY, where to find the Harfbuzz library.
|
||||
|
||||
# If LIBHARFBUZZ_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT LIBHARFBUZZ_ROOT_DIR AND NOT $ENV{LIBHARFBUZZ_ROOT_DIR} STREQUAL "")
|
||||
SET(LIBHARFBUZZ_ROOT_DIR $ENV{LIBHARFBUZZ_ROOT_DIR})
|
||||
ENDIF()
|
||||
if(NOT LIBHARFBUZZ_ROOT_DIR AND NOT $ENV{LIBHARFBUZZ_ROOT_DIR} STREQUAL "")
|
||||
set(LIBHARFBUZZ_ROOT_DIR $ENV{LIBHARFBUZZ_ROOT_DIR})
|
||||
endif()
|
||||
|
||||
SET(_harfbuzz_SEARCH_DIRS
|
||||
set(_harfbuzz_SEARCH_DIRS
|
||||
${LIBHARFBUZZ_ROOT_DIR}
|
||||
)
|
||||
|
||||
FIND_PATH(LIBHARFBUZZ_INCLUDE_DIR harfbuzz/hb.h
|
||||
find_path(LIBHARFBUZZ_INCLUDE_DIR harfbuzz/hb.h
|
||||
HINTS
|
||||
${_harfbuzz_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIBHARFBUZZ_LIBRARY
|
||||
find_library(LIBHARFBUZZ_LIBRARY
|
||||
NAMES
|
||||
harfbuzz
|
||||
HINTS
|
||||
@ -42,16 +42,16 @@ FIND_LIBRARY(LIBHARFBUZZ_LIBRARY
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set HARFBUZZ_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Harfbuzz DEFAULT_MSG
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Harfbuzz DEFAULT_MSG
|
||||
LIBHARFBUZZ_LIBRARY LIBHARFBUZZ_INCLUDE_DIR)
|
||||
|
||||
IF(HARFBUZZ_FOUND)
|
||||
SET(LIBHARFBUZZ_LIBRARIES ${LIBHARFBUZZ_LIBRARY})
|
||||
SET(LIBHARFBUZZ_INCLUDE_DIRS ${LIBHARFBUZZ_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
if(HARFBUZZ_FOUND)
|
||||
set(LIBHARFBUZZ_LIBRARIES ${LIBHARFBUZZ_LIBRARY})
|
||||
set(LIBHARFBUZZ_INCLUDE_DIRS ${LIBHARFBUZZ_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
LIBHARFBUZZ_INCLUDE_DIR
|
||||
LIBHARFBUZZ_LIBRARY
|
||||
)
|
||||
|
@ -28,7 +28,10 @@ set(_optix_SEARCH_DIRS
|
||||
|
||||
# TODO: Which environment uses this?
|
||||
if(DEFINED ENV{PROGRAMDATA})
|
||||
list(APPEND _optix_SEARCH_DIRS "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0")
|
||||
list(APPEND _optix_SEARCH_DIRS
|
||||
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.4.0"
|
||||
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path(OPTIX_INCLUDE_DIR
|
||||
|
@ -974,7 +974,6 @@ function(delayed_do_install
|
||||
endfunction()
|
||||
|
||||
# Same as above but generates the var name and output automatic.
|
||||
# Takes optional: `STRIP_LEADING_C_COMMENTS` argument.
|
||||
function(data_to_c
|
||||
file_from file_to
|
||||
list_to_add
|
||||
@ -985,19 +984,10 @@ function(data_to_c
|
||||
|
||||
get_filename_component(_file_to_path ${file_to} PATH)
|
||||
|
||||
set(optional_args "")
|
||||
foreach(f ${ARGN})
|
||||
if(f STREQUAL "STRIP_LEADING_C_COMMENTS")
|
||||
set(optional_args "--options=strip_leading_c_comments")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown optional argument ${f} to \"data_to_c\"")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${file_from} ${file_to} ${optional_args}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${file_from} ${file_to}
|
||||
DEPENDS ${file_from} datatoc)
|
||||
|
||||
set_source_files_properties(${file_to} PROPERTIES GENERATED TRUE)
|
||||
@ -1005,7 +995,6 @@ endfunction()
|
||||
|
||||
|
||||
# Same as above but generates the var name and output automatic.
|
||||
# Takes optional: `STRIP_LEADING_C_COMMENTS` argument.
|
||||
function(data_to_c_simple
|
||||
file_from
|
||||
list_to_add
|
||||
@ -1022,24 +1011,46 @@ function(data_to_c_simple
|
||||
|
||||
get_filename_component(_file_to_path ${_file_to} PATH)
|
||||
|
||||
set(optional_args "")
|
||||
foreach(f ${ARGN})
|
||||
if(f STREQUAL "STRIP_LEADING_C_COMMENTS")
|
||||
set(optional_args "--options=strip_leading_c_comments")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown optional argument ${f} to \"data_to_c_simple\"")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to} ${optional_args}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to}
|
||||
DEPENDS ${_file_from} datatoc)
|
||||
|
||||
set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
|
||||
endfunction()
|
||||
|
||||
|
||||
# Process glsl file and convert it to c
|
||||
function(glsl_to_c
|
||||
file_from
|
||||
list_to_add
|
||||
)
|
||||
|
||||
# remove ../'s
|
||||
get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from} REALPATH)
|
||||
get_filename_component(_file_tmp ${CMAKE_CURRENT_BINARY_DIR}/${file_from} REALPATH)
|
||||
get_filename_component(_file_to ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.c REALPATH)
|
||||
|
||||
list(APPEND ${list_to_add} ${_file_to})
|
||||
source_group(Generated FILES ${_file_to})
|
||||
list(APPEND ${list_to_add} ${file_from})
|
||||
set(${list_to_add} ${${list_to_add}} PARENT_SCOPE)
|
||||
|
||||
get_filename_component(_file_to_path ${_file_to} PATH)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${_file_to}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
|
||||
COMMAND "$<TARGET_FILE:glsl_preprocess>" ${_file_from} ${_file_tmp}
|
||||
COMMAND "$<TARGET_FILE:datatoc>" ${_file_tmp} ${_file_to}
|
||||
DEPENDS ${_file_from} datatoc glsl_preprocess)
|
||||
|
||||
set_source_files_properties(${_file_tmp} PROPERTIES GENERATED TRUE)
|
||||
set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
|
||||
endfunction()
|
||||
|
||||
|
||||
function(msgfmt_simple
|
||||
file_from
|
||||
list_to_add
|
||||
|
@ -103,9 +103,9 @@ if(WIN32)
|
||||
TYPE SHA1 UPPER
|
||||
)
|
||||
|
||||
set(CPACK_WIX_TEMPLATE ${LIBDIR}/package/installer_wix/WIX.template)
|
||||
set(CPACK_WIX_UI_BANNER ${LIBDIR}/package/installer_wix/WIX_UI_BANNER.bmp)
|
||||
set(CPACK_WIX_UI_DIALOG ${LIBDIR}/package/installer_wix/WIX_UI_DIALOG.bmp)
|
||||
set(CPACK_WIX_TEMPLATE ${CMAKE_SOURCE_DIR}/release/windows/installer_wix/WIX.template)
|
||||
set(CPACK_WIX_UI_BANNER ${CMAKE_SOURCE_DIR}/release/windows/installer_wix/WIX_UI_BANNER.bmp)
|
||||
set(CPACK_WIX_UI_DIALOG ${CMAKE_SOURCE_DIR}/release/windows/installer_wix/WIX_UI_DIALOG.bmp)
|
||||
|
||||
set(CPACK_WIX_LIGHT_EXTRA_FLAGS -dcl:medium)
|
||||
endif()
|
||||
|
@ -126,10 +126,9 @@ macro(blender_src_gtest_ex)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES VS_GLOBAL_VcpkgEnabled "false")
|
||||
|
||||
if(WITH_WINDOWS_EXTERNAL_MANIFEST)
|
||||
install(
|
||||
FILES ${CMAKE_BINARY_DIR}/tests.exe.manifest
|
||||
DESTINATION ${TESTS_OUTPUT_DIR}
|
||||
RENAME ${TARGET_NAME}.exe.manifest
|
||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/tests.exe.manifest ${TESTS_OUTPUT_DIR}/${TARGET_NAME}.exe.manifest
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/tests.exe.manifest
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,10 +1,10 @@
|
||||
Pipeline Config
|
||||
===============
|
||||
|
||||
The `yaml` configuration file is used by buildbot build pipeline `update-code` step.
|
||||
The `yaml` configuration file is used by buildbot build pipeline `update-code` step.
|
||||
|
||||
The file allows to set branches or specific commits for both git submodules and svn artifacts. Can also define various build package versions for use by build workers. Especially useful in experimental and release branches.
|
||||
|
||||
NOTE:
|
||||
* The configuration file is ```NOT``` used by the `../utils/make_update.py` script.
|
||||
* The configuration file is ```NOT``` used by the `../utils/make_update.py` script.
|
||||
* That will implemented in the future.
|
||||
|
@ -1,4 +1,8 @@
|
||||
set BUILD_VS_LIBDIR=lib/windows_x64
|
||||
if "%BUILD_ARCH%" == "arm64" (
|
||||
set BUILD_VS_LIBDIR=lib/windows_arm64
|
||||
) else (
|
||||
set BUILD_VS_LIBDIR=lib/windows_x64
|
||||
)
|
||||
|
||||
:RETRY
|
||||
"%GIT%" -C "%BLENDER_DIR%\" config --local "submodule.%BUILD_VS_LIBDIR%.update" "checkout"
|
||||
|
@ -402,7 +402,7 @@ def main():
|
||||
log.info(" saving to: " + Path_Blend)
|
||||
try:
|
||||
bpy.ops.wm.save_as_mainfile(filepath=Path_Blend, copy=True, compress=False)
|
||||
except:
|
||||
except Exception:
|
||||
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
|
||||
return
|
||||
else:
|
||||
|
@ -57,7 +57,7 @@ translations_tuple = (
|
||||
(("Operator", "Render: Copy Settings"),
|
||||
(("bpy.types.SCENE_OT_render_copy_settings",),
|
||||
()),
|
||||
("fr_FR", "Rendu : copier réglages",
|
||||
("fr_FR", "Rendu: copier réglages",
|
||||
(False, ())),
|
||||
),
|
||||
(("*", "Copy render settings from current scene to others"),
|
||||
|
@ -66,7 +66,7 @@ API_F_ARGS = 7
|
||||
def api_version():
|
||||
try:
|
||||
import bpy
|
||||
except:
|
||||
except ModuleNotFoundError:
|
||||
return None, None
|
||||
version = tuple(bpy.app.version[:2])
|
||||
version_key = "%d.%d" % (version[0], version[1])
|
||||
|
@ -1205,8 +1205,6 @@ context_type_map = {
|
||||
"edit_object": [("Object", False)],
|
||||
"edit_text": [("Text", False)],
|
||||
"editable_bones": [("EditBone", True)],
|
||||
"editable_gpencil_layers": [("GPencilLayer", True)],
|
||||
"editable_gpencil_strokes": [("GPencilStroke", True)],
|
||||
"editable_objects": [("Object", True)],
|
||||
"editable_fcurves": [("FCurve", True)],
|
||||
"fluid": [("FluidSimulationModifier", False)],
|
||||
@ -2539,7 +2537,7 @@ def main():
|
||||
|
||||
try:
|
||||
os.mkdir(SPHINX_IN_TMP)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Copy extra files needed for theme.
|
||||
|
@ -18,6 +18,8 @@ from bl_ui.properties_view_layer import (
|
||||
ViewLayerLightgroupsPanelHelper,
|
||||
)
|
||||
|
||||
from bl_ui.properties_object import has_geometry_visibility
|
||||
|
||||
|
||||
class CyclesPresetPanel(PresetPanel, Panel):
|
||||
COMPAT_ENGINES = {'CYCLES'}
|
||||
@ -1255,46 +1257,14 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
col.prop(cob, "use_deform_motion", text="Deformation")
|
||||
|
||||
|
||||
def has_geometry_visibility(ob):
|
||||
return ob and (
|
||||
(ob.type in {
|
||||
'MESH',
|
||||
'CURVE',
|
||||
'SURFACE',
|
||||
'FONT',
|
||||
'META',
|
||||
'LIGHT',
|
||||
'VOLUME',
|
||||
'POINTCLOUD',
|
||||
'CURVES',
|
||||
}) or (ob.instance_type == 'COLLECTION' and ob.instance_collection))
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Shading"
|
||||
bl_context = "object"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not CyclesButtonsPanel.poll(context):
|
||||
return False
|
||||
|
||||
ob = context.object
|
||||
return ob and has_geometry_visibility(ob)
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_shading_shadow_terminator(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Shadow Terminator"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_parent_id = "OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.object.type != 'LIGHT'
|
||||
return CyclesButtonsPanel.poll(context) and context.object.type != 'LIGHT'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -1310,12 +1280,12 @@ class CYCLES_OBJECT_PT_shading_shadow_terminator(CyclesButtonsPanel, Panel):
|
||||
|
||||
class CYCLES_OBJECT_PT_shading_gi_approximation(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Fast GI Approximation"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_parent_id = "OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.object.type != 'LIGHT'
|
||||
return CyclesButtonsPanel.poll(context) and context.object.type != 'LIGHT'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -1334,7 +1304,7 @@ class CYCLES_OBJECT_PT_shading_gi_approximation(CyclesButtonsPanel, Panel):
|
||||
|
||||
class CYCLES_OBJECT_PT_shading_caustics(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Caustics"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_parent_id = "OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
|
||||
@classmethod
|
||||
@ -1356,7 +1326,7 @@ class CYCLES_OBJECT_PT_shading_caustics(CyclesButtonsPanel, Panel):
|
||||
|
||||
class CYCLES_OBJECT_PT_lightgroup(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Light Group"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_parent_id = "OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
@ -1379,96 +1349,6 @@ class CYCLES_OBJECT_PT_lightgroup(CyclesButtonsPanel, Panel):
|
||||
sub.operator("scene.view_layer_add_lightgroup", icon='ADD', text="").name = ob.lightgroup
|
||||
|
||||
|
||||
class CYCLES_OBJECT_MT_light_linking_context_menu(Menu):
|
||||
bl_label = "Light Linking Specials"
|
||||
|
||||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.light_linking_receivers_select")
|
||||
|
||||
|
||||
class CYCLES_OBJECT_MT_shadow_linking_context_menu(Menu):
|
||||
bl_label = "Shadow Linking Specials"
|
||||
|
||||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.light_linking_blockers_select")
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_light_linking(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Light Linking"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
object = context.object
|
||||
light_linking = object.light_linking
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.template_ID(
|
||||
light_linking,
|
||||
"receiver_collection",
|
||||
new="object.light_linking_receiver_collection_new")
|
||||
|
||||
if not light_linking.receiver_collection:
|
||||
return
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.template_light_linking_collection(row, light_linking, "receiver_collection")
|
||||
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
prop = sub.operator("object.light_linking_receivers_link", icon='ADD', text="")
|
||||
prop.link_state = 'INCLUDE'
|
||||
sub.operator("object.light_linking_unlink_from_collection", icon='REMOVE', text="")
|
||||
sub = col.column()
|
||||
sub.menu("CYCLES_OBJECT_MT_light_linking_context_menu", icon='DOWNARROW_HLT', text="")
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_shadow_linking(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Shadow Linking"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
object = context.object
|
||||
light_linking = object.light_linking
|
||||
|
||||
col = layout.column()
|
||||
|
||||
col.template_ID(
|
||||
light_linking,
|
||||
"blocker_collection",
|
||||
new="object.light_linking_blocker_collection_new")
|
||||
|
||||
if not light_linking.blocker_collection:
|
||||
return
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.template_light_linking_collection(row, light_linking, "blocker_collection")
|
||||
|
||||
col = row.column()
|
||||
sub = col.column(align=True)
|
||||
prop = sub.operator("object.light_linking_blockers_link", icon='ADD', text="")
|
||||
prop.link_state = 'INCLUDE'
|
||||
sub.operator("object.light_linking_unlink_from_collection", icon='REMOVE', text="")
|
||||
sub = col.column()
|
||||
sub.menu("CYCLES_OBJECT_MT_shadow_linking_context_menu", icon='DOWNARROW_HLT', text="")
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Visibility"
|
||||
bl_context = "object"
|
||||
@ -2517,14 +2397,6 @@ def draw_pause(self, context):
|
||||
layout.prop(cscene, "preview_pause", icon='PLAY' if cscene.preview_pause else 'PAUSE', text="")
|
||||
|
||||
|
||||
def draw_make_links(self, context):
|
||||
if context.engine == "CYCLES":
|
||||
layout = self.layout
|
||||
layout.separator()
|
||||
layout.operator_menu_enum("object.light_linking_receivers_link", "link_state")
|
||||
layout.operator_menu_enum("object.light_linking_blockers_link", "link_state")
|
||||
|
||||
|
||||
def get_panels():
|
||||
exclude_panels = {
|
||||
'DATA_PT_camera_dof',
|
||||
@ -2608,15 +2480,10 @@ classes = (
|
||||
CYCLES_CAMERA_PT_dof_aperture,
|
||||
CYCLES_PT_context_material,
|
||||
CYCLES_OBJECT_PT_motion_blur,
|
||||
CYCLES_OBJECT_PT_shading,
|
||||
CYCLES_OBJECT_PT_shading_shadow_terminator,
|
||||
CYCLES_OBJECT_PT_shading_gi_approximation,
|
||||
CYCLES_OBJECT_PT_shading_caustics,
|
||||
CYCLES_OBJECT_PT_lightgroup,
|
||||
CYCLES_OBJECT_MT_light_linking_context_menu,
|
||||
CYCLES_OBJECT_PT_light_linking,
|
||||
CYCLES_OBJECT_MT_shadow_linking_context_menu,
|
||||
CYCLES_OBJECT_PT_shadow_linking,
|
||||
CYCLES_OBJECT_PT_visibility,
|
||||
CYCLES_OBJECT_PT_visibility_ray_visibility,
|
||||
CYCLES_OBJECT_PT_visibility_culling,
|
||||
@ -2663,7 +2530,6 @@ def register():
|
||||
|
||||
bpy.types.RENDER_PT_context.append(draw_device)
|
||||
bpy.types.VIEW3D_HT_header.append(draw_pause)
|
||||
bpy.types.VIEW3D_MT_make_links.append(draw_make_links)
|
||||
|
||||
for panel in get_panels():
|
||||
panel.COMPAT_ENGINES.add('CYCLES')
|
||||
@ -2677,7 +2543,6 @@ def unregister():
|
||||
|
||||
bpy.types.RENDER_PT_context.remove(draw_device)
|
||||
bpy.types.VIEW3D_HT_header.remove(draw_pause)
|
||||
bpy.types.VIEW3D_MT_make_links.remove(draw_make_links)
|
||||
|
||||
for panel in get_panels():
|
||||
if 'CYCLES' in panel.COMPAT_ENGINES:
|
||||
|
@ -19,6 +19,13 @@
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
class Device;
|
||||
class GPUDevice;
|
||||
class CUDADevice;
|
||||
class OptiXDevice;
|
||||
class HIPDevice;
|
||||
class HIPRTDevice;
|
||||
class MetalDevice;
|
||||
class OneapiDevice;
|
||||
|
||||
enum MemoryType {
|
||||
MEM_READ_ONLY,
|
||||
|
@ -1225,10 +1225,6 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
|
||||
list(APPEND sycl_compiler_flags -fPIC)
|
||||
list(APPEND sycl_compiler_flags -fvisibility=hidden)
|
||||
|
||||
# We avoid getting __FAST_MATH__ to be defined when building on CentOS-7 and Rocky-8
|
||||
# until the compilation issues it triggers at either AoT or JIT stages gets fixed.
|
||||
list(APPEND sycl_compiler_flags -fhonor-nans)
|
||||
|
||||
# Add $ORIGIN to `cycles_kernel_oneapi.so` RPATH so `libsycl.so` and
|
||||
# `libpi_level_zero.so` can be placed next to it and get found.
|
||||
list(APPEND sycl_compiler_flags -Wl,-rpath,'$$ORIGIN')
|
||||
|
@ -12,22 +12,6 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Spherical coordinates <-> Cartesian direction. */
|
||||
|
||||
ccl_device float2 direction_to_spherical(float3 dir)
|
||||
{
|
||||
float theta = safe_acosf(dir.z);
|
||||
float phi = atan2f(dir.x, dir.y);
|
||||
|
||||
return make_float2(theta, phi);
|
||||
}
|
||||
|
||||
ccl_device float3 spherical_to_direction(float theta, float phi)
|
||||
{
|
||||
float sin_theta = sinf(theta);
|
||||
return make_float3(sin_theta * sinf(phi), sin_theta * cosf(phi), cosf(theta));
|
||||
}
|
||||
|
||||
/* Equirectangular coordinates <-> Cartesian direction */
|
||||
|
||||
ccl_device float2 direction_to_equirectangular_range(float3 dir, float4 range)
|
||||
@ -45,8 +29,7 @@ ccl_device float3 equirectangular_range_to_direction(float u, float v, float4 ra
|
||||
{
|
||||
float phi = range.x * u + range.y;
|
||||
float theta = range.z * v + range.w;
|
||||
float sin_theta = sinf(theta);
|
||||
return make_float3(sin_theta * cosf(phi), sin_theta * sinf(phi), cosf(theta));
|
||||
return spherical_to_direction(theta, phi);
|
||||
}
|
||||
|
||||
ccl_device float2 direction_to_equirectangular(float3 dir)
|
||||
@ -77,14 +60,24 @@ ccl_device float3 central_cylindrical_to_direction(float u, float v, float4 rang
|
||||
|
||||
/* Fisheye <-> Cartesian direction */
|
||||
|
||||
ccl_device float2 direction_to_fisheye(float3 dir, float fov)
|
||||
ccl_device_inline float3 fisheye_to_direction(float theta, float u, float v, float r)
|
||||
{
|
||||
float phi = safe_acosf(safe_divide(u, r));
|
||||
if (v < 0.0f) {
|
||||
phi = -phi;
|
||||
}
|
||||
|
||||
return make_float3(cosf(theta), -cosf(phi) * sinf(theta), sinf(phi) * sinf(theta));
|
||||
}
|
||||
|
||||
ccl_device float2 direction_to_fisheye_equidistant(float3 dir, float fov)
|
||||
{
|
||||
const float r = atan2f(len(make_float2(dir.y, dir.z)), dir.x) / fov;
|
||||
const float2 uv = r * safe_normalize(make_float2(dir.y, dir.z));
|
||||
return make_float2(0.5f - uv.x, uv.y + 0.5f);
|
||||
}
|
||||
|
||||
ccl_device float3 fisheye_to_direction(float u, float v, float fov)
|
||||
ccl_device float3 fisheye_equidistant_to_direction(float u, float v, float fov)
|
||||
{
|
||||
u = (u - 0.5f) * 2.0f;
|
||||
v = (v - 0.5f) * 2.0f;
|
||||
@ -94,13 +87,9 @@ ccl_device float3 fisheye_to_direction(float u, float v, float fov)
|
||||
if (r > 1.0f)
|
||||
return zero_float3();
|
||||
|
||||
float phi = safe_acosf((r != 0.0f) ? u / r : 0.0f);
|
||||
float theta = r * fov * 0.5f;
|
||||
|
||||
if (v < 0.0f)
|
||||
phi = -phi;
|
||||
|
||||
return make_float3(cosf(theta), -cosf(phi) * sinf(theta), sinf(phi) * sinf(theta));
|
||||
return fisheye_to_direction(theta, u, v, r);
|
||||
}
|
||||
|
||||
ccl_device float2 direction_to_fisheye_equisolid(float3 dir, float lens, float width, float height)
|
||||
@ -124,13 +113,9 @@ fisheye_equisolid_to_direction(float u, float v, float lens, float fov, float wi
|
||||
if (r > rmax)
|
||||
return zero_float3();
|
||||
|
||||
float phi = safe_acosf((r != 0.0f) ? u / r : 0.0f);
|
||||
float theta = 2.0f * asinf(r / (2.0f * lens));
|
||||
|
||||
if (v < 0.0f)
|
||||
phi = -phi;
|
||||
|
||||
return make_float3(cosf(theta), -cosf(phi) * sinf(theta), sinf(phi) * sinf(theta));
|
||||
return fisheye_to_direction(theta, u, v, r);
|
||||
}
|
||||
|
||||
ccl_device_inline float3 fisheye_lens_polynomial_to_direction(
|
||||
@ -147,12 +132,7 @@ ccl_device_inline float3 fisheye_lens_polynomial_to_direction(
|
||||
if (fabsf(theta) > 0.5f * fov)
|
||||
return zero_float3();
|
||||
|
||||
float phi = safe_acosf((r != 0.0f) ? u / r : 0.0f);
|
||||
|
||||
if (v < 0.0f)
|
||||
phi = -phi;
|
||||
|
||||
return make_float3(cosf(theta), -cosf(phi) * sinf(theta), sinf(phi) * sinf(theta));
|
||||
return fisheye_to_direction(theta, u, v, r);
|
||||
}
|
||||
|
||||
ccl_device float2 direction_to_fisheye_lens_polynomial(
|
||||
@ -258,7 +238,7 @@ ccl_device_inline float3 panorama_to_direction(ccl_constant KernelCamera *cam, f
|
||||
case PANORAMA_MIRRORBALL:
|
||||
return mirrorball_to_direction(u, v);
|
||||
case PANORAMA_FISHEYE_EQUIDISTANT:
|
||||
return fisheye_to_direction(u, v, cam->fisheye_fov);
|
||||
return fisheye_equidistant_to_direction(u, v, cam->fisheye_fov);
|
||||
case PANORAMA_FISHEYE_LENS_POLYNOMIAL:
|
||||
return fisheye_lens_polynomial_to_direction(u,
|
||||
v,
|
||||
@ -286,7 +266,7 @@ ccl_device_inline float2 direction_to_panorama(ccl_constant KernelCamera *cam, f
|
||||
case PANORAMA_MIRRORBALL:
|
||||
return direction_to_mirrorball(dir);
|
||||
case PANORAMA_FISHEYE_EQUIDISTANT:
|
||||
return direction_to_fisheye(dir, cam->fisheye_fov);
|
||||
return direction_to_fisheye_equidistant(dir, cam->fisheye_fov);
|
||||
case PANORAMA_FISHEYE_LENS_POLYNOMIAL:
|
||||
return direction_to_fisheye_lens_polynomial(dir,
|
||||
cam->fisheye_lens_polynomial_bias,
|
||||
|
@ -185,13 +185,10 @@ ccl_device int bsdf_ashikhmin_shirley_sample(ccl_private const ShaderClosure *sc
|
||||
}
|
||||
|
||||
/* get half vector in tangent space */
|
||||
float sin_theta = sqrtf(fmaxf(0.0f, 1.0f - cos_theta * cos_theta));
|
||||
float cos_phi = cosf(phi);
|
||||
float sin_phi = sinf(phi); /* No `sqrt(1-cos^2)` here because it causes artifacts. */
|
||||
float3 h = make_float3(sin_theta * cos_phi, sin_theta * sin_phi, cos_theta);
|
||||
float3 h = spherical_cos_to_direction(cos_theta, phi);
|
||||
|
||||
/* half vector to world space */
|
||||
float3 H = h.x * X + h.y * Y + h.z * N;
|
||||
float3 H = to_global(h, X, Y, N);
|
||||
float HdotI = dot(H, wi);
|
||||
if (HdotI < 0.0f)
|
||||
H = -H;
|
||||
|
@ -99,7 +99,7 @@ ccl_device_forceinline float3 microfacet_beckmann_sample_vndf(const float3 wi,
|
||||
wi_ = normalize(wi_);
|
||||
|
||||
/* 2. sample P22_{wi}(x_slope, y_slope, 1, 1) */
|
||||
float slope_x, slope_y;
|
||||
float2 slope;
|
||||
float cos_phi_i = 1.0f;
|
||||
float sin_phi_i = 0.0f;
|
||||
|
||||
@ -107,8 +107,7 @@ ccl_device_forceinline float3 microfacet_beckmann_sample_vndf(const float3 wi,
|
||||
/* Special case (normal incidence). */
|
||||
const float r = sqrtf(-logf(rand.x));
|
||||
const float phi = M_2PI_F * rand.y;
|
||||
slope_x = r * cosf(phi);
|
||||
slope_y = r * sinf(phi);
|
||||
slope = polar_to_cartesian(r, phi);
|
||||
}
|
||||
else {
|
||||
/* Precomputations. */
|
||||
@ -169,21 +168,19 @@ ccl_device_forceinline float3 microfacet_beckmann_sample_vndf(const float3 wi,
|
||||
current.y = 1.0f + current.x + K * expf(-sqr(inv_erf)) - y_exact;
|
||||
}
|
||||
|
||||
slope_x = inv_erf;
|
||||
slope_y = fast_ierff(2.0f * rand.y - 1.0f);
|
||||
slope.x = inv_erf;
|
||||
slope.y = fast_ierff(2.0f * rand.y - 1.0f);
|
||||
}
|
||||
|
||||
/* 3. rotate */
|
||||
float tmp = cos_phi_i * slope_x - sin_phi_i * slope_y;
|
||||
slope_y = sin_phi_i * slope_x + cos_phi_i * slope_y;
|
||||
slope_x = tmp;
|
||||
slope = make_float2(cos_phi_i * slope.x - sin_phi_i * slope.y,
|
||||
sin_phi_i * slope.x + cos_phi_i * slope.y);
|
||||
|
||||
/* 4. unstretch */
|
||||
slope_x = alpha_x * slope_x;
|
||||
slope_y = alpha_y * slope_y;
|
||||
slope *= make_float2(alpha_x, alpha_y);
|
||||
|
||||
/* 5. compute normal */
|
||||
return normalize(make_float3(-slope_x, -slope_y, 1.0f));
|
||||
return normalize(make_float3(-slope.x, -slope.y, 1.0f));
|
||||
}
|
||||
|
||||
/* GGX VNDF importance sampling algorithm from:
|
||||
@ -216,7 +213,7 @@ ccl_device_forceinline float3 microfacet_ggx_sample_vndf(const float3 wi,
|
||||
t.y = mix(safe_sqrtf(1.0f - sqr(t.x)), t.y, 0.5f * (1.0f + wi_.z));
|
||||
|
||||
/* Section 4.3: Reprojection onto hemisphere. */
|
||||
float3 H_ = t.x * T1 + t.y * T2 + safe_sqrtf(1.0f - len_squared(t)) * wi_;
|
||||
float3 H_ = to_global(disk_to_hemisphere(t), T1, T2, wi_);
|
||||
|
||||
/* Section 3.4: Transforming the normal back to the ellipsoid configuration. */
|
||||
return normalize(make_float3(alpha_x * H_.x, alpha_y * H_.y, max(0.0f, H_.z)));
|
||||
@ -686,7 +683,7 @@ ccl_device int bsdf_microfacet_sample(KernelGlobals kg,
|
||||
local_H = microfacet_beckmann_sample_vndf(local_I, alpha_x, alpha_y, float3_to_float2(rand));
|
||||
}
|
||||
|
||||
H = X * local_H.x + Y * local_H.y + N * local_H.z;
|
||||
H = to_global(local_H, X, Y, N);
|
||||
}
|
||||
const float cos_HI = dot(H, wi);
|
||||
|
||||
|
@ -96,9 +96,7 @@ ccl_device int bsdf_phong_ramp_sample(ccl_private const ShaderClosure *sc,
|
||||
make_orthonormals(R, &T, &B);
|
||||
float phi = M_2PI_F * rand.x;
|
||||
float cosTheta = powf(rand.y, 1 / (m_exponent + 1));
|
||||
float sinTheta2 = 1 - cosTheta * cosTheta;
|
||||
float sinTheta = sinTheta2 > 0 ? sqrtf(sinTheta2) : 0;
|
||||
*wo = (cosf(phi) * sinTheta) * T + (sinf(phi) * sinTheta) * B + (cosTheta)*R;
|
||||
*wo = to_global(spherical_cos_to_direction(cosTheta, phi), T, B, R);
|
||||
if (dot(Ng, *wo) > 0.0f) {
|
||||
// common terms for pdf and eval
|
||||
float cosNO = dot(bsdf->N, *wo);
|
||||
|
@ -264,8 +264,8 @@ ccl_device Spectrum bsdf_hair_chiang_eval(KernelGlobals kg,
|
||||
const float3 Z = safe_normalize(cross(X, Y));
|
||||
|
||||
/* local_I is the illumination direction. */
|
||||
const float3 local_O = make_float3(dot(sd->wi, X), dot(sd->wi, Y), dot(sd->wi, Z));
|
||||
const float3 local_I = make_float3(dot(wo, X), dot(wo, Y), dot(wo, Z));
|
||||
const float3 local_O = to_local(sd->wi, X, Y, Z);
|
||||
const float3 local_I = to_local(wo, X, Y, Z);
|
||||
|
||||
const float sin_theta_o = local_O.x;
|
||||
const float cos_theta_o = cos_from_sin(sin_theta_o);
|
||||
@ -350,7 +350,7 @@ ccl_device int bsdf_hair_chiang_sample(KernelGlobals kg,
|
||||
const float3 Z = safe_normalize(cross(X, Y));
|
||||
|
||||
/* `wo` in PBRT. */
|
||||
const float3 local_O = make_float3(dot(sd->wi, X), dot(sd->wi, Y), dot(sd->wi, Z));
|
||||
const float3 local_O = to_local(sd->wi, X, Y, Z);
|
||||
|
||||
const float sin_theta_o = local_O.x;
|
||||
const float cos_theta_o = cos_from_sin(sin_theta_o);
|
||||
@ -443,8 +443,7 @@ ccl_device int bsdf_hair_chiang_sample(KernelGlobals kg,
|
||||
|
||||
*eval = F;
|
||||
*pdf = F_energy;
|
||||
|
||||
*wo = X * sin_theta_i + Y * cos_theta_i * cosf(phi_i) + Z * cos_theta_i * sinf(phi_i);
|
||||
*wo = to_global(spherical_cos_to_direction(sin_theta_i, phi_i), Y, Z, X);
|
||||
|
||||
return LABEL_GLOSSY | ((p == 0) ? LABEL_REFLECT : LABEL_TRANSMIT);
|
||||
}
|
||||
|
@ -243,8 +243,7 @@ ccl_device int bsdf_hair_huang_setup(ccl_private ShaderData *sd,
|
||||
bsdf->extra->Z = safe_normalize(cross(bsdf->N, sd->dPdu));
|
||||
}
|
||||
|
||||
const float3 I = make_float3(
|
||||
dot(sd->wi, bsdf->N), dot(sd->wi, bsdf->extra->Y), dot(sd->wi, bsdf->extra->Z));
|
||||
const float3 I = to_local(sd->wi, bsdf->N, bsdf->extra->Y, bsdf->extra->Z);
|
||||
bsdf->extra->wi = I;
|
||||
bsdf->extra->e2 = 1.0f - sqr(bsdf->aspect_ratio);
|
||||
bsdf->extra->radius = bsdf->extra->e2 == 0 ?
|
||||
@ -286,11 +285,9 @@ ccl_device_inline float3 sample_wh(
|
||||
float3 s, t;
|
||||
make_orthonormals(wm, &s, &t);
|
||||