Compare commits
50 Commits
simulation
...
temp-test-
Author | SHA1 | Date | |
---|---|---|---|
c5e2a8fbbd | |||
401ddff410 | |||
5f47593f50 | |||
89880e891c | |||
fd6d8ac791 | |||
ff3d82d7ef | |||
d26c3e9e75 | |||
b9e1e769fb | |||
26e114efb8 | |||
c9bdeef488 | |||
827861cfdf | |||
82db1198a5 | |||
c8bcb7cc2b | |||
9eb90548c5 | |||
40b269f50b | |||
9b3bdce6a6 | |||
b392632b8d | |||
ebd8f94050 | |||
5c15a74d63 | |||
4dc3831a2a | |||
5bb1a05d9e | |||
6a447a32fe | |||
7dfdb1a8a0 | |||
2b1e84c0de | |||
2cc55bcdc2 | |||
ffb3285672 | |||
69aecad547 | |||
3fab8acfd8 | |||
78b545f1fe | |||
cbf3f46ffd | |||
fcc4a68482 | |||
b344800177 | |||
bd690a4d57 | |||
b11de611d0 | |||
6fda1d007f | |||
8b08366e32 | |||
456c7f2f90 | |||
ebecd0aae5 | |||
118a9f8589 | |||
fc751901d8 | |||
bd0f203d39 | |||
727ed66065 | |||
7f95682ac6 | |||
0055db5838 | |||
64854506d1 | |||
3e07f2e322 | |||
b58db00ddf | |||
3689b783b7 | |||
1f1f1b018e | |||
78d0ec3586 |
@@ -138,6 +138,11 @@ get_blender_version()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Options
|
||||
|
||||
# First platform specific non-cached vars
|
||||
if(UNIX AND NOT (APPLE OR HAIKU))
|
||||
set(WITH_X11 ON)
|
||||
endif()
|
||||
|
||||
# Blender internal features
|
||||
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
||||
mark_as_advanced(WITH_BLENDER)
|
||||
@@ -202,15 +207,7 @@ mark_as_advanced(WITH_GHOST_DEBUG)
|
||||
option(WITH_GHOST_SDL "Enable building Blender against SDL for windowing rather than the native APIs" OFF)
|
||||
mark_as_advanced(WITH_GHOST_SDL)
|
||||
|
||||
if(UNIX AND NOT (APPLE OR HAIKU))
|
||||
option(WITH_GHOST_X11 "Enable building Blender against X11 for windowing" ON)
|
||||
mark_as_advanced(WITH_GHOST_X11)
|
||||
|
||||
option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" OFF)
|
||||
mark_as_advanced(WITH_GHOST_WAYLAND)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_X11)
|
||||
if(WITH_X11)
|
||||
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
|
||||
endif()
|
||||
|
||||
@@ -235,7 +232,7 @@ if(UNIX AND NOT APPLE)
|
||||
mark_as_advanced(WITH_OPENMP_STATIC)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_X11)
|
||||
if(WITH_X11)
|
||||
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
|
||||
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
|
||||
option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON)
|
||||
@@ -436,8 +433,6 @@ endif()
|
||||
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
||||
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
|
||||
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
|
||||
set(TEST_PYTHON_EXE "" CACHE PATH "Python executable to run unit tests")
|
||||
mark_as_advanced(TEST_PYTHON_EXE)
|
||||
|
||||
# Documentation
|
||||
if(UNIX AND NOT APPLE)
|
||||
@@ -478,8 +473,6 @@ endif()
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
|
||||
mark_as_advanced(WITH_LINKER_GOLD)
|
||||
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
|
||||
mark_as_advanced(WITH_LINKER_LLD)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
@@ -543,15 +536,6 @@ if(WIN32)
|
||||
option(WITH_WINDOWS_BUNDLE_CRT "Bundle the C runtime for install free distribution." ON)
|
||||
mark_as_advanced(WITH_WINDOWS_BUNDLE_CRT)
|
||||
|
||||
option(WITH_WINDOWS_SCCACHE "Use sccache to speed up builds (Ninja builder only)" OFF)
|
||||
mark_as_advanced(WITH_WINDOWS_SCCACHE)
|
||||
|
||||
option(WITH_WINDOWS_PDB "Generate a pdb file for client side stacktraces" ON)
|
||||
mark_as_advanced(WITH_WINDOWS_PDB)
|
||||
|
||||
option(WITH_WINDOWS_STRIPPED_PDB "Use a stripped PDB file" On)
|
||||
mark_as_advanced(WITH_WINDOWS_STRIPPED_PDB)
|
||||
|
||||
endif()
|
||||
|
||||
# The following only works with the Ninja generator in CMake >= 3.0.
|
||||
@@ -698,8 +682,7 @@ if(WITH_INSTALL_PORTABLE)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_SDL OR WITH_HEADLESS)
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
set(WITH_GHOST_X11 OFF)
|
||||
set(WITH_X11 OFF)
|
||||
set(WITH_X11_XINPUT OFF)
|
||||
set(WITH_X11_XF86VMODE OFF)
|
||||
set(WITH_X11_XFIXES OFF)
|
||||
|
50
GNUmakefile
50
GNUmakefile
@@ -71,6 +71,17 @@ Testing Targets
|
||||
which are tagged to use the stricter formatting
|
||||
* test_deprecated:
|
||||
Checks for deprecation tags in our code which may need to be removed
|
||||
* test_style_c:
|
||||
Checks C/C++ conforms with blenders style guide:
|
||||
https://wiki.blender.org/wiki/Source/Code_Style
|
||||
* test_style_c_qtc:
|
||||
Same as test_style but outputs QtCreator tasks format
|
||||
* test_style_osl:
|
||||
Checks OpenShadingLanguage conforms with blenders style guide:
|
||||
https://wiki.blender.org/wiki/Source/Code_Style
|
||||
* test_style_osl_qtc:
|
||||
Checks OpenShadingLanguage conforms with blenders style guide:
|
||||
https://wiki.blender.org/wiki/Source/Code_Style
|
||||
|
||||
Static Source Code Checking
|
||||
Not associated with building Blender.
|
||||
@@ -391,6 +402,45 @@ test_cmake: .FORCE
|
||||
test_deprecated: .FORCE
|
||||
$(PYTHON) tests/check_deprecated.py
|
||||
|
||||
test_style_c: .FORCE
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
"$(BLENDER_DIR)/source/blender" \
|
||||
"$(BLENDER_DIR)/source/creator" \
|
||||
--no-length-check
|
||||
|
||||
test_style_c_qtc: .FORCE
|
||||
# run our own checks on C/C++ style
|
||||
USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
"$(BLENDER_DIR)/source/blender" \
|
||||
"$(BLENDER_DIR)/source/creator" \
|
||||
--no-length-check \
|
||||
> \
|
||||
"$(BLENDER_DIR)/test_style.tasks"
|
||||
@echo "written: test_style.tasks"
|
||||
|
||||
|
||||
test_style_osl: .FORCE
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
|
||||
"$(BLENDER_DIR)/release/scripts/templates_osl"
|
||||
|
||||
|
||||
test_style_osl_qtc: .FORCE
|
||||
# run our own checks on C/C++ style
|
||||
USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
|
||||
"$(BLENDER_DIR)/release/scripts/templates_osl" \
|
||||
> \
|
||||
"$(BLENDER_DIR)/test_style.tasks"
|
||||
@echo "written: test_style.tasks"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Project Files
|
||||
|
@@ -25,8 +25,6 @@ if(UNIX AND NOT APPLE)
|
||||
set(BZIP2_CFLAGS "-fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64")
|
||||
set(BZIP2_CONFIGURE_ENV ${BZIP2_CONFIGURE_ENV} && export LDFLAGS=${BZIP2_LDFLAGS} && export CFLAGS=${BZIP2_CFLAGS}
|
||||
&& export PREFIX=${BZIP2_PREFIX})
|
||||
else()
|
||||
set(BZIP2_CONFIGURE_ENV ${CONFIGURE_ENV})
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_bzip2
|
||||
|
@@ -21,7 +21,7 @@ set(OIDN_EXTRA_ARGS
|
||||
-DWITH_EXAMPLE=OFF
|
||||
-DWITH_TEST=OFF
|
||||
-DTBB_ROOT=${LIBDIR}/tbb
|
||||
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
|
||||
-DTBB_STATIC_LIB=ON
|
||||
-DOIDN_STATIC_LIB=ON
|
||||
)
|
||||
|
||||
|
@@ -36,7 +36,7 @@ if(WIN32)
|
||||
set(OPENSUBDIV_EXTRA_ARGS
|
||||
${OPENSUBDIV_EXTRA_ARGS}
|
||||
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
|
||||
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib
|
||||
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb_static.lib
|
||||
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
|
||||
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
|
||||
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
|
||||
|
@@ -20,10 +20,8 @@ if(WIN32)
|
||||
-DTBB_BUILD_SHARED=On
|
||||
-DTBB_BUILD_TBBMALLOC=On
|
||||
-DTBB_BUILD_TBBMALLOC_PROXY=On
|
||||
-DTBB_BUILD_STATIC=Off
|
||||
)
|
||||
set(TBB_LIBRARY tbb)
|
||||
set(TBB_STATIC_LIBRARY Off)
|
||||
-DTBB_BUILD_STATIC=On
|
||||
)
|
||||
else()
|
||||
set(TBB_EXTRA_ARGS
|
||||
-DTBB_BUILD_SHARED=Off
|
||||
@@ -31,8 +29,6 @@ else()
|
||||
-DTBB_BUILD_TBBMALLOC_PROXY=Off
|
||||
-DTBB_BUILD_STATIC=On
|
||||
)
|
||||
set(TBB_LIBRARY tbb_static)
|
||||
set(TBB_STATIC_LIBRARY On)
|
||||
endif()
|
||||
|
||||
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
|
||||
@@ -50,8 +46,7 @@ ExternalProject_Add(external_tbb
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_tbb after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
|
||||
@@ -62,12 +57,7 @@ if(WIN32)
|
||||
endif()
|
||||
if(BUILD_MODE STREQUAL Debug)
|
||||
ExternalProject_Add_Step(external_tbb after_install
|
||||
# findtbb.cmake in some deps *NEEDS* to find tbb.lib even if they are not going to use it
|
||||
# to make that test pass, we place a copy with the right name in the lib folder.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
|
||||
# Normal collection of build artifacts
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.dll ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll
|
||||
|
@@ -23,8 +23,8 @@ set(USD_EXTRA_ARGS
|
||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
||||
-DBOOST_ROOT=${LIBDIR}/boost
|
||||
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
|
||||
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
|
||||
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
|
||||
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
|
||||
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
|
||||
|
||||
# This is a preventative measure that avoids possible conflicts when add-ons
|
||||
# try to load another USD library into the same process space.
|
||||
|
@@ -2654,7 +2654,7 @@ compile_USD() {
|
||||
|
||||
cd $CWD
|
||||
INFO "Done compiling USD-$USD_VERSION!"
|
||||
_is_building=false
|
||||
_is_building=true
|
||||
else
|
||||
INFO "Own USD-$USD_VERSION is up to date, nothing to do!"
|
||||
INFO "If you want to force rebuild of this lib, use the --force-usd option."
|
||||
@@ -5354,11 +5354,6 @@ print_info() {
|
||||
_1="-D WITH_USD=ON"
|
||||
PRINT " $_1"
|
||||
_buildargs="$_buildargs $_1"
|
||||
if [ -d $INST/usd ]; then
|
||||
_1="-D USD_ROOT_DIR=$INST/usd"
|
||||
PRINT " $_1"
|
||||
_buildargs="$_buildargs $_1"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$NO_SYSTEM_GLEW" = true ]; then
|
||||
|
@@ -109,9 +109,6 @@ if (WIN32)
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
|
||||
COMMENT "Preprocessing tbbmalloc.def"
|
||||
)
|
||||
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/tbb_resource.rc)
|
||||
list(APPEND tbbmalloc_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
|
||||
list(APPEND tbbmalloc_proxy_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
|
||||
else()
|
||||
add_custom_command(OUTPUT tbb.def
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
|
||||
@@ -148,12 +145,8 @@ if (TBB_BUILD_SHARED)
|
||||
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
|
||||
elseif(WIN32)
|
||||
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
|
||||
|
||||
endif()
|
||||
install(TARGETS tbb DESTINATION lib)
|
||||
if(WIN32)
|
||||
set_target_properties(tbb PROPERTIES OUTPUT_NAME "tbb$<$<CONFIG:Debug>:_debug>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
@@ -203,7 +196,7 @@ if(TBB_BUILD_TBBMALLOC_PROXY)
|
||||
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
|
||||
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
|
||||
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
|
||||
target_link_libraries(tbbmalloc_proxy tbbmalloc)
|
||||
link_libraries(tbbmalloc_proxy tbbmalloc)
|
||||
install(TARGETS tbbmalloc_proxy DESTINATION lib)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -18,6 +18,17 @@ diff --git a/mkl-dnn/cmake/TBB.cmake b/mkl-dnn/cmake/TBB.cmake
|
||||
index 0711e699..c14210b6 100644
|
||||
--- a/mkl-dnn/cmake/TBB.cmake
|
||||
+++ b/mkl-dnn/cmake/TBB.cmake
|
||||
@@ -90,8 +90,8 @@ if(WIN32)
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
set(TBB_LIB_DIR ${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
|
||||
- find_library(TBB_LIBRARY tbb PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
+ find_library(TBB_LIBRARY tbb_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
else()
|
||||
@@ -138,13 +138,13 @@ else()
|
||||
set(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
|
||||
if(APPLE)
|
||||
|
@@ -66,9 +66,6 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_link_libraries(${TARGET_NAME} bf_intern_libc_compat)
|
||||
endif()
|
||||
if(WITH_TBB)
|
||||
target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES})
|
||||
endif()
|
||||
|
||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
|
@@ -440,14 +440,6 @@ function(SETUP_LIBDIRS)
|
||||
link_directories(${HDF5_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
link_directories(
|
||||
${wayland-client_LIBRARY_DIRS}
|
||||
${wayland-egl_LIBRARY_DIRS}
|
||||
${xkbcommon_LIBRARY_DIRS}
|
||||
${wayland-cursor_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
link_directories(${PTHREADS_LIBPATH})
|
||||
endif()
|
||||
|
@@ -504,27 +504,7 @@ if(WITH_SYSTEM_AUDASPACE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(wayland-client REQUIRED wayland-client>=1.12)
|
||||
pkg_check_modules(wayland-egl REQUIRED wayland-egl)
|
||||
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
|
||||
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
|
||||
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
|
||||
|
||||
set(WITH_GL_EGL ON)
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${wayland-client_LIBRARIES}
|
||||
${wayland-egl_LIBRARIES}
|
||||
${xkbcommon_LIBRARIES}
|
||||
${wayland-cursor_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_X11)
|
||||
if(WITH_X11)
|
||||
find_package(X11 REQUIRED)
|
||||
|
||||
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
|
||||
@@ -595,19 +575,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
unset(LD_VERSION)
|
||||
endif()
|
||||
|
||||
if(WITH_LINKER_LLD)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if("${LD_VERSION}" MATCHES "LLD")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
|
||||
else()
|
||||
message(STATUS "LLD linker isn't available, using the default system linker.")
|
||||
endif()
|
||||
unset(LD_VERSION)
|
||||
endif()
|
||||
|
||||
# CLang is the same as GCC for now.
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||
|
@@ -51,10 +51,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \"${CLANG_OPENMP_LIB}\"")
|
||||
endif()
|
||||
if(WITH_WINDOWS_STRIPPED_PDB)
|
||||
message(WARNING "stripped pdb not supported with clang, disabling..")
|
||||
set(WITH_WINDOWS_STRIPPED_PDB Off)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS})
|
||||
@@ -116,7 +112,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version
|
||||
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32
|
||||
advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp Shlwapi
|
||||
)
|
||||
|
||||
@@ -138,12 +134,7 @@ add_definitions(-D_ALLOW_KEYWORD_MACROS)
|
||||
# We want to support Windows 7 level ABI
|
||||
add_definitions(-D_WIN32_WINNT=0x601)
|
||||
include(build_files/cmake/platform/platform_win32_bundle_crt.cmake)
|
||||
remove_cc_flag("/MDd" "/MD" "/Zi")
|
||||
|
||||
if(WITH_WINDOWS_PDB)
|
||||
set(PDB_INFO_OVERRIDE_FLAGS "/Z7")
|
||||
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||
endif()
|
||||
remove_cc_flag("/MDd" "/MD")
|
||||
|
||||
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
|
||||
@@ -160,30 +151,16 @@ if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:twoPhase-")
|
||||
endif()
|
||||
|
||||
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
|
||||
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
|
||||
set(WITH_WINDOWS_SCCACHE Off)
|
||||
endif()
|
||||
|
||||
if(WITH_WINDOWS_SCCACHE)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER sccache)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER sccache)
|
||||
set(SYMBOL_FORMAT /Z7)
|
||||
else()
|
||||
unset(CMAKE_C_COMPILER_LAUNCHER)
|
||||
unset(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
set(SYMBOL_FORMAT /ZI)
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
|
||||
unset(SYMBOL_FORMAT)
|
||||
# JMC is available on msvc 15.8 (1915) and up
|
||||
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /JMC")
|
||||
@@ -195,7 +172,6 @@ set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAUL
|
||||
|
||||
# Ignore meaningless for us linker warnings.
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
|
||||
set(PLATFORM_LINKFLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${PDB_INFO_OVERRIDE_LINKER_FLAGS}")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
|
||||
|
||||
if(CMAKE_CL_64)
|
||||
@@ -233,7 +209,7 @@ endif()
|
||||
|
||||
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
||||
# that we have very little control over
|
||||
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG AND NOT WITH_WINDOWS_SCCACHE)
|
||||
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG)
|
||||
add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
|
||||
endif()
|
||||
|
||||
@@ -596,7 +572,7 @@ if(WITH_SYSTEM_AUDASPACE)
|
||||
endif()
|
||||
|
||||
if(WITH_TBB)
|
||||
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/debug/tbb_debug.lib)
|
||||
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
|
||||
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
|
||||
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
||||
if(WITH_TBB_MALLOC_PROXY)
|
||||
|
@@ -2,11 +2,6 @@ set BUILD_GENERATOR_POST=
|
||||
set BUILD_PLATFORM_SELECT=
|
||||
set MSBUILD_PLATFORM=x64
|
||||
|
||||
if "%BUILD_WITH_SCCACHE%"=="1" (
|
||||
echo sccache is only supported with ninja as the build system.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%WITH_CLANG%"=="1" (
|
||||
set CLANG_CMAKE_ARGS=-T"llvm"
|
||||
if "%WITH_ASAN%"=="1" (
|
||||
|
@@ -6,13 +6,6 @@ if %ERRORLEVEL% NEQ 0 (
|
||||
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
|
||||
|
||||
if "%BUILD_WITH_SCCACHE%"=="1" (
|
||||
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_WINDOWS_SCCACHE=On
|
||||
if NOT "%verbose%" == "" (
|
||||
echo Enabling sccache
|
||||
)
|
||||
)
|
||||
|
||||
if "%WITH_CLANG%" == "1" (
|
||||
set LLVM_DIR=
|
||||
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
|
||||
|
@@ -86,8 +86,6 @@ if NOT "%1" == "" (
|
||||
set BUILD_UPDATE_ARGS="--no-libraries"
|
||||
) else if "%1" == "ninja" (
|
||||
SET BUILD_WITH_NINJA=1
|
||||
) else if "%1" == "sccache" (
|
||||
SET BUILD_WITH_SCCACHE=1
|
||||
) else if "%1" == "clean" (
|
||||
set MUST_CLEAN=1
|
||||
) else if "%1" == "verbose" (
|
||||
|
@@ -30,4 +30,3 @@ set WITH_PYDEBUG=
|
||||
set PYDEBUG_CMAKE_ARGS=
|
||||
set FORMAT=
|
||||
set TEST=
|
||||
set BUILD_WITH_SCCACHE=
|
||||
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "V2.90"
|
||||
PROJECT_NUMBER = "V2.83"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
2
extern/CMakeLists.txt
vendored
2
extern/CMakeLists.txt
vendored
@@ -72,7 +72,7 @@ if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_X11 AND WITH_GHOST_XDND)
|
||||
if(WITH_X11 AND WITH_GHOST_XDND)
|
||||
add_subdirectory(xdnd)
|
||||
endif()
|
||||
|
||||
|
4
extern/audaspace/bindings/C/AUD_Device.cpp
vendored
4
extern/audaspace/bindings/C/AUD_Device.cpp
vendored
@@ -290,14 +290,14 @@ AUD_API AUD_Device* AUD_Device_getCurrent()
|
||||
return new AUD_Device(device);
|
||||
}
|
||||
|
||||
AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, double time)
|
||||
AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, float time)
|
||||
{
|
||||
auto synchronizer = DeviceManager::getDevice()->getSynchronizer();
|
||||
if(synchronizer)
|
||||
synchronizer->seek(*reinterpret_cast<std::shared_ptr<IHandle>*>(handle), time);
|
||||
}
|
||||
|
||||
AUD_API double AUD_getSynchronizerPosition(AUD_Handle* handle)
|
||||
AUD_API float AUD_getSynchronizerPosition(AUD_Handle* handle)
|
||||
{
|
||||
auto synchronizer = DeviceManager::getDevice()->getSynchronizer();
|
||||
if(synchronizer)
|
||||
|
4
extern/audaspace/bindings/C/AUD_Device.h
vendored
4
extern/audaspace/bindings/C/AUD_Device.h
vendored
@@ -221,14 +221,14 @@ extern AUD_API AUD_Device* AUD_Device_getCurrent();
|
||||
* \param handle Playback handle.
|
||||
* \param time Time in seconds to seek to.
|
||||
*/
|
||||
extern AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, double time);
|
||||
extern AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, float time);
|
||||
|
||||
/**
|
||||
* Returns the current sound scene playback time.
|
||||
* \param handle Playback handle.
|
||||
* \return The playback time in seconds.
|
||||
*/
|
||||
extern AUD_API double AUD_getSynchronizerPosition(AUD_Handle* handle);
|
||||
extern AUD_API float AUD_getSynchronizerPosition(AUD_Handle* handle);
|
||||
|
||||
/**
|
||||
* Starts the playback of jack transport if possible.
|
||||
|
@@ -101,14 +101,14 @@ AUD_API int AUD_DynamicMusic_pause(AUD_DynamicMusic* player)
|
||||
return (*player)->pause();
|
||||
}
|
||||
|
||||
AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, double position)
|
||||
AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, float position)
|
||||
{
|
||||
assert(player);
|
||||
|
||||
return (*player)->seek(position);
|
||||
}
|
||||
|
||||
AUD_API double AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player)
|
||||
AUD_API float AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player)
|
||||
{
|
||||
assert(player);
|
||||
|
||||
@@ -141,4 +141,4 @@ AUD_API int AUD_DynamicMusic_stop(AUD_DynamicMusic* player)
|
||||
assert(player);
|
||||
|
||||
return (*player)->stop();
|
||||
}
|
||||
}
|
@@ -103,14 +103,14 @@ extern AUD_API int AUD_DynamicMusic_pause(AUD_DynamicMusic* player);
|
||||
* \param position The new position from which to play back, in seconds.
|
||||
* \return 0 if the seeking wasn't possible.
|
||||
*/
|
||||
extern AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, double position);
|
||||
extern AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, float position);
|
||||
|
||||
/**
|
||||
* Retrieves the position of the current scene of a dynamic music player.
|
||||
* \param player The DynamicMusic object.
|
||||
* \return The position of the current playing scene.
|
||||
*/
|
||||
extern AUD_API double AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player);
|
||||
extern AUD_API float AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player);
|
||||
|
||||
/**
|
||||
* Retrieves the volume of the current scene of a dynamic music player.
|
||||
@@ -142,4 +142,4 @@ extern AUD_API int AUD_DynamicMusic_stop(AUD_DynamicMusic* player);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
4
extern/audaspace/bindings/C/AUD_Handle.cpp
vendored
4
extern/audaspace/bindings/C/AUD_Handle.cpp
vendored
@@ -259,13 +259,13 @@ AUD_API int AUD_Handle_setPitch(AUD_Handle* handle, float value)
|
||||
return (*handle)->setPitch(value);
|
||||
}
|
||||
|
||||
AUD_API double AUD_Handle_getPosition(AUD_Handle* handle)
|
||||
AUD_API float AUD_Handle_getPosition(AUD_Handle* handle)
|
||||
{
|
||||
assert(handle);
|
||||
return (*handle)->getPosition();
|
||||
}
|
||||
|
||||
AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, double value)
|
||||
AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, float value)
|
||||
{
|
||||
assert(handle);
|
||||
return (*handle)->seek(value);
|
||||
|
4
extern/audaspace/bindings/C/AUD_Handle.h
vendored
4
extern/audaspace/bindings/C/AUD_Handle.h
vendored
@@ -211,14 +211,14 @@ extern AUD_API int AUD_Handle_setPitch(AUD_Handle* handle, float value);
|
||||
* param handle The handle to get the position from.
|
||||
* return The position of the handle.
|
||||
*/
|
||||
extern AUD_API double AUD_Handle_getPosition(AUD_Handle* handle);
|
||||
extern AUD_API float AUD_Handle_getPosition(AUD_Handle* handle);
|
||||
|
||||
/**
|
||||
* Sets the position of a handle.
|
||||
* param handle The handle to set the position from.
|
||||
* param value The new position to set.
|
||||
*/
|
||||
extern AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, double value);
|
||||
extern AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, float value);
|
||||
|
||||
/**
|
||||
* Retrieves the relative of a handle.
|
||||
|
4
extern/audaspace/bindings/C/AUD_Sequence.cpp
vendored
4
extern/audaspace/bindings/C/AUD_Sequence.cpp
vendored
@@ -41,7 +41,7 @@ AUD_API void AUD_Sequence_free(AUD_Sound* sequence)
|
||||
delete sequence;
|
||||
}
|
||||
|
||||
AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, double begin, double end, double skip)
|
||||
AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, float begin, float end, float skip)
|
||||
{
|
||||
if(!sound)
|
||||
return new AUD_SequenceEntry(((Sequence *)sequence->get())->add(AUD_Sound(), begin, end, skip));
|
||||
@@ -160,7 +160,7 @@ AUD_API void AUD_Sequence_setSpeedOfSound(AUD_Sound* sequence, float value)
|
||||
|
||||
|
||||
|
||||
AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, double end, double skip)
|
||||
AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, float begin, float end, float skip)
|
||||
{
|
||||
(*entry)->move(begin, end, skip);
|
||||
}
|
||||
|
4
extern/audaspace/bindings/C/AUD_Sequence.h
vendored
4
extern/audaspace/bindings/C/AUD_Sequence.h
vendored
@@ -55,7 +55,7 @@ extern AUD_API void AUD_Sequence_free(AUD_Sound* sequence);
|
||||
* \param skip How much seconds should be skipped at the beginning.
|
||||
* \return The entry added.
|
||||
*/
|
||||
extern AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, double begin, double end, double skip);
|
||||
extern AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, float begin, float end, float skip);
|
||||
|
||||
/**
|
||||
* Removes an entry from the scene.
|
||||
@@ -167,7 +167,7 @@ extern AUD_API void AUD_Sequence_setSpeedOfSound(AUD_Sound* sequence, float valu
|
||||
* \param end The new end time or a negative value if unknown.
|
||||
* \param skip How many seconds to skip at the beginning.
|
||||
*/
|
||||
extern AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, double end, double skip);
|
||||
extern AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, float begin, float end, float skip);
|
||||
|
||||
/**
|
||||
* Writes animation data to a sequenced entry.
|
||||
|
4
extern/audaspace/bindings/C/AUD_Special.cpp
vendored
4
extern/audaspace/bindings/C/AUD_Special.cpp
vendored
@@ -175,7 +175,7 @@ static void pauseSound(AUD_Handle* handle)
|
||||
(*handle)->pause();
|
||||
}
|
||||
|
||||
AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds)
|
||||
AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds)
|
||||
{
|
||||
auto device = DeviceManager::getDevice();
|
||||
|
||||
@@ -336,7 +336,7 @@ AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start
|
||||
}
|
||||
}
|
||||
|
||||
AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, double start)
|
||||
AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
4
extern/audaspace/bindings/C/AUD_Special.h
vendored
4
extern/audaspace/bindings/C/AUD_Special.h
vendored
@@ -45,7 +45,7 @@ extern AUD_API float* AUD_readSoundBuffer(const char* filename, float low, float
|
||||
* \param seconds The time in seconds.
|
||||
* \return The silence handle.
|
||||
*/
|
||||
extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds);
|
||||
extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds);
|
||||
|
||||
/**
|
||||
* Reads a sound into a buffer for drawing at a specific sampling rate.
|
||||
@@ -101,7 +101,7 @@ extern AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned in
|
||||
* \param start The start time of the mixdown in the sound scene.
|
||||
* \return The read device for the mixdown.
|
||||
*/
|
||||
extern AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, double start);
|
||||
extern AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start);
|
||||
|
||||
/**
|
||||
* Initializes audio routines (FFMPEG/JACK if it is enabled).
|
||||
|
1
extern/audaspace/bindings/doc/device.rst
vendored
1
extern/audaspace/bindings/doc/device.rst
vendored
@@ -4,5 +4,4 @@ Device
|
||||
.. currentmodule:: aud
|
||||
.. autoclass:: Device
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
|
1
extern/audaspace/bindings/doc/handle.rst
vendored
1
extern/audaspace/bindings/doc/handle.rst
vendored
@@ -4,5 +4,4 @@ Handle
|
||||
.. currentmodule:: aud
|
||||
.. autoclass:: Handle
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
|
3
extern/audaspace/bindings/doc/index.rst
vendored
3
extern/audaspace/bindings/doc/index.rst
vendored
@@ -7,7 +7,6 @@ Welcome to audaspace's documentation!
|
||||
=====================================
|
||||
|
||||
.. automodule:: aud
|
||||
:no-members:
|
||||
|
||||
This documentation is valid for both the Python and C bindings of audaspace. If you are looking for installation instructions check the `C++ API documentation <../index.html>`_. As C is not an object oriented language everything is accessible via functions where the first paramter is always the object. For methods these are named as ``AUD_ClassName_method()`` and properties are accessed via ``AUD_ClassName_property_get/set()``. Python users simply ``import aud`` to access the library.
|
||||
|
||||
@@ -19,7 +18,7 @@ This documentation is valid for both the Python and C bindings of audaspace. If
|
||||
Classes:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:maxdepth: 2
|
||||
|
||||
device
|
||||
sound
|
||||
|
1
extern/audaspace/bindings/doc/sequence.rst
vendored
1
extern/audaspace/bindings/doc/sequence.rst
vendored
@@ -4,5 +4,4 @@ Sequence
|
||||
.. currentmodule:: aud
|
||||
.. autoclass:: Sequence
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
|
@@ -4,5 +4,4 @@ Sequence Entry
|
||||
.. currentmodule:: aud
|
||||
.. autoclass:: SequenceEntry
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
|
1
extern/audaspace/bindings/doc/sound.rst
vendored
1
extern/audaspace/bindings/doc/sound.rst
vendored
@@ -4,5 +4,4 @@ Sound
|
||||
.. currentmodule:: aud
|
||||
.. autoclass:: Sound
|
||||
:members:
|
||||
:noindex:
|
||||
|
||||
|
2
extern/audaspace/bindings/doc/tutorials.rst
vendored
2
extern/audaspace/bindings/doc/tutorials.rst
vendored
@@ -40,7 +40,7 @@ and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
|
||||
sine = aud.Sound.sine(440)
|
||||
|
||||
.. note:: At this point nothing is playing back yet,
|
||||
:class:`aud.Sound` objects are just descriptions of sounds.
|
||||
:class:`aud.Sound` objects are just descriptions of sounds.
|
||||
|
||||
However instead of a sine wave, we would like to have a square wave
|
||||
to produce a more retro gaming sound. We could of course use the
|
||||
|
@@ -228,9 +228,9 @@ PyDoc_STRVAR(M_aud_DynamicMusic_position_doc,
|
||||
static int
|
||||
DynamicMusic_set_position(DynamicMusicP* self, PyObject* args, void* nothing)
|
||||
{
|
||||
double position;
|
||||
float position;
|
||||
|
||||
if(!PyArg_Parse(args, "d:position", &position))
|
||||
if(!PyArg_Parse(args, "f:position", &position))
|
||||
return -1;
|
||||
|
||||
try
|
||||
@@ -252,7 +252,7 @@ DynamicMusic_get_position(DynamicMusicP* self, void* nothing)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Py_BuildValue("d", (*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->getPosition());
|
||||
return Py_BuildValue("f", (*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->getPosition());
|
||||
}
|
||||
catch(aud::Exception& e)
|
||||
{
|
||||
|
@@ -696,7 +696,7 @@ Handle_get_position(Handle* self, void* nothing)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Py_BuildValue("d", (*reinterpret_cast<std::shared_ptr<IHandle>*>(self->handle))->getPosition());
|
||||
return Py_BuildValue("f", (*reinterpret_cast<std::shared_ptr<IHandle>*>(self->handle))->getPosition());
|
||||
}
|
||||
catch(Exception& e)
|
||||
{
|
||||
@@ -708,9 +708,9 @@ Handle_get_position(Handle* self, void* nothing)
|
||||
static int
|
||||
Handle_set_position(Handle* self, PyObject* args, void* nothing)
|
||||
{
|
||||
double position;
|
||||
float position;
|
||||
|
||||
if(!PyArg_Parse(args, "d:position", &position))
|
||||
if(!PyArg_Parse(args, "f:position", &position))
|
||||
return -1;
|
||||
|
||||
try
|
||||
|
14
extern/audaspace/bindings/python/PySequence.cpp
vendored
14
extern/audaspace/bindings/python/PySequence.cpp
vendored
@@ -104,11 +104,11 @@ PyDoc_STRVAR(M_aud_Sequence_add_doc,
|
||||
" :arg sound: The sound this entry should play.\n"
|
||||
" :type sound: :class:`Sound`\n"
|
||||
" :arg begin: The start time.\n"
|
||||
" :type begin: double\n"
|
||||
" :type begin: float\n"
|
||||
" :arg end: The end time or a negative value if determined by the sound.\n"
|
||||
" :type end: double\n"
|
||||
" :type end: float\n"
|
||||
" :arg skip: How much seconds should be skipped at the beginning.\n"
|
||||
" :type skip: double\n"
|
||||
" :type skip: float\n"
|
||||
" :return: The entry added.\n"
|
||||
" :rtype: :class:`SequenceEntry`");
|
||||
|
||||
@@ -116,13 +116,13 @@ static PyObject *
|
||||
Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
|
||||
{
|
||||
PyObject* object;
|
||||
double begin;
|
||||
double end = -1.0;
|
||||
double skip = 0.0;
|
||||
float begin;
|
||||
float end = -1.0f;
|
||||
float skip = 0.0f;
|
||||
|
||||
static const char* kwlist[] = {"sound", "begin", "end", "skip", nullptr};
|
||||
|
||||
if(!PyArg_ParseTupleAndKeywords(args, kwds, "Od|dd:add", const_cast<char**>(kwlist), &object, &begin, &end, &skip))
|
||||
if(!PyArg_ParseTupleAndKeywords(args, kwds, "Of|ff:add", const_cast<char**>(kwlist), &object, &begin, &end, &skip))
|
||||
return nullptr;
|
||||
|
||||
Sound* sound = checkSound(object);
|
||||
|
@@ -46,18 +46,18 @@ PyDoc_STRVAR(M_aud_SequenceEntry_move_doc,
|
||||
".. classmethod:: move()\n\n"
|
||||
" Moves the entry.\n\n"
|
||||
" :arg begin: The new start time.\n"
|
||||
" :type begin: double\n"
|
||||
" :type begin: float\n"
|
||||
" :arg end: The new end time or a negative value if unknown.\n"
|
||||
" :type end: double\n"
|
||||
" :type end: float\n"
|
||||
" :arg skip: How many seconds to skip at the beginning.\n"
|
||||
" :type skip: double\n");
|
||||
" :type skip: float\n");
|
||||
|
||||
static PyObject *
|
||||
SequenceEntry_move(SequenceEntry* self, PyObject* args)
|
||||
{
|
||||
double begin, end, skip;
|
||||
float begin, end, skip;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "ddd:move", &begin, &end, &skip))
|
||||
if(!PyArg_ParseTuple(args, "fff:move", &begin, &end, &skip))
|
||||
return nullptr;
|
||||
|
||||
try
|
||||
|
9
extern/audaspace/bindings/python/PySound.cpp
vendored
9
extern/audaspace/bindings/python/PySound.cpp
vendored
@@ -1394,7 +1394,7 @@ PyDoc_STRVAR(M_aud_Sound_threshold_doc,
|
||||
" with a amplitude >= threshold to 1, all <= -threshold to -1 and\n"
|
||||
" all between to 0.\n\n"
|
||||
" :arg threshold: Threshold value over which an amplitude counts\n"
|
||||
" non-zero.\n\n"
|
||||
" non-zero.\n"
|
||||
":type threshold: float\n"
|
||||
":return: The created :class:`Sound` object.\n"
|
||||
":rtype: :class:`Sound`");
|
||||
@@ -1434,8 +1434,7 @@ PyDoc_STRVAR(M_aud_Sound_volume_doc,
|
||||
" :type volume: float\n"
|
||||
" :return: The created :class:`Sound` object.\n"
|
||||
" :rtype: :class:`Sound`\n\n"
|
||||
" .. note::\n\n"
|
||||
" Should be in the range [0, 1] to avoid clipping.\n\n"
|
||||
" .. note:: Should be in the range [0, 1] to avoid clipping.\n\n"
|
||||
" .. note::\n\n"
|
||||
" This is a filter function, you might consider using\n"
|
||||
" :attr:`Handle.volume` instead.");
|
||||
@@ -1476,8 +1475,8 @@ PyDoc_STRVAR(M_aud_Sound_join_doc,
|
||||
" :return: The created :class:`Sound` object.\n"
|
||||
" :rtype: :class:`Sound`\n\n"
|
||||
" .. note::\n\n"
|
||||
" The two factories have to have the same specifications\n"
|
||||
" (channels and samplerate).");
|
||||
" The two factories have to have the same specifications\n"
|
||||
" (channels and samplerate).");
|
||||
|
||||
static PyObject *
|
||||
Sound_join(Sound* self, PyObject* object)
|
||||
|
@@ -33,8 +33,8 @@ AUD_NAMESPACE_BEGIN
|
||||
class AUD_API DefaultSynchronizer : public ISynchronizer
|
||||
{
|
||||
public:
|
||||
virtual void seek(std::shared_ptr<IHandle> handle, double time);
|
||||
virtual double getPosition(std::shared_ptr<IHandle> handle);
|
||||
virtual void seek(std::shared_ptr<IHandle> handle, float time);
|
||||
virtual float getPosition(std::shared_ptr<IHandle> handle);
|
||||
virtual void play();
|
||||
virtual void stop();
|
||||
virtual void setSyncCallback(syncFunction function, void* data);
|
||||
|
@@ -35,9 +35,6 @@ AUD_NAMESPACE_BEGIN
|
||||
class AUD_API IDeviceFactory
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Destroys the device factory.
|
||||
*/
|
||||
virtual ~IDeviceFactory() {}
|
||||
|
||||
/**
|
||||
|
4
extern/audaspace/include/devices/IHandle.h
vendored
4
extern/audaspace/include/devices/IHandle.h
vendored
@@ -105,14 +105,14 @@ public:
|
||||
* - false if the handle is invalid.
|
||||
* \warning Whether the seek works or not depends on the sound source.
|
||||
*/
|
||||
virtual bool seek(double position)=0;
|
||||
virtual bool seek(float position)=0;
|
||||
|
||||
/**
|
||||
* Retrieves the current playback position of a sound.
|
||||
* \return The playback position in seconds, or 0.0 if the handle is
|
||||
* invalid.
|
||||
*/
|
||||
virtual double getPosition()=0;
|
||||
virtual float getPosition()=0;
|
||||
|
||||
/**
|
||||
* Returns the status of a played back sound.
|
||||
|
@@ -56,14 +56,14 @@ public:
|
||||
* @param handle The handle that should be synchronized/seeked.
|
||||
* @param time The absolute time to synchronize to.
|
||||
*/
|
||||
virtual void seek(std::shared_ptr<IHandle> handle, double time) = 0;
|
||||
virtual void seek(std::shared_ptr<IHandle> handle, float time) = 0;
|
||||
|
||||
/**
|
||||
* Retrieves the position of the synchronizer.
|
||||
* @param handle The handle which is synchronized.
|
||||
* @return The position in seconds.
|
||||
*/
|
||||
virtual double getPosition(std::shared_ptr<IHandle> handle) = 0;
|
||||
virtual float getPosition(std::shared_ptr<IHandle> handle) = 0;
|
||||
|
||||
/**
|
||||
* Starts the synchronizer playback.
|
||||
|
@@ -53,8 +53,8 @@ private:
|
||||
virtual bool stop();
|
||||
virtual bool getKeep();
|
||||
virtual bool setKeep(bool keep);
|
||||
virtual bool seek(double position);
|
||||
virtual double getPosition();
|
||||
virtual bool seek(float position);
|
||||
virtual float getPosition();
|
||||
virtual Status getStatus();
|
||||
virtual float getVolume();
|
||||
virtual bool setVolume(float volume);
|
||||
|
@@ -180,8 +180,8 @@ protected:
|
||||
virtual bool stop();
|
||||
virtual bool getKeep();
|
||||
virtual bool setKeep(bool keep);
|
||||
virtual bool seek(double position);
|
||||
virtual double getPosition();
|
||||
virtual bool seek(float position);
|
||||
virtual float getPosition();
|
||||
virtual Status getStatus();
|
||||
virtual float getVolume();
|
||||
virtual bool setVolume(float volume);
|
||||
|
5
extern/audaspace/include/file/IFileInput.h
vendored
5
extern/audaspace/include/file/IFileInput.h
vendored
@@ -40,10 +40,7 @@ class Buffer;
|
||||
class AUD_API IFileInput
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Destroys the file input.
|
||||
*/
|
||||
virtual ~IFileInput() {}
|
||||
virtual ~IFileInput() {};
|
||||
|
||||
/**
|
||||
* Creates a reader for a file to be read.
|
||||
|
6
extern/audaspace/include/fx/Delay.h
vendored
6
extern/audaspace/include/fx/Delay.h
vendored
@@ -35,7 +35,7 @@ private:
|
||||
/**
|
||||
* The delay in samples.
|
||||
*/
|
||||
const double m_delay;
|
||||
const float m_delay;
|
||||
|
||||
// delete copy constructor and operator=
|
||||
Delay(const Delay&) = delete;
|
||||
@@ -47,12 +47,12 @@ public:
|
||||
* \param sound The input sound.
|
||||
* \param delay The desired delay in seconds.
|
||||
*/
|
||||
Delay(std::shared_ptr<ISound> sound, double delay = 0);
|
||||
Delay(std::shared_ptr<ISound> sound, float delay = 0);
|
||||
|
||||
/**
|
||||
* Returns the delay in seconds.
|
||||
*/
|
||||
double getDelay() const;
|
||||
float getDelay() const;
|
||||
|
||||
virtual std::shared_ptr<IReader> createReader();
|
||||
};
|
||||
|
2
extern/audaspace/include/fx/DelayReader.h
vendored
2
extern/audaspace/include/fx/DelayReader.h
vendored
@@ -52,7 +52,7 @@ public:
|
||||
* \param reader The reader to read from.
|
||||
* \param delay The delay in seconds.
|
||||
*/
|
||||
DelayReader(std::shared_ptr<IReader> reader, double delay);
|
||||
DelayReader(std::shared_ptr<IReader> reader, float delay);
|
||||
|
||||
virtual void seek(int position);
|
||||
virtual int getLength() const;
|
||||
|
10
extern/audaspace/include/fx/DynamicMusic.h
vendored
10
extern/audaspace/include/fx/DynamicMusic.h
vendored
@@ -55,7 +55,7 @@ private:
|
||||
/**
|
||||
* Length of the crossfade transition in seconds, used when no custom transition has been set.
|
||||
*/
|
||||
double m_fadeTime;
|
||||
float m_fadeTime;
|
||||
|
||||
/**
|
||||
* Handle to the playback of the current scene.
|
||||
@@ -145,13 +145,13 @@ public:
|
||||
* Sets the length of the crossfade transition (default 1 second).
|
||||
* \param seconds The time in seconds.
|
||||
*/
|
||||
void setFadeTime(double seconds);
|
||||
void setFadeTime(float seconds);
|
||||
|
||||
/**
|
||||
* Gets the length of the crossfade transition (default 1 second).
|
||||
* \return The length of the cressfade transition in seconds.
|
||||
*/
|
||||
double getFadeTime();
|
||||
float getFadeTime();
|
||||
|
||||
/**
|
||||
* Resumes a paused sound.
|
||||
@@ -177,14 +177,14 @@ public:
|
||||
* - false if the handle is invalid.
|
||||
* \warning Whether the seek works or not depends on the sound source.
|
||||
*/
|
||||
bool seek(double position);
|
||||
bool seek(float position);
|
||||
|
||||
/**
|
||||
* Retrieves the current playback position of a sound.
|
||||
* \return The playback position in seconds, or 0.0 if the handle is
|
||||
* invalid.
|
||||
*/
|
||||
double getPosition();
|
||||
float getPosition();
|
||||
|
||||
/**
|
||||
* Retrieves the volume of the scenes.
|
||||
|
10
extern/audaspace/include/fx/Fader.h
vendored
10
extern/audaspace/include/fx/Fader.h
vendored
@@ -43,12 +43,12 @@ private:
|
||||
/**
|
||||
* The fading start.
|
||||
*/
|
||||
const double m_start;
|
||||
const float m_start;
|
||||
|
||||
/**
|
||||
* The fading length.
|
||||
*/
|
||||
const double m_length;
|
||||
const float m_length;
|
||||
|
||||
// delete copy constructor and operator=
|
||||
Fader(const Fader&) = delete;
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
*/
|
||||
Fader(std::shared_ptr<ISound> sound,
|
||||
FadeType type = FADE_IN,
|
||||
double start = 0, double length = 1);
|
||||
float start = 0.0f, float length = 1.0f);
|
||||
|
||||
/**
|
||||
* Returns the fading type.
|
||||
@@ -74,12 +74,12 @@ public:
|
||||
/**
|
||||
* Returns the fading start.
|
||||
*/
|
||||
double getStart() const;
|
||||
float getStart() const;
|
||||
|
||||
/**
|
||||
* Returns the fading length.
|
||||
*/
|
||||
double getLength() const;
|
||||
float getLength() const;
|
||||
|
||||
virtual std::shared_ptr<IReader> createReader();
|
||||
};
|
||||
|
6
extern/audaspace/include/fx/FaderReader.h
vendored
6
extern/audaspace/include/fx/FaderReader.h
vendored
@@ -49,12 +49,12 @@ private:
|
||||
/**
|
||||
* The fading start.
|
||||
*/
|
||||
const double m_start;
|
||||
const float m_start;
|
||||
|
||||
/**
|
||||
* The fading length.
|
||||
*/
|
||||
const double m_length;
|
||||
const float m_length;
|
||||
|
||||
// delete copy constructor and operator=
|
||||
FaderReader(const FaderReader&) = delete;
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
* \param length How long fading should last in seconds.
|
||||
*/
|
||||
FaderReader(std::shared_ptr<IReader> reader, FadeType type,
|
||||
double start,double length);
|
||||
float start,float length);
|
||||
|
||||
virtual void read(int& length, bool& eos, sample_t* buffer);
|
||||
};
|
||||
|
10
extern/audaspace/include/fx/Limiter.h
vendored
10
extern/audaspace/include/fx/Limiter.h
vendored
@@ -35,12 +35,12 @@ private:
|
||||
/**
|
||||
* The start time.
|
||||
*/
|
||||
const double m_start;
|
||||
const float m_start;
|
||||
|
||||
/**
|
||||
* The end time.
|
||||
*/
|
||||
const double m_end;
|
||||
const float m_end;
|
||||
|
||||
// delete copy constructor and operator=
|
||||
Limiter(const Limiter&) = delete;
|
||||
@@ -55,17 +55,17 @@ public:
|
||||
* play to the end.
|
||||
*/
|
||||
Limiter(std::shared_ptr<ISound> sound,
|
||||
double start = 0, double end = -1);
|
||||
float start = 0, float end = -1);
|
||||
|
||||
/**
|
||||
* Returns the start time.
|
||||
*/
|
||||
double getStart() const;
|
||||
float getStart() const;
|
||||
|
||||
/**
|
||||
* Returns the end time.
|
||||
*/
|
||||
double getEnd() const;
|
||||
float getEnd() const;
|
||||
|
||||
virtual std::shared_ptr<IReader> createReader();
|
||||
};
|
||||
|
6
extern/audaspace/include/fx/LimiterReader.h
vendored
6
extern/audaspace/include/fx/LimiterReader.h
vendored
@@ -35,12 +35,12 @@ private:
|
||||
/**
|
||||
* The start sample: inclusive.
|
||||
*/
|
||||
const double m_start;
|
||||
const float m_start;
|
||||
|
||||
/**
|
||||
* The end sample: exlusive.
|
||||
*/
|
||||
const double m_end;
|
||||
const float m_end;
|
||||
|
||||
// delete copy constructor and operator=
|
||||
LimiterReader(const LimiterReader&) = delete;
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
* \param end The desired end time (sample exklusive), a negative value
|
||||
* signals that it should play to the end.
|
||||
*/
|
||||
LimiterReader(std::shared_ptr<IReader> reader, double start = 0, double end = -1);
|
||||
LimiterReader(std::shared_ptr<IReader> reader, float start = 0, float end = -1);
|
||||
|
||||
virtual void seek(int position);
|
||||
virtual int getLength() const;
|
||||
|
2
extern/audaspace/include/sequence/Sequence.h
vendored
2
extern/audaspace/include/sequence/Sequence.h
vendored
@@ -151,7 +151,7 @@ public:
|
||||
* \param skip How much seconds should be skipped at the beginning.
|
||||
* \return The entry added.
|
||||
*/
|
||||
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
|
||||
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
|
||||
|
||||
/**
|
||||
* Removes an entry from the scene.
|
||||
|
@@ -203,7 +203,7 @@ public:
|
||||
* \param skip How much seconds should be skipped at the beginning.
|
||||
* \return The entry added.
|
||||
*/
|
||||
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
|
||||
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
|
||||
|
||||
/**
|
||||
* Removes an entry from the scene.
|
||||
|
@@ -55,13 +55,13 @@ private:
|
||||
std::shared_ptr<ISound> m_sound;
|
||||
|
||||
/// The begin time.
|
||||
double m_begin;
|
||||
float m_begin;
|
||||
|
||||
/// The end time.
|
||||
double m_end;
|
||||
float m_end;
|
||||
|
||||
/// How many seconds are skipped at the beginning.
|
||||
double m_skip;
|
||||
float m_skip;
|
||||
|
||||
/// Whether the entry is muted.
|
||||
bool m_muted;
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
* \param skip How much seconds should be skipped at the beginning.
|
||||
* \param id The ID of the entry.
|
||||
*/
|
||||
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id);
|
||||
SequenceEntry(std::shared_ptr<ISound> sound, float begin, float end, float skip, int id);
|
||||
virtual ~SequenceEntry();
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
* \param end The new end time or a negative value if unknown.
|
||||
* \param skip How many seconds to skip at the beginning.
|
||||
*/
|
||||
void move(double begin, double end, double skip);
|
||||
void move(float begin, float end, float skip);
|
||||
|
||||
/**
|
||||
* Retrieves the muting state of the entry.
|
||||
|
6
extern/audaspace/plugins/jack/JackDevice.cpp
vendored
6
extern/audaspace/plugins/jack/JackDevice.cpp
vendored
@@ -292,7 +292,7 @@ void JackDevice::stopPlayback()
|
||||
m_nextState = JackTransportStopped;
|
||||
}
|
||||
|
||||
void JackDevice::seekPlayback(double time)
|
||||
void JackDevice::seekPlayback(float time)
|
||||
{
|
||||
if(time >= 0.0f)
|
||||
AUD_jack_transport_locate(m_client, time * m_specs.rate);
|
||||
@@ -304,11 +304,11 @@ void JackDevice::setSyncCallback(ISynchronizer::syncFunction sync, void* data)
|
||||
m_syncFuncData = data;
|
||||
}
|
||||
|
||||
double JackDevice::getPlaybackPosition()
|
||||
float JackDevice::getPlaybackPosition()
|
||||
{
|
||||
jack_position_t position;
|
||||
AUD_jack_transport_query(m_client, &position);
|
||||
return position.frame / (double) m_specs.rate;
|
||||
return position.frame / (float) m_specs.rate;
|
||||
}
|
||||
|
||||
bool JackDevice::doesPlayback()
|
||||
|
4
extern/audaspace/plugins/jack/JackDevice.h
vendored
4
extern/audaspace/plugins/jack/JackDevice.h
vendored
@@ -174,7 +174,7 @@ public:
|
||||
* Seeks jack transport playback.
|
||||
* \param time The time to seek to.
|
||||
*/
|
||||
void seekPlayback(double time);
|
||||
void seekPlayback(float time);
|
||||
|
||||
/**
|
||||
* Sets the sync callback for jack transport playback.
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
* Retrieves the jack transport playback time.
|
||||
* \return The current time position.
|
||||
*/
|
||||
double getPlaybackPosition();
|
||||
float getPlaybackPosition();
|
||||
|
||||
/**
|
||||
* Returns whether jack transport plays back.
|
||||
|
@@ -25,12 +25,12 @@ JackSynchronizer::JackSynchronizer(JackDevice* device) :
|
||||
{
|
||||
}
|
||||
|
||||
void JackSynchronizer::seek(std::shared_ptr<IHandle> handle, double time)
|
||||
void JackSynchronizer::seek(std::shared_ptr<IHandle> handle, float time)
|
||||
{
|
||||
m_device->seekPlayback(time);
|
||||
}
|
||||
|
||||
double JackSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
|
||||
float JackSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
|
||||
{
|
||||
return m_device->getPlaybackPosition();
|
||||
}
|
||||
|
@@ -48,8 +48,8 @@ public:
|
||||
*/
|
||||
JackSynchronizer(JackDevice* device);
|
||||
|
||||
virtual void seek(std::shared_ptr<IHandle> handle, double time);
|
||||
virtual double getPosition(std::shared_ptr<IHandle> handle);
|
||||
virtual void seek(std::shared_ptr<IHandle> handle, float time);
|
||||
virtual float getPosition(std::shared_ptr<IHandle> handle);
|
||||
virtual void play();
|
||||
virtual void stop();
|
||||
virtual void setSyncCallback(syncFunction function, void* data);
|
||||
|
@@ -269,7 +269,7 @@ bool OpenALDevice::OpenALHandle::setKeep(bool keep)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenALDevice::OpenALHandle::seek(double position)
|
||||
bool OpenALDevice::OpenALHandle::seek(float position)
|
||||
{
|
||||
if(!m_status)
|
||||
return false;
|
||||
@@ -335,7 +335,7 @@ bool OpenALDevice::OpenALHandle::seek(double position)
|
||||
return true;
|
||||
}
|
||||
|
||||
double OpenALDevice::OpenALHandle::getPosition()
|
||||
float OpenALDevice::OpenALHandle::getPosition()
|
||||
{
|
||||
if(!m_status)
|
||||
return false;
|
||||
|
@@ -126,8 +126,8 @@ private:
|
||||
virtual bool stop();
|
||||
virtual bool getKeep();
|
||||
virtual bool setKeep(bool keep);
|
||||
virtual bool seek(double position);
|
||||
virtual double getPosition();
|
||||
virtual bool seek(float position);
|
||||
virtual float getPosition();
|
||||
virtual Status getStatus();
|
||||
virtual float getVolume();
|
||||
virtual bool setVolume(float volume);
|
||||
|
@@ -19,12 +19,12 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
void DefaultSynchronizer::seek(std::shared_ptr<IHandle> handle, double time)
|
||||
void DefaultSynchronizer::seek(std::shared_ptr<IHandle> handle, float time)
|
||||
{
|
||||
handle->seek(time);
|
||||
}
|
||||
|
||||
double DefaultSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
|
||||
float DefaultSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
|
||||
{
|
||||
return handle->getPosition();
|
||||
}
|
||||
|
4
extern/audaspace/src/devices/NULLDevice.cpp
vendored
4
extern/audaspace/src/devices/NULLDevice.cpp
vendored
@@ -52,12 +52,12 @@ bool NULLDevice::NULLHandle::setKeep(bool keep)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NULLDevice::NULLHandle::seek(double position)
|
||||
bool NULLDevice::NULLHandle::seek(float position)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
double NULLDevice::NULLHandle::getPosition()
|
||||
float NULLDevice::NULLHandle::getPosition()
|
||||
{
|
||||
return std::numeric_limits<float>::quiet_NaN();
|
||||
}
|
||||
|
@@ -347,7 +347,7 @@ bool SoftwareDevice::SoftwareHandle::setKeep(bool keep)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SoftwareDevice::SoftwareHandle::seek(double position)
|
||||
bool SoftwareDevice::SoftwareHandle::seek(float position)
|
||||
{
|
||||
if(!m_status)
|
||||
return false;
|
||||
@@ -366,7 +366,7 @@ bool SoftwareDevice::SoftwareHandle::seek(double position)
|
||||
return true;
|
||||
}
|
||||
|
||||
double SoftwareDevice::SoftwareHandle::getPosition()
|
||||
float SoftwareDevice::SoftwareHandle::getPosition()
|
||||
{
|
||||
if(!m_status)
|
||||
return false;
|
||||
@@ -376,7 +376,7 @@ double SoftwareDevice::SoftwareHandle::getPosition()
|
||||
if(!m_status)
|
||||
return 0.0f;
|
||||
|
||||
double position = m_reader->getPosition() / (double)m_device->m_specs.rate;
|
||||
float position = m_reader->getPosition() / (float)m_device->m_specs.rate;
|
||||
|
||||
return position;
|
||||
}
|
||||
|
4
extern/audaspace/src/fx/Delay.cpp
vendored
4
extern/audaspace/src/fx/Delay.cpp
vendored
@@ -19,13 +19,13 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
Delay::Delay(std::shared_ptr<ISound> sound, double delay) :
|
||||
Delay::Delay(std::shared_ptr<ISound> sound, float delay) :
|
||||
Effect(sound),
|
||||
m_delay(delay)
|
||||
{
|
||||
}
|
||||
|
||||
double Delay::getDelay() const
|
||||
float Delay::getDelay() const
|
||||
{
|
||||
return m_delay;
|
||||
}
|
||||
|
2
extern/audaspace/src/fx/DelayReader.cpp
vendored
2
extern/audaspace/src/fx/DelayReader.cpp
vendored
@@ -20,7 +20,7 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
DelayReader::DelayReader(std::shared_ptr<IReader> reader, double delay) :
|
||||
DelayReader::DelayReader(std::shared_ptr<IReader> reader, float delay) :
|
||||
EffectReader(reader),
|
||||
m_delay(int((SampleRate)delay * reader->getSpecs().rate)),
|
||||
m_remdelay(int((SampleRate)delay * reader->getSpecs().rate))
|
||||
|
10
extern/audaspace/src/fx/DynamicMusic.cpp
vendored
10
extern/audaspace/src/fx/DynamicMusic.cpp
vendored
@@ -133,14 +133,14 @@ bool DynamicMusic::addTransition(int init, int end, std::shared_ptr<ISound> soun
|
||||
return false;
|
||||
}
|
||||
|
||||
void DynamicMusic::setFadeTime(double seconds)
|
||||
void DynamicMusic::setFadeTime(float seconds)
|
||||
{
|
||||
m_device->lock();
|
||||
m_fadeTime = seconds;
|
||||
m_device->unlock();
|
||||
}
|
||||
|
||||
double DynamicMusic::getFadeTime()
|
||||
float DynamicMusic::getFadeTime()
|
||||
{
|
||||
return m_fadeTime;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ bool DynamicMusic::pause()
|
||||
return result || resultTrans;
|
||||
}
|
||||
|
||||
bool DynamicMusic::seek(double position)
|
||||
bool DynamicMusic::seek(float position)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -183,9 +183,9 @@ bool DynamicMusic::seek(double position)
|
||||
return result;
|
||||
}
|
||||
|
||||
double DynamicMusic::getPosition()
|
||||
float DynamicMusic::getPosition()
|
||||
{
|
||||
double result = 0.0f;
|
||||
float result = 0.0f;
|
||||
|
||||
if(m_currentHandle != nullptr)
|
||||
result = m_currentHandle->getPosition();
|
||||
|
6
extern/audaspace/src/fx/Fader.cpp
vendored
6
extern/audaspace/src/fx/Fader.cpp
vendored
@@ -18,7 +18,7 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
Fader::Fader(std::shared_ptr<ISound> sound, FadeType type, double start, double length) :
|
||||
Fader::Fader(std::shared_ptr<ISound> sound, FadeType type, float start, float length) :
|
||||
Effect(sound),
|
||||
m_type(type),
|
||||
m_start(start),
|
||||
@@ -31,12 +31,12 @@ FadeType Fader::getType() const
|
||||
return m_type;
|
||||
}
|
||||
|
||||
double Fader::getStart() const
|
||||
float Fader::getStart() const
|
||||
{
|
||||
return m_start;
|
||||
}
|
||||
|
||||
double Fader::getLength() const
|
||||
float Fader::getLength() const
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
8
extern/audaspace/src/fx/FaderReader.cpp
vendored
8
extern/audaspace/src/fx/FaderReader.cpp
vendored
@@ -20,7 +20,7 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
FaderReader::FaderReader(std::shared_ptr<IReader> reader, FadeType type, double start, double length) :
|
||||
FaderReader::FaderReader(std::shared_ptr<IReader> reader, FadeType type, float start,float length) :
|
||||
EffectReader(reader),
|
||||
m_type(type),
|
||||
m_start(start),
|
||||
@@ -36,14 +36,14 @@ void FaderReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
|
||||
m_reader->read(length, eos, buffer);
|
||||
|
||||
if((position + length) / specs.rate <= m_start)
|
||||
if((position + length) / (float)specs.rate <= m_start)
|
||||
{
|
||||
if(m_type != FADE_OUT)
|
||||
{
|
||||
std::memset(buffer, 0, length * samplesize);
|
||||
}
|
||||
}
|
||||
else if(position / specs.rate >= m_start+m_length)
|
||||
else if(position / (float)specs.rate >= m_start+m_length)
|
||||
{
|
||||
if(m_type == FADE_OUT)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void FaderReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
{
|
||||
if(i % specs.channels == 0)
|
||||
{
|
||||
volume = float((((position + i) / specs.rate) - m_start) / m_length);
|
||||
volume = (((position+i)/(float)specs.rate)-m_start) / m_length;
|
||||
if(volume > 1.0f)
|
||||
volume = 1.0f;
|
||||
else if(volume < 0.0f)
|
||||
|
6
extern/audaspace/src/fx/Limiter.cpp
vendored
6
extern/audaspace/src/fx/Limiter.cpp
vendored
@@ -20,19 +20,19 @@
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
Limiter::Limiter(std::shared_ptr<ISound> sound,
|
||||
double start, double end) :
|
||||
float start, float end) :
|
||||
Effect(sound),
|
||||
m_start(start),
|
||||
m_end(end)
|
||||
{
|
||||
}
|
||||
|
||||
double Limiter::getStart() const
|
||||
float Limiter::getStart() const
|
||||
{
|
||||
return m_start;
|
||||
}
|
||||
|
||||
double Limiter::getEnd() const
|
||||
float Limiter::getEnd() const
|
||||
{
|
||||
return m_end;
|
||||
}
|
||||
|
2
extern/audaspace/src/fx/LimiterReader.cpp
vendored
2
extern/audaspace/src/fx/LimiterReader.cpp
vendored
@@ -21,7 +21,7 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
LimiterReader::LimiterReader(std::shared_ptr<IReader> reader, double start, double end) :
|
||||
LimiterReader::LimiterReader(std::shared_ptr<IReader> reader, float start, float end) :
|
||||
EffectReader(reader),
|
||||
m_start(start),
|
||||
m_end(end)
|
||||
|
@@ -16,9 +16,9 @@
|
||||
|
||||
#include "respec/ChannelMapperReader.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <algorithm>
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
|
4
extern/audaspace/src/respec/Mixer.cpp
vendored
4
extern/audaspace/src/respec/Mixer.cpp
vendored
@@ -66,11 +66,11 @@ void Mixer::setSpecs(Specs specs)
|
||||
|
||||
void Mixer::clear(int length)
|
||||
{
|
||||
m_buffer.assureSize(length * AUD_SAMPLE_SIZE(m_specs));
|
||||
m_buffer.assureSize(length * m_specs.channels * AUD_SAMPLE_SIZE(m_specs));
|
||||
|
||||
m_length = length;
|
||||
|
||||
std::memset(m_buffer.getBuffer(), 0, length * AUD_SAMPLE_SIZE(m_specs));
|
||||
std::memset(m_buffer.getBuffer(), 0, length * m_specs.channels * AUD_SAMPLE_SIZE(m_specs));
|
||||
}
|
||||
|
||||
void Mixer::mix(sample_t* buffer, int start, int length, float volume)
|
||||
|
2
extern/audaspace/src/sequence/Sequence.cpp
vendored
2
extern/audaspace/src/sequence/Sequence.cpp
vendored
@@ -90,7 +90,7 @@ AnimateableProperty* Sequence::getAnimProperty(AnimateablePropertyType type)
|
||||
return m_sequence->getAnimProperty(type);
|
||||
}
|
||||
|
||||
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
|
||||
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, float begin, float end, float skip)
|
||||
{
|
||||
return m_sequence->add(sound, begin, end, skip);
|
||||
}
|
||||
|
@@ -149,7 +149,7 @@ AnimateableProperty* SequenceData::getAnimProperty(AnimateablePropertyType type)
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
|
||||
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, float begin, float end, float skip)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id) :
|
||||
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, float begin, float end, float skip, int id) :
|
||||
m_status(0),
|
||||
m_pos_status(1),
|
||||
m_sound_status(0),
|
||||
@@ -84,7 +84,7 @@ void SequenceEntry::setSound(std::shared_ptr<ISound> sound)
|
||||
}
|
||||
}
|
||||
|
||||
void SequenceEntry::move(double begin, double end, double skip)
|
||||
void SequenceEntry::move(float begin, float end, float skip)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
|
||||
|
@@ -57,7 +57,7 @@ void SequenceHandle::start()
|
||||
m_valid = m_handle.get();
|
||||
}
|
||||
|
||||
bool SequenceHandle::updatePosition(double position)
|
||||
bool SequenceHandle::updatePosition(float position)
|
||||
{
|
||||
std::lock_guard<ILockable> lock(*m_entry);
|
||||
|
||||
@@ -140,7 +140,7 @@ void SequenceHandle::stop()
|
||||
m_3dhandle = nullptr;
|
||||
}
|
||||
|
||||
void SequenceHandle::update(double position, float frame, float fps)
|
||||
void SequenceHandle::update(float position, float frame, float fps)
|
||||
{
|
||||
if(m_sound_status != m_entry->m_sound_status)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ void SequenceHandle::update(double position, float frame, float fps)
|
||||
m_handle->setVolume(0);
|
||||
}
|
||||
|
||||
bool SequenceHandle::seek(double position)
|
||||
bool SequenceHandle::seek(float position)
|
||||
{
|
||||
if(!m_valid)
|
||||
// sound not valid, aborting
|
||||
@@ -240,7 +240,7 @@ bool SequenceHandle::seek(double position)
|
||||
return false;
|
||||
|
||||
std::lock_guard<ILockable> lock(*m_entry);
|
||||
double seekpos = position - m_entry->m_begin;
|
||||
float seekpos = position - m_entry->m_begin;
|
||||
if(seekpos < 0)
|
||||
seekpos = 0;
|
||||
seekpos += m_entry->m_skip;
|
||||
|
@@ -71,7 +71,7 @@ private:
|
||||
* \param position Current playback position in seconds.
|
||||
* \return Whether the handle is valid.
|
||||
*/
|
||||
bool updatePosition(double position);
|
||||
bool updatePosition(float position);
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -104,14 +104,14 @@ public:
|
||||
* \param frame The current frame during playback.
|
||||
* \param fps The animation frames per second.
|
||||
*/
|
||||
void update(double position, float frame, float fps);
|
||||
void update(float position, float frame, float fps);
|
||||
|
||||
/**
|
||||
* Seeks the handle to a specific time position.
|
||||
* \param position The time to seek to.
|
||||
* \return Whether the handle is valid.
|
||||
*/
|
||||
bool seek(double position);
|
||||
bool seek(float position);
|
||||
};
|
||||
|
||||
AUD_NAMESPACE_END
|
||||
|
@@ -49,7 +49,7 @@ void SequenceReader::seek(int position)
|
||||
|
||||
for(auto& handle : m_handles)
|
||||
{
|
||||
handle->seek(position / (double)m_sequence->m_specs.rate);
|
||||
handle->seek(position / m_sequence->m_specs.rate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,12 +150,13 @@ void SequenceReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
|
||||
Specs specs = m_sequence->m_specs;
|
||||
int pos = 0;
|
||||
double time = double(m_position) / double(specs.rate);
|
||||
float time = float(m_position) / float(specs.rate);
|
||||
float volume, frame;
|
||||
int len, cfra;
|
||||
Vector3 v, v2;
|
||||
Quaternion q;
|
||||
|
||||
|
||||
while(pos < length)
|
||||
{
|
||||
frame = time * m_sequence->m_fps;
|
||||
@@ -186,7 +187,7 @@ void SequenceReader::read(int& length, bool& eos, sample_t* buffer)
|
||||
m_device.read(reinterpret_cast<data_t*>(buffer + specs.channels * pos), len);
|
||||
|
||||
pos += len;
|
||||
time += double(len) / double(specs.rate);
|
||||
time += float(len) / float(specs.rate);
|
||||
}
|
||||
|
||||
m_position += length;
|
||||
|
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
@@ -1,3 +1,3 @@
|
||||
|
||||
|
||||
#define MANTA_GIT_VERSION "commit b4a2742bd743e2913fba94dd35846042e2650212"
|
||||
#define MANTA_GIT_VERSION "commit 21303fab2eda588ec22988bf9e5762d2001c131f"
|
||||
|
@@ -244,15 +244,13 @@ struct KnApplyForce : public KernelBase {
|
||||
bool additive;
|
||||
};
|
||||
|
||||
//! add gravity forces to all fluid cells, optionally adapts to different grid sizes automatically
|
||||
//! add gravity forces to all fluid cells, automatically adapts to different grid sizes
|
||||
void addGravity(const FlagGrid &flags,
|
||||
MACGrid &vel,
|
||||
Vec3 gravity,
|
||||
const Grid<Real> *exclude = NULL,
|
||||
bool scale = true)
|
||||
const Grid<Real> *exclude = NULL)
|
||||
{
|
||||
float gridScale = (scale) ? flags.getDx() : 1;
|
||||
Vec3 f = gravity * flags.getParent()->getDt() / gridScale;
|
||||
Vec3 f = gravity * flags.getParent()->getDt() / flags.getDx();
|
||||
KnApplyForce(flags, vel, f, exclude, true);
|
||||
}
|
||||
static PyObject *_W_0(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
@@ -269,9 +267,8 @@ static PyObject *_W_0(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
|
||||
Vec3 gravity = _args.get<Vec3>("gravity", 2, &_lock);
|
||||
const Grid<Real> *exclude = _args.getPtrOpt<Grid<Real>>("exclude", 3, NULL, &_lock);
|
||||
bool scale = _args.getOpt<bool>("scale", 4, true, &_lock);
|
||||
_retval = getPyNone();
|
||||
addGravity(flags, vel, gravity, exclude, scale);
|
||||
addGravity(flags, vel, gravity, exclude);
|
||||
_args.check();
|
||||
}
|
||||
pbFinalizePlugin(parent, "addGravity", !noTiming);
|
||||
@@ -290,13 +287,14 @@ void PbRegister_addGravity()
|
||||
}
|
||||
}
|
||||
|
||||
//! Deprecated: use addGravity(scale=false) instead
|
||||
//! add gravity forces to all fluid cells , but dont account for changing cell size
|
||||
void addGravityNoScale(const FlagGrid &flags,
|
||||
MACGrid &vel,
|
||||
const Vec3 &gravity,
|
||||
const Grid<Real> *exclude = NULL)
|
||||
{
|
||||
addGravity(flags, vel, gravity, exclude, false);
|
||||
const Vec3 f = gravity * flags.getParent()->getDt();
|
||||
KnApplyForce(flags, vel, f, exclude, true);
|
||||
}
|
||||
static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
{
|
||||
@@ -414,17 +412,14 @@ struct KnAddBuoyancy : public KernelBase {
|
||||
Vec3 strength;
|
||||
};
|
||||
|
||||
//! add Buoyancy force based on factor (e.g. smoke density), optionally adapts to different grid
|
||||
//! sizes automatically
|
||||
//! add Buoyancy force based on fctor (e.g. smoke density)
|
||||
void addBuoyancy(const FlagGrid &flags,
|
||||
const Grid<Real> &density,
|
||||
MACGrid &vel,
|
||||
Vec3 gravity,
|
||||
Real coefficient = 1.,
|
||||
bool scale = true)
|
||||
Real coefficient = 1.)
|
||||
{
|
||||
float gridScale = (scale) ? flags.getDx() : 1;
|
||||
Vec3 f = -gravity * flags.getParent()->getDt() / gridScale * coefficient;
|
||||
Vec3 f = -gravity * flags.getParent()->getDt() / flags.getParent()->getDx() * coefficient;
|
||||
KnAddBuoyancy(flags, density, vel, f);
|
||||
}
|
||||
static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
@@ -442,9 +437,8 @@ static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
|
||||
MACGrid &vel = *_args.getPtr<MACGrid>("vel", 2, &_lock);
|
||||
Vec3 gravity = _args.get<Vec3>("gravity", 3, &_lock);
|
||||
Real coefficient = _args.getOpt<Real>("coefficient", 4, 1., &_lock);
|
||||
bool scale = _args.getOpt<bool>("scale", 5, true, &_lock);
|
||||
_retval = getPyNone();
|
||||
addBuoyancy(flags, density, vel, gravity, coefficient, scale);
|
||||
addBuoyancy(flags, density, vel, gravity, coefficient);
|
||||
_args.check();
|
||||
}
|
||||
pbFinalizePlugin(parent, "addBuoyancy", !noTiming);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
|
||||
# add_subdirectory(atomic) # header only
|
||||
add_subdirectory(clog)
|
||||
add_subdirectory(string)
|
||||
add_subdirectory(ghost)
|
||||
add_subdirectory(guardedalloc)
|
||||
add_subdirectory(libmv)
|
||||
|
@@ -253,8 +253,8 @@ class CYCLES_RENDER_PT_sampling_adaptive(CyclesButtonsPanel, Panel):
|
||||
layout.active = cscene.use_adaptive_sampling
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "adaptive_threshold", text="Noise Threshold")
|
||||
col.prop(cscene, "adaptive_min_samples", text="Min Samples")
|
||||
col.prop(cscene, "adaptive_threshold", text="Noise Threshold")
|
||||
|
||||
class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Advanced"
|
||||
@@ -500,9 +500,8 @@ class CYCLES_RENDER_PT_light_paths_caustics(CyclesButtonsPanel, Panel):
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cscene, "blur_glossy")
|
||||
col = layout.column(heading="Caustics", align=True)
|
||||
col.prop(cscene, "caustics_reflective", text="Reflective")
|
||||
col.prop(cscene, "caustics_refractive", text="Refractive")
|
||||
col.prop(cscene, "caustics_reflective")
|
||||
col.prop(cscene, "caustics_refractive")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
|
||||
@@ -763,16 +762,22 @@ class CYCLES_RENDER_PT_filter(CyclesButtonsPanel, Panel):
|
||||
rd = scene.render
|
||||
view_layer = context.view_layer
|
||||
|
||||
col = layout.column(heading="Include")
|
||||
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_sky", text="Environment")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_ao", text="Ambient Occlusion")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_solid", text="Surfaces")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_strand", text="Hair")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_volumes", text="Volumes")
|
||||
if with_freestyle:
|
||||
sub = col.row(align=True)
|
||||
sub.prop(view_layer, "use_freestyle", text="Freestyle")
|
||||
sub.active = rd.use_freestyle
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_freestyle", text="Freestyle")
|
||||
col.active = rd.use_freestyle
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_override(CyclesButtonsPanel, Panel):
|
||||
@@ -814,27 +819,36 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, Panel):
|
||||
view_layer = context.view_layer
|
||||
cycles_view_layer = view_layer.cycles
|
||||
|
||||
col = layout.column(heading="Include", align=True)
|
||||
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_combined")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_z")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_mist")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_normal")
|
||||
sub = col.column()
|
||||
sub.active = not rd.use_motion_blur
|
||||
sub.prop(view_layer, "use_pass_vector")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_vector")
|
||||
col.active = not rd.use_motion_blur
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_uv")
|
||||
|
||||
col.prop(cycles_view_layer, "denoising_store_passes", text="Denoising Data")
|
||||
|
||||
col = layout.column(heading="Indexes", align=True)
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_object_index")
|
||||
col = flow.column()
|
||||
col.prop(view_layer, "use_pass_material_index")
|
||||
|
||||
col = layout.column(heading="Debug", align=True)
|
||||
layout.separator()
|
||||
|
||||
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
col = flow.column()
|
||||
col.prop(cycles_view_layer, "denoising_store_passes", text="Denoising Data")
|
||||
col = flow.column()
|
||||
col.prop(cycles_view_layer, "pass_debug_render_time", text="Render Time")
|
||||
col = flow.column()
|
||||
col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample Count")
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(view_layer, "pass_alpha_threshold")
|
||||
|
||||
@@ -852,26 +866,38 @@ class CYCLES_RENDER_PT_passes_light(CyclesButtonsPanel, Panel):
|
||||
view_layer = context.view_layer
|
||||
cycles_view_layer = view_layer.cycles
|
||||
|
||||
col = layout.column(heading="Diffuse", align=True)
|
||||
col.prop(view_layer, "use_pass_diffuse_direct", text="Direct")
|
||||
col.prop(view_layer, "use_pass_diffuse_indirect", text="Indirect")
|
||||
col.prop(view_layer, "use_pass_diffuse_color", text="Color")
|
||||
split = layout.split(factor=0.35)
|
||||
split.use_property_split = False
|
||||
split.label(text="Diffuse")
|
||||
row = split.row(align=True)
|
||||
row.prop(view_layer, "use_pass_diffuse_direct", text="Direct", toggle=True)
|
||||
row.prop(view_layer, "use_pass_diffuse_indirect", text="Indirect", toggle=True)
|
||||
row.prop(view_layer, "use_pass_diffuse_color", text="Color", toggle=True)
|
||||
|
||||
col = layout.column(heading="Glossy", align=True)
|
||||
col.prop(view_layer, "use_pass_glossy_direct", text="Direct")
|
||||
col.prop(view_layer, "use_pass_glossy_indirect", text="Indirect")
|
||||
col.prop(view_layer, "use_pass_glossy_color", text="Color")
|
||||
split = layout.split(factor=0.35)
|
||||
split.use_property_split = False
|
||||
split.label(text="Glossy")
|
||||
row = split.row(align=True)
|
||||
row.prop(view_layer, "use_pass_glossy_direct", text="Direct", toggle=True)
|
||||
row.prop(view_layer, "use_pass_glossy_indirect", text="Indirect", toggle=True)
|
||||
row.prop(view_layer, "use_pass_glossy_color", text="Color", toggle=True)
|
||||
|
||||
col = layout.column(heading="Transmission", align=True)
|
||||
col.prop(view_layer, "use_pass_transmission_direct", text="Direct")
|
||||
col.prop(view_layer, "use_pass_transmission_indirect", text="Indirect")
|
||||
col.prop(view_layer, "use_pass_transmission_color", text="Color")
|
||||
split = layout.split(factor=0.35)
|
||||
split.use_property_split = False
|
||||
split.label(text="Transmission")
|
||||
row = split.row(align=True)
|
||||
row.prop(view_layer, "use_pass_transmission_direct", text="Direct", toggle=True)
|
||||
row.prop(view_layer, "use_pass_transmission_indirect", text="Indirect", toggle=True)
|
||||
row.prop(view_layer, "use_pass_transmission_color", text="Color", toggle=True)
|
||||
|
||||
col = layout.column(heading="Volume", align=True)
|
||||
col.prop(cycles_view_layer, "use_pass_volume_direct", text="Direct")
|
||||
col.prop(cycles_view_layer, "use_pass_volume_indirect", text="Indirect")
|
||||
split = layout.split(factor=0.35)
|
||||
split.use_property_split = False
|
||||
split.label(text="Volume")
|
||||
row = split.row(align=True)
|
||||
row.prop(cycles_view_layer, "use_pass_volume_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "use_pass_volume_indirect", text="Indirect", toggle=True)
|
||||
|
||||
col = layout.column(heading="Other", align=True)
|
||||
col = layout.column(align=True)
|
||||
col.prop(view_layer, "use_pass_emit", text="Emission")
|
||||
col.prop(view_layer, "use_pass_environment")
|
||||
col.prop(view_layer, "use_pass_shadow")
|
||||
@@ -892,10 +918,11 @@ class CYCLES_RENDER_PT_passes_crypto(CyclesButtonsPanel, Panel):
|
||||
|
||||
cycles_view_layer = context.view_layer.cycles
|
||||
|
||||
col = layout.column(heading="Include", align=True)
|
||||
col.prop(cycles_view_layer, "use_pass_crypto_object", text="Object")
|
||||
col.prop(cycles_view_layer, "use_pass_crypto_material", text="Material")
|
||||
col.prop(cycles_view_layer, "use_pass_crypto_asset", text="Asset")
|
||||
row = layout.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cycles_view_layer, "use_pass_crypto_object", text="Object", toggle=True)
|
||||
row.prop(cycles_view_layer, "use_pass_crypto_material", text="Material", toggle=True)
|
||||
row.prop(cycles_view_layer, "use_pass_crypto_asset", text="Asset", toggle=True)
|
||||
|
||||
layout.prop(cycles_view_layer, "pass_crypto_depth", text="Levels")
|
||||
|
||||
@@ -985,9 +1012,10 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||
view_layer = context.view_layer
|
||||
cycles_view_layer = view_layer.cycles
|
||||
|
||||
layout.active = cycles_view_layer.use_denoising
|
||||
split = layout.split()
|
||||
split.active = cycles_view_layer.use_denoising
|
||||
|
||||
col = layout.column()
|
||||
col = split.column(align=True)
|
||||
|
||||
if show_optix_denoising(context):
|
||||
col.prop(cycles_view_layer, "use_optix_denoising")
|
||||
@@ -998,29 +1026,51 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
|
||||
return
|
||||
|
||||
col.prop(cycles_view_layer, "denoising_radius", text="Radius")
|
||||
|
||||
col = layout.column()
|
||||
col.prop(cycles_view_layer, "denoising_strength", slider=True, text="Strength")
|
||||
col.prop(cycles_view_layer, "denoising_feature_strength", slider=True, text="Feature Strength")
|
||||
col.prop(cycles_view_layer, "denoising_relative_pca")
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
|
||||
split = layout.split(factor=0.5)
|
||||
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
|
||||
|
||||
row = col.row(heading="Diffuse", align=True)
|
||||
col = split.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Diffuse")
|
||||
|
||||
row = split.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cycles_view_layer, "denoising_diffuse_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect", toggle=True)
|
||||
|
||||
row = col.row(heading="Glossy", align=True)
|
||||
split = layout.split(factor=0.5)
|
||||
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
|
||||
|
||||
col = split.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Glossy")
|
||||
|
||||
row = split.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cycles_view_layer, "denoising_glossy_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect", toggle=True)
|
||||
|
||||
row = col.row(heading="Transmission", align=True)
|
||||
split = layout.split(factor=0.5)
|
||||
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
|
||||
|
||||
col = split.column()
|
||||
col.alignment = 'RIGHT'
|
||||
col.label(text="Transmission")
|
||||
|
||||
row = split.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cycles_view_layer, "denoising_transmission_direct", text="Direct", toggle=True)
|
||||
row.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect", toggle=True)
|
||||
|
||||
split = layout.split(factor=0.5)
|
||||
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
|
||||
|
||||
|
||||
class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Post Processing"
|
||||
@@ -1034,7 +1084,7 @@ class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel):
|
||||
|
||||
rd = context.scene.render
|
||||
|
||||
col = layout.column(align=True, heading="Pipeline")
|
||||
col = layout.column(align=True)
|
||||
col.prop(rd, "use_compositing")
|
||||
col.prop(rd, "use_sequencer")
|
||||
|
||||
@@ -1223,18 +1273,22 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
layout = self.layout
|
||||
ob = context.object
|
||||
|
||||
layout.prop(ob, "hide_select", text="Selectable", invert_checkbox=True, toggle=False)
|
||||
|
||||
col = layout.column(heading="Show in")
|
||||
col.prop(ob, "hide_viewport", text="Viewports", invert_checkbox=True, toggle=False)
|
||||
col.prop(ob, "hide_render", text="Renders", invert_checkbox=True, toggle=False)
|
||||
col = flow.column()
|
||||
col.prop(ob, "hide_viewport", text="Show in Viewports", invert_checkbox=True, toggle=False)
|
||||
col = flow.column()
|
||||
col.prop(ob, "hide_render", text="Show in Renders", invert_checkbox=True, toggle=False)
|
||||
col = flow.column()
|
||||
col.prop(ob, "hide_select", text="Selectable", invert_checkbox=True, toggle=False)
|
||||
|
||||
if has_geometry_visibility(ob):
|
||||
cob = ob.cycles
|
||||
col = layout.column(heading="Mask")
|
||||
col = flow.column()
|
||||
col.prop(cob, "is_shadow_catcher")
|
||||
col = flow.column()
|
||||
col.prop(cob, "is_holdout")
|
||||
|
||||
|
||||
@@ -1258,16 +1312,24 @@ class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel):
|
||||
cob = ob.cycles
|
||||
visibility = ob.cycles_visibility
|
||||
|
||||
col = layout.column()
|
||||
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
|
||||
col = flow.column()
|
||||
col.prop(visibility, "camera")
|
||||
col = flow.column()
|
||||
col.prop(visibility, "diffuse")
|
||||
col = flow.column()
|
||||
col.prop(visibility, "glossy")
|
||||
col = flow.column()
|
||||
col.prop(visibility, "transmission")
|
||||
col = flow.column()
|
||||
col.prop(visibility, "scatter")
|
||||
|
||||
if ob.type != 'LIGHT':
|
||||
sub = col.column()
|
||||
sub.prop(visibility, "shadow")
|
||||
col = flow.column()
|
||||
col.prop(visibility, "shadow")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel):
|
||||
@@ -1290,13 +1352,15 @@ class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel):
|
||||
ob = context.object
|
||||
cob = ob.cycles
|
||||
|
||||
row = layout.row()
|
||||
row.active = scene.render.use_simplify and cscene.use_camera_cull
|
||||
row.prop(cob, "use_camera_cull")
|
||||
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
|
||||
row = layout.row()
|
||||
row.active = scene.render.use_simplify and cscene.use_distance_cull
|
||||
row.prop(cob, "use_distance_cull")
|
||||
col = flow.column()
|
||||
col.active = scene.render.use_simplify and cscene.use_camera_cull
|
||||
col.prop(cob, "use_camera_cull")
|
||||
|
||||
col = flow.column()
|
||||
col.active = scene.render.use_simplify and cscene.use_distance_cull
|
||||
col.prop(cob, "use_distance_cull")
|
||||
|
||||
|
||||
def panel_node_draw(layout, id_data, output_type, input_name):
|
||||
@@ -1410,8 +1474,6 @@ class CYCLES_LIGHT_PT_nodes(CyclesButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
light = context.light
|
||||
panel_node_draw(layout, light, 'OUTPUT_LIGHT', 'Surface')
|
||||
|
||||
@@ -1461,8 +1523,6 @@ class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
world = context.world
|
||||
|
||||
if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
|
||||
@@ -1482,8 +1542,6 @@ class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
world = context.world
|
||||
panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
|
||||
|
||||
@@ -1671,8 +1729,6 @@ class CYCLES_MATERIAL_PT_surface(CyclesButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
if not panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface'):
|
||||
layout.prop(mat, "diffuse_color")
|
||||
@@ -1691,8 +1747,6 @@ class CYCLES_MATERIAL_PT_volume(CyclesButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
# cmat = mat.cycles
|
||||
|
||||
@@ -1711,8 +1765,6 @@ class CYCLES_MATERIAL_PT_displacement(CyclesButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
mat = context.material
|
||||
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Displacement')
|
||||
|
||||
@@ -1854,24 +1906,26 @@ class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel):
|
||||
sub.prop(cbk, "normal_b", text="B")
|
||||
|
||||
elif cscene.bake_type == 'COMBINED':
|
||||
row = col.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cbk, "use_pass_direct", toggle=True)
|
||||
row.prop(cbk, "use_pass_indirect", toggle=True)
|
||||
|
||||
col = layout.column(heading="Lighting", align=True)
|
||||
col.prop(cbk, "use_pass_direct")
|
||||
col.prop(cbk, "use_pass_indirect")
|
||||
flow = col.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=True)
|
||||
|
||||
col = layout.column(heading="Contributions", align=True)
|
||||
col.active = cbk.use_pass_direct or cbk.use_pass_indirect
|
||||
col.prop(cbk, "use_pass_diffuse")
|
||||
col.prop(cbk, "use_pass_glossy")
|
||||
col.prop(cbk, "use_pass_transmission")
|
||||
col.prop(cbk, "use_pass_ambient_occlusion")
|
||||
col.prop(cbk, "use_pass_emit")
|
||||
flow.active = cbk.use_pass_direct or cbk.use_pass_indirect
|
||||
flow.prop(cbk, "use_pass_diffuse")
|
||||
flow.prop(cbk, "use_pass_glossy")
|
||||
flow.prop(cbk, "use_pass_transmission")
|
||||
flow.prop(cbk, "use_pass_ambient_occlusion")
|
||||
flow.prop(cbk, "use_pass_emit")
|
||||
|
||||
elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION'}:
|
||||
col = layout.column(heading="Contributions", align=True)
|
||||
col.prop(cbk, "use_pass_direct")
|
||||
col.prop(cbk, "use_pass_indirect")
|
||||
col.prop(cbk, "use_pass_color")
|
||||
row = col.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.prop(cbk, "use_pass_direct", toggle=True)
|
||||
row.prop(cbk, "use_pass_indirect", toggle=True)
|
||||
row.prop(cbk, "use_pass_color", toggle=True)
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_bake_selected_to_active(CyclesButtonsPanel, Panel):
|
||||
@@ -2077,17 +2131,17 @@ class CYCLES_RENDER_PT_simplify_culling(CyclesButtonsPanel, Panel):
|
||||
|
||||
layout.active = rd.use_simplify
|
||||
|
||||
row = layout.row(heading="Camera Culling")
|
||||
row.prop(cscene, "use_camera_cull", text="")
|
||||
sub = row.column()
|
||||
col = layout.column()
|
||||
col.prop(cscene, "use_camera_cull")
|
||||
sub = col.column()
|
||||
sub.active = cscene.use_camera_cull
|
||||
sub.prop(cscene, "camera_cull_margin", text="")
|
||||
sub.prop(cscene, "camera_cull_margin")
|
||||
|
||||
row = layout.row(heading="Distance Culling")
|
||||
row.prop(cscene, "use_distance_cull", text="")
|
||||
sub = row.column()
|
||||
col = layout.column()
|
||||
col.prop(cscene, "use_distance_cull")
|
||||
sub = col.column()
|
||||
sub.active = cscene.use_distance_cull
|
||||
sub.prop(cscene, "distance_cull_margin", text="")
|
||||
sub.prop(cscene, "distance_cull_margin", text="Distance")
|
||||
|
||||
|
||||
class CYCLES_VIEW3D_PT_shading_render_pass(Panel):
|
||||
|
@@ -108,7 +108,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
||||
}
|
||||
|
||||
if (dicing_prop_changed) {
|
||||
for (const pair<const GeometryKey, Geometry *> &iter : geometry_map.key_to_scene_data()) {
|
||||
for (const pair<GeometryKey, Geometry *> &iter : geometry_map.key_to_scene_data()) {
|
||||
Geometry *geom = iter.second;
|
||||
if (geom->type == Geometry::MESH) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
@@ -142,7 +142,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
||||
BL::Object b_ob(b_id);
|
||||
const bool updated_geometry = b_update->is_updated_geometry();
|
||||
|
||||
if (b_update->is_updated_transform() || b_update->is_updated_shading()) {
|
||||
if (b_update->is_updated_transform()) {
|
||||
object_map.set_recalc(b_ob);
|
||||
light_map.set_recalc(b_ob);
|
||||
}
|
||||
|
@@ -156,19 +156,6 @@ void BVHOptiX::pack_tlas()
|
||||
PackedBVH &bvh_pack = geom->bvh->pack;
|
||||
int geom_prim_offset = geom->prim_offset;
|
||||
|
||||
// Merge visibility flags of all objects and fix object indices for non-instanced geometry
|
||||
int object_index = 0; // Unused for instanced geometry
|
||||
int object_visibility = 0;
|
||||
foreach (Object *ob, objects) {
|
||||
if (ob->geometry == geom) {
|
||||
object_visibility |= ob->visibility_for_tracing();
|
||||
if (!geom->is_instanced()) {
|
||||
object_index = ob->get_device_index();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge primitive, object and triangle indexes
|
||||
if (!bvh_pack.prim_index.empty()) {
|
||||
int *bvh_prim_type = &bvh_pack.prim_type[0];
|
||||
@@ -187,8 +174,8 @@ void BVHOptiX::pack_tlas()
|
||||
}
|
||||
|
||||
pack_prim_type[pack_offset] = bvh_prim_type[i];
|
||||
pack_prim_object[pack_offset] = object_index;
|
||||
pack_prim_visibility[pack_offset] = bvh_prim_visibility[i] | object_visibility;
|
||||
pack_prim_object[pack_offset] = 0; // Unused for instanced geometry
|
||||
pack_prim_visibility[pack_offset] = bvh_prim_visibility[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +188,27 @@ void BVHOptiX::pack_tlas()
|
||||
pack_verts_offset += prim_tri_size;
|
||||
}
|
||||
}
|
||||
|
||||
// Merge visibility flags of all objects and fix object indices for non-instanced geometry
|
||||
foreach (Object *ob, objects) {
|
||||
Geometry *const geom = ob->geometry;
|
||||
size_t num_primitives = 0;
|
||||
|
||||
if (geom->type == Geometry::MESH) {
|
||||
num_primitives = static_cast<Mesh *const>(geom)->num_triangles();
|
||||
}
|
||||
else if (geom->type == Geometry::HAIR) {
|
||||
num_primitives = static_cast<Hair *const>(geom)->num_segments();
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < num_primitives; ++i) {
|
||||
if (!geom->is_instanced()) {
|
||||
assert(pack.prim_object[geom->optix_prim_offset + i] == 0);
|
||||
pack.prim_object[geom->optix_prim_offset + i] = ob->get_device_index();
|
||||
}
|
||||
pack.prim_visibility[geom->optix_prim_offset + i] |= ob->visibility_for_tracing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BVHOptiX::pack_nodes(const BVHNode *)
|
||||
|
@@ -383,13 +383,7 @@ class OptiXDevice : public CUDADevice {
|
||||
|
||||
{ // Load and compile PTX module with OptiX kernels
|
||||
string ptx_data, ptx_filename = path_get("lib/kernel_optix.ptx");
|
||||
if (use_adaptive_compilation() || path_file_size(ptx_filename) == -1) {
|
||||
if (!getenv("OPTIX_ROOT_DIR")) {
|
||||
set_error(
|
||||
"OPTIX_ROOT_DIR environment variable not set, must be set with the path to the "
|
||||
"Optix SDK in order to compile the Optix kernel on demand.");
|
||||
return false;
|
||||
}
|
||||
if (use_adaptive_compilation()) {
|
||||
ptx_filename = compile_kernel(requested_features, "kernel_optix", "optix", true);
|
||||
}
|
||||
if (ptx_filename.empty() || !path_read_text(ptx_filename, ptx_data)) {
|
||||
|
@@ -507,7 +507,7 @@ endif()
|
||||
|
||||
# OptiX PTX modules
|
||||
|
||||
if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
||||
if(WITH_CYCLES_DEVICE_OPTIX)
|
||||
foreach(input ${SRC_OPTIX_KERNELS})
|
||||
get_filename_component(input_we ${input} NAME_WE)
|
||||
|
||||
@@ -677,7 +677,7 @@ source_group("svm" FILES ${SRC_SVM_HEADERS})
|
||||
if(WITH_CYCLES_CUDA)
|
||||
add_dependencies(cycles_kernel cycles_kernel_cuda)
|
||||
endif()
|
||||
if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
||||
if(WITH_CYCLES_DEVICE_OPTIX)
|
||||
add_dependencies(cycles_kernel cycles_kernel_optix)
|
||||
endif()
|
||||
|
||||
|
@@ -71,7 +71,6 @@ __device__ half __float2half(const float f)
|
||||
#define ccl_may_alias
|
||||
#define ccl_addr_space
|
||||
#define ccl_restrict __restrict__
|
||||
#define ccl_loop_no_unroll
|
||||
/* TODO(sergey): In theory we might use references with CUDA, however
|
||||
* performance impact yet to be investigated.
|
||||
*/
|
||||
|
@@ -43,7 +43,6 @@
|
||||
#define ccl_local __local
|
||||
#define ccl_local_param __local
|
||||
#define ccl_private __private
|
||||
#define ccl_loop_no_unroll __attribute__((opencl_unroll_hint(1)))
|
||||
#define ccl_restrict restrict
|
||||
#define ccl_ref
|
||||
#define ccl_align(n) __attribute__((aligned(n)))
|
||||
|
@@ -70,7 +70,6 @@ __device__ half __float2half(const float f)
|
||||
#define ccl_private
|
||||
#define ccl_may_alias
|
||||
#define ccl_addr_space
|
||||
#define ccl_loop_no_unroll
|
||||
#define ccl_restrict __restrict__
|
||||
#define ccl_ref
|
||||
#define ccl_align(n) __align__(n)
|
||||
|
@@ -199,33 +199,32 @@ ccl_device float pmj_sample_1D(KernelGlobals *kg, int sample, int rng_hash, int
|
||||
{
|
||||
/* Fallback to random */
|
||||
if (sample >= NUM_PMJ_SAMPLES) {
|
||||
const int p = rng_hash + dimension;
|
||||
int p = rng_hash + dimension;
|
||||
return cmj_randfloat(sample, p);
|
||||
}
|
||||
else {
|
||||
const uint mask = cmj_hash_simple(dimension, rng_hash) & 0x007fffff;
|
||||
const int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
|
||||
return __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ mask) - 1.0f;
|
||||
}
|
||||
uint tmp_rng = cmj_hash_simple(dimension, rng_hash);
|
||||
int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
|
||||
return __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ (tmp_rng & 0x007fffff)) -
|
||||
1.0f;
|
||||
}
|
||||
|
||||
ccl_device float2 pmj_sample_2D(KernelGlobals *kg, int sample, int rng_hash, int dimension)
|
||||
ccl_device void pmj_sample_2D(
|
||||
KernelGlobals *kg, int sample, int rng_hash, int dimension, float *fx, float *fy)
|
||||
{
|
||||
if (sample >= NUM_PMJ_SAMPLES) {
|
||||
const int p = rng_hash + dimension;
|
||||
const float fx = cmj_randfloat(sample, p);
|
||||
const float fy = cmj_randfloat(sample, p + 1);
|
||||
return make_float2(fx, fy);
|
||||
}
|
||||
else {
|
||||
const int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
|
||||
const uint maskx = cmj_hash_simple(dimension, rng_hash) & 0x007fffff;
|
||||
const uint masky = cmj_hash_simple(dimension + 1, rng_hash) & 0x007fffff;
|
||||
const float fx = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ maskx) - 1.0f;
|
||||
const float fy = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index + 1) ^ masky) -
|
||||
1.0f;
|
||||
return make_float2(fx, fy);
|
||||
int p = rng_hash + dimension;
|
||||
*fx = cmj_randfloat(sample, p);
|
||||
*fy = cmj_randfloat(sample, p + 1);
|
||||
return;
|
||||
}
|
||||
uint tmp_rng = cmj_hash_simple(dimension, rng_hash);
|
||||
int index = ((dimension % NUM_PMJ_PATTERNS) * NUM_PMJ_SAMPLES + sample) * 2;
|
||||
*fx = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index) ^ (tmp_rng & 0x007fffff)) -
|
||||
1.0f;
|
||||
tmp_rng = cmj_hash_simple(dimension + 1, rng_hash);
|
||||
*fy = __uint_as_float(kernel_tex_fetch(__sample_pattern_lut, index + 1) ^
|
||||
(tmp_rng & 0x007fffff)) -
|
||||
1.0f;
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@@ -102,9 +102,7 @@ ccl_device_forceinline void path_rng_2D(KernelGlobals *kg,
|
||||
return;
|
||||
#endif
|
||||
if (kernel_data.integrator.sampling_pattern == SAMPLING_PATTERN_PMJ) {
|
||||
const float2 f = pmj_sample_2D(kg, sample, rng_hash, dimension);
|
||||
*fx = f.x;
|
||||
*fy = f.y;
|
||||
pmj_sample_2D(kg, sample, rng_hash, dimension, fx, fy);
|
||||
return;
|
||||
}
|
||||
#ifdef __CMJ__
|
||||
|
@@ -1011,13 +1011,7 @@ bool OSLRenderServices::get_userdata(
|
||||
return false; /* disabled by lockgeom */
|
||||
}
|
||||
|
||||
#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename,
|
||||
OSL::ShadingContext *)
|
||||
#else
|
||||
|
||||
TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(ustring filename)
|
||||
#endif
|
||||
{
|
||||
OSLTextureHandleMap::iterator it = textures.find(filename);
|
||||
|
||||
@@ -1371,17 +1365,6 @@ bool OSLRenderServices::environment(ustring filename,
|
||||
return status;
|
||||
}
|
||||
|
||||
#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
bool OSLRenderServices::get_texture_info(ustring filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *,
|
||||
OSL::ShadingContext *,
|
||||
int subimage,
|
||||
ustring dataname,
|
||||
TypeDesc datatype,
|
||||
void *data,
|
||||
ustring *)
|
||||
#else
|
||||
bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg,
|
||||
ustring filename,
|
||||
TextureHandle *texture_handle,
|
||||
@@ -1389,7 +1372,6 @@ bool OSLRenderServices::get_texture_info(OSL::ShaderGlobals *sg,
|
||||
ustring dataname,
|
||||
TypeDesc datatype,
|
||||
void *data)
|
||||
#endif
|
||||
{
|
||||
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
|
||||
|
||||
|
@@ -173,12 +173,7 @@ class OSLRenderServices : public OSL::RendererServices {
|
||||
void *val,
|
||||
bool derivatives) override;
|
||||
|
||||
#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
TextureSystem::TextureHandle *get_texture_handle(ustring filename,
|
||||
OSL::ShadingContext *context) override;
|
||||
#else
|
||||
TextureSystem::TextureHandle *get_texture_handle(ustring filename) override;
|
||||
#endif
|
||||
|
||||
bool good(TextureSystem::TextureHandle *texture_handle) override;
|
||||
|
||||
@@ -229,17 +224,6 @@ class OSLRenderServices : public OSL::RendererServices {
|
||||
float *dresultdt,
|
||||
ustring *errormessage) override;
|
||||
|
||||
#if OSL_LIBRARY_VERSION_CODE >= 11100
|
||||
bool get_texture_info(ustring filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *texture_thread_info,
|
||||
OSL::ShadingContext *shading_context,
|
||||
int subimage,
|
||||
ustring dataname,
|
||||
TypeDesc datatype,
|
||||
void *data,
|
||||
ustring *errormessage) override;
|
||||
#else
|
||||
bool get_texture_info(OSL::ShaderGlobals *sg,
|
||||
ustring filename,
|
||||
TextureHandle *texture_handle,
|
||||
@@ -247,7 +231,6 @@ class OSLRenderServices : public OSL::RendererServices {
|
||||
ustring dataname,
|
||||
TypeDesc datatype,
|
||||
void *data) override;
|
||||
#endif
|
||||
|
||||
static bool get_background_attribute(
|
||||
KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val);
|
||||
|
@@ -84,118 +84,114 @@ float safe_snoise(vector4 p)
|
||||
}
|
||||
|
||||
/* The fractal_noise functions are all exactly the same except for the input type. */
|
||||
float fractal_noise(float p, float details, float roughness)
|
||||
float fractal_noise(float p, float details)
|
||||
{
|
||||
float fscale = 1.0;
|
||||
float amp = 1.0;
|
||||
float maxamp = 0.0;
|
||||
float sum = 0.0;
|
||||
float octaves = clamp(details, 0.0, 16.0);
|
||||
int n = (int)octaves;
|
||||
for (int i = 0; i <= n; i++) {
|
||||
float t = safe_noise(fscale * p);
|
||||
sum += t * amp;
|
||||
maxamp += amp;
|
||||
amp *= clamp(roughness, 0.0, 1.0);
|
||||
amp *= 0.5;
|
||||
fscale *= 2.0;
|
||||
}
|
||||
float rmd = octaves - floor(octaves);
|
||||
if (rmd != 0.0) {
|
||||
float t = safe_noise(fscale * p);
|
||||
float sum2 = sum + t * amp;
|
||||
sum /= maxamp;
|
||||
sum2 /= maxamp + amp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
sum2 *= ((float)(1 << (n + 1)) / (float)((1 << (n + 2)) - 1));
|
||||
return (1.0 - rmd) * sum + rmd * sum2;
|
||||
}
|
||||
else {
|
||||
return sum / maxamp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
|
||||
/* The fractal_noise functions are all exactly the same except for the input type. */
|
||||
float fractal_noise(vector2 p, float details, float roughness)
|
||||
float fractal_noise(vector2 p, float details)
|
||||
{
|
||||
float fscale = 1.0;
|
||||
float amp = 1.0;
|
||||
float maxamp = 0.0;
|
||||
float sum = 0.0;
|
||||
float octaves = clamp(details, 0.0, 16.0);
|
||||
int n = (int)octaves;
|
||||
for (int i = 0; i <= n; i++) {
|
||||
float t = safe_noise(fscale * p);
|
||||
sum += t * amp;
|
||||
maxamp += amp;
|
||||
amp *= clamp(roughness, 0.0, 1.0);
|
||||
amp *= 0.5;
|
||||
fscale *= 2.0;
|
||||
}
|
||||
float rmd = octaves - floor(octaves);
|
||||
if (rmd != 0.0) {
|
||||
float t = safe_noise(fscale * p);
|
||||
float sum2 = sum + t * amp;
|
||||
sum /= maxamp;
|
||||
sum2 /= maxamp + amp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
sum2 *= ((float)(1 << (n + 1)) / (float)((1 << (n + 2)) - 1));
|
||||
return (1.0 - rmd) * sum + rmd * sum2;
|
||||
}
|
||||
else {
|
||||
return sum / maxamp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
|
||||
/* The fractal_noise functions are all exactly the same except for the input type. */
|
||||
float fractal_noise(vector3 p, float details, float roughness)
|
||||
float fractal_noise(vector3 p, float details)
|
||||
{
|
||||
float fscale = 1.0;
|
||||
float amp = 1.0;
|
||||
float maxamp = 0.0;
|
||||
float sum = 0.0;
|
||||
float octaves = clamp(details, 0.0, 16.0);
|
||||
int n = (int)octaves;
|
||||
for (int i = 0; i <= n; i++) {
|
||||
float t = safe_noise(fscale * p);
|
||||
sum += t * amp;
|
||||
maxamp += amp;
|
||||
amp *= clamp(roughness, 0.0, 1.0);
|
||||
amp *= 0.5;
|
||||
fscale *= 2.0;
|
||||
}
|
||||
float rmd = octaves - floor(octaves);
|
||||
if (rmd != 0.0) {
|
||||
float t = safe_noise(fscale * p);
|
||||
float sum2 = sum + t * amp;
|
||||
sum /= maxamp;
|
||||
sum2 /= maxamp + amp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
sum2 *= ((float)(1 << (n + 1)) / (float)((1 << (n + 2)) - 1));
|
||||
return (1.0 - rmd) * sum + rmd * sum2;
|
||||
}
|
||||
else {
|
||||
return sum / maxamp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
|
||||
/* The fractal_noise functions are all exactly the same except for the input type. */
|
||||
float fractal_noise(vector4 p, float details, float roughness)
|
||||
float fractal_noise(vector4 p, float details)
|
||||
{
|
||||
float fscale = 1.0;
|
||||
float amp = 1.0;
|
||||
float maxamp = 0.0;
|
||||
float sum = 0.0;
|
||||
float octaves = clamp(details, 0.0, 16.0);
|
||||
int n = (int)octaves;
|
||||
for (int i = 0; i <= n; i++) {
|
||||
float t = safe_noise(fscale * p);
|
||||
sum += t * amp;
|
||||
maxamp += amp;
|
||||
amp *= clamp(roughness, 0.0, 1.0);
|
||||
amp *= 0.5;
|
||||
fscale *= 2.0;
|
||||
}
|
||||
float rmd = octaves - floor(octaves);
|
||||
if (rmd != 0.0) {
|
||||
float t = safe_noise(fscale * p);
|
||||
float sum2 = sum + t * amp;
|
||||
sum /= maxamp;
|
||||
sum2 /= maxamp + amp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
sum2 *= ((float)(1 << (n + 1)) / (float)((1 << (n + 2)) - 1));
|
||||
return (1.0 - rmd) * sum + rmd * sum2;
|
||||
}
|
||||
else {
|
||||
return sum / maxamp;
|
||||
sum *= ((float)(1 << n) / (float)((1 << (n + 1)) - 1));
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -55,22 +55,21 @@ vector4 random_vector4_offset(float seed)
|
||||
100.0 + noise("hash", seed, 3.0) * 100.0);
|
||||
}
|
||||
|
||||
float noise_texture(float co, float detail, float roughness, float distortion, output color Color)
|
||||
float noise_texture(float co, float detail, float distortion, output color Color)
|
||||
{
|
||||
float p = co;
|
||||
if (distortion != 0.0) {
|
||||
p += safe_snoise(p + random_float_offset(0.0)) * distortion;
|
||||
}
|
||||
|
||||
float value = fractal_noise(p, detail, roughness);
|
||||
float value = fractal_noise(p, detail);
|
||||
Color = color(value,
|
||||
fractal_noise(p + random_float_offset(1.0), detail, roughness),
|
||||
fractal_noise(p + random_float_offset(2.0), detail, roughness));
|
||||
fractal_noise(p + random_float_offset(1.0), detail),
|
||||
fractal_noise(p + random_float_offset(2.0), detail));
|
||||
return value;
|
||||
}
|
||||
|
||||
float noise_texture(
|
||||
vector2 co, float detail, float roughness, float distortion, output color Color)
|
||||
float noise_texture(vector2 co, float detail, float distortion, output color Color)
|
||||
{
|
||||
vector2 p = co;
|
||||
if (distortion != 0.0) {
|
||||
@@ -78,15 +77,14 @@ float noise_texture(
|
||||
safe_snoise(p + random_vector2_offset(1.0)) * distortion);
|
||||
}
|
||||
|
||||
float value = fractal_noise(p, detail, roughness);
|
||||
float value = fractal_noise(p, detail);
|
||||
Color = color(value,
|
||||
fractal_noise(p + random_vector2_offset(2.0), detail, roughness),
|
||||
fractal_noise(p + random_vector2_offset(3.0), detail, roughness));
|
||||
fractal_noise(p + random_vector2_offset(2.0), detail),
|
||||
fractal_noise(p + random_vector2_offset(3.0), detail));
|
||||
return value;
|
||||
}
|
||||
|
||||
float noise_texture(
|
||||
vector3 co, float detail, float roughness, float distortion, output color Color)
|
||||
float noise_texture(vector3 co, float detail, float distortion, output color Color)
|
||||
{
|
||||
vector3 p = co;
|
||||
if (distortion != 0.0) {
|
||||
@@ -95,15 +93,14 @@ float noise_texture(
|
||||
safe_snoise(p + random_vector3_offset(2.0)) * distortion);
|
||||
}
|
||||
|
||||
float value = fractal_noise(p, detail, roughness);
|
||||
float value = fractal_noise(p, detail);
|
||||
Color = color(value,
|
||||
fractal_noise(p + random_vector3_offset(3.0), detail, roughness),
|
||||
fractal_noise(p + random_vector3_offset(4.0), detail, roughness));
|
||||
fractal_noise(p + random_vector3_offset(3.0), detail),
|
||||
fractal_noise(p + random_vector3_offset(4.0), detail));
|
||||
return value;
|
||||
}
|
||||
|
||||
float noise_texture(
|
||||
vector4 co, float detail, float roughness, float distortion, output color Color)
|
||||
float noise_texture(vector4 co, float detail, float distortion, output color Color)
|
||||
{
|
||||
vector4 p = co;
|
||||
if (distortion != 0.0) {
|
||||
@@ -113,10 +110,10 @@ float noise_texture(
|
||||
safe_snoise(p + random_vector4_offset(3.0)) * distortion);
|
||||
}
|
||||
|
||||
float value = fractal_noise(p, detail, roughness);
|
||||
float value = fractal_noise(p, detail);
|
||||
Color = color(value,
|
||||
fractal_noise(p + random_vector4_offset(4.0), detail, roughness),
|
||||
fractal_noise(p + random_vector4_offset(5.0), detail, roughness));
|
||||
fractal_noise(p + random_vector4_offset(4.0), detail),
|
||||
fractal_noise(p + random_vector4_offset(5.0), detail));
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -127,7 +124,6 @@ shader node_noise_texture(int use_mapping = 0,
|
||||
float W = 0.0,
|
||||
float Scale = 5.0,
|
||||
float Detail = 2.0,
|
||||
float Roughness = 0.5,
|
||||
float Distortion = 0.0,
|
||||
output float Fac = 0.0,
|
||||
output color Color = 0.0)
|
||||
@@ -140,13 +136,13 @@ shader node_noise_texture(int use_mapping = 0,
|
||||
float w = W * Scale;
|
||||
|
||||
if (dimensions == "1D")
|
||||
Fac = noise_texture(w, Detail, Roughness, Distortion, Color);
|
||||
Fac = noise_texture(w, Detail, Distortion, Color);
|
||||
else if (dimensions == "2D")
|
||||
Fac = noise_texture(vector2(p[0], p[1]), Detail, Roughness, Distortion, Color);
|
||||
Fac = noise_texture(vector2(p[0], p[1]), Detail, Distortion, Color);
|
||||
else if (dimensions == "3D")
|
||||
Fac = noise_texture(p, Detail, Roughness, Distortion, Color);
|
||||
Fac = noise_texture(p, Detail, Distortion, Color);
|
||||
else if (dimensions == "4D")
|
||||
Fac = noise_texture(vector4(p[0], p[1], p[2], w), Detail, Roughness, Distortion, Color);
|
||||
Fac = noise_texture(vector4(p[0], p[1], p[2], w), Detail, Distortion, Color);
|
||||
else
|
||||
error("Unknown dimension!");
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user