Compare commits
148 Commits
decklink
...
temp_viewp
Author | SHA1 | Date | |
---|---|---|---|
194998766c | |||
7da189b4e8 | |||
2465bd90d5 | |||
d67c07ea49 | |||
7ac126e728 | |||
bcde045b32 | |||
ca01fe58e1 | |||
f0c7a2a25c | |||
d747bfbe29 | |||
503315111e | |||
d05014f844 | |||
42e2398ae3 | |||
3f744a16c4 | |||
046adde64f | |||
5ea27bec1f | |||
47a5d7d1bc | |||
ef515822ce | |||
57cff46cec | |||
9285bbe484 | |||
3c64696972 | |||
![]() |
e0db647d35 | ||
09da51e603 | |||
81f435202a | |||
28398f654d | |||
eaf894db6d | |||
a3a7e46318 | |||
9182e07c0e | |||
c7e7c1b241 | |||
424f41ad1c | |||
180aad5e0b | |||
a47937454c | |||
6d111a233c | |||
51cb4ea2cf | |||
049f715d1c | |||
![]() |
9c600435fa | ||
abb9d0b0ad | |||
b0985b393c | |||
520691e591 | |||
08baf3ea79 | |||
5be4d0b328 | |||
f87611622d | |||
f2c5ea2516 | |||
2566652ae6 | |||
617c4d6adb | |||
8d8c5a542c | |||
1883dbd8c3 | |||
cefbe8fe54 | |||
24d53f79b2 | |||
055001111e | |||
2033f47e55 | |||
66b12ef4ab | |||
65df2fd997 | |||
421ec97276 | |||
2b15a588a1 | |||
1cd3676d4d | |||
324bed3843 | |||
ebdd2e0b6d | |||
b8112a8960 | |||
eea89417f4 | |||
c0bf881ebf | |||
fa9bb2ffe9 | |||
40f1c4f343 | |||
5b061ddf1e | |||
0b415700f4 | |||
42aec3b355 | |||
4df6474f01 | |||
dccf5afbef | |||
4ec1c76afc | |||
07925b6316 | |||
a99c03a0ad | |||
25f3c0a395 | |||
54343b821d | |||
af077706fb | |||
b07508a362 | |||
a5788a9c47 | |||
8529b2f925 | |||
5da02ab9e2 | |||
efd547f3da | |||
6798809c7e | |||
d733826708 | |||
20f0e2f342 | |||
88ac2d390b | |||
5065343074 | |||
d01499a45c | |||
69bf7a44aa | |||
b41cfb590c | |||
b32fd196a0 | |||
c683c3805e | |||
bdd855ac1a | |||
b9de44f458 | |||
![]() |
fc96110bb5 | ||
37fc4b575f | |||
6ca6d3c4fd | |||
e02679f71e | |||
5e063ce6c9 | |||
6307e823ca | |||
438bdccff3 | |||
b7a0340414 | |||
4845736e41 | |||
94057b15d1 | |||
c6864c408b | |||
0a029e3dd1 | |||
e623d6b223 | |||
1345865dcd | |||
fc60689a25 | |||
eaa19177e7 | |||
654019fa01 | |||
942b98e55c | |||
7e0a3c2c9e | |||
333e58919c | |||
36f5dffc6a | |||
fc0e24b05c | |||
2fd4fc1f2d | |||
707ee19146 | |||
394b815261 | |||
7cea6ecddb | |||
87cb1cc2e6 | |||
0d4db6e9e8 | |||
32b481f873 | |||
53cfd4761c | |||
4491627bfa | |||
c3f3b958dc | |||
49e0eff55d | |||
2d82d98669 | |||
38125d3547 | |||
bf696c65fd | |||
c9f3339aa3 | |||
7f1e982da1 | |||
8e49d815d1 | |||
d323c4904e | |||
6cc93dcc5e | |||
3fd766ba38 | |||
b350e51f53 | |||
14aca96652 | |||
559a21d467 | |||
9e1aec6c63 | |||
9d854700d6 | |||
dd95926c6e | |||
3af88c69aa | |||
96b01755af | |||
85d5c78901 | |||
f707ffdd3a | |||
36ae264727 | |||
b6e99a672b | |||
17569847e8 | |||
2f61341bfc | |||
86f21ba177 | |||
dd958cb5b6 |
@@ -229,8 +229,12 @@ option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
||||
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
|
||||
if(APPLE)
|
||||
set(WITH_GAMEENGINE_DECKLINK OFF)
|
||||
else()
|
||||
option(WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON)
|
||||
endif()
|
||||
option(WITH_PLAYER "Build Player" OFF)
|
||||
option(WITH_DECKLINK "Support BlackMagicDesign DeckLink cards in the BGE" ON)
|
||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
||||
|
||||
# Compositor
|
||||
@@ -457,12 +461,6 @@ mark_as_advanced(
|
||||
WITH_GL_PROFILE_ES20
|
||||
)
|
||||
|
||||
if(WITH_GL_PROFILE_COMPAT)
|
||||
set(WITH_GLU ON)
|
||||
else()
|
||||
set(WITH_GLU OFF)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
|
||||
mark_as_advanced(WITH_GL_ANGLE)
|
||||
@@ -2527,11 +2525,6 @@ endif()
|
||||
find_package(OpenGL)
|
||||
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
|
||||
|
||||
if(WITH_GLU)
|
||||
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GLU)
|
||||
endif()
|
||||
|
||||
if(WITH_SYSTEM_GLES)
|
||||
find_package_wrapper(OpenGLES)
|
||||
endif()
|
||||
@@ -2759,9 +2752,7 @@ else()
|
||||
|
||||
endif()
|
||||
|
||||
if(NOT WITH_GLU)
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
|
||||
endif()
|
||||
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure Bullet
|
||||
@@ -3260,7 +3251,6 @@ if(FIRST_RUN)
|
||||
|
||||
info_cfg_text("OpenGL:")
|
||||
info_cfg_option(WITH_GLEW_ES)
|
||||
info_cfg_option(WITH_GLU)
|
||||
info_cfg_option(WITH_GL_EGL)
|
||||
info_cfg_option(WITH_GL_PROFILE_COMPAT)
|
||||
info_cfg_option(WITH_GL_PROFILE_CORE)
|
||||
|
1386
SConstruct
Normal file
1386
SConstruct
Normal file
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
ARGS=$( \
|
||||
getopt \
|
||||
-o s:i:t:h \
|
||||
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-confirm,with-all,with-opencollada,\
|
||||
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,with-all,with-opencollada,\
|
||||
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
|
||||
force-all,force-python,force-numpy,force-boost,\
|
||||
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
|
||||
@@ -97,6 +97,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--no-sudo
|
||||
Disable use of sudo (this script won't be able to do much though, will just print needed packages...).
|
||||
|
||||
--no-build
|
||||
Do not build (compile) anything, dependencies not installable with the package manager will remain missing.
|
||||
|
||||
--no-confirm
|
||||
Disable any interaction with user (suitable for automated run).
|
||||
|
||||
@@ -267,6 +270,7 @@ DO_SHOW_DEPS=false
|
||||
|
||||
SUDO="sudo"
|
||||
|
||||
NO_BUILD=false
|
||||
NO_CONFIRM=false
|
||||
|
||||
PYTHON_VERSION="3.5.1"
|
||||
@@ -463,6 +467,12 @@ while true; do
|
||||
PRINT ""
|
||||
SUDO=""; shift; continue
|
||||
;;
|
||||
--no-build)
|
||||
PRINT ""
|
||||
WARNING "--no-build enabled, this script will not be able to install all dependencies..."
|
||||
PRINT ""
|
||||
NO_BUILD=true; shift; continue
|
||||
;;
|
||||
--no-confirm)
|
||||
NO_CONFIRM=true; shift; continue
|
||||
;;
|
||||
@@ -967,6 +977,11 @@ clean_Python() {
|
||||
}
|
||||
|
||||
compile_Python() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, Python will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
py_magic=1
|
||||
_init_python
|
||||
@@ -1032,6 +1047,11 @@ clean_Numpy() {
|
||||
}
|
||||
|
||||
compile_Numpy() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, Numpy will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
numpy_magic=0
|
||||
_init_numpy
|
||||
@@ -1092,6 +1112,11 @@ clean_Boost() {
|
||||
}
|
||||
|
||||
compile_Boost() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, Boost will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
boost_magic=10
|
||||
|
||||
@@ -1165,6 +1190,11 @@ clean_OCIO() {
|
||||
}
|
||||
|
||||
compile_OCIO() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenColorIO will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
ocio_magic=1
|
||||
_init_ocio
|
||||
@@ -1256,6 +1286,11 @@ clean_ILMBASE() {
|
||||
}
|
||||
|
||||
compile_ILMBASE() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, ILMBase will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
ilmbase_magic=10
|
||||
_init_ilmbase
|
||||
@@ -1343,6 +1378,11 @@ clean_OPENEXR() {
|
||||
}
|
||||
|
||||
compile_OPENEXR() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenEXR will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
openexr_magic=14
|
||||
|
||||
@@ -1458,6 +1498,11 @@ clean_OIIO() {
|
||||
}
|
||||
|
||||
compile_OIIO() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenImageIO will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
oiio_magic=16
|
||||
_init_oiio
|
||||
@@ -1589,6 +1634,11 @@ clean_LLVM() {
|
||||
}
|
||||
|
||||
compile_LLVM() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, LLVM will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
llvm_magic=3
|
||||
_init_llvm
|
||||
@@ -1686,6 +1736,11 @@ clean_OSL() {
|
||||
}
|
||||
|
||||
compile_OSL() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenShadingLanguage will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
osl_magic=20
|
||||
_init_osl
|
||||
@@ -1812,6 +1867,11 @@ clean_OSD() {
|
||||
}
|
||||
|
||||
compile_OSD() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenSubdiv will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
osd_magic=1
|
||||
_init_osd
|
||||
@@ -1904,6 +1964,11 @@ clean_BLOSC() {
|
||||
}
|
||||
|
||||
compile_BLOSC() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, Blosc will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
blosc_magic=0
|
||||
_init_blosc
|
||||
@@ -1986,6 +2051,11 @@ clean_OPENVDB() {
|
||||
}
|
||||
|
||||
compile_OPENVDB() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenVDB will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
compile_BLOSC
|
||||
PRINT ""
|
||||
|
||||
@@ -2082,6 +2152,11 @@ clean_OpenCOLLADA() {
|
||||
}
|
||||
|
||||
compile_OpenCOLLADA() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenCOLLADA will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled results!
|
||||
opencollada_magic=9
|
||||
_init_opencollada
|
||||
@@ -2161,6 +2236,11 @@ clean_FFmpeg() {
|
||||
}
|
||||
|
||||
compile_FFmpeg() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, ffmpeg will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
ffmpeg_magic=5
|
||||
_init_ffmpeg
|
||||
|
@@ -285,7 +285,7 @@ def generic_builder(id, libdir='', branch='', rsync=False):
|
||||
maxsize=150 * 1024 * 1024,
|
||||
workdir='install'))
|
||||
f.addStep(MasterShellCommand(name='unpack',
|
||||
command=['python', unpack_script, filename],
|
||||
command=['python2.7', unpack_script, filename],
|
||||
description='unpacking',
|
||||
descriptionDone='unpacked'))
|
||||
return f
|
||||
|
@@ -75,18 +75,20 @@ if 'cmake' in builder:
|
||||
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/bin/nvcc')
|
||||
|
||||
elif builder.startswith('win'):
|
||||
if builder.endswith('_vc2015'):
|
||||
if builder.startswith('win64'):
|
||||
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64', '-DWITH_CYCLES_CUDA_BINARIES=0'])
|
||||
elif builder.startswith('win32'):
|
||||
bits = 32
|
||||
cmake_options.extend(['-G', 'Visual Studio 14 2015', '-DWITH_CYCLES_CUDA_BINARIES=0'])
|
||||
else:
|
||||
if builder.startswith('win64'):
|
||||
cmake_options.extend(['-G', 'Visual Studio 12 2013 Win64'])
|
||||
elif builder.startswith('win32'):
|
||||
bits = 32
|
||||
cmake_options.extend(['-G', 'Visual Studio 12 2013'])
|
||||
if builder.endswith('_vc2015'):
|
||||
if builder.startswith('win64'):
|
||||
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
|
||||
elif builder.startswith('win32'):
|
||||
bits = 32
|
||||
cmake_options.extend(['-G', 'Visual Studio 14 2015'])
|
||||
cmake_extra_options.append('-DCUDA_NVCC_FLAGS=--cl-version;2013;' +
|
||||
'--compiler-bindir;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin')
|
||||
else:
|
||||
if builder.startswith('win64'):
|
||||
cmake_options.extend(['-G', 'Visual Studio 12 2013 Win64'])
|
||||
elif builder.startswith('win32'):
|
||||
bits = 32
|
||||
cmake_options.extend(['-G', 'Visual Studio 12 2013'])
|
||||
|
||||
elif builder.startswith('linux'):
|
||||
tokens = builder.split("_")
|
||||
|
@@ -108,6 +108,8 @@ if builder.find('cmake') != -1:
|
||||
platform += 'i386'
|
||||
elif builder.endswith('ppc_10_6_cmake'):
|
||||
platform += 'ppc'
|
||||
if builder.endswith('vc2015'):
|
||||
platform += "-vc14"
|
||||
builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform)
|
||||
if branch != '':
|
||||
builderified_name = branch + "-" + builderified_name
|
||||
|
@@ -685,7 +685,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
|
||||
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
|
||||
endif()
|
||||
|
||||
if(WITH_DECKLINK)
|
||||
if(WITH_GAMEENGINE_DECKLINK)
|
||||
list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
|
||||
endif()
|
||||
|
||||
|
263
build_files/scons/config/darwin-config.py
Normal file
263
build_files/scons/config/darwin-config.py
Normal file
@@ -0,0 +1,263 @@
|
||||
import commands
|
||||
|
||||
#############################################################################
|
||||
################### Compiler & architecture settings ##################
|
||||
#############################################################################
|
||||
|
||||
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
|
||||
MACOSX_SDK='' # set an sdk name like '10.7' or leave empty for automatic choosing highest available
|
||||
MACOSX_DEPLOYMENT_TARGET = '10.6'
|
||||
|
||||
# gcc always defaults to the system standard compiler linked by a shim or symlink
|
||||
CC = 'gcc'
|
||||
CXX = 'g++'
|
||||
LCGDIR = '#../lib/darwin-9.x.universal'
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
#############################################################################
|
||||
################### Dependency settings ##################
|
||||
#############################################################################
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = True
|
||||
BF_FFMPEG = LIBDIR + '/ffmpeg'
|
||||
BF_FFMPEG_INC = "${BF_FFMPEG}/include"
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
|
||||
#bz2 is a standard osx dynlib
|
||||
|
||||
BF_PYTHON_VERSION = '3.4'
|
||||
WITH_OSX_STATICPYTHON = True
|
||||
|
||||
# python 3.4 uses precompiled libraries in bf svn /lib by default
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}m'
|
||||
# BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}m'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
|
||||
# BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
|
||||
#BF_OPENAL_LIB = 'openal'
|
||||
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
# we use simply jack framework
|
||||
WITH_BF_JACK = True
|
||||
BF_JACK = '/Library/Frameworks/Jackmp.framework'
|
||||
BF_JACK_INC = '${BF_JACK}/headers'
|
||||
#BF_JACK_LIB = 'jack' # not used due framework
|
||||
BF_JACK_LIBPATH = '${BF_JACK}'
|
||||
|
||||
WITH_BF_SNDFILE = True
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'sndfile FLAC ogg vorbis vorbisenc'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored in ffmpeg dir
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL2' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = '${LCGDIR}/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
|
||||
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'jpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = LIBDIR + '/png'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'png'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
WITH_BF_TIFF = True
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'tiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = '/usr'
|
||||
#BF_ZLIB_INC = '${BF_ZLIB}/include' # don't use this, it breaks -isysroot ${MACOSX_SDK}
|
||||
BF_ZLIB_LIB = 'z'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = True
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_QUICKTIME = True
|
||||
|
||||
WITH_BF_ICONV = True
|
||||
BF_ICONV = '/usr'
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
#BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
WITH_BF_STATICOPENGL = True
|
||||
BF_OPENGL_LIB = 'GL'
|
||||
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
|
||||
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
|
||||
|
||||
#OpenCollada flags
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
|
||||
BF_PCRE = LIBDIR + '/opencollada'
|
||||
BF_PCRE_LIB = 'pcre'
|
||||
BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
|
||||
#BF_EXPAT = '/usr'
|
||||
#BF_EXPAT_LIB = 'expat'
|
||||
#BF_EXPAT_LIBPATH = '/usr/lib'
|
||||
|
||||
# Cycles
|
||||
WITH_BF_CYCLES = True
|
||||
|
||||
#OSL
|
||||
|
||||
WITH_BF_CYCLES_OSL = True
|
||||
BF_OSL = LIBDIR + '/osl'
|
||||
BF_OSL_INC = '${BF_OSL}/include'
|
||||
# note oslexec would passed via program linkflags, which is needed to
|
||||
# make llvm happy with osl_allocate_closure_component
|
||||
#BF_OSL_LIB = 'oslcomp oslquery'
|
||||
BF_OSL_LIBPATH = '${BF_OSL}/lib'
|
||||
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
|
||||
|
||||
WITH_BF_LLVM = True
|
||||
BF_LLVM = LIBDIR + '/llvm'
|
||||
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
|
||||
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
|
||||
'LLVMTarget LLVMMC LLVMCore LLVMSupport LLVMObject'
|
||||
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = LIBDIR + '/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO tinyxml yaml-cpp'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt'
|
||||
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mt'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
#OpenMP ( will be checked for compiler support and turned off eventually )
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = []
|
||||
|
||||
# SpaceNavigator and related 3D mice, driver must be 3DxWare 10 Beta 4 (Mac OS X) or later !
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
#############################################################################
|
||||
################### various compile settings and flags ##################
|
||||
#############################################################################
|
||||
|
||||
BF_QUIET = '1' # suppress verbose output
|
||||
|
||||
CFLAGS = []
|
||||
CXXFLAGS = []
|
||||
CCFLAGS = ['-pipe','-funsigned-char']
|
||||
CPPFLAGS = []
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']
|
||||
|
||||
LLIBS = ['stdc++']
|
||||
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2']
|
||||
|
||||
CC_WARN = ['-Wall']
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
|
||||
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
|
||||
|
||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||
|
||||
##LOPTS = --dynamic
|
||||
##DYNLDFLAGS = -shared $(LDFLAGS)
|
||||
|
||||
BF_PROFILE_CCFLAGS = ['-pg', '-g ']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
BF_PROFILE = False
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_CCFLAGS = ['-g']
|
||||
|
||||
#############################################################################
|
||||
################### Output directories ##################
|
||||
#############################################################################
|
||||
|
||||
BF_BUILDDIR='../build/darwin'
|
||||
BF_INSTALLDIR='../install/darwin'
|
268
build_files/scons/config/linux-config.py
Normal file
268
build_files/scons/config/linux-config.py
Normal file
@@ -0,0 +1,268 @@
|
||||
from FindPython import FindPython
|
||||
|
||||
py = FindPython()
|
||||
|
||||
BF_PYTHON_ABI_FLAGS = py['ABI_FLAGS']
|
||||
BF_PYTHON = py['PYTHON']
|
||||
BF_PYTHON_LIBPATH = py['LIBPATH']
|
||||
BF_PYTHON_LIBPATH_ARCH = py['LIBPATH_ARCH']
|
||||
BF_PYTHON_CONFIG = py['CONFIG']
|
||||
BF_PYTHON_VERSION = py['VERSION']
|
||||
WITH_BF_STATICPYTHON = False
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS} ' + BF_PYTHON_CONFIG
|
||||
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}' # BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
|
||||
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
|
||||
BF_PYTHON_LIB_STATIC = '${BF_PYTHON_LIBPATH_ARCH}/libpython${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}.a'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
WITH_BF_STATICOPENAL = False
|
||||
BF_OPENAL = '/usr'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'openal'
|
||||
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
|
||||
|
||||
BF_CXX = '/usr'
|
||||
WITH_BF_STATICCXX = False
|
||||
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = '/usr'
|
||||
BF_JACK_INC = '${BF_JACK}/include/jack'
|
||||
BF_JACK_LIB = 'jack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
WITH_BF_STATICSNDFILE = False
|
||||
BF_SNDFILE = '/usr'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
|
||||
BF_SNDFILE_LIB = 'sndfile'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
BF_SNDFILE_LIB_STATIC = '${BF_SNDFILE}/lib/libsndfile.a ${BF_OGG}/lib/libvorbis.a ${BF_OGG}/lib/libFLAC.a ${BF_OGG}/lib/libvorbisenc.a ${BF_OGG}/lib/libogg.a'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = '/usr' #$(shell sdl-config --prefix)
|
||||
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
|
||||
BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = '/usr'
|
||||
# when compiling with your own openexr lib you might need to set...
|
||||
# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
|
||||
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
|
||||
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = '/usr'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'jpeg'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = '/usr'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'png'
|
||||
|
||||
WITH_BF_TIFF = True
|
||||
BF_TIFF = '/usr'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'tiff'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = '/usr'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'z'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = True
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
WITH_BF_ELTOPO = False
|
||||
BF_LAPACK = '/usr'
|
||||
BF_LAPACK_LIB = 'lapack3gf blas clapack'
|
||||
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
|
||||
|
||||
BF_FREETYPE = '/usr'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype'
|
||||
#BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
|
||||
|
||||
WITH_BF_ICONV = False
|
||||
BF_ICONV = "/usr"
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_BINRELOC = True
|
||||
|
||||
# enable ffmpeg support
|
||||
WITH_BF_FFMPEG = True
|
||||
BF_FFMPEG = '/usr'
|
||||
BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
#WITH_BF_STATICFFMPEG = True
|
||||
#BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH/libavcodec.a ${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libavutil.a ${BF_FFMPEG_LIBPATH}/libavdevice.a'
|
||||
|
||||
# enable ogg, vorbis and theora in ffmpeg
|
||||
WITH_BF_OGG = False
|
||||
BF_OGG = '/usr'
|
||||
BF_OGG_INC = '${BF_OGG}/include'
|
||||
BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = False
|
||||
WITH_BF_STATICFFTW3 = False
|
||||
BF_FFTW3 = '/usr'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'fftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
BF_FFTW3_LIB_STATIC = '${BF_FFTW3_LIBPATH}/libfftw3.a'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE = '#extern/libredcode'
|
||||
BF_REDCODE_LIB = ''
|
||||
# BF_REDCODE_INC = '${BF_REDCODE}/include'
|
||||
BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
|
||||
BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
|
||||
|
||||
# Mesa Libs should go here if you're using them as well....
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL = '/usr'
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIB = 'GL X11 Xi Xxf86vm'
|
||||
BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
|
||||
BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
|
||||
|
||||
WITH_BF_COLLADA = False
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
BF_OPENCOLLADA = '/usr'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
BF_PCRE = ''
|
||||
BF_PCRE_LIB = 'pcre'
|
||||
BF_PCRE_LIBPATH = '/usr/lib'
|
||||
BF_EXPAT = '/usr'
|
||||
BF_EXPAT_LIB = 'expat'
|
||||
BF_EXPAT_LIBPATH = '/usr/lib'
|
||||
|
||||
WITH_BF_JEMALLOC = False
|
||||
WITH_BF_STATICJEMALLOC = False
|
||||
BF_JEMALLOC = '/usr'
|
||||
BF_JEMALLOC_INC = '${BF_JEMALLOC}/include'
|
||||
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
|
||||
BF_JEMALLOC_LIB = 'jemalloc'
|
||||
BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a'
|
||||
|
||||
WITH_BF_OIIO = False
|
||||
WITH_BF_STATICOIIO = False
|
||||
BF_OIIO = '/usr'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = False
|
||||
WITH_BF_STATICOCIO = False
|
||||
BF_OCIO = '/usr'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml'
|
||||
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
WITH_BF_STATICBOOST = False
|
||||
BF_BOOST = '/usr'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'boost_filesystem boost_regex boost_system boost_thread boost_date_time'
|
||||
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_thread.a'
|
||||
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
|
||||
|
||||
#SpaceNavigator and friends
|
||||
WITH_BF_3DMOUSE = True
|
||||
WITH_BF_STATIC3DMOUSE = False
|
||||
BF_3DMOUSE = '/usr'
|
||||
BF_3DMOUSE_INC = '${BF_3DMOUSE}/include'
|
||||
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
|
||||
BF_3DMOUSE_LIB = 'spnav'
|
||||
BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
CXX = 'g++'
|
||||
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
|
||||
CFLAGS = ['-std=gnu89']
|
||||
CXXFLAGS = []
|
||||
|
||||
CPPFLAGS = []
|
||||
# g++ 4.6, only needed for bullet
|
||||
CXXFLAGS += ['-fpermissive']
|
||||
if WITH_BF_FFMPEG:
|
||||
# libavutil needs UINT64_C()
|
||||
CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2']
|
||||
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
|
||||
CC_WARN = ['-Wall']
|
||||
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
|
||||
|
||||
LLIBS = ['util', 'c', 'm', 'dl', 'pthread']
|
||||
|
||||
BF_PROFILE = False
|
||||
BF_PROFILE_CCFLAGS = ['-pg','-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_CCFLAGS = ['-g']
|
||||
|
||||
BF_BUILDDIR = '../build/linux'
|
||||
BF_INSTALLDIR='../install/linux'
|
||||
|
||||
#Link against pthread
|
||||
PLATFORM_LINKFLAGS = ['-pthread']
|
||||
|
||||
#Fix for LLVM conflict with Mesa llvmpipe, SDL dynload also requires symbols to be hidden.
|
||||
# TODO(sergey): Move this to SConstruct, so we can have this line depended on user config.
|
||||
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']
|
221
build_files/scons/config/win32-mingw-config.py
Normal file
221
build_files/scons/config/win32-mingw-config.py
Normal file
@@ -0,0 +1,221 @@
|
||||
LCGDIR = '#../lib/mingw32'
|
||||
LIBDIR = "${LCGDIR}"
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.4'
|
||||
WITH_BF_STATICPYTHON = False
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
|
||||
BF_PYTHON_DLL = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
WITH_BF_FFMPEG = True
|
||||
BF_FFMPEG_LIB = 'avformat-55 avcodec-55 avdevice-55 avutil-52 swscale-2'
|
||||
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'libsndfile-1'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
BF_PTHREADS = LIBDIR + '/pthreads'
|
||||
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadGC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
|
||||
BF_OPENEXR_LIB = 'Half IlmImf Imath IlmThread Iex'
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
# Warning, this static lib configuration is untested! users of this OS please confirm.
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'liblibjpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = LIBDIR + '/png'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'png'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
WITH_BF_TIFF = True
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'tiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'z'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'fftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = True
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_ICONV = False
|
||||
BF_ICONV = LIBDIR + "/iconv"
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL = 'C:\\MingW'
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
BF_OPENGL_LIB = 'opengl32'
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a',
|
||||
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
|
||||
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
|
||||
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa xml'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
#Cycles
|
||||
WITH_BF_CYCLES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = LIBDIR + '/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'boost_date_time-mgw46-mt-s-1_49 boost_filesystem-mgw46-mt-s-1_49 boost_regex-mgw46-mt-s-1_49 boost_system-mgw46-mt-s-1_49 boost_thread-mgw46-mt-s-1_49'
|
||||
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mgw46-mt-s-1_49'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
CXX = 'g++'
|
||||
|
||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
CXXFLAGS = []
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2']
|
||||
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
|
||||
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-ldbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('-limm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
## DISABLED, causes linking errors!
|
||||
## for re-distribution, so users dont need mingw installed
|
||||
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_CCFLAGS= ['-g']
|
||||
|
||||
BF_PROFILE_CCFLAGS = ['-pg', '-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
|
||||
BF_PROFILE = False
|
||||
|
||||
BF_BUILDDIR = '..\\build\\win32-mingw'
|
||||
BF_INSTALLDIR='..\\install\\win32-mingw'
|
256
build_files/scons/config/win32-vc-config.py
Normal file
256
build_files/scons/config/win32-vc-config.py
Normal file
@@ -0,0 +1,256 @@
|
||||
import subprocess
|
||||
|
||||
CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||
CL_STDOUT, CL_STDERR = CL_OUT.communicate()
|
||||
|
||||
if "18.00." in CL_STDERR:
|
||||
VC_VERSION = '12.0'
|
||||
LCGDIR = '#../lib/windows_vc12'
|
||||
else:
|
||||
import sys
|
||||
print("Visual C version not supported {}\n".format(CL_STDERR))
|
||||
sys.exit(1)
|
||||
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
WITH_BF_FFMPEG = True
|
||||
BF_FFMPEG = LIBDIR +'/ffmpeg'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat-55.lib avcodec-55.lib avdevice-55.lib avutil-52.lib swscale-2.lib'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.4'
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
|
||||
BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_PYTHON_INSTALL_NUMPY = True
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'OpenAL32'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
WITH_BF_ICONV = True
|
||||
BF_ICONV = LIBDIR + '/iconv'
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = True
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'libsndfile-1'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL2.lib'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
BF_PTHREADS = LIBDIR + '/pthreads'
|
||||
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadVC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
|
||||
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 '
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'libjpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = LIBDIR + '/png'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
WITH_BF_TIFF = True
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'libtiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'libz_st'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = True
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
WITH_BF_ELTOPO = False
|
||||
BF_LAPACK = LIBDIR + '/lapack'
|
||||
BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
|
||||
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
WITH_BF_BINRELOC = False
|
||||
|
||||
BF_WITH_FREETYPE = True
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype2ST'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Cycles
|
||||
WITH_BF_CYCLES = True
|
||||
|
||||
WITH_BF_CYCLES_OSL = True
|
||||
WITH_BF_STATICOSL = True
|
||||
BF_OSL = '${LIBDIR}/osl'
|
||||
BF_OSL_INC = '${BF_OSL}/include'
|
||||
BF_OSL_LIBPATH = '${BF_OSL}/lib'
|
||||
BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
|
||||
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
|
||||
|
||||
WITH_BF_LLVM = True
|
||||
BF_LLVM = LIBDIR + '/llvm'
|
||||
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
|
||||
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
|
||||
'LLVMTarget LLVMMC LLVMCore LLVMObject LLVMRuntimeDyld LLVMSupport'
|
||||
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = '${LIBDIR}/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib'
|
||||
WITH_BF_STATICOIIO = True
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = '${LIBDIR}/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
|
||||
WITH_BF_STATICOCIO = True
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = '${LIBDIR}/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55'
|
||||
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
BF_OPENGL_LIB = 'opengl32'
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a',
|
||||
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
|
||||
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
|
||||
|
||||
CC = 'cl.exe'
|
||||
CXX = 'cl.exe'
|
||||
|
||||
CCFLAGS = ['/nologo', '/J', '/W3', '/Gd', '/w34062', '/wd4018', '/wd4065', '/wd4127', '/wd4181', '/wd4200', '/wd4244', '/wd4267', '/wd4305', '/wd4800', '/we4013', '/we4431']
|
||||
CXXFLAGS = ['/EHsc']
|
||||
BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
|
||||
|
||||
if VC_VERSION == '12.0':
|
||||
CCFLAGS.append('/DOIIO_STATIC_BUILD') # OIIO api changed with 1.4 making this needed
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/Ob0', '/Od', '/FR${TARGET}.sbr']
|
||||
|
||||
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2', '/Ob2']
|
||||
|
||||
C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('imm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
# # Todo
|
||||
# BF_PROFILE_CCFLAGS = ['-pg', '-g ']
|
||||
# BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
# BF_PROFILE = False
|
||||
|
||||
BF_BSC=False
|
||||
|
||||
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
|
||||
BF_BUILDDIR = '..\\build\\win32-vc'
|
||||
BF_INSTALLDIR='..\\install\\win32-vc'
|
216
build_files/scons/config/win64-mingw-config.py
Normal file
216
build_files/scons/config/win64-mingw-config.py
Normal file
@@ -0,0 +1,216 @@
|
||||
LCGDIR = '#../lib/mingw64'
|
||||
LIBDIR = "${LCGDIR}"
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.4'
|
||||
WITH_BF_STATICPYTHON = False
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
|
||||
BF_PYTHON_DLL = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include'
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
WITH_BF_FFMPEG = True
|
||||
BF_FFMPEG_LIB = 'avformat.dll avcodec.dll avdevice.dll avutil.dll swscale.dll swresample.dll'
|
||||
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
|
||||
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll ${BF_FFMPEG_LIBPATH}/swresample-0.dll ${BF_FFMPEG_LIBPATH}/xvidcore.dll'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
BF_JACK = LIBDIR + '/jack'
|
||||
BF_JACK_INC = '${BF_JACK}/include'
|
||||
BF_JACK_LIB = 'libjack'
|
||||
BF_JACK_LIBPATH = '${BF_JACK}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = False
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'libsndfile-1'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
BF_PTHREADS = '' # Part of MinGW-w64
|
||||
BF_PTHREADS_INC = ''
|
||||
BF_PTHREADS_LIB = ''
|
||||
BF_PTHREADS_LIBPATH = ''
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
|
||||
BF_OPENEXR_LIB = 'Half IlmImf Imath IlmThread Iex'
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'jpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = LIBDIR + '/png'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'png'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
WITH_BF_TIFF = True
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'tiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'z'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'fftw3'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_OCEANSIM = True
|
||||
WITH_BF_PLAYER = True
|
||||
WITH_BF_LIBMV = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
# enable freetype2 support for text objects
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2/'
|
||||
BF_FREETYPE_LIB = 'freetype'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_ICONV = False
|
||||
BF_ICONV = LIBDIR + "/iconv"
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL = 'C:\\MingW'
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
BF_OPENGL_LIB = 'opengl32'
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a',
|
||||
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
|
||||
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
|
||||
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa xml'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
#Cycles
|
||||
WITH_BF_CYCLES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = LIBDIR + '/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIB = 'OpenColorIO'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'boost_date_time-mgw47-mt-s-1_49 boost_date_time-mgw47-mt-sd-1_49 boost_filesystem-mgw47-mt-s-1_49 boost_filesystem-mgw47-mt-sd-1_49 boost_regex-mgw47-mt-s-1_49 boost_regex-mgw47-mt-sd-1_49 boost_system-mgw47-mt-s-1_49 boost_system-mgw47-mt-sd-1_49 boost_thread-mgw47-mt-s-1_49 boost_thread-mgw47-mt-sd-1_49'
|
||||
BF_BOOST_LIB_INTERNATIONAL = ' boost_locale-mgw47-mt-s-1_49 boost_locale-mgw47-mt-sd-1_49'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
CXX = 'g++'
|
||||
|
||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
CXXFLAGS = [ '-fpermissive' ]
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2', '-ftree-vectorize']
|
||||
|
||||
# NOTE: C_WARN seems to get ignored - at least -Wno-char-subscripts doesn't work!
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
|
||||
|
||||
CC_WARN = [ '-Wall', '-Wno-char-subscripts' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-ldbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('-limm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
## DISABLED, causes linking errors!
|
||||
## for re-distribution, so users dont need mingw installed
|
||||
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
|
||||
|
||||
BF_DEBUG = False
|
||||
BF_DEBUG_CCFLAGS= ['-g']
|
||||
|
||||
BF_PROFILE_CCFLAGS = ['-pg', '-g']
|
||||
BF_PROFILE_LINKFLAGS = ['-pg']
|
||||
BF_PROFILE_FLAGS = BF_PROFILE_CCFLAGS
|
||||
BF_PROFILE = False
|
||||
|
||||
BF_BUILDDIR = '..\\build\\win64-mingw'
|
||||
BF_INSTALLDIR='..\\install\\win64-mingw'
|
256
build_files/scons/config/win64-vc-config.py
Normal file
256
build_files/scons/config/win64-vc-config.py
Normal file
@@ -0,0 +1,256 @@
|
||||
import subprocess
|
||||
|
||||
CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||
CL_STDOUT, CL_STDERR = CL_OUT.communicate()
|
||||
|
||||
if "18.00." in CL_STDERR:
|
||||
VC_VERSION = '12.0'
|
||||
LCGDIR = '#../lib/win64_vc12'
|
||||
else:
|
||||
import sys
|
||||
print("Visual C version not supported {}\n".format(CL_STDERR))
|
||||
sys.exit(1)
|
||||
|
||||
LIBDIR = '${LCGDIR}'
|
||||
|
||||
WITH_BF_FFMPEG = True
|
||||
BF_FFMPEG = LIBDIR +'/ffmpeg'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc '
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
BF_FFMPEG_LIB = 'avformat-55.lib avcodec-55.lib avdevice-55.lib avutil-52.lib swscale-2.lib'
|
||||
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
|
||||
|
||||
|
||||
BF_PYTHON = LIBDIR + '/python'
|
||||
BF_PYTHON_VERSION = '3.4'
|
||||
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
|
||||
BF_PYTHON_BINARY = 'python'
|
||||
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
|
||||
BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
|
||||
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
|
||||
|
||||
WITH_BF_PYTHON_INSTALL_NUMPY = True
|
||||
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'OpenAL32'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = True
|
||||
BF_SNDFILE = LIBDIR + '/sndfile'
|
||||
BF_SNDFILE_INC = '${BF_SNDFILE}/include'
|
||||
BF_SNDFILE_LIB = 'libsndfile-1'
|
||||
BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
|
||||
|
||||
WITH_BF_ICONV = True
|
||||
BF_ICONV = LIBDIR + '/iconv'
|
||||
BF_ICONV_INC = '${BF_ICONV}/include'
|
||||
BF_ICONV_LIB = 'iconv'
|
||||
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
|
||||
|
||||
WITH_BF_SDL = True
|
||||
BF_SDL = LIBDIR + '/sdl'
|
||||
BF_SDL_INC = '${BF_SDL}/include'
|
||||
BF_SDL_LIB = 'SDL2.lib'
|
||||
BF_SDL_LIBPATH = '${BF_SDL}/lib'
|
||||
|
||||
WITH_BF_JACK = False
|
||||
|
||||
BF_PTHREADS = LIBDIR + '/pthreads'
|
||||
BF_PTHREADS_INC = '${BF_PTHREADS}/include'
|
||||
BF_PTHREADS_LIB = 'pthreadVC2'
|
||||
BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
|
||||
|
||||
WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
|
||||
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 '
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'libjpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
BF_PNG = LIBDIR + '/png'
|
||||
BF_PNG_INC = '${BF_PNG}/include'
|
||||
BF_PNG_LIB = 'libpng'
|
||||
BF_PNG_LIBPATH = '${BF_PNG}/lib'
|
||||
|
||||
WITH_BF_TIFF = True
|
||||
BF_TIFF = LIBDIR + '/tiff'
|
||||
BF_TIFF_INC = '${BF_TIFF}/include'
|
||||
BF_TIFF_LIB = 'libtiff'
|
||||
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'libz_st'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = True
|
||||
WITH_BF_OCEANSIM = True
|
||||
|
||||
WITH_BF_BULLET = True
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
WITH_BF_ELTOPO = False
|
||||
BF_LAPACK = LIBDIR + '/lapack'
|
||||
BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
|
||||
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
|
||||
|
||||
BF_WINTAB = LIBDIR + '/wintab'
|
||||
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
|
||||
|
||||
WITH_BF_BINRELOC = False
|
||||
|
||||
BF_WITH_FREETYPE = True
|
||||
BF_FREETYPE = LIBDIR + '/freetype'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype2ST'
|
||||
BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
|
||||
|
||||
WITH_BF_QUICKTIME = False
|
||||
BF_QUICKTIME = LIBDIR + '/QTDevWin'
|
||||
BF_QUICKTIME_INC = '${BF_QUICKTIME}/CIncludes'
|
||||
BF_QUICKTIME_LIB = 'qtmlClient'
|
||||
BF_QUICKTIME_LIBPATH = '${BF_QUICKTIME}/Libraries'
|
||||
|
||||
WITH_BF_OPENJPEG = True
|
||||
BF_OPENJPEG = '#extern/libopenjpeg'
|
||||
BF_OPENJPEG_LIB = ''
|
||||
BF_OPENJPEG_INC = '${BF_OPENJPEG}'
|
||||
BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
|
||||
|
||||
WITH_BF_FFTW3 = True
|
||||
BF_FFTW3 = LIBDIR + '/fftw3'
|
||||
BF_FFTW3_INC = '${BF_FFTW3}/include'
|
||||
BF_FFTW3_LIB = 'libfftw'
|
||||
BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Cycles
|
||||
WITH_BF_CYCLES = True
|
||||
|
||||
WITH_BF_CYCLES_OSL = True
|
||||
WITH_BF_STATICOSL = True
|
||||
BF_OSL = '${LIBDIR}/osl'
|
||||
BF_OSL_INC = '${BF_OSL}/include'
|
||||
BF_OSL_LIBPATH = '${BF_OSL}/lib'
|
||||
BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
|
||||
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
|
||||
|
||||
WITH_BF_LLVM = True
|
||||
BF_LLVM = LIBDIR + '/llvm'
|
||||
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
|
||||
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
|
||||
'LLVMTarget LLVMMC LLVMCore LLVMObject LLVMRuntimeDyld LLVMSupport'
|
||||
BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = '${LIBDIR}/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib ${BF_OIIO_LIBPATH}/OpenImageIO_Util.lib'
|
||||
WITH_BF_STATICOIIO = True
|
||||
|
||||
WITH_BF_OCIO = True
|
||||
BF_OCIO = '${LIBDIR}/opencolorio'
|
||||
BF_OCIO_INC = '${BF_OCIO}/include'
|
||||
BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
|
||||
BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
|
||||
WITH_BF_STATICOCIO = True
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = '${LIBDIR}/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55'
|
||||
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
# No need to manually specify SSE/SSE2 on x64 systems.
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
BF_OPENGL_LIB = 'opengl32'
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a',
|
||||
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
|
||||
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
|
||||
CC = 'cl.exe'
|
||||
CXX = 'cl.exe'
|
||||
|
||||
CFLAGS = []
|
||||
CCFLAGS = ['/nologo', '/J', '/W3', '/Gd', '/w34062', '/wd4018', '/wd4065', '/wd4127', '/wd4181', '/wd4200', '/wd4244', '/wd4267', '/wd4305', '/wd4800', '/we4013', '/we4431']
|
||||
|
||||
# We want to support Vista level ABI for x64
|
||||
if VC_VERSION == '12.0':
|
||||
CCFLAGS.append('/D_WIN32_WINNT=0x600')
|
||||
CCFLAGS.append('/DOIIO_STATIC_BUILD') # OIIO api changed with 1.4 making this needed
|
||||
|
||||
CXXFLAGS = ['/EHsc']
|
||||
BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast']
|
||||
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od', '/Ob0']
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2', '/Ob2']
|
||||
|
||||
C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('imm32')
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
|
||||
BF_BUILDDIR = '..\\build\\win64-vc'
|
||||
BF_INSTALLDIR='..\\install\\win64-vc'
|
@@ -6,18 +6,18 @@ usable by OpenGL, they must be processed by a shader. The three shaders presente
|
||||
cover all common video capture cases.
|
||||
|
||||
This file reflects the current video transfer method implemented in the Decklink module:
|
||||
whenever possible the video images are transferred as float texture because this is more
|
||||
whenever possible the video images are transferred as float texture because this is more
|
||||
compatible with GPUs. Of course, only the pixel formats that have a correspondant GL format
|
||||
can be transferred as float. Look for fg_shaders in this file for an exhaustive list.
|
||||
|
||||
Other pixel formats will be transferred as 32 bits integer red-channel texture but this
|
||||
won't work with certain GPU (Intel GMA); the corresponding shaders are not shown here.
|
||||
won't work with certain GPU (Intel GMA); the corresponding shaders are not shown here.
|
||||
However, it should not be necessary to use any of them as the list below covers all practical
|
||||
cases of video capture with all types of Decklink product.
|
||||
|
||||
In other words, only use one of the pixel format below and you will be fine. Note that depending
|
||||
on the video stream, only certain pixel formats will be allowed (others will throw an exception).
|
||||
For example, to capture a PAL video stream, you must use one of the YUV formats.
|
||||
For example, to capture a PAL video stream, you must use one of the YUV formats.
|
||||
|
||||
To find which pixel format is suitable for a particular video stream, use the 'Media Express'
|
||||
utility that comes with the Decklink software : if you see the video in the 'Log and Capture'
|
||||
@@ -40,7 +40,7 @@ VertexShader = """
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
}
|
||||
|
||||
|
||||
"""
|
||||
|
||||
# For use with RGB video stream: the pixel is directly usable
|
||||
@@ -61,7 +61,7 @@ FragmentShader_R10l = """
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
color = texture(tex, vec2(tx,ty));
|
||||
color.a = 0.7;
|
||||
gl_FragColor = color;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -69,18 +69,18 @@ FragmentShader_R10l = """
|
||||
#
|
||||
FragmentShader_2vuy = """
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D tex;
|
||||
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
|
||||
uniform float stereo;
|
||||
// eye = 0.0 for the left eye, 0.5 for the right eye
|
||||
uniform float eye;
|
||||
|
||||
void main(void)
|
||||
void main(void)
|
||||
{
|
||||
vec4 color;
|
||||
float tx, ty, width, Y, Cb, Cr;
|
||||
float tx, ty, width, Y, Cb, Cr;
|
||||
int px;
|
||||
tx = gl_TexCoord[0].x;
|
||||
tx = gl_TexCoord[0].x;
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
width = float(textureSize(tex, 0).x);
|
||||
color = texture(tex, vec2(tx, ty));
|
||||
@@ -93,14 +93,14 @@ FragmentShader_2vuy = """
|
||||
Y = color.a;
|
||||
break;
|
||||
}
|
||||
Y = (Y - 0.0625) * 1.168949772;
|
||||
Cb = (color.b - 0.0625) * 1.142857143 - 0.5;
|
||||
Cr = (color.r - 0.0625) * 1.142857143 - 0.5;
|
||||
color.r = Y + 1.5748 * Cr;
|
||||
Y = (Y - 0.0625) * 1.168949772;
|
||||
Cb = (color.b - 0.0625) * 1.142857143 - 0.5;
|
||||
Cr = (color.r - 0.0625) * 1.142857143 - 0.5;
|
||||
color.r = Y + 1.5748 * Cr;
|
||||
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
|
||||
color.b = Y + 1.8556 * Cb;
|
||||
color.a = 0.7;
|
||||
gl_FragColor = color;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -108,19 +108,19 @@ FragmentShader_2vuy = """
|
||||
#
|
||||
FragmentShader_v210 = """
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D tex;
|
||||
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
|
||||
uniform float stereo;
|
||||
// eye = 0.0 for the left eye, 0.5 for the right eye
|
||||
uniform float eye;
|
||||
|
||||
void main(void)
|
||||
void main(void)
|
||||
{
|
||||
vec4 color, color1, color2, color3;
|
||||
int px;
|
||||
float tx, ty, width, sx, dx, bx, Y, Cb, Cr;
|
||||
tx = gl_TexCoord[0].x;
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
float tx, ty, width, sx, dx, bx, Y, Cb, Cr;
|
||||
tx = gl_TexCoord[0].x;
|
||||
ty = eye+gl_TexCoord[0].y*stereo;
|
||||
width = float(textureSize(tex, 0).x);
|
||||
// to sample macro pixels (6 pixels in 4 words)
|
||||
sx = tx*width*0.25+0.01;
|
||||
@@ -170,14 +170,14 @@ FragmentShader_v210 = """
|
||||
Y = color3.r;
|
||||
break;
|
||||
}
|
||||
Y = (Y - 0.0625) * 1.168949772;
|
||||
Cb = (Cb - 0.0625) * 1.142857143 - 0.5;
|
||||
Cr = (Cr - 0.0625) * 1.142857143 - 0.5;
|
||||
color.r = Y + 1.5748 * Cr;
|
||||
Y = (Y - 0.0625) * 1.168949772;
|
||||
Cb = (Cb - 0.0625) * 1.142857143 - 0.5;
|
||||
Cr = (Cr - 0.0625) * 1.142857143 - 0.5;
|
||||
color.r = Y + 1.5748 * Cr;
|
||||
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
|
||||
color.b = Y + 1.8556 * Cb;
|
||||
color.a = 0.7;
|
||||
gl_FragColor = color;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -197,17 +197,15 @@ fg_shaders = {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Helper function to attach a pixel shader to the material that receives the video frame.
|
||||
#
|
||||
|
||||
def config_video(obj, format, pixel, is3D=False, mat=0, card=0):
|
||||
if not pixel in fg_shaders:
|
||||
if pixel not in fg_shaders:
|
||||
raise('Unsuported shader')
|
||||
shader = obj.meshes[0].materials[mat].getShader()
|
||||
if shader != None and not shader.isValid():
|
||||
if shader is not None and not shader.isValid():
|
||||
shader.setSource(VertexShader, fg_shaders[pixel], True)
|
||||
shader.setSampler('tex', 0)
|
||||
shader.setUniformEyef("eye")
|
||||
@@ -221,19 +219,19 @@ def config_video(obj, format, pixel, is3D=False, mat=0, card=0):
|
||||
#
|
||||
# Attach this function to an object that has a material with texture
|
||||
# and call it once to initialize the object
|
||||
#
|
||||
#
|
||||
def init(cont):
|
||||
#config_video(cont.owner, 'HD720p5994', '8BitBGRA')
|
||||
#config_video(cont.owner, 'HD720p5994', '8BitYUV')
|
||||
#config_video(cont.owner, 'pal ', '10BitYUV')
|
||||
config_video(cont.owner, 'pal ', '8BitYUV')
|
||||
|
||||
# config_video(cont.owner, 'HD720p5994', '8BitBGRA')
|
||||
# config_video(cont.owner, 'HD720p5994', '8BitYUV')
|
||||
# config_video(cont.owner, 'pal ', '10BitYUV')
|
||||
config_video(cont.owner, 'pal ', '8BitYUV')
|
||||
|
||||
|
||||
#
|
||||
# To be called on every frame
|
||||
#
|
||||
def play(cont):
|
||||
obj = cont.owner
|
||||
if hasattr(obj, "video"):
|
||||
obj["video"].refresh(True)
|
||||
|
||||
video = obj.get("video")
|
||||
if video is not None:
|
||||
video.refresh(True)
|
||||
|
@@ -8,11 +8,11 @@ Physics Constraints (bge.constraints)
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. include:: ../examples/bge.constraints.py
|
||||
.. include:: __/examples/bge.constraints.py
|
||||
:start-line: 1
|
||||
:end-line: 4
|
||||
|
||||
.. literalinclude:: ../examples/bge.constraints.py
|
||||
.. literalinclude:: __/examples/bge.constraints.py
|
||||
:lines: 6-
|
||||
|
||||
|
||||
|
@@ -12,53 +12,53 @@ This module holds key constants for the SCA_KeyboardSensor.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Set a connected keyboard sensor to accept F1
|
||||
import bge
|
||||
# Set a connected keyboard sensor to accept F1
|
||||
import bge
|
||||
|
||||
co = bge.logic.getCurrentController()
|
||||
# 'Keyboard' is a keyboard sensor
|
||||
sensor = co.sensors["Keyboard"]
|
||||
sensor.key = bge.events.F1KEY
|
||||
co = bge.logic.getCurrentController()
|
||||
# 'Keyboard' is a keyboard sensor
|
||||
sensor = co.sensors["Keyboard"]
|
||||
sensor.key = bge.events.F1KEY
|
||||
|
||||
.. code-block:: python
|
||||
code-block:: python
|
||||
|
||||
# Do the all keys thing
|
||||
import bge
|
||||
# Do the all keys thing
|
||||
import bge
|
||||
|
||||
co = bge.logic.getCurrentController()
|
||||
# 'Keyboard' is a keyboard sensor
|
||||
sensor = co.sensors["Keyboard"]
|
||||
co = bge.logic.getCurrentController()
|
||||
# 'Keyboard' is a keyboard sensor
|
||||
sensor = co.sensors["Keyboard"]
|
||||
|
||||
for key,status in sensor.events:
|
||||
# key[0] == bge.events.keycode, key[1] = status
|
||||
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
|
||||
if key == bge.events.WKEY:
|
||||
# Activate Forward!
|
||||
if key == bge.events.SKEY:
|
||||
# Activate Backward!
|
||||
if key == bge.events.AKEY:
|
||||
# Activate Left!
|
||||
if key == bge.events.DKEY:
|
||||
# Activate Right!
|
||||
for key,status in sensor.events:
|
||||
# key[0] == bge.events.keycode, key[1] = status
|
||||
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
|
||||
if key == bge.events.WKEY:
|
||||
# Activate Forward!
|
||||
if key == bge.events.SKEY:
|
||||
# Activate Backward!
|
||||
if key == bge.events.AKEY:
|
||||
# Activate Left!
|
||||
if key == bge.events.DKEY:
|
||||
# Activate Right!
|
||||
|
||||
.. code-block:: python
|
||||
code-block:: python
|
||||
|
||||
# The all keys thing without a keyboard sensor (but you will
|
||||
# need an always sensor with pulse mode on)
|
||||
import bge
|
||||
# The all keys thing without a keyboard sensor (but you will
|
||||
# need an always sensor with pulse mode on)
|
||||
import bge
|
||||
|
||||
# Just shortening names here
|
||||
keyboard = bge.logic.keyboard
|
||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||
# Just shortening names here
|
||||
keyboard = bge.logic.keyboard
|
||||
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
||||
|
||||
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
|
||||
print("Activate Forward!")
|
||||
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
|
||||
print("Activate Backward!")
|
||||
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
|
||||
print("Activate Left!")
|
||||
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
|
||||
print("Activate Right!")
|
||||
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
|
||||
print("Activate Forward!")
|
||||
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
|
||||
print("Activate Backward!")
|
||||
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
|
||||
print("Activate Left!")
|
||||
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
|
||||
print("Activate Right!")
|
||||
|
||||
|
||||
*********
|
||||
|
@@ -385,9 +385,10 @@ General functions
|
||||
If False, the render is skipped and another logic frame starts immediately.
|
||||
|
||||
.. note::
|
||||
|
||||
GPU VSync no longer limits the number of frame per second when render is off,
|
||||
but the 'Use Frame Rate' option still regulates the fps. To run as many frames
|
||||
as possible, untick this option (Render Properties, System panel)
|
||||
but the *Use Frame Rate* option still regulates the fps. To run as many frames
|
||||
as possible, untick this option (Render Properties, System panel).
|
||||
|
||||
:arg render: the render flag
|
||||
:type render: bool
|
||||
|
@@ -98,6 +98,7 @@ Constants
|
||||
|
||||
The pixel buffer for offscreen render is a Texture. Argument to :func:`offScreenCreate`
|
||||
|
||||
|
||||
*****
|
||||
Types
|
||||
*****
|
||||
@@ -107,8 +108,8 @@ Types
|
||||
An off-screen render buffer object.
|
||||
|
||||
Use :func:`offScreenCreate` to create it.
|
||||
Currently it can only be used in the :class:`bge.texture.ImageRender` constructor to render on a FBO rather than the
|
||||
default viewport.
|
||||
Currently it can only be used in the :class:`bge.texture.ImageRender`
|
||||
constructor to render on a FBO rather than the default viewport.
|
||||
|
||||
.. attribute:: width
|
||||
|
||||
@@ -124,10 +125,14 @@ Types
|
||||
|
||||
.. attribute:: color
|
||||
|
||||
The underlying OpenGL bind code of the texture object that holds the rendered image, 0 if the FBO is using RenderBuffer. The choice between RenderBuffer and Texture is determined by the target argument of :func:`offScreenCreate`.
|
||||
The underlying OpenGL bind code of the texture object that holds
|
||||
the rendered image, 0 if the FBO is using RenderBuffer.
|
||||
The choice between RenderBuffer and Texture is determined
|
||||
by the target argument of :func:`offScreenCreate`.
|
||||
|
||||
:type: integer
|
||||
|
||||
|
||||
*********
|
||||
Functions
|
||||
*********
|
||||
@@ -410,7 +415,11 @@ Functions
|
||||
:type height: integer
|
||||
:arg samples: the number of multisample for anti-aliasing (MSAA), 0 to disable MSAA
|
||||
:type samples: integer
|
||||
:arg target: the pixel storage: :data:`RAS_OFS_RENDER_BUFFER` to render on RenderBuffers (the default), :data:`RAS_OFS_RENDER_TEXTURE` to render on texture. The later is interesting if you want to access the texture directly (see :attr:`RASOffScreen.color`). Otherwise the default is preferable as it's more widely supported by GPUs and more efficient. If the GPU does not support MSAA+Texture (e.g. Intel HD GPU), MSAA will be disabled.
|
||||
:arg target: the pixel storage: :data:`RAS_OFS_RENDER_BUFFER` to render on RenderBuffers (the default),
|
||||
:data:`RAS_OFS_RENDER_TEXTURE` to render on texture.
|
||||
The later is interesting if you want to access the texture directly (see :attr:`RASOffScreen.color`).
|
||||
Otherwise the default is preferable as it's more widely supported by GPUs and more efficient.
|
||||
If the GPU does not support MSAA+Texture (e.g. Intel HD GPU), MSAA will be disabled.
|
||||
:type target: integer
|
||||
:rtype: :class:`RASOffScreen`
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -12,13 +12,13 @@ base class --- :class:`PyObjectPlus`
|
||||
.. attribute:: name
|
||||
|
||||
The name assigned to the joystick by the operating system. (read-only)
|
||||
|
||||
|
||||
:type: string
|
||||
|
||||
.. attribute:: activeButtons
|
||||
|
||||
A list of active button values. (read-only)
|
||||
|
||||
|
||||
:type: list
|
||||
|
||||
.. attribute:: axisValues
|
||||
@@ -27,8 +27,10 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
:type: list of ints.
|
||||
|
||||
Each specifying the value of an axis between -1.0 and 1.0 depending on how far the axis is pushed, 0 for nothing.
|
||||
The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls.
|
||||
Each specifying the value of an axis between -1.0 and 1.0
|
||||
depending on how far the axis is pushed, 0 for nothing.
|
||||
The first 2 values are used by most joysticks and gamepads for directional control.
|
||||
3rd and 4th values are only on some joysticks and can be used for arbitary controls.
|
||||
|
||||
* left:[-1.0, 0.0, ...]
|
||||
* right:[1.0, 0.0, ...]
|
||||
|
@@ -1,7 +1,8 @@
|
||||
..
|
||||
This document is appended to the auto generated bmesh api doc to avoid clogging up the C files with details.
|
||||
to test this run:
|
||||
./blender.bin -b -noaudio -P doc/python_api/sphinx_doc_gen.py -- --partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
|
||||
./blender.bin -b -noaudio -P doc/python_api/sphinx_doc_gen.py -- \
|
||||
--partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
|
||||
|
||||
|
||||
Submodules:
|
||||
@@ -40,7 +41,7 @@ For an overview of BMesh data types and how they reference each other see:
|
||||
Example Script
|
||||
--------------
|
||||
|
||||
.. literalinclude:: ../../../release/scripts/templates_py/bmesh_simple.py
|
||||
.. literalinclude:: __/__/__/release/scripts/templates_py/bmesh_simple.py
|
||||
|
||||
|
||||
Stand-Alone Module
|
||||
@@ -59,9 +60,9 @@ There are 2 ways to access BMesh data, you can create a new BMesh by converting
|
||||
:class:`bpy.types.BlendData.meshes` or by accessing the current edit mode mesh.
|
||||
see: :class:`bmesh.types.BMesh.from_mesh` and :mod:`bmesh.from_edit_mesh` respectively.
|
||||
|
||||
When explicitly converting from mesh data python **owns** the data, that is to say - that the mesh only exists while
|
||||
python holds a reference to it, and the script is responsible for putting it back into a mesh data-block when the edits
|
||||
are done.
|
||||
When explicitly converting from mesh data python **owns** the data, that is to say -
|
||||
that the mesh only exists while python holds a reference to it,
|
||||
and the script is responsible for putting it back into a mesh data-block when the edits are done.
|
||||
|
||||
Note that unlike :mod:`bpy`, a BMesh does not necessarily correspond to data in the currently open blend file,
|
||||
a BMesh can be created, edited and freed without the user ever seeing or having access to it.
|
||||
|
@@ -151,7 +151,7 @@ Data Creation/Removal
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Those of you familiar with other Python API's may be surprised that
|
||||
new datablocks in the bpy API can't be created by calling the class:
|
||||
new data-blocks in the bpy API can't be created by calling the class:
|
||||
|
||||
>>> bpy.types.Mesh()
|
||||
Traceback (most recent call last):
|
||||
@@ -305,7 +305,7 @@ In Python, this is done by defining a class, which is a subclass of an existing
|
||||
Example Operator
|
||||
----------------
|
||||
|
||||
.. literalinclude:: ../../../release/scripts/templates_py/operator_simple.py
|
||||
.. literalinclude:: __/__/__/release/scripts/templates_py/operator_simple.py
|
||||
|
||||
Once this script runs, ``SimpleOperator`` is registered with Blender
|
||||
and can be called from the operator search popup or added to the toolbar.
|
||||
@@ -336,7 +336,7 @@ Example Panel
|
||||
Panels register themselves as a class, like an operator.
|
||||
Notice the extra ``bl_`` variables used to set the context they display in.
|
||||
|
||||
.. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py
|
||||
.. literalinclude:: __/__/__/release/scripts/templates_py/ui_panel_simple.py
|
||||
|
||||
To run the script:
|
||||
|
||||
@@ -393,11 +393,11 @@ so these are accessed as normal Python types.
|
||||
Internal Types
|
||||
--------------
|
||||
|
||||
Used for Blender datablocks and collections: :class:`bpy.types.bpy_struct`
|
||||
Used for Blender data-blocks and collections: :class:`bpy.types.bpy_struct`
|
||||
|
||||
For data that contains its own attributes groups/meshes/bones/scenes... etc.
|
||||
|
||||
There are 2 main types that wrap Blenders data, one for datablocks
|
||||
There are 2 main types that wrap Blenders data, one for data-blocks
|
||||
(known internally as ``bpy_struct``), another for properties.
|
||||
|
||||
>>> bpy.context.object
|
||||
|
@@ -57,7 +57,7 @@ Operator Example
|
||||
++++++++++++++++
|
||||
This script shows how operators can be used to model a link of a chain.
|
||||
|
||||
.. literalinclude:: ../examples/bmesh.ops.1.py
|
||||
.. literalinclude:: __/examples/bmesh.ops.1.py
|
||||
"""
|
||||
|
||||
|
||||
|
@@ -325,6 +325,24 @@ except ImportError:
|
||||
"freestyle.types",
|
||||
"freestyle.utils"]
|
||||
|
||||
# Source files we use, and need to copy to the OUTPUT_DIR
|
||||
# to have working out-of-source builds.
|
||||
# Note that ".." is replaced by "__" in the RST files,
|
||||
# to avoid having to match Blender's source tree.
|
||||
EXTRA_SOURCE_FILES = (
|
||||
"../../../release/scripts/templates_py/bmesh_simple.py",
|
||||
"../../../release/scripts/templates_py/operator_simple.py",
|
||||
"../../../release/scripts/templates_py/ui_panel_simple.py",
|
||||
"../../../release/scripts/templates_py/ui_previews_custom_icon.py",
|
||||
"../examples/bge.constraints.py",
|
||||
"../examples/bge.texture.1.py",
|
||||
"../examples/bge.texture.2.py",
|
||||
"../examples/bge.texture.py",
|
||||
"../examples/bmesh.ops.1.py",
|
||||
"../examples/bpy.app.translations.py",
|
||||
)
|
||||
|
||||
|
||||
# examples
|
||||
EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples"))
|
||||
EXAMPLE_SET = set()
|
||||
@@ -1890,6 +1908,21 @@ def copy_handwritten_rsts(basepath):
|
||||
shutil.copy2(os.path.join(RST_DIR, f), basepath)
|
||||
|
||||
|
||||
def copy_handwritten_extra(basepath):
|
||||
for f_src in EXTRA_SOURCE_FILES:
|
||||
if os.sep != "/":
|
||||
f_src = os.sep.join(f_src.split("/"))
|
||||
|
||||
f_dst = f_src.replace("..", "__")
|
||||
|
||||
f_src = os.path.join(RST_DIR, f_src)
|
||||
f_dst = os.path.join(basepath, f_dst)
|
||||
|
||||
os.makedirs(os.path.dirname(f_dst), exist_ok=True)
|
||||
|
||||
shutil.copy2(f_src, f_dst)
|
||||
|
||||
|
||||
def rna2sphinx(basepath):
|
||||
|
||||
try:
|
||||
@@ -1921,35 +1954,48 @@ def rna2sphinx(basepath):
|
||||
# copy the other rsts
|
||||
copy_handwritten_rsts(basepath)
|
||||
|
||||
# copy source files referenced
|
||||
copy_handwritten_extra(basepath)
|
||||
|
||||
def align_sphinx_in_to_sphinx_in_tmp():
|
||||
|
||||
def align_sphinx_in_to_sphinx_in_tmp(dir_src, dir_dst):
|
||||
'''
|
||||
Move changed files from SPHINX_IN_TMP to SPHINX_IN
|
||||
'''
|
||||
import filecmp
|
||||
|
||||
sphinx_in_files = set(os.listdir(SPHINX_IN))
|
||||
sphinx_in_tmp_files = set(os.listdir(SPHINX_IN_TMP))
|
||||
# possible the dir doesn't exist when running recursively
|
||||
os.makedirs(dir_dst, exist_ok=True)
|
||||
|
||||
sphinx_dst_files = set(os.listdir(dir_dst))
|
||||
sphinx_src_files = set(os.listdir(dir_src))
|
||||
|
||||
# remove deprecated files that have been removed
|
||||
for f in sorted(sphinx_in_files):
|
||||
if f not in sphinx_in_tmp_files:
|
||||
for f in sorted(sphinx_dst_files):
|
||||
if f not in sphinx_src_files:
|
||||
BPY_LOGGER.debug("\tdeprecated: %s" % f)
|
||||
os.remove(os.path.join(SPHINX_IN, f))
|
||||
f_dst = os.path.join(dir_dst, f)
|
||||
if os.path.isdir(f_dst):
|
||||
shutil.rmtree(f_dst, True)
|
||||
else:
|
||||
os.remove(f_dst)
|
||||
|
||||
# freshen with new files.
|
||||
for f in sorted(sphinx_in_tmp_files):
|
||||
f_from = os.path.join(SPHINX_IN_TMP, f)
|
||||
f_to = os.path.join(SPHINX_IN, f)
|
||||
for f in sorted(sphinx_src_files):
|
||||
f_src = os.path.join(dir_src, f)
|
||||
f_dst = os.path.join(dir_dst, f)
|
||||
|
||||
do_copy = True
|
||||
if f in sphinx_in_files:
|
||||
if filecmp.cmp(f_from, f_to):
|
||||
do_copy = False
|
||||
if os.path.isdir(f_src):
|
||||
align_sphinx_in_to_sphinx_in_tmp(f_src, f_dst)
|
||||
else:
|
||||
do_copy = True
|
||||
if f in sphinx_dst_files:
|
||||
if filecmp.cmp(f_src, f_dst):
|
||||
do_copy = False
|
||||
|
||||
if do_copy:
|
||||
BPY_LOGGER.debug("\tupdating: %s" % f)
|
||||
shutil.copy(f_from, f_to)
|
||||
if do_copy:
|
||||
BPY_LOGGER.debug("\tupdating: %s" % f)
|
||||
shutil.copy(f_src, f_dst)
|
||||
|
||||
|
||||
def refactor_sphinx_log(sphinx_logfile):
|
||||
@@ -2036,7 +2082,7 @@ def main():
|
||||
shutil.rmtree(SPHINX_OUT_PDF, True)
|
||||
else:
|
||||
# move changed files in SPHINX_IN
|
||||
align_sphinx_in_to_sphinx_in_tmp()
|
||||
align_sphinx_in_to_sphinx_in_tmp(SPHINX_IN_TMP, SPHINX_IN)
|
||||
|
||||
# report which example files weren't used
|
||||
EXAMPLE_SET_UNUSED = EXAMPLE_SET - EXAMPLE_SET_USED
|
||||
|
@@ -3,11 +3,6 @@
|
||||
# bash doc/python_api/sphinx_doc_gen.sh
|
||||
# ssh upload means you need an account on the server
|
||||
|
||||
if [ "$1" == "" ] ; then
|
||||
echo "Expected a single argument for the username on blender.org, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Upload vars
|
||||
|
||||
@@ -22,9 +17,15 @@ if [ -z $BLENDER_BIN ] ; then
|
||||
BLENDER_BIN="./blender.bin"
|
||||
fi
|
||||
|
||||
SSH_USER=$1
|
||||
SSH_HOST=$SSH_USER"@blender.org"
|
||||
SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
|
||||
if [ "$1" == "" ] ; then
|
||||
echo "Expected a single argument for the username on blender.org, skipping upload step!"
|
||||
DO_UPLOAD=false
|
||||
else
|
||||
SSH_USER=$1
|
||||
SSH_HOST=$SSH_USER"@blender.org"
|
||||
SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION, added after
|
||||
fi
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Blender Version & Info
|
||||
@@ -33,10 +34,12 @@ SSH_UPLOAD="/data/www/vhosts/www.blender.org/api" # blender_python_api_VERSION,
|
||||
# "_".join(str(v) for v in bpy.app.version)
|
||||
# custom blender vars
|
||||
blender_srcdir=$(dirname -- $0)/../..
|
||||
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||
blender_version_header="$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h"
|
||||
blender_version=$(grep "BLENDER_VERSION\s" "$blender_version_header" | awk '{print $3}')
|
||||
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_version_header" | awk '{print $3}')
|
||||
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_version_header" | awk '{print $3}')
|
||||
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_version_header" | awk '{print $3}')
|
||||
unset blender_version_header
|
||||
|
||||
if [ "$blender_version_cycle" = "release" ] ; then
|
||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
|
||||
@@ -48,6 +51,8 @@ SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
|
||||
|
||||
SPHINXBASE=doc/python_api
|
||||
|
||||
SPHINX_WORKDIR="$(mktemp --directory --suffix=.sphinx)"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Generate reStructuredText (blender/python only)
|
||||
@@ -59,7 +64,10 @@ if $DO_EXE_BLENDER ; then
|
||||
-noaudio \
|
||||
--factory-startup \
|
||||
--python-exit-code 1 \
|
||||
--python $SPHINXBASE/sphinx_doc_gen.py
|
||||
--python $SPHINXBASE/sphinx_doc_gen.py \
|
||||
-- \
|
||||
--output=$SPHINX_WORKDIR
|
||||
|
||||
|
||||
if (($? != 0)) ; then
|
||||
echo "Generating documentation failed, aborting"
|
||||
@@ -67,15 +75,14 @@ if $DO_EXE_BLENDER ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Generate HTML (sphinx)
|
||||
|
||||
if $DO_OUT_HTML ; then
|
||||
# sphinx-build -n -b html $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
|
||||
# sphinx-build -n -b html $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
|
||||
# annoying bug in sphinx makes it very slow unless we do this. should report.
|
||||
cd $SPHINXBASE
|
||||
cd $SPHINX_WORKDIR
|
||||
sphinx-build -b html sphinx-in sphinx-out
|
||||
|
||||
# XXX, saves space on upload and zip, should move HTML outside
|
||||
@@ -103,20 +110,21 @@ fi
|
||||
# Generate PDF (sphinx/laytex)
|
||||
|
||||
if $DO_OUT_PDF ; then
|
||||
sphinx-build -n -b latex $SPHINXBASE/sphinx-in $SPHINXBASE/sphinx-out
|
||||
make -C $SPHINXBASE/sphinx-out
|
||||
mv $SPHINXBASE/sphinx-out/contents.pdf $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
cd $SPHINX_WORKDIR
|
||||
sphinx-build -n -b latex $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
make -C $SPHINX_WORKDIR/sphinx-out
|
||||
mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
|
||||
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
fi
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Upload to blender servers, comment this section for testing
|
||||
|
||||
if $DO_UPLOAD ; then
|
||||
|
||||
cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html
|
||||
cp $SPHINX_WORKDIR/sphinx-out/contents.html $SPHINX_WORKDIR/sphinx-out/index.html
|
||||
ssh $SSH_USER@blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*'
|
||||
rsync --progress -ave "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
|
||||
rsync --progress -ave "ssh -p 22" $SPHINX_WORKDIR/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/
|
||||
|
||||
## symlink the dir to a static URL
|
||||
#ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc'
|
||||
@@ -134,11 +142,15 @@ if $DO_UPLOAD ; then
|
||||
|
||||
if $DO_OUT_PDF ; then
|
||||
# rename so local PDF has matching name.
|
||||
rsync --progress -ave "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
rsync --progress -ave "ssh -p 22" \
|
||||
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf \
|
||||
$SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
fi
|
||||
|
||||
if $DO_OUT_HTML_ZIP ; then
|
||||
rsync --progress -ave "ssh -p 22" $SPHINXBASE/blender_python_reference_$BLENDER_VERSION.zip $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip
|
||||
rsync --progress -ave "ssh -p 22" \
|
||||
$SPHINX_WORKDIR/blender_python_reference_$BLENDER_VERSION.zip \
|
||||
$SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip
|
||||
fi
|
||||
|
||||
fi
|
||||
@@ -149,5 +161,5 @@ fi
|
||||
|
||||
echo ""
|
||||
echo "Finished! view the docs from: "
|
||||
if $DO_OUT_HTML ; then echo " html:" $SPHINXBASE/sphinx-out/contents.html ; fi
|
||||
if $DO_OUT_PDF ; then echo " pdf:" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf ; fi
|
||||
if $DO_OUT_HTML ; then echo " html:" $SPHINX_WORKDIR/sphinx-out/contents.html ; fi
|
||||
if $DO_OUT_PDF ; then echo " pdf:" $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf ; fi
|
||||
|
6
extern/curve_fit_nd/curve_fit_nd.h
vendored
6
extern/curve_fit_nd/curve_fit_nd.h
vendored
@@ -60,6 +60,7 @@ int curve_fit_cubic_to_points_db(
|
||||
const unsigned int points_len,
|
||||
const unsigned int dims,
|
||||
const double error_threshold,
|
||||
const unsigned int calc_flag,
|
||||
const unsigned int *corners,
|
||||
unsigned int corners_len,
|
||||
|
||||
@@ -72,6 +73,7 @@ int curve_fit_cubic_to_points_fl(
|
||||
const unsigned int points_len,
|
||||
const unsigned int dims,
|
||||
const float error_threshold,
|
||||
const unsigned int calc_flag,
|
||||
const unsigned int *corners,
|
||||
const unsigned int corners_len,
|
||||
|
||||
@@ -117,6 +119,10 @@ int curve_fit_cubic_to_points_single_fl(
|
||||
float r_handle_r[],
|
||||
float *r_error_sq);
|
||||
|
||||
enum {
|
||||
CURVE_FIT_CALC_HIGH_QUALIY = (1 << 0),
|
||||
};
|
||||
|
||||
/* curve_fit_corners_detect.c */
|
||||
|
||||
/**
|
||||
|
196
extern/curve_fit_nd/intern/curve_fit_cubic.c
vendored
196
extern/curve_fit_nd/intern/curve_fit_cubic.c
vendored
@@ -46,6 +46,12 @@
|
||||
/* Take curvature into account when calculating the least square solution isn't usable. */
|
||||
#define USE_CIRCULAR_FALLBACK
|
||||
|
||||
/* Use the maximum distance of any points from the direct line between 2 points
|
||||
* to calculate how long the handles need to be.
|
||||
* Can do a 'perfect' reversal of subdivision when for curve has symmetrical handles and doesn't change direction
|
||||
* (as with an 'S' shape). */
|
||||
#define USE_OFFSET_FALLBACK
|
||||
|
||||
/* avoid re-calculating lengths multiple times */
|
||||
#define USE_LENGTH_CACHE
|
||||
|
||||
@@ -339,6 +345,44 @@ static double cubic_calc_error(
|
||||
return error_max_sq;
|
||||
}
|
||||
|
||||
#ifdef USE_OFFSET_FALLBACK
|
||||
/**
|
||||
* A version #cubic_calc_error where we don't need the split-index and can exit early when over the limit.
|
||||
*/
|
||||
static double cubic_calc_error_simple(
|
||||
const Cubic *cubic,
|
||||
const double *points_offset,
|
||||
const uint points_offset_len,
|
||||
const double *u,
|
||||
const double error_threshold_sq,
|
||||
const uint dims)
|
||||
|
||||
{
|
||||
double error_max_sq = 0.0;
|
||||
|
||||
const double *pt_real = points_offset + dims;
|
||||
#ifdef USE_VLA
|
||||
double pt_eval[dims];
|
||||
#else
|
||||
double *pt_eval = alloca(sizeof(double) * dims);
|
||||
#endif
|
||||
|
||||
for (uint i = 1; i < points_offset_len - 1; i++, pt_real += dims) {
|
||||
cubic_evaluate(cubic, u[i], dims, pt_eval);
|
||||
|
||||
const double err_sq = len_squared_vnvn(pt_real, pt_eval, dims);
|
||||
if (err_sq >= error_threshold_sq) {
|
||||
return error_threshold_sq;
|
||||
}
|
||||
else if (err_sq >= error_max_sq) {
|
||||
error_max_sq = err_sq;
|
||||
}
|
||||
}
|
||||
|
||||
return error_max_sq;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Bezier multipliers
|
||||
*/
|
||||
@@ -530,6 +574,85 @@ static void cubic_from_points_fallback(
|
||||
}
|
||||
#endif /* USE_CIRCULAR_FALLBACK */
|
||||
|
||||
|
||||
#ifdef USE_OFFSET_FALLBACK
|
||||
|
||||
static void cubic_from_points_offset_fallback(
|
||||
const double *points_offset,
|
||||
const uint points_offset_len,
|
||||
const double tan_l[],
|
||||
const double tan_r[],
|
||||
const uint dims,
|
||||
|
||||
Cubic *r_cubic)
|
||||
{
|
||||
const double *p0 = &points_offset[0];
|
||||
const double *p3 = &points_offset[(points_offset_len - 1) * dims];
|
||||
|
||||
#ifdef USE_VLA
|
||||
double dir_unit[dims];
|
||||
double a[2][dims];
|
||||
double tmp[dims];
|
||||
#else
|
||||
double *dir_unit = alloca(sizeof(double) * dims);
|
||||
double *a[2] = {
|
||||
alloca(sizeof(double) * dims),
|
||||
alloca(sizeof(double) * dims),
|
||||
};
|
||||
double *tmp = alloca(sizeof(double) * dims);
|
||||
#endif
|
||||
|
||||
const double dir_dist = normalize_vn_vnvn(dir_unit, p3, p0, dims);
|
||||
project_plane_vn_vnvn_normalized(a[0], tan_l, dir_unit, dims);
|
||||
project_plane_vn_vnvn_normalized(a[1], tan_r, dir_unit, dims);
|
||||
|
||||
/* only for better accuracy, not essential */
|
||||
normalize_vn(a[0], dims);
|
||||
normalize_vn(a[1], dims);
|
||||
|
||||
mul_vnvn_fl(a[1], a[1], -1, dims);
|
||||
|
||||
double dists[2] = {0, 0};
|
||||
|
||||
const double *pt = points_offset;
|
||||
for (uint i = 1; i < points_offset_len - 1; i++, pt += dims) {
|
||||
for (uint k = 0; k < 2; k++) {
|
||||
sub_vn_vnvn(tmp, p0, pt, dims);
|
||||
project_vn_vnvn_normalized(tmp, tmp, a[k], dims);
|
||||
dists[k] = max(dists[k], dot_vnvn(tmp, a[k], dims));
|
||||
}
|
||||
}
|
||||
|
||||
float alpha_l = (dists[0] / 0.75) / dot_vnvn(tan_l, a[0], dims);
|
||||
float alpha_r = (dists[1] / 0.75) / -dot_vnvn(tan_r, a[1], dims);
|
||||
|
||||
if (!(alpha_l > 0.0f)) {
|
||||
alpha_l = dir_dist / 3.0;
|
||||
}
|
||||
if (!(alpha_r > 0.0f)) {
|
||||
alpha_r = dir_dist / 3.0;
|
||||
}
|
||||
|
||||
double *p1 = CUBIC_PT(r_cubic, 1, dims);
|
||||
double *p2 = CUBIC_PT(r_cubic, 2, dims);
|
||||
|
||||
copy_vnvn(CUBIC_PT(r_cubic, 0, dims), p0, dims);
|
||||
copy_vnvn(CUBIC_PT(r_cubic, 3, dims), p3, dims);
|
||||
|
||||
#ifdef USE_ORIG_INDEX_DATA
|
||||
r_cubic->orig_span = (points_offset_len - 1);
|
||||
#endif
|
||||
|
||||
/* p1 = p0 - (tan_l * alpha_l);
|
||||
* p2 = p3 + (tan_r * alpha_r);
|
||||
*/
|
||||
msub_vn_vnvn_fl(p1, p0, tan_l, alpha_l, dims);
|
||||
madd_vn_vnvn_fl(p2, p3, tan_r, alpha_r, dims);
|
||||
}
|
||||
|
||||
#endif /* USE_OFFSET_FALLBACK */
|
||||
|
||||
|
||||
/**
|
||||
* Use least-squares method to find Bezier control points for region.
|
||||
*/
|
||||
@@ -918,6 +1041,8 @@ static bool fit_cubic_to_points(
|
||||
|
||||
Cubic *cubic_test = alloca(cubic_alloc_size(dims));
|
||||
|
||||
/* Run this so we use the non-circular calculation when the circular-fallback
|
||||
* in 'cubic_from_points' failed to give a close enough result. */
|
||||
#ifdef USE_CIRCULAR_FALLBACK
|
||||
if (!(error_max_sq < error_threshold_sq)) {
|
||||
/* Don't use the cubic calculated above, instead calculate a new fallback cubic,
|
||||
@@ -940,14 +1065,28 @@ static bool fit_cubic_to_points(
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Test the offset fallback */
|
||||
#ifdef USE_OFFSET_FALLBACK
|
||||
if (!(error_max_sq < error_threshold_sq)) {
|
||||
/* Using the offset from the curve to calculate cubic handle length may give better results
|
||||
* try this as a second fallback. */
|
||||
cubic_from_points_offset_fallback(
|
||||
points_offset, points_offset_len,
|
||||
tan_l, tan_r, dims, cubic_test);
|
||||
const double error_max_sq_test = cubic_calc_error_simple(
|
||||
cubic_test, points_offset, points_offset_len, u, error_max_sq, dims);
|
||||
|
||||
if (error_max_sq > error_max_sq_test) {
|
||||
error_max_sq = error_max_sq_test;
|
||||
cubic_copy(r_cubic, cubic_test, dims);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
*r_error_max_sq = error_max_sq;
|
||||
*r_split_index = split_index;
|
||||
|
||||
if (error_max_sq < error_threshold_sq) {
|
||||
free(u);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
if (!(error_max_sq < error_threshold_sq)) {
|
||||
cubic_copy(cubic_test, r_cubic, dims);
|
||||
|
||||
/* If error not too large, try some reparameterization and iteration */
|
||||
@@ -965,25 +1104,28 @@ static bool fit_cubic_to_points(
|
||||
points_offset_coords_length,
|
||||
#endif
|
||||
u_prime, tan_l, tan_r, dims, cubic_test);
|
||||
error_max_sq = cubic_calc_error(
|
||||
|
||||
const double error_max_sq_test = cubic_calc_error(
|
||||
cubic_test, points_offset, points_offset_len, u_prime, dims,
|
||||
&split_index);
|
||||
|
||||
if (error_max_sq < error_threshold_sq) {
|
||||
free(u_prime);
|
||||
free(u);
|
||||
|
||||
cubic_copy(r_cubic, cubic_test, dims);
|
||||
*r_error_max_sq = error_max_sq;
|
||||
*r_split_index = split_index;
|
||||
return true;
|
||||
}
|
||||
else if (error_max_sq < *r_error_max_sq) {
|
||||
if (error_max_sq > error_max_sq_test) {
|
||||
error_max_sq = error_max_sq_test;
|
||||
cubic_copy(r_cubic, cubic_test, dims);
|
||||
*r_error_max_sq = error_max_sq;
|
||||
*r_split_index = split_index;
|
||||
}
|
||||
|
||||
if (!(error_max_sq < error_threshold_sq)) {
|
||||
/* continue */
|
||||
}
|
||||
else {
|
||||
assert((error_max_sq < error_threshold_sq));
|
||||
free(u_prime);
|
||||
free(u);
|
||||
return true;
|
||||
}
|
||||
|
||||
SWAP(double *, u, u_prime);
|
||||
}
|
||||
free(u_prime);
|
||||
@@ -991,6 +1133,10 @@ static bool fit_cubic_to_points(
|
||||
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
free(u);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static void fit_cubic_to_points_recursive(
|
||||
@@ -1002,6 +1148,7 @@ static void fit_cubic_to_points_recursive(
|
||||
const double tan_l[],
|
||||
const double tan_r[],
|
||||
const double error_threshold_sq,
|
||||
const uint calc_flag,
|
||||
const uint dims,
|
||||
/* fill in the list */
|
||||
CubicList *clist)
|
||||
@@ -1015,8 +1162,11 @@ static void fit_cubic_to_points_recursive(
|
||||
#ifdef USE_LENGTH_CACHE
|
||||
points_length_cache,
|
||||
#endif
|
||||
tan_l, tan_r, error_threshold_sq, dims,
|
||||
cubic, &error_max_sq, &split_index))
|
||||
tan_l, tan_r,
|
||||
(calc_flag & CURVE_FIT_CALC_HIGH_QUALIY) ? DBL_EPSILON : error_threshold_sq,
|
||||
dims,
|
||||
cubic, &error_max_sq, &split_index) ||
|
||||
(error_max_sq < error_threshold_sq))
|
||||
{
|
||||
cubic_list_prepend(clist, cubic);
|
||||
return;
|
||||
@@ -1068,13 +1218,13 @@ static void fit_cubic_to_points_recursive(
|
||||
#ifdef USE_LENGTH_CACHE
|
||||
points_length_cache,
|
||||
#endif
|
||||
tan_l, tan_center, error_threshold_sq, dims, clist);
|
||||
tan_l, tan_center, error_threshold_sq, calc_flag, dims, clist);
|
||||
fit_cubic_to_points_recursive(
|
||||
&points_offset[split_index * dims], points_offset_len - split_index,
|
||||
#ifdef USE_LENGTH_CACHE
|
||||
points_length_cache + split_index,
|
||||
#endif
|
||||
tan_center, tan_r, error_threshold_sq, dims, clist);
|
||||
tan_center, tan_r, error_threshold_sq, calc_flag, dims, clist);
|
||||
|
||||
}
|
||||
|
||||
@@ -1097,6 +1247,7 @@ int curve_fit_cubic_to_points_db(
|
||||
const uint points_len,
|
||||
const uint dims,
|
||||
const double error_threshold,
|
||||
const uint calc_flag,
|
||||
const uint *corners,
|
||||
uint corners_len,
|
||||
|
||||
@@ -1172,7 +1323,7 @@ int curve_fit_cubic_to_points_db(
|
||||
#ifdef USE_LENGTH_CACHE
|
||||
points_length_cache,
|
||||
#endif
|
||||
tan_l, tan_r, error_threshold_sq, dims, &clist);
|
||||
tan_l, tan_r, error_threshold_sq, calc_flag, dims, &clist);
|
||||
}
|
||||
else if (points_len == 1) {
|
||||
assert(points_offset_len == 1);
|
||||
@@ -1239,6 +1390,7 @@ int curve_fit_cubic_to_points_fl(
|
||||
const uint points_len,
|
||||
const uint dims,
|
||||
const float error_threshold,
|
||||
const uint calc_flag,
|
||||
const uint *corners,
|
||||
const uint corners_len,
|
||||
|
||||
@@ -1256,7 +1408,7 @@ int curve_fit_cubic_to_points_fl(
|
||||
uint cubic_array_len = 0;
|
||||
|
||||
int result = curve_fit_cubic_to_points_db(
|
||||
points_db, points_len, dims, error_threshold, corners, corners_len,
|
||||
points_db, points_len, dims, error_threshold, calc_flag, corners, corners_len,
|
||||
&cubic_array_db, &cubic_array_len,
|
||||
r_cubic_orig_index,
|
||||
r_corner_index_array, r_corner_index_len);
|
||||
|
24
extern/curve_fit_nd/intern/curve_fit_inline.h
vendored
24
extern/curve_fit_nd/intern/curve_fit_inline.h
vendored
@@ -290,4 +290,28 @@ MINLINE bool equals_vnvn(
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
MINLINE void project_vn_vnvn(
|
||||
double v_out[], const double p[], const double v_proj[], const uint dims)
|
||||
{
|
||||
const double mul = dot_vnvn(p, v_proj, dims) / dot_vnvn(v_proj, v_proj, dims);
|
||||
mul_vnvn_fl(v_out, v_proj, mul, dims);
|
||||
}
|
||||
#endif
|
||||
|
||||
MINLINE void project_vn_vnvn_normalized(
|
||||
double v_out[], const double p[], const double v_proj[], const uint dims)
|
||||
{
|
||||
const double mul = dot_vnvn(p, v_proj, dims);
|
||||
mul_vnvn_fl(v_out, v_proj, mul, dims);
|
||||
}
|
||||
|
||||
MINLINE void project_plane_vn_vnvn_normalized(
|
||||
double v_out[], const double v[], const double v_plane[], const uint dims)
|
||||
{
|
||||
assert(v != v_out);
|
||||
project_vn_vnvn_normalized(v_out, v, v_plane, dims);
|
||||
sub_vn_vnvn(v_out, v, v_out, dims);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
@@ -34,7 +34,7 @@ add_subdirectory(mikktspace)
|
||||
add_subdirectory(glew-mx)
|
||||
add_subdirectory(eigen)
|
||||
|
||||
if (WITH_DECKLINK)
|
||||
if (WITH_GAMEENGINE_DECKLINK)
|
||||
add_subdirectory(decklink)
|
||||
endif()
|
||||
|
||||
|
@@ -73,18 +73,6 @@ struct XMLReadState : public XMLReader {
|
||||
|
||||
/* Attribute Reading */
|
||||
|
||||
static bool xml_read_bool(bool *value, pugi::xml_node node, const char *name)
|
||||
{
|
||||
pugi::xml_attribute attr = node.attribute(name);
|
||||
|
||||
if(attr) {
|
||||
*value = (string_iequals(attr.value(), "true")) || (atoi(attr.value()) != 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool xml_read_int(int *value, pugi::xml_node node, const char *name)
|
||||
{
|
||||
pugi::xml_attribute attr = node.attribute(name);
|
||||
@@ -193,18 +181,6 @@ static bool xml_read_string(string *str, pugi::xml_node node, const char *name)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool xml_read_ustring(ustring *str, pugi::xml_node node, const char *name)
|
||||
{
|
||||
pugi::xml_attribute attr = node.attribute(name);
|
||||
|
||||
if(attr) {
|
||||
*str = ustring(attr.value());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool xml_equal_string(pugi::xml_node node, const char *name, const char *value)
|
||||
{
|
||||
pugi::xml_attribute attr = node.attribute(name);
|
||||
@@ -215,24 +191,6 @@ static bool xml_equal_string(pugi::xml_node node, const char *name, const char *
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool xml_read_enum_value(int *value, NodeEnum& enm, pugi::xml_node node, const char *name)
|
||||
{
|
||||
pugi::xml_attribute attr = node.attribute(name);
|
||||
|
||||
if(attr) {
|
||||
ustring ustr(attr.value());
|
||||
|
||||
if(enm.exists(ustr)) {
|
||||
*value = enm[ustr];
|
||||
return true;
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Unknown value \"%s\" for attribute \"%s\".\n", ustr.c_str(), name);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Camera */
|
||||
|
||||
static void xml_read_camera(XMLReadState& state, pugi::xml_node node)
|
||||
@@ -267,47 +225,74 @@ static void xml_read_shader_graph(XMLReadState& state, Shader *shader, pugi::xml
|
||||
{
|
||||
xml_read_node(state, shader, graph_node);
|
||||
|
||||
ShaderManager *manager = state.scene->shader_manager;
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
map<string, ShaderNode*> nodemap;
|
||||
|
||||
nodemap["output"] = graph->output();
|
||||
/* local state, shader nodes can't link to nodes outside the shader graph */
|
||||
XMLReader graph_reader;
|
||||
graph_reader.node_map[ustring("output")] = graph->output();
|
||||
|
||||
for(pugi::xml_node node = graph_node.first_child(); node; node = node.next_sibling()) {
|
||||
ustring node_name(node.name());
|
||||
|
||||
if(node_name == "connect") {
|
||||
/* connect nodes */
|
||||
vector<string> from_tokens, to_tokens;
|
||||
|
||||
string_split(from_tokens, node.attribute("from").value());
|
||||
string_split(to_tokens, node.attribute("to").value());
|
||||
|
||||
if(from_tokens.size() == 2 && to_tokens.size() == 2) {
|
||||
ustring from_node_name(from_tokens[0]);
|
||||
ustring from_socket_name(from_tokens[1]);
|
||||
ustring to_node_name(to_tokens[0]);
|
||||
ustring to_socket_name(to_tokens[1]);
|
||||
|
||||
/* find nodes and sockets */
|
||||
ShaderOutput *output = NULL;
|
||||
ShaderInput *input = NULL;
|
||||
|
||||
if(graph_reader.node_map.find(from_node_name) != graph_reader.node_map.end()) {
|
||||
ShaderNode *fromnode = (ShaderNode*)graph_reader.node_map[from_node_name];
|
||||
|
||||
foreach(ShaderOutput *out, fromnode->outputs)
|
||||
if(string_iequals(xml_socket_name(out->name().c_str()), from_socket_name.c_str()))
|
||||
output = out;
|
||||
|
||||
if(!output)
|
||||
fprintf(stderr, "Unknown output socket name \"%s\" on \"%s\".\n", from_node_name.c_str(), from_socket_name.c_str());
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Unknown shader node name \"%s\".\n", from_node_name.c_str());
|
||||
|
||||
if(graph_reader.node_map.find(to_node_name) != graph_reader.node_map.end()) {
|
||||
ShaderNode *tonode = (ShaderNode*)graph_reader.node_map[to_node_name];
|
||||
|
||||
foreach(ShaderInput *in, tonode->inputs)
|
||||
if(string_iequals(xml_socket_name(in->name().c_str()), to_socket_name.c_str()))
|
||||
input = in;
|
||||
|
||||
if(!input)
|
||||
fprintf(stderr, "Unknown input socket name \"%s\" on \"%s\".\n", to_socket_name.c_str(), to_node_name.c_str());
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Unknown shader node name \"%s\".\n", to_node_name.c_str());
|
||||
|
||||
/* connect */
|
||||
if(output && input)
|
||||
graph->connect(output, input);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Invalid from or to value for connect node.\n");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
ShaderNode *snode = NULL;
|
||||
|
||||
/* ToDo: Add missing nodes
|
||||
* RGBCurvesNode, VectorCurvesNode, RGBRampNode and ConvertNode (RGB -> BW).
|
||||
*/
|
||||
|
||||
if(string_iequals(node.name(), "image_texture")) {
|
||||
ImageTextureNode *img = new ImageTextureNode();
|
||||
|
||||
xml_read_string(&img->filename, node, "src");
|
||||
img->filename = path_join(state.base, img->filename);
|
||||
|
||||
xml_read_enum_value((int*)&img->color_space, ImageTextureNode::color_space_enum, node, "color_space");
|
||||
xml_read_enum_value((int*)&img->projection, ImageTextureNode::projection_enum, node, "projection");
|
||||
xml_read_float(&img->projection_blend, node, "projection_blend");
|
||||
|
||||
/* ToDo: Interpolation */
|
||||
|
||||
snode = img;
|
||||
}
|
||||
else if(string_iequals(node.name(), "environment_texture")) {
|
||||
EnvironmentTextureNode *env = new EnvironmentTextureNode();
|
||||
|
||||
xml_read_string(&env->filename, node, "src");
|
||||
env->filename = path_join(state.base, env->filename);
|
||||
|
||||
xml_read_enum_value((int*)&env->color_space, EnvironmentTextureNode::color_space_enum, node, "color_space");
|
||||
xml_read_enum_value((int*)&env->projection, EnvironmentTextureNode::projection_enum, node, "projection");
|
||||
|
||||
snode = env;
|
||||
}
|
||||
#ifdef WITH_OSL
|
||||
else if(string_iequals(node.name(), "osl_shader")) {
|
||||
if(node_name == "osl_shader") {
|
||||
ShaderManager *manager = state.scene->shader_manager;
|
||||
|
||||
if(manager->use_osl()) {
|
||||
std::string filepath;
|
||||
|
||||
@@ -320,390 +305,54 @@ static void xml_read_shader_graph(XMLReadState& state, Shader *shader, pugi::xml
|
||||
|
||||
if(!snode) {
|
||||
fprintf(stderr, "Failed to create OSL node from \"%s\".\n", filepath.c_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "OSL node missing \"src\" attribute.\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "OSL node without using --shadingsys osl.\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if(string_iequals(node.name(), "sky_texture")) {
|
||||
SkyTextureNode *sky = new SkyTextureNode();
|
||||
|
||||
xml_read_enum_value((int*)&sky->type, SkyTextureNode::type_enum, node, "type");
|
||||
xml_read_float3(&sky->sun_direction, node, "sun_direction");
|
||||
xml_read_float(&sky->turbidity, node, "turbidity");
|
||||
xml_read_float(&sky->ground_albedo, node, "ground_albedo");
|
||||
|
||||
snode = sky;
|
||||
}
|
||||
else if(string_iequals(node.name(), "noise_texture")) {
|
||||
snode = new NoiseTextureNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "checker_texture")) {
|
||||
snode = new CheckerTextureNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "brick_texture")) {
|
||||
BrickTextureNode *brick = new BrickTextureNode();
|
||||
|
||||
xml_read_float(&brick->offset, node, "offset");
|
||||
xml_read_int(&brick->offset_frequency, node, "offset_frequency");
|
||||
xml_read_float(&brick->squash, node, "squash");
|
||||
xml_read_int(&brick->squash_frequency, node, "squash_frequency");
|
||||
|
||||
snode = brick;
|
||||
}
|
||||
else if(string_iequals(node.name(), "gradient_texture")) {
|
||||
GradientTextureNode *blend = new GradientTextureNode();
|
||||
xml_read_enum_value((int*)&blend->type, GradientTextureNode::type_enum, node, "type");
|
||||
snode = blend;
|
||||
}
|
||||
else if(string_iequals(node.name(), "voronoi_texture")) {
|
||||
VoronoiTextureNode *voronoi = new VoronoiTextureNode();
|
||||
xml_read_enum_value((int*)&voronoi->coloring, VoronoiTextureNode::coloring_enum, node, "coloring");
|
||||
snode = voronoi;
|
||||
}
|
||||
else if(string_iequals(node.name(), "musgrave_texture")) {
|
||||
MusgraveTextureNode *musgrave = new MusgraveTextureNode();
|
||||
xml_read_enum_value((int*)&musgrave->type, MusgraveTextureNode::type_enum, node, "type");
|
||||
snode = musgrave;
|
||||
}
|
||||
else if(string_iequals(node.name(), "magic_texture")) {
|
||||
MagicTextureNode *magic = new MagicTextureNode();
|
||||
xml_read_int(&magic->depth, node, "depth");
|
||||
snode = magic;
|
||||
}
|
||||
else if(string_iequals(node.name(), "wave_texture")) {
|
||||
WaveTextureNode *wave = new WaveTextureNode();
|
||||
xml_read_enum_value((int*)&wave->type, WaveTextureNode::type_enum, node, "type");
|
||||
xml_read_enum_value((int*)&wave->profile, WaveTextureNode::profile_enum, node, "profile");
|
||||
snode = wave;
|
||||
}
|
||||
else if(string_iequals(node.name(), "normal")) {
|
||||
NormalNode *normal = new NormalNode();
|
||||
xml_read_float3(&normal->direction, node, "direction");
|
||||
snode = normal;
|
||||
}
|
||||
else if(string_iequals(node.name(), "bump")) {
|
||||
BumpNode *bump = new BumpNode();
|
||||
xml_read_bool(&bump->invert, node, "invert");
|
||||
snode = bump;
|
||||
}
|
||||
else if(string_iequals(node.name(), "mapping")) {
|
||||
MappingNode *map = new MappingNode();
|
||||
|
||||
TextureMapping *texmap = &map->tex_mapping;
|
||||
xml_read_enum_value((int*) &texmap->type, TextureMapping::type_enum, node, "type");
|
||||
xml_read_enum_value((int*) &texmap->projection, TextureMapping::projection_enum, node, "projection");
|
||||
xml_read_enum_value((int*) &texmap->x_mapping, TextureMapping::mapping_enum, node, "x_mapping");
|
||||
xml_read_enum_value((int*) &texmap->y_mapping, TextureMapping::mapping_enum, node, "y_mapping");
|
||||
xml_read_enum_value((int*) &texmap->z_mapping, TextureMapping::mapping_enum, node, "z_mapping");
|
||||
xml_read_bool(&texmap->use_minmax, node, "use_minmax");
|
||||
if(texmap->use_minmax) {
|
||||
xml_read_float3(&texmap->min, node, "min");
|
||||
xml_read_float3(&texmap->max, node, "max");
|
||||
}
|
||||
xml_read_float3(&texmap->translation, node, "translation");
|
||||
xml_read_float3(&texmap->rotation, node, "rotation");
|
||||
xml_read_float3(&texmap->scale, node, "scale");
|
||||
|
||||
snode = map;
|
||||
}
|
||||
else if(string_iequals(node.name(), "anisotropic_bsdf")) {
|
||||
AnisotropicBsdfNode *aniso = new AnisotropicBsdfNode();
|
||||
xml_read_enum_value((int*)&aniso->distribution, AnisotropicBsdfNode::distribution_enum, node, "distribution");
|
||||
snode = aniso;
|
||||
}
|
||||
else if(string_iequals(node.name(), "diffuse_bsdf")) {
|
||||
snode = new DiffuseBsdfNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "translucent_bsdf")) {
|
||||
snode = new TranslucentBsdfNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "transparent_bsdf")) {
|
||||
snode = new TransparentBsdfNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "velvet_bsdf")) {
|
||||
snode = new VelvetBsdfNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "toon_bsdf")) {
|
||||
ToonBsdfNode *toon = new ToonBsdfNode();
|
||||
xml_read_enum_value((int*)&toon->component, ToonBsdfNode::component_enum, node, "component");
|
||||
snode = toon;
|
||||
}
|
||||
else if(string_iequals(node.name(), "glossy_bsdf")) {
|
||||
GlossyBsdfNode *glossy = new GlossyBsdfNode();
|
||||
xml_read_enum_value((int*)&glossy->distribution, GlossyBsdfNode::distribution_enum, node, "distribution");
|
||||
snode = glossy;
|
||||
}
|
||||
else if(string_iequals(node.name(), "glass_bsdf")) {
|
||||
GlassBsdfNode *diel = new GlassBsdfNode();
|
||||
xml_read_enum_value((int*)&diel->distribution, GlassBsdfNode::distribution_enum, node, "distribution");
|
||||
snode = diel;
|
||||
}
|
||||
else if(string_iequals(node.name(), "refraction_bsdf")) {
|
||||
RefractionBsdfNode *diel = new RefractionBsdfNode();
|
||||
xml_read_enum_value((int*)&diel->distribution, RefractionBsdfNode::distribution_enum, node, "distribution");
|
||||
snode = diel;
|
||||
}
|
||||
else if(string_iequals(node.name(), "hair_bsdf")) {
|
||||
HairBsdfNode *hair = new HairBsdfNode();
|
||||
xml_read_enum_value((int*)&hair->component, HairBsdfNode::component_enum, node, "component");
|
||||
snode = hair;
|
||||
}
|
||||
else if(string_iequals(node.name(), "emission")) {
|
||||
snode = new EmissionNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "ambient_occlusion")) {
|
||||
snode = new AmbientOcclusionNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "background")) {
|
||||
snode = new BackgroundNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "holdout")) {
|
||||
snode = new HoldoutNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "absorption_volume")) {
|
||||
snode = new AbsorptionVolumeNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "scatter_volume")) {
|
||||
snode = new ScatterVolumeNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "subsurface_scattering")) {
|
||||
SubsurfaceScatteringNode *sss = new SubsurfaceScatteringNode();
|
||||
|
||||
string falloff;
|
||||
xml_read_string(&falloff, node, "falloff");
|
||||
if(falloff == "cubic")
|
||||
sss->closure = CLOSURE_BSSRDF_CUBIC_ID;
|
||||
else if(falloff == "gaussian")
|
||||
sss->closure = CLOSURE_BSSRDF_GAUSSIAN_ID;
|
||||
else /*if(falloff == "burley")*/
|
||||
sss->closure = CLOSURE_BSSRDF_BURLEY_ID;
|
||||
|
||||
snode = sss;
|
||||
}
|
||||
else if(string_iequals(node.name(), "geometry")) {
|
||||
snode = new GeometryNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "texture_coordinate")) {
|
||||
snode = new TextureCoordinateNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "light_path")) {
|
||||
snode = new LightPathNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "light_falloff")) {
|
||||
snode = new LightFalloffNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "object_info")) {
|
||||
snode = new ObjectInfoNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "particle_info")) {
|
||||
snode = new ParticleInfoNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "hair_info")) {
|
||||
snode = new HairInfoNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "value")) {
|
||||
ValueNode *value = new ValueNode();
|
||||
xml_read_float(&value->value, node, "value");
|
||||
snode = value;
|
||||
}
|
||||
else if(string_iequals(node.name(), "color")) {
|
||||
ColorNode *color = new ColorNode();
|
||||
xml_read_float3(&color->value, node, "value");
|
||||
snode = color;
|
||||
}
|
||||
else if(string_iequals(node.name(), "mix_closure")) {
|
||||
snode = new MixClosureNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "add_closure")) {
|
||||
snode = new AddClosureNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "invert")) {
|
||||
snode = new InvertNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "mix")) {
|
||||
/* ToDo: Tag Mix case for optimization */
|
||||
MixNode *mix = new MixNode();
|
||||
xml_read_enum_value((int*)&mix->type, MixNode::type_enum, node, "type");
|
||||
xml_read_bool(&mix->use_clamp, node, "use_clamp");
|
||||
snode = mix;
|
||||
}
|
||||
else if(string_iequals(node.name(), "gamma")) {
|
||||
snode = new GammaNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "brightness")) {
|
||||
snode = new BrightContrastNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "combine_rgb")) {
|
||||
snode = new CombineRGBNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "separate_rgb")) {
|
||||
snode = new SeparateRGBNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "combine_hsv")) {
|
||||
snode = new CombineHSVNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "separate_hsv")) {
|
||||
snode = new SeparateHSVNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "combine_xyz")) {
|
||||
snode = new CombineXYZNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "separate_xyz")) {
|
||||
snode = new SeparateXYZNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "hsv")) {
|
||||
snode = new HSVNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "wavelength")) {
|
||||
snode = new WavelengthNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "blackbody")) {
|
||||
snode = new BlackbodyNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "attribute")) {
|
||||
AttributeNode *attr = new AttributeNode();
|
||||
xml_read_ustring(&attr->attribute, node, "attribute");
|
||||
snode = attr;
|
||||
}
|
||||
else if(string_iequals(node.name(), "uv_map")) {
|
||||
UVMapNode *uvm = new UVMapNode();
|
||||
xml_read_ustring(&uvm->attribute, node, "uv_map");
|
||||
snode = uvm;
|
||||
}
|
||||
else if(string_iequals(node.name(), "camera")) {
|
||||
snode = new CameraNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "fresnel")) {
|
||||
snode = new FresnelNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "layer_weight")) {
|
||||
snode = new LayerWeightNode();
|
||||
}
|
||||
else if(string_iequals(node.name(), "wireframe")) {
|
||||
WireframeNode *wire = new WireframeNode;
|
||||
xml_read_bool(&wire->use_pixel_size, node, "use_pixel_size");
|
||||
snode = wire;
|
||||
}
|
||||
else if(string_iequals(node.name(), "normal_map")) {
|
||||
NormalMapNode *nmap = new NormalMapNode;
|
||||
xml_read_ustring(&nmap->attribute, node, "attribute");
|
||||
xml_read_enum_value((int*)&nmap->space, NormalMapNode::space_enum, node, "space");
|
||||
snode = nmap;
|
||||
}
|
||||
else if(string_iequals(node.name(), "tangent")) {
|
||||
TangentNode *tangent = new TangentNode;
|
||||
xml_read_ustring(&tangent->attribute, node, "attribute");
|
||||
xml_read_enum_value((int*)&tangent->direction_type, TangentNode::direction_type_enum, node, "direction_type");
|
||||
xml_read_enum_value((int*)&tangent->axis, TangentNode::axis_enum, node, "axis");
|
||||
snode = tangent;
|
||||
}
|
||||
else if(string_iequals(node.name(), "math")) {
|
||||
MathNode *math = new MathNode();
|
||||
xml_read_enum_value((int*)&math->type, MathNode::type_enum, node, "type");
|
||||
xml_read_bool(&math->use_clamp, node, "use_clamp");
|
||||
snode = math;
|
||||
}
|
||||
else if(string_iequals(node.name(), "vector_math")) {
|
||||
VectorMathNode *vmath = new VectorMathNode();
|
||||
xml_read_enum_value((int*)&vmath->type, VectorMathNode::type_enum, node, "type");
|
||||
snode = vmath;
|
||||
}
|
||||
else if(string_iequals(node.name(), "vector_transform")) {
|
||||
VectorTransformNode *vtransform = new VectorTransformNode();
|
||||
xml_read_enum_value((int*)&vtransform->type, VectorTransformNode::type_enum, node, "type");
|
||||
xml_read_enum_value((int*)&vtransform->convert_from, VectorTransformNode::convert_space_enum, node, "convert_from");
|
||||
xml_read_enum_value((int*)&vtransform->convert_to, VectorTransformNode::convert_space_enum, node, "convert_to");
|
||||
snode = vtransform;
|
||||
}
|
||||
else if(string_iequals(node.name(), "connect")) {
|
||||
/* connect nodes */
|
||||
vector<string> from_tokens, to_tokens;
|
||||
|
||||
string_split(from_tokens, node.attribute("from").value());
|
||||
string_split(to_tokens, node.attribute("to").value());
|
||||
|
||||
if(from_tokens.size() == 2 && to_tokens.size() == 2) {
|
||||
/* find nodes and sockets */
|
||||
ShaderOutput *output = NULL;
|
||||
ShaderInput *input = NULL;
|
||||
|
||||
if(nodemap.find(from_tokens[0]) != nodemap.end()) {
|
||||
ShaderNode *fromnode = nodemap[from_tokens[0]];
|
||||
|
||||
foreach(ShaderOutput *out, fromnode->outputs)
|
||||
if(string_iequals(xml_socket_name(out->name().c_str()), from_tokens[1]))
|
||||
output = out;
|
||||
|
||||
if(!output)
|
||||
fprintf(stderr, "Unknown output socket name \"%s\" on \"%s\".\n", from_tokens[1].c_str(), from_tokens[0].c_str());
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Unknown shader node name \"%s\".\n", from_tokens[0].c_str());
|
||||
|
||||
if(nodemap.find(to_tokens[0]) != nodemap.end()) {
|
||||
ShaderNode *tonode = nodemap[to_tokens[0]];
|
||||
|
||||
foreach(ShaderInput *in, tonode->inputs)
|
||||
if(string_iequals(xml_socket_name(in->name().c_str()), to_tokens[1]))
|
||||
input = in;
|
||||
|
||||
if(!input)
|
||||
fprintf(stderr, "Unknown input socket name \"%s\" on \"%s\".\n", to_tokens[1].c_str(), to_tokens[0].c_str());
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Unknown shader node name \"%s\".\n", to_tokens[0].c_str());
|
||||
|
||||
/* connect */
|
||||
if(output && input)
|
||||
graph->connect(output, input);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Invalid from or to value for connect node.\n");
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Unknown shader node \"%s\".\n", node.name());
|
||||
#endif
|
||||
{
|
||||
/* exception for name collision */
|
||||
if(node_name == "background")
|
||||
node_name = "background_shader";
|
||||
|
||||
const NodeType *node_type = NodeType::find(node_name);
|
||||
|
||||
if(!node_type) {
|
||||
fprintf(stderr, "Unknown shader node \"%s\".\n", node.name());
|
||||
continue;
|
||||
}
|
||||
else if(node_type->type != NodeType::SHADER) {
|
||||
fprintf(stderr, "Node type \"%s\" is not a shader node.\n", node_type->name.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
snode = (ShaderNode*) node_type->create(node_type);
|
||||
}
|
||||
|
||||
xml_read_node(graph_reader, snode, node);
|
||||
|
||||
if(node_name == "image_texture") {
|
||||
ImageTextureNode *img = (ImageTextureNode*) snode;
|
||||
img->filename = path_join(state.base, img->filename.string());
|
||||
}
|
||||
else if(node_name == "environment_texture") {
|
||||
EnvironmentTextureNode *env = (EnvironmentTextureNode*) snode;
|
||||
env->filename = path_join(state.base, env->filename.string());
|
||||
}
|
||||
|
||||
if(snode) {
|
||||
/* add to graph */
|
||||
graph->add(snode);
|
||||
|
||||
/* add to map for name lookups */
|
||||
string name = "";
|
||||
xml_read_string(&name, node, "name");
|
||||
|
||||
nodemap[name] = snode;
|
||||
|
||||
/* read input values */
|
||||
for(pugi::xml_attribute attr = node.first_attribute(); attr; attr = attr.next_attribute()) {
|
||||
foreach(ShaderInput *in, snode->inputs) {
|
||||
if(string_iequals(in->name().c_str(), attr.name())) {
|
||||
switch(in->type()) {
|
||||
case SocketType::FLOAT:
|
||||
case SocketType::INT:
|
||||
xml_read_float(&in->value_float(), node, attr.name());
|
||||
break;
|
||||
case SocketType::COLOR:
|
||||
case SocketType::VECTOR:
|
||||
case SocketType::POINT:
|
||||
case SocketType::NORMAL:
|
||||
xml_read_float3(&in->value(), node, attr.name());
|
||||
break;
|
||||
case SocketType::STRING:
|
||||
xml_read_ustring( &in->value_string(), node, attr.name() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -153,28 +153,31 @@ static void set_default_value(ShaderInput *input,
|
||||
BL::BlendData& b_data,
|
||||
BL::ID& b_id)
|
||||
{
|
||||
Node *node = input->parent;
|
||||
const SocketType& socket = input->socket_type;
|
||||
|
||||
/* copy values for non linked inputs */
|
||||
switch(input->type()) {
|
||||
case SocketType::FLOAT: {
|
||||
input->set(get_float(b_sock.ptr, "default_value"));
|
||||
node->set(socket, get_float(b_sock.ptr, "default_value"));
|
||||
break;
|
||||
}
|
||||
case SocketType::INT: {
|
||||
input->set(get_int(b_sock.ptr, "default_value"));
|
||||
node->set(socket, get_int(b_sock.ptr, "default_value"));
|
||||
break;
|
||||
}
|
||||
case SocketType::COLOR: {
|
||||
input->set(float4_to_float3(get_float4(b_sock.ptr, "default_value")));
|
||||
node->set(socket, float4_to_float3(get_float4(b_sock.ptr, "default_value")));
|
||||
break;
|
||||
}
|
||||
case SocketType::NORMAL:
|
||||
case SocketType::POINT:
|
||||
case SocketType::VECTOR: {
|
||||
input->set(get_float3(b_sock.ptr, "default_value"));
|
||||
node->set(socket, get_float3(b_sock.ptr, "default_value"));
|
||||
break;
|
||||
}
|
||||
case SocketType::STRING: {
|
||||
input->set((ustring)blender_absolute_path(b_data, b_id, get_string(b_sock.ptr, "default_value")));
|
||||
node->set(socket, (ustring)blender_absolute_path(b_data, b_id, get_string(b_sock.ptr, "default_value")));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -616,7 +619,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
image->filename,
|
||||
image->filename.string(),
|
||||
image->builtin_data,
|
||||
get_image_interpolation(b_image_node),
|
||||
get_image_extension(b_image_node));
|
||||
@@ -662,7 +665,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
/* TODO(sergey): Does not work properly when we change builtin type. */
|
||||
if(b_image.is_updated()) {
|
||||
scene->image_manager->tag_reload_image(
|
||||
env->filename,
|
||||
env->filename.string(),
|
||||
env->builtin_data,
|
||||
get_image_interpolation(b_env_node),
|
||||
EXTENSION_REPEAT);
|
||||
@@ -799,7 +802,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
if(true) {
|
||||
b_point_density_node.cache_point_density(b_scene, settings);
|
||||
scene->image_manager->tag_reload_image(
|
||||
point_density->filename,
|
||||
point_density->filename.string(),
|
||||
point_density->builtin_data,
|
||||
point_density->interpolation,
|
||||
EXTENSION_CLIP);
|
||||
@@ -1153,13 +1156,12 @@ void BlenderSync::sync_materials(bool update_all)
|
||||
add_nodes(scene, b_engine, b_data, b_scene, !preview, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
ShaderNode *closure, *out;
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
diffuse->color = get_float3(b_mat->diffuse_color());
|
||||
graph->add(diffuse);
|
||||
|
||||
closure = graph->add(new DiffuseBsdfNode());
|
||||
closure->input("Color")->set(get_float3(b_mat->diffuse_color()));
|
||||
out = graph->output();
|
||||
|
||||
graph->connect(closure->output("BSDF"), out->input("Surface"));
|
||||
ShaderNode *out = graph->output();
|
||||
graph->connect(diffuse->output("BSDF"), out->input("Surface"));
|
||||
}
|
||||
|
||||
/* settings */
|
||||
@@ -1202,13 +1204,12 @@ void BlenderSync::sync_world(bool update_all)
|
||||
shader->volume_interpolation_method = get_volume_interpolation(cworld);
|
||||
}
|
||||
else if(b_world) {
|
||||
ShaderNode *closure, *out;
|
||||
BackgroundNode *background = new BackgroundNode();
|
||||
background->color = get_float3(b_world.horizon_color());
|
||||
graph->add(background);
|
||||
|
||||
closure = graph->add(new BackgroundNode());
|
||||
closure->input("Color")->set(get_float3(b_world.horizon_color()));
|
||||
out = graph->output();
|
||||
|
||||
graph->connect(closure->output("Background"), out->input("Surface"));
|
||||
ShaderNode *out = graph->output();
|
||||
graph->connect(background->output("Background"), out->input("Surface"));
|
||||
}
|
||||
|
||||
if(b_world) {
|
||||
@@ -1287,7 +1288,6 @@ void BlenderSync::sync_lamps(bool update_all)
|
||||
add_nodes(scene, b_engine, b_data, b_scene, !preview, graph, b_ntree);
|
||||
}
|
||||
else {
|
||||
ShaderNode *closure, *out;
|
||||
float strength = 1.0f;
|
||||
|
||||
if(b_lamp->type() == BL::Lamp::type_POINT ||
|
||||
@@ -1297,12 +1297,13 @@ void BlenderSync::sync_lamps(bool update_all)
|
||||
strength = 100.0f;
|
||||
}
|
||||
|
||||
closure = graph->add(new EmissionNode());
|
||||
closure->input("Color")->set(get_float3(b_lamp->color()));
|
||||
closure->input("Strength")->set(strength);
|
||||
out = graph->output();
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
emission->color = get_float3(b_lamp->color());
|
||||
emission->strength = strength;
|
||||
graph->add(emission);
|
||||
|
||||
graph->connect(closure->output("Emission"), out->input("Surface"));
|
||||
ShaderNode *out = graph->output();
|
||||
graph->connect(emission->output("Emission"), out->input("Surface"));
|
||||
}
|
||||
|
||||
shader->set_graph(graph);
|
||||
|
@@ -230,6 +230,7 @@ void BVHBuild::add_references(BVHRange& root)
|
||||
foreach(Object *ob, objects) {
|
||||
if(params.top_level) {
|
||||
if(!ob->is_traceable()) {
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
if(!ob->mesh->is_instanced())
|
||||
|
@@ -82,6 +82,12 @@ void Node::set(const SocketType& input, int value)
|
||||
get_socket_value<int>(this, input) = value;
|
||||
}
|
||||
|
||||
void Node::set(const SocketType& input, uint value)
|
||||
{
|
||||
assert(input.type == SocketType::UINT);
|
||||
get_socket_value<uint>(this, input) = value;
|
||||
}
|
||||
|
||||
void Node::set(const SocketType& input, float value)
|
||||
{
|
||||
assert(input.type == SocketType::FLOAT);
|
||||
@@ -198,6 +204,12 @@ int Node::get_int(const SocketType& input) const
|
||||
return get_socket_value<int>(this, input);
|
||||
}
|
||||
|
||||
uint Node::get_uint(const SocketType& input) const
|
||||
{
|
||||
assert(input.type == SocketType::UINT);
|
||||
return get_socket_value<uint>(this, input);
|
||||
}
|
||||
|
||||
float Node::get_float(const SocketType& input) const
|
||||
{
|
||||
assert(input.type == SocketType::FLOAT);
|
||||
|
@@ -38,6 +38,7 @@ struct Node
|
||||
/* set values */
|
||||
void set(const SocketType& input, bool value);
|
||||
void set(const SocketType& input, int value);
|
||||
void set(const SocketType& input, uint value);
|
||||
void set(const SocketType& input, float value);
|
||||
void set(const SocketType& input, float2 value);
|
||||
void set(const SocketType& input, float3 value);
|
||||
@@ -60,6 +61,7 @@ struct Node
|
||||
/* get values */
|
||||
bool get_bool(const SocketType& input) const;
|
||||
int get_int(const SocketType& input) const;
|
||||
uint get_uint(const SocketType& input) const;
|
||||
float get_float(const SocketType& input) const;
|
||||
float2 get_float2(const SocketType& input) const;
|
||||
float3 get_float3(const SocketType& input) const;
|
||||
|
@@ -41,6 +41,7 @@ size_t SocketType::size(Type type)
|
||||
case BOOLEAN: return sizeof(bool);
|
||||
case FLOAT: return sizeof(float);
|
||||
case INT: return sizeof(int);
|
||||
case UINT: return sizeof(uint);
|
||||
case COLOR: return sizeof(float3);
|
||||
case VECTOR: return sizeof(float3);
|
||||
case POINT: return sizeof(float3);
|
||||
|
@@ -39,6 +39,7 @@ struct SocketType
|
||||
BOOLEAN,
|
||||
FLOAT,
|
||||
INT,
|
||||
UINT,
|
||||
COLOR,
|
||||
VECTOR,
|
||||
POINT,
|
||||
@@ -154,7 +155,7 @@ const NodeType *structname::register_type()
|
||||
#define SOCKET_DEFINE(name, ui_name, default_value, datatype, TYPE, flags, ...) \
|
||||
{ \
|
||||
static datatype defval = default_value; \
|
||||
assert(SOCKET_SIZEOF(T, name) == sizeof(datatype)); \
|
||||
CHECK_TYPE(((T *)1)->name, datatype); \
|
||||
type->register_input(ustring(#name), ustring(ui_name), TYPE, SOCKET_OFFSETOF(T, name), &defval, NULL, NULL, flags, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
@@ -162,6 +163,8 @@ const NodeType *structname::register_type()
|
||||
SOCKET_DEFINE(name, ui_name, default_value, bool, SocketType::BOOLEAN, 0, ##__VA_ARGS__)
|
||||
#define SOCKET_INT(name, ui_name, default_value, ...) \
|
||||
SOCKET_DEFINE(name, ui_name, default_value, int, SocketType::INT, 0, ##__VA_ARGS__)
|
||||
#define SOCKET_UINT(name, ui_name, default_value, ...) \
|
||||
SOCKET_DEFINE(name, ui_name, default_value, uint, SocketType::UINT, 0, ##__VA_ARGS__)
|
||||
#define SOCKET_FLOAT(name, ui_name, default_value, ...) \
|
||||
SOCKET_DEFINE(name, ui_name, default_value, float, SocketType::FLOAT, 0, ##__VA_ARGS__)
|
||||
#define SOCKET_COLOR(name, ui_name, default_value, ...) \
|
||||
|
@@ -108,6 +108,11 @@ void xml_read_node(XMLReader& reader, Node *node, pugi::xml_node xml_node)
|
||||
node->set(socket, (int)atoi(attr.value()));
|
||||
break;
|
||||
}
|
||||
case SocketType::UINT:
|
||||
{
|
||||
node->set(socket, (uint)atoi(attr.value()));
|
||||
break;
|
||||
}
|
||||
case SocketType::INT_ARRAY:
|
||||
{
|
||||
vector<string> tokens;
|
||||
@@ -310,6 +315,11 @@ pugi::xml_node xml_write_node(Node *node, pugi::xml_node xml_root)
|
||||
attr = node->get_int(socket);
|
||||
break;
|
||||
}
|
||||
case SocketType::UINT:
|
||||
{
|
||||
attr = node->get_uint(socket);
|
||||
break;
|
||||
}
|
||||
case SocketType::INT_ARRAY:
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
@@ -276,7 +276,7 @@ ccl_device float3 bsdf_microfacet_ggx_eval_reflect(const ShaderClosure *sc, cons
|
||||
bool m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID;
|
||||
float3 N = sc->N;
|
||||
|
||||
if(m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
if(m_refractive || alpha_x*alpha_y <= 1e-7f)
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
@@ -367,7 +367,7 @@ ccl_device float3 bsdf_microfacet_ggx_eval_transmit(const ShaderClosure *sc, con
|
||||
bool m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID;
|
||||
float3 N = sc->N;
|
||||
|
||||
if(!m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
if(!m_refractive || alpha_x*alpha_y <= 1e-7f)
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
@@ -450,7 +450,7 @@ ccl_device int bsdf_microfacet_ggx_sample(KernelGlobals *kg, const ShaderClosure
|
||||
*omega_in = 2 * cosMO * m - I;
|
||||
|
||||
if(dot(Ng, *omega_in) > 0) {
|
||||
if(fmaxf(alpha_x, alpha_y) <= 1e-4f) {
|
||||
if(alpha_x*alpha_y <= 1e-7f) {
|
||||
/* some high number for MIS */
|
||||
*pdf = 1e6f;
|
||||
*eval = make_float3(1e6f, 1e6f, 1e6f);
|
||||
@@ -539,7 +539,7 @@ ccl_device int bsdf_microfacet_ggx_sample(KernelGlobals *kg, const ShaderClosure
|
||||
*domega_in_dy = dTdy;
|
||||
#endif
|
||||
|
||||
if(fmaxf(alpha_x, alpha_y) <= 1e-4f || fabsf(m_eta - 1.0f) < 1e-4f) {
|
||||
if(alpha_x*alpha_y <= 1e-7f || fabsf(m_eta - 1.0f) < 1e-4f) {
|
||||
/* some high number for MIS */
|
||||
*pdf = 1e6f;
|
||||
*eval = make_float3(1e6f, 1e6f, 1e6f);
|
||||
@@ -622,7 +622,7 @@ ccl_device float3 bsdf_microfacet_beckmann_eval_reflect(const ShaderClosure *sc,
|
||||
bool m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID;
|
||||
float3 N = sc->N;
|
||||
|
||||
if(m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
if(m_refractive || alpha_x*alpha_y <= 1e-7f)
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
@@ -716,7 +716,7 @@ ccl_device float3 bsdf_microfacet_beckmann_eval_transmit(const ShaderClosure *sc
|
||||
bool m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID;
|
||||
float3 N = sc->N;
|
||||
|
||||
if(!m_refractive || fmaxf(alpha_x, alpha_y) <= 1e-4f)
|
||||
if(!m_refractive || alpha_x*alpha_y <= 1e-7f)
|
||||
return make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float cosNO = dot(N, I);
|
||||
@@ -798,7 +798,7 @@ ccl_device int bsdf_microfacet_beckmann_sample(KernelGlobals *kg, const ShaderCl
|
||||
*omega_in = 2 * cosMO * m - I;
|
||||
|
||||
if(dot(Ng, *omega_in) > 0) {
|
||||
if(fmaxf(alpha_x, alpha_y) <= 1e-4f) {
|
||||
if(alpha_x*alpha_y <= 1e-7f) {
|
||||
/* some high number for MIS */
|
||||
*pdf = 1e6f;
|
||||
*eval = make_float3(1e6f, 1e6f, 1e6f);
|
||||
@@ -889,7 +889,7 @@ ccl_device int bsdf_microfacet_beckmann_sample(KernelGlobals *kg, const ShaderCl
|
||||
*domega_in_dy = dTdy;
|
||||
#endif
|
||||
|
||||
if(fmaxf(alpha_x, alpha_y) <= 1e-4f || fabsf(m_eta - 1.0f) < 1e-4f) {
|
||||
if(alpha_x*alpha_y <= 1e-7f || fabsf(m_eta - 1.0f) < 1e-4f) {
|
||||
/* some high number for MIS */
|
||||
*pdf = 1e6f;
|
||||
*eval = make_float3(1e6f, 1e6f, 1e6f);
|
||||
|
@@ -292,7 +292,6 @@ enum PathRayFlag {
|
||||
PATH_RAY_CURVE = 512, /* visibility flag to define curve segments */
|
||||
PATH_RAY_VOLUME_SCATTER = 1024, /* volume scattering */
|
||||
|
||||
/* note that these can use maximum 12 bits, the other are for layers */
|
||||
PATH_RAY_ALL_VISIBILITY = (1|2|4|8|16|32|64|128|256|512|1024),
|
||||
|
||||
PATH_RAY_MIS_SKIP = 2048,
|
||||
|
@@ -276,7 +276,7 @@ ccl_device float kernel_volume_distance_sample(float max_t, float3 sigma_t, int
|
||||
float sample_t = min(max_t, -logf(1.0f - xi*(1.0f - sample_transmittance))/sample_sigma_t);
|
||||
|
||||
*transmittance = volume_color_transmittance(sigma_t, sample_t);
|
||||
*pdf = (sigma_t * *transmittance)/(make_float3(1.0f, 1.0f, 1.0f) - full_transmittance);
|
||||
*pdf = safe_divide_color(sigma_t * *transmittance, make_float3(1.0f, 1.0f, 1.0f) - full_transmittance);
|
||||
|
||||
/* todo: optimization: when taken together with hit/miss decision,
|
||||
* the full_transmittance cancels out drops out and xi does not
|
||||
@@ -290,7 +290,7 @@ ccl_device float3 kernel_volume_distance_pdf(float max_t, float3 sigma_t, float
|
||||
float3 full_transmittance = volume_color_transmittance(sigma_t, max_t);
|
||||
float3 transmittance = volume_color_transmittance(sigma_t, sample_t);
|
||||
|
||||
return (sigma_t * transmittance)/(make_float3(1.0f, 1.0f, 1.0f) - full_transmittance);
|
||||
return safe_divide_color(sigma_t * transmittance, make_float3(1.0f, 1.0f, 1.0f) - full_transmittance);
|
||||
}
|
||||
|
||||
/* Emission */
|
||||
@@ -625,11 +625,13 @@ ccl_device void kernel_volume_decoupled_record(KernelGlobals *kg, PathState *sta
|
||||
const int global_max_steps = kernel_data.integrator.volume_max_steps;
|
||||
step_size = kernel_data.integrator.volume_step_size;
|
||||
/* compute exact steps in advance for malloc */
|
||||
max_steps = max((int)ceilf(ray->t/step_size), 1);
|
||||
if(max_steps > global_max_steps) {
|
||||
if(ray->t > global_max_steps*step_size) {
|
||||
max_steps = global_max_steps;
|
||||
step_size = ray->t / (float)max_steps;
|
||||
}
|
||||
else {
|
||||
max_steps = max((int)ceilf(ray->t/step_size), 1);
|
||||
}
|
||||
#ifdef __KERNEL_CPU__
|
||||
/* NOTE: For the branched path tracing it's possible to have direct
|
||||
* and indirect light integration both having volume segments allocated.
|
||||
|
@@ -45,9 +45,9 @@ shader node_anisotropic_bsdf(
|
||||
RoughnessV = Roughness / (1.0 - aniso);
|
||||
}
|
||||
|
||||
if (distribution == "Sharp")
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * reflection(Normal);
|
||||
else if (distribution == "Beckmann")
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * microfacet_beckmann_aniso(Normal, T, RoughnessU, RoughnessV);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * microfacet_ggx_aniso(Normal, T, RoughnessU, RoughnessV);
|
||||
|
@@ -44,7 +44,7 @@ shader node_environment_texture(
|
||||
matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
vector Vector = P,
|
||||
string filename = "",
|
||||
string projection = "Equirectangular",
|
||||
string projection = "equirectangular",
|
||||
string interpolation = "linear",
|
||||
string color_space = "sRGB",
|
||||
int is_float = 1,
|
||||
@@ -59,7 +59,7 @@ shader node_environment_texture(
|
||||
|
||||
p = normalize(p);
|
||||
|
||||
if (projection == "Equirectangular")
|
||||
if (projection == "equirectangular")
|
||||
p = environment_texture_direction_to_equirectangular(p);
|
||||
else
|
||||
p = environment_texture_direction_to_mirrorball(p);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
shader node_glass_bsdf(
|
||||
color Color = 0.8,
|
||||
string distribution = "Sharp",
|
||||
string distribution = "sharp",
|
||||
float Roughness = 0.2,
|
||||
float IOR = 1.45,
|
||||
normal Normal = N,
|
||||
@@ -30,9 +30,9 @@ shader node_glass_bsdf(
|
||||
float cosi = dot(I, Normal);
|
||||
float Fr = fresnel_dielectric_cos(cosi, eta);
|
||||
|
||||
if (distribution == "Sharp")
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * (Fr * reflection(Normal) + (1.0 - Fr) * refraction(Normal, eta));
|
||||
else if (distribution == "Beckmann")
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * (Fr * microfacet_beckmann(Normal, Roughness) +
|
||||
(1.0 - Fr) * microfacet_beckmann_refraction(Normal, Roughness, eta));
|
||||
else if (distribution == "GGX")
|
||||
|
@@ -24,9 +24,9 @@ shader node_glossy_bsdf(
|
||||
normal Normal = N,
|
||||
output closure color BSDF = 0)
|
||||
{
|
||||
if (distribution == "Sharp")
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * reflection(Normal);
|
||||
else if (distribution == "Beckmann")
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * microfacet_beckmann(Normal, Roughness);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * microfacet_ggx(Normal, Roughness);
|
||||
|
@@ -29,31 +29,31 @@ float gradient(point p, string type)
|
||||
|
||||
float result = 0.0;
|
||||
|
||||
if (type == "Linear") {
|
||||
if (type == "linear") {
|
||||
result = x;
|
||||
}
|
||||
else if (type == "Quadratic") {
|
||||
else if (type == "quadratic") {
|
||||
float r = max(x, 0.0);
|
||||
result = r * r;
|
||||
}
|
||||
else if (type == "Easing") {
|
||||
else if (type == "easing") {
|
||||
float r = min(max(x, 0.0), 1.0);
|
||||
float t = r * r;
|
||||
|
||||
result = (3.0 * t - 2.0 * t * r);
|
||||
}
|
||||
else if (type == "Diagonal") {
|
||||
else if (type == "diagonal") {
|
||||
result = (x + y) * 0.5;
|
||||
}
|
||||
else if (type == "Radial") {
|
||||
else if (type == "radial") {
|
||||
result = atan2(y, x) / M_2PI + 0.5;
|
||||
}
|
||||
else {
|
||||
float r = max(1.0 - sqrt(x * x + y * y + z * z), 0.0);
|
||||
|
||||
if (type == "Quadratic Sphere")
|
||||
if (type == "quadratic_sphere")
|
||||
result = r * r;
|
||||
else if (type == "Spherical")
|
||||
else if (type == "spherical")
|
||||
result = r;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ float gradient(point p, string type)
|
||||
shader node_gradient_texture(
|
||||
int use_mapping = 0,
|
||||
matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
string type = "Linear",
|
||||
string type = "linear",
|
||||
point Vector = P,
|
||||
output float Fac = 0.0,
|
||||
output color Color = 0.0)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
shader node_hair_bsdf(
|
||||
color Color = 0.8,
|
||||
string component = "Reflection",
|
||||
string component = "reflection",
|
||||
float Offset = 0.0,
|
||||
float RoughnessU = 0.1,
|
||||
float RoughnessV = 1.0,
|
||||
@@ -37,7 +37,7 @@ shader node_hair_bsdf(
|
||||
BSDF = transparent();
|
||||
}
|
||||
else {
|
||||
if (component == "Reflection")
|
||||
if (component == "reflection")
|
||||
BSDF = Color * hair_reflection(Normal, roughnessh, roughnessv, normalize(dPdv), 0.0);
|
||||
else
|
||||
BSDF = Color * hair_transmission(Normal, roughnessh, roughnessv, normalize(dPdv), 0.0);
|
||||
@@ -48,7 +48,7 @@ shader node_hair_bsdf(
|
||||
BSDF = transparent();
|
||||
}
|
||||
else {
|
||||
if (component == "Reflection")
|
||||
if (component == "reflection")
|
||||
BSDF = Color * hair_reflection(Normal, roughnessh, roughnessv, dPdu, -Offset);
|
||||
else
|
||||
BSDF = Color * hair_transmission(Normal, roughnessh, roughnessv, dPdu, -Offset);
|
||||
|
@@ -86,7 +86,7 @@ shader node_image_texture(
|
||||
point Vector = P,
|
||||
string filename = "",
|
||||
string color_space = "sRGB",
|
||||
string projection = "Flat",
|
||||
string projection = "flat",
|
||||
string interpolation = "smartcubic",
|
||||
string wrap = "periodic",
|
||||
float projection_blend = 0.0,
|
||||
@@ -100,7 +100,7 @@ shader node_image_texture(
|
||||
if (use_mapping)
|
||||
p = transform(mapping, p);
|
||||
|
||||
if (projection == "Flat") {
|
||||
if (projection == "flat") {
|
||||
Color = image_texture_lookup(filename,
|
||||
color_space,
|
||||
p[0], p[1],
|
||||
@@ -110,7 +110,7 @@ shader node_image_texture(
|
||||
interpolation,
|
||||
wrap);
|
||||
}
|
||||
else if (projection == "Box") {
|
||||
else if (projection == "box") {
|
||||
/* object space normal */
|
||||
vector Nob = transform("world", "object", N);
|
||||
|
||||
@@ -210,7 +210,7 @@ shader node_image_texture(
|
||||
Alpha += weight[2] * tmp_alpha;
|
||||
}
|
||||
}
|
||||
else if (projection == "Sphere") {
|
||||
else if (projection == "sphere") {
|
||||
point projected = map_to_sphere(texco_remap_square(p));
|
||||
Color = image_texture_lookup(filename,
|
||||
color_space,
|
||||
@@ -221,7 +221,7 @@ shader node_image_texture(
|
||||
interpolation,
|
||||
wrap);
|
||||
}
|
||||
else if (projection == "Tube") {
|
||||
else if (projection == "tube") {
|
||||
point projected = map_to_tube(texco_remap_square(p));
|
||||
Color = image_texture_lookup(filename,
|
||||
color_space,
|
||||
|
@@ -49,7 +49,7 @@ float safe_log(float a, float b)
|
||||
}
|
||||
|
||||
shader node_math(
|
||||
string type = "Add",
|
||||
string type = "add",
|
||||
int use_clamp = 0,
|
||||
float Value1 = 0.0,
|
||||
float Value2 = 0.0,
|
||||
@@ -57,43 +57,43 @@ shader node_math(
|
||||
{
|
||||
/* OSL asin, acos, pow check for values that could give rise to nan */
|
||||
|
||||
if (type == "Add")
|
||||
if (type == "add")
|
||||
Value = Value1 + Value2;
|
||||
else if (type == "Subtract")
|
||||
else if (type == "subtract")
|
||||
Value = Value1 - Value2;
|
||||
else if (type == "Multiply")
|
||||
else if (type == "multiply")
|
||||
Value = Value1 * Value2;
|
||||
else if (type == "Divide")
|
||||
else if (type == "divide")
|
||||
Value = safe_divide(Value1, Value2);
|
||||
else if (type == "Sine")
|
||||
else if (type == "sine")
|
||||
Value = sin(Value1);
|
||||
else if (type == "Cosine")
|
||||
else if (type == "cosine")
|
||||
Value = cos(Value1);
|
||||
else if (type == "Tangent")
|
||||
else if (type == "tangent")
|
||||
Value = tan(Value1);
|
||||
else if (type == "Arcsine")
|
||||
else if (type == "arcsine")
|
||||
Value = asin(Value1);
|
||||
else if (type == "Arccosine")
|
||||
else if (type == "arccosine")
|
||||
Value = acos(Value1);
|
||||
else if (type == "Arctangent")
|
||||
else if (type == "arctangent")
|
||||
Value = atan(Value1);
|
||||
else if (type == "Power")
|
||||
else if (type == "power")
|
||||
Value = pow(Value1, Value2);
|
||||
else if (type == "Logarithm")
|
||||
else if (type == "logarithm")
|
||||
Value = safe_log(Value1, Value2);
|
||||
else if (type == "Minimum")
|
||||
else if (type == "minimum")
|
||||
Value = min(Value1, Value2);
|
||||
else if (type == "Maximum")
|
||||
else if (type == "maximum")
|
||||
Value = max(Value1, Value2);
|
||||
else if (type == "Round")
|
||||
else if (type == "round")
|
||||
Value = floor(Value1 + 0.5);
|
||||
else if (type == "Less Than")
|
||||
else if (type == "less_than")
|
||||
Value = Value1 < Value2;
|
||||
else if (type == "Greater Than")
|
||||
else if (type == "greater_than")
|
||||
Value = Value1 > Value2;
|
||||
else if (type == "Modulo")
|
||||
else if (type == "modulo")
|
||||
Value = safe_modulo(Value1, Value2);
|
||||
else if (type == "Absolute")
|
||||
else if (type == "absolute")
|
||||
Value = fabs(Value1);
|
||||
|
||||
if (use_clamp)
|
||||
|
@@ -277,7 +277,7 @@ color node_mix_clamp(color col)
|
||||
}
|
||||
|
||||
shader node_mix(
|
||||
string type = "Mix",
|
||||
string type = "mix",
|
||||
int use_clamp = 0,
|
||||
float Fac = 0.5,
|
||||
color Color1 = 0.0,
|
||||
@@ -286,41 +286,41 @@ shader node_mix(
|
||||
{
|
||||
float t = clamp(Fac, 0.0, 1.0);
|
||||
|
||||
if (type == "Mix")
|
||||
if (type == "mix")
|
||||
Color = node_mix_blend(t, Color1, Color2);
|
||||
if (type == "Add")
|
||||
if (type == "add")
|
||||
Color = node_mix_add(t, Color1, Color2);
|
||||
if (type == "Multiply")
|
||||
if (type == "multiply")
|
||||
Color = node_mix_mul(t, Color1, Color2);
|
||||
if (type == "Screen")
|
||||
if (type == "screen")
|
||||
Color = node_mix_screen(t, Color1, Color2);
|
||||
if (type == "Overlay")
|
||||
if (type == "overlay")
|
||||
Color = node_mix_overlay(t, Color1, Color2);
|
||||
if (type == "Subtract")
|
||||
if (type == "subtract")
|
||||
Color = node_mix_sub(t, Color1, Color2);
|
||||
if (type == "Divide")
|
||||
if (type == "divide")
|
||||
Color = node_mix_div(t, Color1, Color2);
|
||||
if (type == "Difference")
|
||||
if (type == "difference")
|
||||
Color = node_mix_diff(t, Color1, Color2);
|
||||
if (type == "Darken")
|
||||
if (type == "darken")
|
||||
Color = node_mix_dark(t, Color1, Color2);
|
||||
if (type == "Lighten")
|
||||
if (type == "lighten")
|
||||
Color = node_mix_light(t, Color1, Color2);
|
||||
if (type == "Dodge")
|
||||
if (type == "dodge")
|
||||
Color = node_mix_dodge(t, Color1, Color2);
|
||||
if (type == "Burn")
|
||||
if (type == "burn")
|
||||
Color = node_mix_burn(t, Color1, Color2);
|
||||
if (type == "Hue")
|
||||
if (type == "hue")
|
||||
Color = node_mix_hue(t, Color1, Color2);
|
||||
if (type == "Saturation")
|
||||
if (type == "saturation")
|
||||
Color = node_mix_sat(t, Color1, Color2);
|
||||
if (type == "Value")
|
||||
if (type == "value")
|
||||
Color = node_mix_val (t, Color1, Color2);
|
||||
if (type == "Color")
|
||||
if (type == "color")
|
||||
Color = node_mix_color(t, Color1, Color2);
|
||||
if (type == "Soft Light")
|
||||
if (type == "soft_light")
|
||||
Color = node_mix_soft(t, Color1, Color2);
|
||||
if (type == "Linear Light")
|
||||
if (type == "linear_light")
|
||||
Color = node_mix_linear(t, Color1, Color2);
|
||||
|
||||
if (use_clamp)
|
||||
|
@@ -210,15 +210,15 @@ shader node_musgrave_texture(
|
||||
|
||||
p = p * Scale;
|
||||
|
||||
if (type == "Multifractal")
|
||||
if (type == "multifractal")
|
||||
Fac = intensity * noise_musgrave_multi_fractal(p, dimension, lacunarity, octaves);
|
||||
else if (type == "fBM")
|
||||
Fac = intensity * noise_musgrave_fBm(p, dimension, lacunarity, octaves);
|
||||
else if (type == "Hybrid Multifractal")
|
||||
else if (type == "hybrid_multifractal")
|
||||
Fac = intensity * noise_musgrave_hybrid_multi_fractal(p, dimension, lacunarity, octaves, Offset, Gain);
|
||||
else if (type == "Ridged Multifractal")
|
||||
else if (type == "ridged_multifractal")
|
||||
Fac = intensity * noise_musgrave_ridged_multi_fractal(p, dimension, lacunarity, octaves, Offset, Gain);
|
||||
else if (type == "Hetero Terrain")
|
||||
else if (type == "hetero_terrain")
|
||||
Fac = intensity * noise_musgrave_hetero_terrain(p, dimension, lacunarity, octaves, Offset);
|
||||
|
||||
Color = color(Fac, Fac, Fac);
|
||||
|
@@ -20,14 +20,14 @@ shader node_normal_map(
|
||||
normal NormalIn = N,
|
||||
float Strength = 1.0,
|
||||
color Color = color(0.5, 0.5, 1.0),
|
||||
string space = "Tangent",
|
||||
string space = "tangent",
|
||||
string attr_name = "geom:tangent",
|
||||
string attr_sign_name = "geom:tangent_sign",
|
||||
output normal Normal = NormalIn)
|
||||
{
|
||||
color mcolor = 2.0 * color(Color[0] - 0.5, Color[1] - 0.5, Color[2] - 0.5);
|
||||
|
||||
if (space == "Tangent") {
|
||||
if (space == "tangent") {
|
||||
vector tangent;
|
||||
vector ninterp;
|
||||
float tangent_sign;
|
||||
@@ -53,20 +53,20 @@ shader node_normal_map(
|
||||
Normal = normal(0, 0, 0);
|
||||
}
|
||||
}
|
||||
else if (space == "Object") {
|
||||
else if (space == "object") {
|
||||
Normal = normalize(transform("object", "world", vector(mcolor)));
|
||||
}
|
||||
else if (space == "World") {
|
||||
else if (space == "world") {
|
||||
Normal = normalize(vector(mcolor));
|
||||
}
|
||||
else if (space == "Blender Object") {
|
||||
else if (space == "blender_object") {
|
||||
/* strange blender convention */
|
||||
mcolor[1] = -mcolor[1];
|
||||
mcolor[2] = -mcolor[2];
|
||||
|
||||
Normal = normalize(transform("object", "world", vector(mcolor)));
|
||||
}
|
||||
else if (space == "Blender World") {
|
||||
else if (space == "blender_world") {
|
||||
/* strange blender convention */
|
||||
mcolor[1] = -mcolor[1];
|
||||
mcolor[2] = -mcolor[2];
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
shader node_refraction_bsdf(
|
||||
color Color = 0.8,
|
||||
string distribution = "Sharp",
|
||||
string distribution = "sharp",
|
||||
float Roughness = 0.2,
|
||||
float IOR = 1.45,
|
||||
normal Normal = N,
|
||||
@@ -27,9 +27,9 @@ shader node_refraction_bsdf(
|
||||
float f = max(IOR, 1e-5);
|
||||
float eta = backfacing() ? 1.0 / f : f;
|
||||
|
||||
if (distribution == "Sharp")
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * refraction(Normal, eta);
|
||||
else if (distribution == "Beckmann")
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * microfacet_beckmann_refraction(Normal, Roughness, eta);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * microfacet_ggx_refraction(Normal, Roughness, eta);
|
||||
|
@@ -111,7 +111,7 @@ shader node_sky_texture(
|
||||
int use_mapping = 0,
|
||||
matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
vector Vector = P,
|
||||
string sky_model = "Hosek / Wilkie",
|
||||
string type = "hosek_wilkie",
|
||||
float theta = 0.0,
|
||||
float phi = 0.0,
|
||||
color radiance = color(0.0, 0.0, 0.0),
|
||||
@@ -125,7 +125,7 @@ shader node_sky_texture(
|
||||
if (use_mapping)
|
||||
p = transform(mapping, p);
|
||||
|
||||
if (sky_model == "Hosek / Wilkie")
|
||||
if (type == "hosek_wilkie")
|
||||
Color = sky_radiance_new(p, phi, theta, radiance, config_x, config_y, config_z);
|
||||
else
|
||||
Color = sky_radiance_old(p, phi, theta, radiance, config_x, config_y, config_z);
|
||||
|
@@ -22,13 +22,13 @@ shader node_subsurface_scattering(
|
||||
vector Radius = vector(0.1, 0.1, 0.1),
|
||||
float TextureBlur = 0.0,
|
||||
float Sharpness = 0.0,
|
||||
string falloff = "Cubic",
|
||||
string falloff = "cubic",
|
||||
normal Normal = N,
|
||||
output closure color BSSRDF = 0)
|
||||
{
|
||||
if (falloff == "Gaussian")
|
||||
if (falloff == "gaussian")
|
||||
BSSRDF = Color * bssrdf_gaussian(Normal, Scale * Radius, TextureBlur);
|
||||
else if (falloff == "Cubic")
|
||||
else if (falloff == "cubic")
|
||||
BSSRDF = Color * bssrdf_cubic(Normal, Scale * Radius, TextureBlur, Sharpness);
|
||||
else
|
||||
BSSRDF = Color * bssrdf_burley(Normal, Scale * Radius, TextureBlur, Color);
|
||||
|
@@ -19,24 +19,24 @@
|
||||
shader node_tangent(
|
||||
normal NormalIn = N,
|
||||
string attr_name = "geom:tangent",
|
||||
string direction_type = "Radial",
|
||||
string axis = "Z",
|
||||
string direction_type = "radial",
|
||||
string axis = "z",
|
||||
output normal Tangent = normalize(dPdu))
|
||||
{
|
||||
vector T;
|
||||
|
||||
if (direction_type == "UV Map") {
|
||||
if (direction_type == "uv_map") {
|
||||
getattribute(attr_name, T);
|
||||
}
|
||||
else if (direction_type == "Radial") {
|
||||
else if (direction_type == "radial") {
|
||||
point generated;
|
||||
|
||||
if (!getattribute("geom:generated", generated))
|
||||
generated = P;
|
||||
|
||||
if (axis == "X")
|
||||
if (axis == "x")
|
||||
T = vector(0.0, -(generated[2] - 0.5), (generated[1] - 0.5));
|
||||
else if (axis == "Y")
|
||||
else if (axis == "y")
|
||||
T = vector(-(generated[2] - 0.5), 0.0, (generated[0] - 0.5));
|
||||
else
|
||||
T = vector(-(generated[1] - 0.5), (generated[0] - 0.5), 0.0);
|
||||
|
@@ -18,15 +18,15 @@
|
||||
|
||||
shader node_toon_bsdf(
|
||||
color Color = 0.8,
|
||||
string component = "Diffuse",
|
||||
string component = "diffuse",
|
||||
float Size = 0.5,
|
||||
float Smooth = 0.0,
|
||||
normal Normal = N,
|
||||
output closure color BSDF = 0)
|
||||
{
|
||||
if (component == "Diffuse")
|
||||
if (component == "diffuse")
|
||||
BSDF = Color * diffuse_toon(Normal, Size, Smooth);
|
||||
else if (component == "Glossy")
|
||||
else if (component == "glossy")
|
||||
BSDF = Color * glossy_toon(Normal, Size, Smooth);
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
shader node_uv_map(
|
||||
int from_dupli = 0,
|
||||
string name = "",
|
||||
string attribute = "",
|
||||
string bump_offset = "center",
|
||||
output point UV = point(0.0, 0.0, 0.0))
|
||||
{
|
||||
@@ -26,10 +26,10 @@ shader node_uv_map(
|
||||
getattribute("geom:dupli_uv", UV);
|
||||
}
|
||||
else {
|
||||
if (name == "")
|
||||
if (attribute == "")
|
||||
getattribute("geom:uv", UV);
|
||||
else
|
||||
getattribute(name, UV);
|
||||
getattribute(attribute, UV);
|
||||
}
|
||||
|
||||
if (bump_offset == "dx") {
|
||||
|
@@ -17,33 +17,33 @@
|
||||
#include "stdosl.h"
|
||||
|
||||
shader node_vector_math(
|
||||
string type = "Add",
|
||||
string type = "add",
|
||||
vector Vector1 = vector(0.0, 0.0, 0.0),
|
||||
vector Vector2 = vector(0.0, 0.0, 0.0),
|
||||
output float Value = 0.0,
|
||||
output vector Vector = vector(0.0, 0.0, 0.0))
|
||||
{
|
||||
if (type == "Add") {
|
||||
if (type == "add") {
|
||||
Vector = Vector1 + Vector2;
|
||||
Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2])) / 3.0;
|
||||
}
|
||||
else if (type == "Subtract") {
|
||||
else if (type == "subtract") {
|
||||
Vector = Vector1 - Vector2;
|
||||
Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2])) / 3.0;
|
||||
}
|
||||
else if (type == "Average") {
|
||||
else if (type == "average") {
|
||||
Value = length(Vector1 + Vector2);
|
||||
Vector = normalize(Vector1 + Vector2);
|
||||
}
|
||||
else if (type == "Dot Product") {
|
||||
else if (type == "dot_product") {
|
||||
Value = dot(Vector1, Vector2);
|
||||
}
|
||||
else if (type == "Cross Product") {
|
||||
else if (type == "cross_product") {
|
||||
vector c = cross(Vector1, Vector2);
|
||||
Value = length(c);
|
||||
Vector = normalize(c);
|
||||
}
|
||||
else if (type == "Normalize") {
|
||||
else if (type == "normalize") {
|
||||
Value = length(Vector1);
|
||||
Vector = normalize(Vector1);
|
||||
}
|
||||
|
@@ -17,18 +17,18 @@
|
||||
#include "stdosl.h"
|
||||
|
||||
shader node_vector_transform(
|
||||
string type = "Vector",
|
||||
string type = "vector",
|
||||
string convert_from = "world",
|
||||
string convert_to = "object",
|
||||
vector VectorIn = vector(0.0, 0.0, 0.0),
|
||||
output vector VectorOut = vector(0.0, 0.0, 0.0))
|
||||
{
|
||||
if (type == "Vector" || type == "Normal") {
|
||||
if (type == "vector" || type == "normal") {
|
||||
VectorOut = transform(convert_from, convert_to, VectorIn);
|
||||
if (type == "Normal")
|
||||
if (type == "normal")
|
||||
VectorOut = normalize(VectorOut);
|
||||
}
|
||||
else if (type == "Point") {
|
||||
else if (type == "point") {
|
||||
point Point = (point)VectorIn;
|
||||
VectorOut = transform(convert_from, convert_to, Point);
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
shader node_voronoi_texture(
|
||||
int use_mapping = 0,
|
||||
matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
string coloring = "Intensity",
|
||||
string coloring = "intensity",
|
||||
float Scale = 5.0,
|
||||
point Vector = P,
|
||||
output float Fac = 0.0,
|
||||
@@ -40,7 +40,7 @@ shader node_voronoi_texture(
|
||||
voronoi(p * Scale, 1.0, da, pa);
|
||||
|
||||
/* Colored output */
|
||||
if (coloring == "Intensity") {
|
||||
if (coloring == "intensity") {
|
||||
Fac = fabs(da[0]);
|
||||
Color = color(Fac);
|
||||
}
|
||||
|
@@ -23,10 +23,10 @@ float wave(point p, string type, string profile, float detail, float distortion,
|
||||
{
|
||||
float n = 0.0;
|
||||
|
||||
if (type == "Bands") {
|
||||
if (type == "bands") {
|
||||
n = (p[0] + p[1] + p[2]) * 10.0;
|
||||
}
|
||||
else if (type == "Rings") {
|
||||
else if (type == "rings") {
|
||||
n = length(p) * 20.0;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ float wave(point p, string type, string profile, float detail, float distortion,
|
||||
n = n + (distortion * noise_turbulence(p * dscale, detail, 0));
|
||||
}
|
||||
|
||||
if (profile == "Sine") {
|
||||
if (profile == "sine") {
|
||||
return 0.5 + 0.5 * sin(n);
|
||||
}
|
||||
else {
|
||||
@@ -48,8 +48,8 @@ float wave(point p, string type, string profile, float detail, float distortion,
|
||||
shader node_wave_texture(
|
||||
int use_mapping = 0,
|
||||
matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
string type = "Bands",
|
||||
string profile = "Sine",
|
||||
string type = "bands",
|
||||
string profile = "sine",
|
||||
float Scale = 5.0,
|
||||
float Distortion = 0.0,
|
||||
float Detail = 2.0,
|
||||
|
@@ -32,12 +32,12 @@ NODE_DEFINE(Background)
|
||||
{
|
||||
NodeType* type = NodeType::add("background", create);
|
||||
|
||||
SOCKET_INT(ao_factor, "AO Factor", 0.0f);
|
||||
SOCKET_FLOAT(ao_factor, "AO Factor", 0.0f);
|
||||
SOCKET_FLOAT(ao_distance, "AO Distance", FLT_MAX);
|
||||
|
||||
SOCKET_BOOLEAN(use_shader, "Use Shader", true);
|
||||
SOCKET_BOOLEAN(use_ao, "Use AO", false);
|
||||
SOCKET_INT(visibility, "Visibility", PATH_RAY_ALL_VISIBILITY);
|
||||
SOCKET_UINT(visibility, "Visibility", PATH_RAY_ALL_VISIBILITY);
|
||||
SOCKET_BOOLEAN(transparent, "Transparent", false);
|
||||
|
||||
SOCKET_NODE(shader, "Shader", &Shader::node_type);
|
||||
|
@@ -68,7 +68,7 @@ NODE_DEFINE(Camera)
|
||||
|
||||
SOCKET_FLOAT(aperturesize, "Aperture Size", 0.0f);
|
||||
SOCKET_FLOAT(focaldistance, "Focal Distance", 10.0f);
|
||||
SOCKET_INT(blades, "Blades", 0);
|
||||
SOCKET_UINT(blades, "Blades", 0);
|
||||
SOCKET_FLOAT(bladesrotation, "Blades Rotation", 0.0f);
|
||||
|
||||
SOCKET_TRANSFORM(matrix, "Matrix", transform_identity());
|
||||
|
@@ -51,72 +51,19 @@ bool check_node_inputs_traversed(const ShaderNode *node,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool check_node_inputs_equals(const ShaderNode *node_a,
|
||||
const ShaderNode *node_b)
|
||||
{
|
||||
if(node_a->inputs.size() != node_b->inputs.size()) {
|
||||
/* Happens with BSDF closure nodes which are currently sharing the same
|
||||
* name for all the BSDF types, making it impossible to filter out
|
||||
* incompatible nodes.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
for(int i = 0; i < node_a->inputs.size(); ++i) {
|
||||
ShaderInput *input_a = node_a->inputs[i],
|
||||
*input_b = node_b->inputs[i];
|
||||
if(input_a->link == NULL && input_b->link == NULL) {
|
||||
/* Unconnected inputs are expected to have the same value. */
|
||||
if(input_a->value() != input_b->value()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(input_a->link != NULL && input_b->link != NULL) {
|
||||
/* Expect links are to come from the same exact socket. */
|
||||
if(input_a->link != input_b->link) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* One socket has a link and another has not, inputs can't be
|
||||
* considered equal.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} /* namespace */
|
||||
|
||||
/* Input and Output */
|
||||
|
||||
ShaderInput::ShaderInput(ShaderNode *parent_, const char *name, SocketType::Type type)
|
||||
{
|
||||
parent = parent_;
|
||||
name_ = name;
|
||||
type_ = type;
|
||||
link = NULL;
|
||||
value_ = make_float3(0.0f, 0.0f, 0.0f);
|
||||
stack_offset = SVM_STACK_INVALID;
|
||||
flags_ = 0;
|
||||
}
|
||||
|
||||
ShaderOutput::ShaderOutput(ShaderNode *parent_, const char *name, SocketType::Type type)
|
||||
{
|
||||
parent = parent_;
|
||||
name_ = name;
|
||||
type_ = type;
|
||||
stack_offset = SVM_STACK_INVALID;
|
||||
}
|
||||
|
||||
/* Node */
|
||||
|
||||
ShaderNode::ShaderNode(const char *name_)
|
||||
ShaderNode::ShaderNode(const NodeType *type)
|
||||
: Node(type)
|
||||
{
|
||||
name = name_;
|
||||
name = type->name;
|
||||
id = -1;
|
||||
bump = SHADER_BUMP_NONE;
|
||||
special_type = SHADER_SPECIAL_TYPE_NONE;
|
||||
|
||||
create_inputs_outputs(type);
|
||||
}
|
||||
|
||||
ShaderNode::~ShaderNode()
|
||||
@@ -128,6 +75,19 @@ ShaderNode::~ShaderNode()
|
||||
delete socket;
|
||||
}
|
||||
|
||||
void ShaderNode::create_inputs_outputs(const NodeType *type)
|
||||
{
|
||||
foreach(const SocketType& socket, type->inputs) {
|
||||
if(socket.flags & SocketType::LINKABLE) {
|
||||
inputs.push_back(new ShaderInput(socket, this));
|
||||
}
|
||||
}
|
||||
|
||||
foreach(const SocketType& socket, type->outputs) {
|
||||
outputs.push_back(new ShaderOutput(socket, this));
|
||||
}
|
||||
}
|
||||
|
||||
ShaderInput *ShaderNode::input(const char *name)
|
||||
{
|
||||
foreach(ShaderInput *socket, inputs) {
|
||||
@@ -166,31 +126,6 @@ ShaderOutput *ShaderNode::output(ustring name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ShaderInput *ShaderNode::add_input(const char *name, SocketType::Type type, float value, int flags)
|
||||
{
|
||||
ShaderInput *input = new ShaderInput(this, name, type);
|
||||
input->value_.x = value;
|
||||
input->flags_ = flags;
|
||||
inputs.push_back(input);
|
||||
return input;
|
||||
}
|
||||
|
||||
ShaderInput *ShaderNode::add_input(const char *name, SocketType::Type type, float3 value, int flags)
|
||||
{
|
||||
ShaderInput *input = new ShaderInput(this, name, type);
|
||||
input->value_ = value;
|
||||
input->flags_ = flags;
|
||||
inputs.push_back(input);
|
||||
return input;
|
||||
}
|
||||
|
||||
ShaderOutput *ShaderNode::add_output(const char *name, SocketType::Type type)
|
||||
{
|
||||
ShaderOutput *output = new ShaderOutput(this, name, type);
|
||||
outputs.push_back(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
||||
{
|
||||
foreach(ShaderInput *input, inputs) {
|
||||
@@ -209,6 +144,49 @@ void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
||||
}
|
||||
}
|
||||
|
||||
bool ShaderNode::equals(const ShaderNode& other)
|
||||
{
|
||||
if (type != other.type || bump != other.bump)
|
||||
return false;
|
||||
|
||||
assert(inputs.size() == other.inputs.size());
|
||||
|
||||
/* Compare unlinkable sockets */
|
||||
foreach(const SocketType& socket, type->inputs) {
|
||||
if(!(socket.flags & SocketType::LINKABLE)) {
|
||||
if(!Node::equals_value(other, socket)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Compare linkable input sockets */
|
||||
for(int i = 0; i < inputs.size(); ++i) {
|
||||
ShaderInput *input_a = inputs[i],
|
||||
*input_b = other.inputs[i];
|
||||
if(input_a->link == NULL && input_b->link == NULL) {
|
||||
/* Unconnected inputs are expected to have the same value. */
|
||||
if(!Node::equals_value(other, input_a->socket_type)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(input_a->link != NULL && input_b->link != NULL) {
|
||||
/* Expect links are to come from the same exact socket. */
|
||||
if(input_a->link != input_b->link) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* One socket has a link and another has not, inputs can't be
|
||||
* considered equal.
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Graph */
|
||||
|
||||
ShaderGraph::ShaderGraph()
|
||||
@@ -470,8 +448,7 @@ void ShaderGraph::remove_proxy_nodes()
|
||||
disconnect(to);
|
||||
|
||||
/* transfer the default input value to the target socket */
|
||||
to->set(input->value());
|
||||
to->set(input->value_string());
|
||||
tonode->copy_value(to->socket_type, *proxy, input->socket_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,7 +519,7 @@ void ShaderGraph::constant_fold()
|
||||
vector<ShaderInput*> links(output->links);
|
||||
for(size_t i = 0; i < links.size(); i++) {
|
||||
if(i > 0)
|
||||
links[i]->set(links[0]->value());
|
||||
links[i]->parent->copy_value(links[i]->socket_type, *links[0]->parent, links[0]->socket_type);
|
||||
disconnect(links[i]);
|
||||
}
|
||||
}
|
||||
@@ -604,25 +581,11 @@ void ShaderGraph::deduplicate_nodes()
|
||||
}
|
||||
/* Try to merge this node with another one. */
|
||||
foreach(ShaderNode *other_node, done[node->name]) {
|
||||
if(node == other_node) {
|
||||
/* Don't merge with self. */
|
||||
continue;
|
||||
}
|
||||
if(node->name != other_node->name) {
|
||||
/* Can only de-duplicate nodes of the same type. */
|
||||
continue;
|
||||
}
|
||||
if(!check_node_inputs_equals(node, other_node)) {
|
||||
/* Node inputs are different, can't merge them, */
|
||||
continue;
|
||||
}
|
||||
if(!node->equals(other_node)) {
|
||||
/* Node settings are different. */
|
||||
continue;
|
||||
}
|
||||
/* TODO(sergey): Consider making it an utility function. */
|
||||
for(int i = 0; i < node->outputs.size(); ++i) {
|
||||
relink(node, node->outputs[i], other_node->outputs[i]);
|
||||
if (node != other_node && node->equals(*other_node)) {
|
||||
/* TODO(sergey): Consider making it an utility function. */
|
||||
for(int i = 0; i < node->outputs.size(); ++i) {
|
||||
relink(node, node->outputs[i], other_node->outputs[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -927,14 +890,15 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight
|
||||
|
||||
if(fin) {
|
||||
/* mix closure: add node to mix closure weights */
|
||||
ShaderNode *mix_node = add(new MixClosureWeightNode());
|
||||
MixClosureWeightNode *mix_node = new MixClosureWeightNode();
|
||||
add(mix_node);
|
||||
ShaderInput *fac_in = mix_node->input("Fac");
|
||||
ShaderInput *weight_in = mix_node->input("Weight");
|
||||
|
||||
if(fin->link)
|
||||
connect(fin->link, fac_in);
|
||||
else
|
||||
fac_in->set(fin->value_float());
|
||||
mix_node->fac = node->get_float(fin->socket_type);
|
||||
|
||||
if(weight_out)
|
||||
connect(weight_out, weight_in);
|
||||
@@ -961,20 +925,20 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight
|
||||
return;
|
||||
|
||||
/* already has a weight connected to it? add weights */
|
||||
if(weight_in->link || weight_in->value_float() != 0.0f) {
|
||||
ShaderNode *math_node = add(new MathNode());
|
||||
ShaderInput *value1_in = math_node->input("Value1");
|
||||
ShaderInput *value2_in = math_node->input("Value2");
|
||||
float weight_value = node->get_float(weight_in->socket_type);
|
||||
if(weight_in->link || weight_value != 0.0f) {
|
||||
MathNode *math_node = new MathNode();
|
||||
add(math_node);
|
||||
|
||||
if(weight_in->link)
|
||||
connect(weight_in->link, value1_in);
|
||||
connect(weight_in->link, math_node->input("Value1"));
|
||||
else
|
||||
value1_in->set(weight_in->value_float());
|
||||
math_node->value1 = weight_value;
|
||||
|
||||
if(weight_out)
|
||||
connect(weight_out, value2_in);
|
||||
connect(weight_out, math_node->input("Value2"));
|
||||
else
|
||||
value2_in->set(1.0f);
|
||||
math_node->value2 = 1.0f;
|
||||
|
||||
weight_out = math_node->output("Value");
|
||||
if(weight_in->link)
|
||||
@@ -985,7 +949,7 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight
|
||||
if(weight_out)
|
||||
connect(weight_out, weight_in);
|
||||
else
|
||||
weight_in->set(weight_in->value_float() + 1.0f);
|
||||
node->set(weight_in->socket_type, weight_value + 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#define __GRAPH_H__
|
||||
|
||||
#include "node.h"
|
||||
#include "node_type.h"
|
||||
|
||||
#include "kernel_types.h"
|
||||
|
||||
@@ -79,32 +80,21 @@ enum ShaderNodeSpecialType {
|
||||
|
||||
class ShaderInput {
|
||||
public:
|
||||
ShaderInput(ShaderNode *parent, const char *name, SocketType::Type type);
|
||||
ShaderInput(const SocketType& socket_type_, ShaderNode* parent_)
|
||||
: socket_type(socket_type_), parent(parent_), link(NULL), stack_offset(SVM_STACK_INVALID)
|
||||
{}
|
||||
|
||||
ustring name() { return name_; }
|
||||
int flags() { return flags_; }
|
||||
SocketType::Type type() { return type_; }
|
||||
ustring name() { return socket_type.ui_name; }
|
||||
int flags() { return socket_type.flags; }
|
||||
SocketType::Type type() { return socket_type.type; }
|
||||
|
||||
void set(float f) { value_.x = f; }
|
||||
void set(float3 f) { value_ = f; }
|
||||
void set(int i) { value_.x = (float)i; }
|
||||
void set(ustring s) { value_string_ = s; }
|
||||
|
||||
float3& value() { return value_; }
|
||||
float& value_float() { return value_.x; }
|
||||
ustring& value_string() { return value_string_; }
|
||||
|
||||
ustring name_;
|
||||
SocketType::Type type_;
|
||||
void set(float f) { ((Node*)parent)->set(socket_type, f); }
|
||||
void set(float3 f) { ((Node*)parent)->set(socket_type, f); }
|
||||
|
||||
const SocketType& socket_type;
|
||||
ShaderNode *parent;
|
||||
ShaderOutput *link;
|
||||
|
||||
float3 value_;
|
||||
ustring value_string_;
|
||||
|
||||
int stack_offset; /* for SVM compiler */
|
||||
int flags_;
|
||||
};
|
||||
|
||||
/* Output
|
||||
@@ -113,17 +103,16 @@ public:
|
||||
|
||||
class ShaderOutput {
|
||||
public:
|
||||
ShaderOutput(ShaderNode *parent, const char *name, SocketType::Type type);
|
||||
ShaderOutput(const SocketType& socket_type_, ShaderNode* parent_)
|
||||
: socket_type(socket_type_), parent(parent_), stack_offset(SVM_STACK_INVALID)
|
||||
{}
|
||||
|
||||
ustring name() { return name_; }
|
||||
SocketType::Type type() { return type_; }
|
||||
|
||||
ustring name_;
|
||||
SocketType::Type type_;
|
||||
ustring name() { return socket_type.ui_name; }
|
||||
SocketType::Type type() { return socket_type.type; }
|
||||
|
||||
const SocketType& socket_type;
|
||||
ShaderNode *parent;
|
||||
vector<ShaderInput*> links;
|
||||
|
||||
int stack_offset; /* for SVM compiler */
|
||||
};
|
||||
|
||||
@@ -132,20 +121,18 @@ public:
|
||||
* Shader node in graph, with input and output sockets. This is the virtual
|
||||
* base class for all node types. */
|
||||
|
||||
class ShaderNode {
|
||||
class ShaderNode : public Node {
|
||||
public:
|
||||
explicit ShaderNode(const char *name);
|
||||
explicit ShaderNode(const NodeType *type);
|
||||
virtual ~ShaderNode();
|
||||
|
||||
void create_inputs_outputs(const NodeType *type);
|
||||
|
||||
ShaderInput *input(const char *name);
|
||||
ShaderOutput *output(const char *name);
|
||||
ShaderInput *input(ustring name);
|
||||
ShaderOutput *output(ustring name);
|
||||
|
||||
ShaderInput *add_input(const char *name, SocketType::Type type, float value=0.0f, int flags=0);
|
||||
ShaderInput *add_input(const char *name, SocketType::Type type, float3 value, int flags=0);
|
||||
ShaderOutput *add_output(const char *name, SocketType::Type type);
|
||||
|
||||
virtual ShaderNode *clone() const = 0;
|
||||
virtual void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
virtual void compile(SVMCompiler& compiler) = 0;
|
||||
@@ -171,7 +158,6 @@ public:
|
||||
vector<ShaderInput*> inputs;
|
||||
vector<ShaderOutput*> outputs;
|
||||
|
||||
ustring name; /* name, not required to be unique */
|
||||
int id; /* index in graph node array */
|
||||
ShaderBump bump; /* for bump mapping utility */
|
||||
|
||||
@@ -207,23 +193,21 @@ public:
|
||||
* NOTE: If some node can't be de-duplicated for whatever reason it
|
||||
* is to be handled in the subclass.
|
||||
*/
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
return name == other->name &&
|
||||
bump == other->bump;
|
||||
}
|
||||
virtual bool equals(const ShaderNode& other);
|
||||
};
|
||||
|
||||
|
||||
/* Node definition utility macros */
|
||||
|
||||
#define SHADER_NODE_CLASS(type) \
|
||||
NODE_DECLARE; \
|
||||
type(); \
|
||||
virtual ShaderNode *clone() const { return new type(*this); } \
|
||||
virtual void compile(SVMCompiler& compiler); \
|
||||
virtual void compile(OSLCompiler& compiler); \
|
||||
|
||||
#define SHADER_NODE_NO_CLONE_CLASS(type) \
|
||||
NODE_DECLARE; \
|
||||
type(); \
|
||||
virtual void compile(SVMCompiler& compiler); \
|
||||
virtual void compile(OSLCompiler& compiler); \
|
||||
|
@@ -85,7 +85,7 @@ NODE_DEFINE(Mesh)
|
||||
displacement_method_enum.insert("both", DISPLACE_BOTH);
|
||||
SOCKET_ENUM(displacement_method, "Displacement Method", displacement_method_enum, DISPLACE_BUMP);
|
||||
|
||||
SOCKET_INT(motion_steps, "Motion Steps", 3);
|
||||
SOCKET_UINT(motion_steps, "Motion Steps", 3);
|
||||
SOCKET_BOOLEAN(use_motion_blur, "Use Motion Blur", false);
|
||||
|
||||
SOCKET_INT_ARRAY(triangles, "Triangles", array<int>());
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@
|
||||
#define __NODES_H__
|
||||
|
||||
#include "graph.h"
|
||||
#include "node.h"
|
||||
|
||||
#include "util_string.h"
|
||||
|
||||
@@ -35,6 +36,7 @@ public:
|
||||
Transform compute_transform();
|
||||
bool skip();
|
||||
void compile(SVMCompiler& compiler, int offset_in, int offset_out);
|
||||
int compile(SVMCompiler& compiler, ShaderInput *vector_in);
|
||||
void compile(OSLCompiler &compiler);
|
||||
|
||||
int compile_begin(SVMCompiler& compiler, ShaderInput *vector_in);
|
||||
@@ -49,48 +51,26 @@ public:
|
||||
|
||||
enum Type { POINT = 0, TEXTURE = 1, VECTOR = 2, NORMAL = 3 };
|
||||
Type type;
|
||||
static NodeEnum type_enum;
|
||||
|
||||
enum Mapping { NONE = 0, X = 1, Y = 2, Z = 3 };
|
||||
Mapping x_mapping, y_mapping, z_mapping;
|
||||
static NodeEnum mapping_enum;
|
||||
|
||||
enum Projection { FLAT, CUBE, TUBE, SPHERE };
|
||||
Projection projection;
|
||||
static NodeEnum projection_enum;
|
||||
|
||||
bool equals(const TextureMapping& other) {
|
||||
return translation == other.translation &&
|
||||
rotation == other.rotation &&
|
||||
scale == other.scale &&
|
||||
use_minmax == other.use_minmax &&
|
||||
min == other.min &&
|
||||
max == other.max &&
|
||||
type == other.type &&
|
||||
x_mapping == other.x_mapping &&
|
||||
y_mapping == other.y_mapping &&
|
||||
z_mapping == other.z_mapping &&
|
||||
projection == other.projection;
|
||||
}
|
||||
};
|
||||
|
||||
/* Nodes */
|
||||
|
||||
class TextureNode : public ShaderNode {
|
||||
public:
|
||||
explicit TextureNode(const char *name_) : ShaderNode(name_) {}
|
||||
explicit TextureNode(const NodeType *node_type) : ShaderNode(node_type) {}
|
||||
TextureMapping tex_mapping;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
return ShaderNode::equals(other) &&
|
||||
tex_mapping.equals(((const TextureNode*)other)->tex_mapping);
|
||||
}
|
||||
};
|
||||
|
||||
/* Any node which uses image manager's slot should be a subclass of this one. */
|
||||
class ImageSlotTextureNode : public TextureNode {
|
||||
public:
|
||||
explicit ImageSlotTextureNode(const char *name_) : TextureNode(name_) {
|
||||
explicit ImageSlotTextureNode(const NodeType *node_type) : TextureNode(node_type) {
|
||||
special_type = SHADER_SPECIAL_TYPE_IMAGE_SLOT;
|
||||
}
|
||||
int slot;
|
||||
@@ -107,7 +87,7 @@ public:
|
||||
int is_float;
|
||||
bool is_linear;
|
||||
bool use_alpha;
|
||||
string filename;
|
||||
ustring filename;
|
||||
void *builtin_data;
|
||||
NodeImageColorSpace color_space;
|
||||
NodeImageProjection projection;
|
||||
@@ -115,22 +95,14 @@ public:
|
||||
ExtensionType extension;
|
||||
float projection_blend;
|
||||
bool animated;
|
||||
float3 vector;
|
||||
|
||||
static NodeEnum color_space_enum;
|
||||
static NodeEnum projection_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const ImageTextureNode *image_node = (const ImageTextureNode*)other;
|
||||
virtual bool equals(const ShaderNode& other)
|
||||
{
|
||||
const ImageTextureNode& image_node = (const ImageTextureNode&)other;
|
||||
return ImageSlotTextureNode::equals(other) &&
|
||||
use_alpha == image_node->use_alpha &&
|
||||
filename == image_node->filename &&
|
||||
builtin_data == image_node->builtin_data &&
|
||||
color_space == image_node->color_space &&
|
||||
projection == image_node->projection &&
|
||||
interpolation == image_node->interpolation &&
|
||||
extension == image_node->extension &&
|
||||
projection_blend == image_node->projection_blend &&
|
||||
animated == image_node->animated;
|
||||
builtin_data == image_node.builtin_data &&
|
||||
animated == image_node.animated;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -146,26 +118,20 @@ public:
|
||||
int is_float;
|
||||
bool is_linear;
|
||||
bool use_alpha;
|
||||
string filename;
|
||||
ustring filename;
|
||||
void *builtin_data;
|
||||
NodeImageColorSpace color_space;
|
||||
NodeEnvironmentProjection projection;
|
||||
InterpolationType interpolation;
|
||||
bool animated;
|
||||
float3 vector;
|
||||
|
||||
static NodeEnum color_space_enum;
|
||||
static NodeEnum projection_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const EnvironmentTextureNode *env_node = (const EnvironmentTextureNode*)other;
|
||||
virtual bool equals(const ShaderNode& other)
|
||||
{
|
||||
const EnvironmentTextureNode& env_node = (const EnvironmentTextureNode&)other;
|
||||
return ImageSlotTextureNode::equals(other) &&
|
||||
use_alpha == env_node->use_alpha &&
|
||||
filename == env_node->filename &&
|
||||
builtin_data == env_node->builtin_data &&
|
||||
color_space == env_node->color_space &&
|
||||
projection == env_node->projection &&
|
||||
interpolation == env_node->interpolation &&
|
||||
animated == env_node->animated;
|
||||
builtin_data == env_node.builtin_data &&
|
||||
animated == env_node.animated;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -179,25 +145,20 @@ public:
|
||||
float3 sun_direction;
|
||||
float turbidity;
|
||||
float ground_albedo;
|
||||
|
||||
static NodeEnum type_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const SkyTextureNode *sky_node = (const SkyTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
sun_direction == sky_node->sun_direction &&
|
||||
turbidity == sky_node->turbidity &&
|
||||
ground_albedo == sky_node->ground_albedo &&
|
||||
type == sky_node->type;
|
||||
}
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class OutputNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(OutputNode)
|
||||
|
||||
void* surface;
|
||||
void* volume;
|
||||
float displacement;
|
||||
float3 normal;
|
||||
|
||||
/* Don't allow output node de-duplication. */
|
||||
virtual bool equals(const ShaderNode * /*other*/) { return false; }
|
||||
virtual bool equals(const ShaderNode& /*other*/) { return false; }
|
||||
};
|
||||
|
||||
class GradientTextureNode : public TextureNode {
|
||||
@@ -207,18 +168,15 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
NodeGradientType type;
|
||||
static NodeEnum type_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const GradientTextureNode *gradient_node = (const GradientTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
type == gradient_node->type;
|
||||
}
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class NoiseTextureNode : public TextureNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(NoiseTextureNode)
|
||||
|
||||
float scale, detail, distortion;
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class VoronoiTextureNode : public TextureNode {
|
||||
@@ -228,13 +186,8 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
NodeVoronoiColoring coloring;
|
||||
static NodeEnum coloring_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const VoronoiTextureNode *voronoi_node = (const VoronoiTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
coloring == voronoi_node->coloring;
|
||||
}
|
||||
float scale;
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class MusgraveTextureNode : public TextureNode {
|
||||
@@ -244,13 +197,8 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
NodeMusgraveType type;
|
||||
static NodeEnum type_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const MusgraveTextureNode *musgrave_node = (const MusgraveTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
type == musgrave_node->type;
|
||||
}
|
||||
float scale, detail, dimension, lacunarity, offset, gain;
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class WaveTextureNode : public TextureNode {
|
||||
@@ -261,15 +209,9 @@ public:
|
||||
|
||||
NodeWaveType type;
|
||||
NodeWaveProfile profile;
|
||||
static NodeEnum type_enum;
|
||||
static NodeEnum profile_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const WaveTextureNode *wave_node = (const WaveTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
type == wave_node->type &&
|
||||
profile == wave_node->profile;
|
||||
}
|
||||
float scale, distortion, detail, detail_scale;
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class MagicTextureNode : public TextureNode {
|
||||
@@ -279,18 +221,17 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
int depth;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const MagicTextureNode *magic_node = (const MagicTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
depth == magic_node->depth;
|
||||
}
|
||||
float3 vector;
|
||||
float scale, distortion;
|
||||
};
|
||||
|
||||
class CheckerTextureNode : public TextureNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(CheckerTextureNode)
|
||||
|
||||
float3 vector, color1, color2;
|
||||
float scale;
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
};
|
||||
|
||||
@@ -301,16 +242,11 @@ public:
|
||||
float offset, squash;
|
||||
int offset_frequency, squash_frequency;
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
float3 color1, color2, mortar;
|
||||
float scale, mortar_size, bias, brick_width, row_height;
|
||||
float3 vector;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const BrickTextureNode *brick_node = (const BrickTextureNode*)other;
|
||||
return TextureNode::equals(other) &&
|
||||
offset == brick_node->offset &&
|
||||
squash == brick_node->squash &&
|
||||
offset_frequency == brick_node->offset_frequency &&
|
||||
squash_frequency == brick_node->squash_frequency;
|
||||
}
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
};
|
||||
|
||||
class PointDensityTextureNode : public ShaderNode {
|
||||
@@ -324,25 +260,20 @@ public:
|
||||
bool has_spatial_varying() { return true; }
|
||||
bool has_object_dependency() { return true; }
|
||||
|
||||
ustring filename;
|
||||
NodeTexVoxelSpace space;
|
||||
InterpolationType interpolation;
|
||||
Transform tfm;
|
||||
float3 vector;
|
||||
|
||||
ImageManager *image_manager;
|
||||
int slot;
|
||||
string filename;
|
||||
NodeTexVoxelSpace space;
|
||||
void *builtin_data;
|
||||
InterpolationType interpolation;
|
||||
|
||||
Transform tfm;
|
||||
|
||||
static NodeEnum space_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const PointDensityTextureNode *point_dendity_node = (const PointDensityTextureNode*)other;
|
||||
virtual bool equals(const ShaderNode& other) {
|
||||
const PointDensityTextureNode& point_dendity_node = (const PointDensityTextureNode&)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
filename == point_dendity_node->filename &&
|
||||
space == point_dendity_node->space &&
|
||||
builtin_data == point_dendity_node->builtin_data &&
|
||||
interpolation == point_dendity_node->interpolation &&
|
||||
tfm == point_dendity_node->tfm;
|
||||
builtin_data == point_dendity_node.builtin_data;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -351,20 +282,16 @@ public:
|
||||
SHADER_NODE_CLASS(MappingNode)
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
float3 vector;
|
||||
TextureMapping tex_mapping;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const MappingNode *mapping_node = (const MappingNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
tex_mapping.equals(mapping_node->tex_mapping);
|
||||
}
|
||||
};
|
||||
|
||||
class RGBToBWNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(RGBToBWNode)
|
||||
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
float3 color;
|
||||
};
|
||||
|
||||
class ConvertNode : public ShaderNode {
|
||||
@@ -376,28 +303,39 @@ public:
|
||||
|
||||
SocketType::Type from, to;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const ConvertNode *convert_node = (const ConvertNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
from == convert_node->from &&
|
||||
to == convert_node->to;
|
||||
}
|
||||
union {
|
||||
float value_float;
|
||||
int value_int;
|
||||
float3 value_color;
|
||||
float3 value_vector;
|
||||
float3 value_point;
|
||||
float3 value_normal;
|
||||
};
|
||||
ustring value_string;
|
||||
|
||||
private:
|
||||
static const int MAX_TYPE = 12;
|
||||
static bool register_types();
|
||||
static Node* create(const NodeType *type);
|
||||
static const NodeType *node_types[MAX_TYPE][MAX_TYPE];
|
||||
static bool initialized;
|
||||
};
|
||||
|
||||
class BsdfNode : public ShaderNode {
|
||||
public:
|
||||
explicit BsdfNode(bool scattering = false);
|
||||
explicit BsdfNode(const NodeType *node_type);
|
||||
SHADER_NODE_BASE_CLASS(BsdfNode);
|
||||
|
||||
bool has_spatial_varying() { return true; }
|
||||
void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2, ShaderInput *param3 = NULL, ShaderInput *param4 = NULL);
|
||||
virtual ClosureType get_closure_type() { return closure; }
|
||||
|
||||
float3 color;
|
||||
float3 normal;
|
||||
float surface_mix_weight;
|
||||
ClosureType closure;
|
||||
bool scattering;
|
||||
|
||||
virtual bool equals(const ShaderNode * /*other*/)
|
||||
virtual bool equals(const ShaderNode& /*other*/)
|
||||
{
|
||||
/* TODO(sergey): With some care BSDF nodes can be de-duplicated. */
|
||||
return false;
|
||||
@@ -408,8 +346,9 @@ class AnisotropicBsdfNode : public BsdfNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(AnisotropicBsdfNode)
|
||||
|
||||
float3 tangent;
|
||||
float roughness, anisotropy, rotation;
|
||||
ClosureType distribution;
|
||||
static NodeEnum distribution_enum;
|
||||
|
||||
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
};
|
||||
@@ -417,6 +356,8 @@ public:
|
||||
class DiffuseBsdfNode : public BsdfNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(DiffuseBsdfNode)
|
||||
|
||||
float roughness;
|
||||
};
|
||||
|
||||
class TranslucentBsdfNode : public BsdfNode {
|
||||
@@ -434,6 +375,8 @@ public:
|
||||
class VelvetBsdfNode : public BsdfNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(VelvetBsdfNode)
|
||||
|
||||
float sigma;
|
||||
};
|
||||
|
||||
class GlossyBsdfNode : public BsdfNode {
|
||||
@@ -443,8 +386,8 @@ public:
|
||||
void simplify_settings(Scene *scene);
|
||||
bool has_integrator_dependency();
|
||||
|
||||
float roughness;
|
||||
ClosureType distribution, distribution_orig;
|
||||
static NodeEnum distribution_enum;
|
||||
};
|
||||
|
||||
class GlassBsdfNode : public BsdfNode {
|
||||
@@ -454,8 +397,8 @@ public:
|
||||
void simplify_settings(Scene *scene);
|
||||
bool has_integrator_dependency();
|
||||
|
||||
float roughness, IOR;
|
||||
ClosureType distribution, distribution_orig;
|
||||
static NodeEnum distribution_enum;
|
||||
};
|
||||
|
||||
class RefractionBsdfNode : public BsdfNode {
|
||||
@@ -465,16 +408,16 @@ public:
|
||||
void simplify_settings(Scene *scene);
|
||||
bool has_integrator_dependency();
|
||||
|
||||
float roughness, IOR;
|
||||
ClosureType distribution, distribution_orig;
|
||||
static NodeEnum distribution_enum;
|
||||
};
|
||||
|
||||
class ToonBsdfNode : public BsdfNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(ToonBsdfNode)
|
||||
|
||||
float smooth, size;
|
||||
ClosureType component;
|
||||
static NodeEnum component_enum;
|
||||
};
|
||||
|
||||
class SubsurfaceScatteringNode : public BsdfNode {
|
||||
@@ -483,8 +426,11 @@ public:
|
||||
bool has_surface_bssrdf() { return true; }
|
||||
bool has_bssrdf_bump();
|
||||
|
||||
float scale;
|
||||
float3 radius;
|
||||
float sharpness;
|
||||
float texture_blur;
|
||||
ClosureType falloff;
|
||||
static NodeEnum falloff_enum;
|
||||
};
|
||||
|
||||
class EmissionNode : public ShaderNode {
|
||||
@@ -494,6 +440,10 @@ public:
|
||||
virtual ClosureType get_closure_type() { return CLOSURE_EMISSION_ID; }
|
||||
|
||||
bool has_surface_emission() { return true; }
|
||||
|
||||
float3 color;
|
||||
float strength;
|
||||
float surface_mix_weight;
|
||||
};
|
||||
|
||||
class BackgroundNode : public ShaderNode {
|
||||
@@ -501,6 +451,10 @@ public:
|
||||
SHADER_NODE_CLASS(BackgroundNode)
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
virtual ClosureType get_closure_type() { return CLOSURE_BACKGROUND_ID; }
|
||||
|
||||
float3 color;
|
||||
float strength;
|
||||
float surface_mix_weight;
|
||||
};
|
||||
|
||||
class HoldoutNode : public ShaderNode {
|
||||
@@ -508,6 +462,9 @@ public:
|
||||
SHADER_NODE_CLASS(HoldoutNode)
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
virtual ClosureType get_closure_type() { return CLOSURE_HOLDOUT_ID; }
|
||||
|
||||
float surface_mix_weight;
|
||||
float volume_mix_weight;
|
||||
};
|
||||
|
||||
class AmbientOcclusionNode : public ShaderNode {
|
||||
@@ -517,11 +474,16 @@ public:
|
||||
bool has_spatial_varying() { return true; }
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
virtual ClosureType get_closure_type() { return CLOSURE_AMBIENT_OCCLUSION_ID; }
|
||||
|
||||
float3 normal_osl;
|
||||
float3 color;
|
||||
float surface_mix_weight;
|
||||
};
|
||||
|
||||
class VolumeNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(VolumeNode)
|
||||
VolumeNode(const NodeType *node_type);
|
||||
SHADER_NODE_BASE_CLASS(VolumeNode)
|
||||
|
||||
void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2);
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
@@ -530,9 +492,12 @@ public:
|
||||
}
|
||||
virtual ClosureType get_closure_type() { return closure; }
|
||||
|
||||
float3 color;
|
||||
float density;
|
||||
float volume_mix_weight;
|
||||
ClosureType closure;
|
||||
|
||||
virtual bool equals(const ShaderNode * /*other*/)
|
||||
virtual bool equals(const ShaderNode& /*other*/)
|
||||
{
|
||||
/* TODO(sergey): With some care Volume nodes can be de-duplicated. */
|
||||
return false;
|
||||
@@ -547,6 +512,8 @@ public:
|
||||
class ScatterVolumeNode : public VolumeNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(ScatterVolumeNode)
|
||||
|
||||
float anisotropy;
|
||||
};
|
||||
|
||||
class HairBsdfNode : public BsdfNode {
|
||||
@@ -554,8 +521,10 @@ public:
|
||||
SHADER_NODE_CLASS(HairBsdfNode)
|
||||
|
||||
ClosureType component;
|
||||
static NodeEnum component_enum;
|
||||
|
||||
float offset;
|
||||
float roughness_u;
|
||||
float roughness_v;
|
||||
float3 tangent;
|
||||
};
|
||||
|
||||
class GeometryNode : public ShaderNode {
|
||||
@@ -563,6 +532,8 @@ public:
|
||||
SHADER_NODE_CLASS(GeometryNode)
|
||||
void attributes(Shader *shader, AttributeRequestSet *attributes);
|
||||
bool has_spatial_varying() { return true; }
|
||||
|
||||
float3 normal_osl;
|
||||
};
|
||||
|
||||
class TextureCoordinateNode : public ShaderNode {
|
||||
@@ -572,17 +543,10 @@ public:
|
||||
bool has_spatial_varying() { return true; }
|
||||
bool has_object_dependency() { return use_transform; }
|
||||
|
||||
float3 normal_osl;
|
||||
bool from_dupli;
|
||||
bool use_transform;
|
||||
Transform ob_tfm;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const TextureCoordinateNode *texco_node = (const TextureCoordinateNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
from_dupli == texco_node->from_dupli &&
|
||||
use_transform == texco_node->use_transform &&
|
||||
ob_tfm == texco_node->ob_tfm;
|
||||
}
|
||||
};
|
||||
|
||||
class UVMapNode : public ShaderNode {
|
||||
@@ -594,13 +558,6 @@ public:
|
||||
|
||||
ustring attribute;
|
||||
bool from_dupli;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const UVMapNode *uv_map_node = (const UVMapNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
attribute == uv_map_node->attribute &&
|
||||
from_dupli == uv_map_node->from_dupli;
|
||||
}
|
||||
};
|
||||
|
||||
class LightPathNode : public ShaderNode {
|
||||
@@ -614,6 +571,9 @@ public:
|
||||
SHADER_NODE_CLASS(LightFalloffNode)
|
||||
bool has_spatial_varying() { return true; }
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
float strength;
|
||||
float smooth;
|
||||
};
|
||||
|
||||
class ObjectInfoNode : public ShaderNode {
|
||||
@@ -648,12 +608,6 @@ public:
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
float value;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const ValueNode *value_node = (const ValueNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
value == value_node->value;
|
||||
}
|
||||
};
|
||||
|
||||
class ColorNode : public ShaderNode {
|
||||
@@ -663,12 +617,6 @@ public:
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
float3 value;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const ColorNode *color_node = (const ColorNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
value == color_node->value;
|
||||
}
|
||||
};
|
||||
|
||||
class AddClosureNode : public ShaderNode {
|
||||
@@ -680,11 +628,16 @@ class MixClosureNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(MixClosureNode)
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
float fac;
|
||||
};
|
||||
|
||||
class MixClosureWeightNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(MixClosureWeightNode);
|
||||
|
||||
float weight;
|
||||
float fac;
|
||||
};
|
||||
|
||||
class InvertNode : public ShaderNode {
|
||||
@@ -692,6 +645,9 @@ public:
|
||||
SHADER_NODE_CLASS(InvertNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float fac;
|
||||
float3 color;
|
||||
};
|
||||
|
||||
class MixNode : public ShaderNode {
|
||||
@@ -701,80 +657,90 @@ public:
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
bool use_clamp;
|
||||
|
||||
NodeMix type;
|
||||
static NodeEnum type_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const MixNode *mix_node = (const MixNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
use_clamp == mix_node->use_clamp &&
|
||||
type == mix_node->type;
|
||||
}
|
||||
bool use_clamp;
|
||||
float3 color1;
|
||||
float3 color2;
|
||||
float fac;
|
||||
};
|
||||
|
||||
class CombineRGBNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(CombineRGBNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float r, g, b;
|
||||
};
|
||||
|
||||
class CombineHSVNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(CombineHSVNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float h, s, v;
|
||||
};
|
||||
|
||||
class CombineXYZNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(CombineXYZNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
class GammaNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(GammaNode)
|
||||
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
|
||||
float3 color;
|
||||
float gamma;
|
||||
};
|
||||
|
||||
class BrightContrastNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(BrightContrastNode)
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
|
||||
float3 color;
|
||||
float bright;
|
||||
float contrast;
|
||||
};
|
||||
|
||||
class SeparateRGBNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(SeparateRGBNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float3 color;
|
||||
};
|
||||
|
||||
class SeparateHSVNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(SeparateHSVNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float3 color;
|
||||
};
|
||||
|
||||
class SeparateXYZNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(SeparateXYZNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class HSVNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(HSVNode)
|
||||
|
||||
float hue;
|
||||
float saturation;
|
||||
float value;
|
||||
float fac;
|
||||
float3 color;
|
||||
};
|
||||
|
||||
class AttributeNode : public ShaderNode {
|
||||
@@ -784,12 +750,6 @@ public:
|
||||
bool has_spatial_varying() { return true; }
|
||||
|
||||
ustring attribute;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const AttributeNode *color_node = (const AttributeNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
attribute == color_node->attribute;
|
||||
}
|
||||
};
|
||||
|
||||
class CameraNode : public ShaderNode {
|
||||
@@ -803,6 +763,9 @@ public:
|
||||
SHADER_NODE_CLASS(FresnelNode)
|
||||
bool has_spatial_varying() { return true; }
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
|
||||
float3 normal;
|
||||
float IOR;
|
||||
};
|
||||
|
||||
class LayerWeightNode : public ShaderNode {
|
||||
@@ -810,6 +773,9 @@ public:
|
||||
SHADER_NODE_CLASS(LayerWeightNode)
|
||||
bool has_spatial_varying() { return true; }
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
|
||||
float3 normal;
|
||||
float blend;
|
||||
};
|
||||
|
||||
class WireframeNode : public ShaderNode {
|
||||
@@ -818,22 +784,25 @@ public:
|
||||
bool has_spatial_varying() { return true; }
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float size;
|
||||
bool use_pixel_size;
|
||||
};
|
||||
|
||||
class WavelengthNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(WavelengthNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float wavelength;
|
||||
};
|
||||
|
||||
class BlackbodyNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(BlackbodyNode)
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
float temperature;
|
||||
};
|
||||
|
||||
class MathNode : public ShaderNode {
|
||||
@@ -842,18 +811,10 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
bool use_clamp;
|
||||
|
||||
float value1;
|
||||
float value2;
|
||||
NodeMath type;
|
||||
static NodeEnum type_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const MathNode *math_node = (const MathNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
use_clamp == math_node->use_clamp &&
|
||||
type == math_node->type;
|
||||
}
|
||||
bool use_clamp;
|
||||
};
|
||||
|
||||
class NormalNode : public ShaderNode {
|
||||
@@ -862,13 +823,7 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_2; }
|
||||
|
||||
float3 direction;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const NormalNode *normal_node = (const NormalNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
direction == normal_node->direction;
|
||||
}
|
||||
float3 normal;
|
||||
};
|
||||
|
||||
class VectorMathNode : public ShaderNode {
|
||||
@@ -877,15 +832,9 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
bool constant_fold(ShaderGraph *graph, ShaderOutput *socket, ShaderInput *optimized);
|
||||
|
||||
float3 vector1;
|
||||
float3 vector2;
|
||||
NodeVectorMath type;
|
||||
static NodeEnum type_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const VectorMathNode *math_node = (const VectorMathNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
type == math_node->type;
|
||||
}
|
||||
};
|
||||
|
||||
class VectorTransformNode : public ShaderNode {
|
||||
@@ -897,17 +846,7 @@ public:
|
||||
NodeVectorTransformType type;
|
||||
NodeVectorTransformConvertSpace convert_from;
|
||||
NodeVectorTransformConvertSpace convert_to;
|
||||
|
||||
static NodeEnum type_enum;
|
||||
static NodeEnum convert_space_enum;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const VectorTransformNode *vector_transform_node = (const VectorTransformNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
type == vector_transform_node->type &&
|
||||
convert_from == vector_transform_node->convert_from &&
|
||||
convert_to == vector_transform_node->convert_to;
|
||||
}
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class BumpNode : public ShaderNode {
|
||||
@@ -920,12 +859,13 @@ public:
|
||||
}
|
||||
|
||||
bool invert;
|
||||
|
||||
virtual bool equals(const ShaderNode *other) {
|
||||
const BumpNode *bump_node = (const BumpNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
invert == bump_node->invert;
|
||||
}
|
||||
float height;
|
||||
float sample_center;
|
||||
float sample_x;
|
||||
float sample_y;
|
||||
float3 normal;
|
||||
float strength;
|
||||
float distance;
|
||||
};
|
||||
|
||||
class RGBCurvesNode : public ShaderNode {
|
||||
@@ -933,10 +873,10 @@ public:
|
||||
SHADER_NODE_CLASS(RGBCurvesNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
virtual bool equals(const ShaderNode * /*other*/) { return false; }
|
||||
|
||||
array<float3> curves;
|
||||
float min_x, max_x;
|
||||
float min_x, max_x, fac;
|
||||
float3 color;
|
||||
};
|
||||
|
||||
class VectorCurvesNode : public ShaderNode {
|
||||
@@ -944,25 +884,27 @@ public:
|
||||
SHADER_NODE_CLASS(VectorCurvesNode)
|
||||
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
virtual bool equals(const ShaderNode * /*other*/) { return false; }
|
||||
|
||||
array<float3> curves;
|
||||
float min_x, max_x;
|
||||
float min_x, max_x, fac;
|
||||
float3 vector;
|
||||
};
|
||||
|
||||
class RGBRampNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(RGBRampNode)
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
|
||||
array<float3> ramp;
|
||||
array<float> ramp_alpha;
|
||||
float fac;
|
||||
bool interpolate;
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_1; }
|
||||
virtual bool equals(const ShaderNode * /*other*/) { return false; }
|
||||
};
|
||||
|
||||
class SetNormalNode : public ShaderNode {
|
||||
public:
|
||||
SHADER_NODE_CLASS(SetNormalNode)
|
||||
float3 direction;
|
||||
};
|
||||
|
||||
class OSLNode : public ShaderNode {
|
||||
@@ -970,17 +912,20 @@ public:
|
||||
static OSLNode *create(size_t num_inputs);
|
||||
~OSLNode();
|
||||
|
||||
SHADER_NODE_BASE_CLASS(OSLNode)
|
||||
ShaderNode *clone() const;
|
||||
|
||||
char* input_default_value();
|
||||
void add_input(ustring name, SocketType::Type type);
|
||||
void add_output(ustring name, SocketType::Type type);
|
||||
|
||||
SHADER_NODE_NO_CLONE_CLASS(OSLNode)
|
||||
|
||||
/* ideally we could beter detect this, but we can't query this now */
|
||||
bool has_spatial_varying() { return true; }
|
||||
virtual bool equals(const ShaderNode * /*other*/) { return false; }
|
||||
virtual bool equals(const ShaderNode& /*other*/) { return false; }
|
||||
|
||||
string filepath;
|
||||
string bytecode_hash;
|
||||
|
||||
private:
|
||||
OSLNode();
|
||||
};
|
||||
|
||||
class NormalMapNode : public ShaderNode {
|
||||
@@ -991,17 +936,10 @@ public:
|
||||
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
|
||||
|
||||
NodeNormalMapSpace space;
|
||||
static NodeEnum space_enum;
|
||||
|
||||
ustring attribute;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const NormalMapNode *normal_map_node = (const NormalMapNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
space == normal_map_node->space &&
|
||||
attribute == normal_map_node->attribute;
|
||||
}
|
||||
float strength;
|
||||
float3 color;
|
||||
float3 normal_osl;
|
||||
};
|
||||
|
||||
class TangentNode : public ShaderNode {
|
||||
@@ -1013,19 +951,8 @@ public:
|
||||
|
||||
NodeTangentDirectionType direction_type;
|
||||
NodeTangentAxis axis;
|
||||
static NodeEnum direction_type_enum;
|
||||
static NodeEnum axis_enum;
|
||||
|
||||
ustring attribute;
|
||||
|
||||
virtual bool equals(const ShaderNode *other)
|
||||
{
|
||||
const TangentNode *tangent_node = (const TangentNode*)other;
|
||||
return ShaderNode::equals(other) &&
|
||||
direction_type == tangent_node->direction_type &&
|
||||
axis == tangent_node->axis &&
|
||||
attribute == tangent_node->attribute;
|
||||
}
|
||||
float3 normal_osl;
|
||||
};
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@@ -39,8 +39,8 @@ NODE_DEFINE(Object)
|
||||
|
||||
SOCKET_NODE(mesh, "Mesh", &Mesh::node_type);
|
||||
SOCKET_TRANSFORM(tfm, "Transform", transform_identity());
|
||||
SOCKET_INT(visibility, "Visibility", ~0);
|
||||
SOCKET_INT(random_id, "Random ID", 0);
|
||||
SOCKET_UINT(visibility, "Visibility", ~0);
|
||||
SOCKET_UINT(random_id, "Random ID", 0);
|
||||
SOCKET_INT(pass_id, "Pass ID", 0);
|
||||
SOCKET_BOOLEAN(use_holdout, "Use Holdout", false);
|
||||
SOCKET_POINT(dupli_generated, "Dupli Generated", make_float3(0.0f, 0.0f, 0.0f));
|
||||
|
@@ -477,8 +477,10 @@ OSLNode *OSLShaderManager::osl_node(const std::string& filepath,
|
||||
continue;
|
||||
|
||||
if(!param->isoutput && param->validdefault) {
|
||||
node->add_input(param->name.c_str(), socket_type, make_float3(param->fdefault[0], param->fdefault[1], param->fdefault[2]));
|
||||
continue;
|
||||
float3 *default_value = (float3*)node->input_default_value();
|
||||
default_value->x = param->fdefault[0];
|
||||
default_value->y = param->fdefault[1];
|
||||
default_value->z = param->fdefault[2];
|
||||
}
|
||||
}
|
||||
else if(param->type.aggregate == TypeDesc::SCALAR) {
|
||||
@@ -486,24 +488,21 @@ OSLNode *OSLShaderManager::osl_node(const std::string& filepath,
|
||||
socket_type = SocketType::INT;
|
||||
|
||||
if(!param->isoutput && param->validdefault) {
|
||||
node->add_input(param->name.c_str(), socket_type, (float)param->idefault[0]);
|
||||
continue;
|
||||
*(int*)node->input_default_value() = param->idefault[0];
|
||||
}
|
||||
}
|
||||
else if(param->type.basetype == TypeDesc::FLOAT) {
|
||||
socket_type = SocketType::FLOAT;
|
||||
|
||||
if(!param->isoutput && param->validdefault) {
|
||||
node->add_input(param->name.c_str(), socket_type, param->fdefault[0]);
|
||||
continue;
|
||||
*(float*)node->input_default_value() = param->fdefault[0];
|
||||
}
|
||||
}
|
||||
else if(param->type.basetype == TypeDesc::STRING) {
|
||||
socket_type = SocketType::STRING;
|
||||
|
||||
if(!param->isoutput && param->validdefault) {
|
||||
node->add_input(param->name.c_str(), socket_type);
|
||||
continue;
|
||||
*(ustring*)node->input_default_value() = param->sdefault[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -513,10 +512,10 @@ OSLNode *OSLShaderManager::osl_node(const std::string& filepath,
|
||||
continue;
|
||||
|
||||
if(param->isoutput) {
|
||||
node->add_output(param->name.c_str(), socket_type);
|
||||
node->add_output(param->name, socket_type);
|
||||
}
|
||||
else {
|
||||
node->add_input(param->name.c_str(), socket_type);
|
||||
node->add_input(param->name, socket_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,6 +527,9 @@ OSLNode *OSLShaderManager::osl_node(const std::string& filepath,
|
||||
node->filepath = filepath;
|
||||
}
|
||||
|
||||
/* Generate inputs and outputs */
|
||||
node->create_inputs_outputs(node->type);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -643,27 +645,28 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
|
||||
continue;
|
||||
|
||||
string param_name = compatible_name(node, input);
|
||||
const SocketType& socket = input->socket_type;
|
||||
switch(input->type()) {
|
||||
case SocketType::COLOR:
|
||||
parameter_color(param_name.c_str(), input->value());
|
||||
parameter_color(param_name.c_str(), node->get_float3(socket));
|
||||
break;
|
||||
case SocketType::POINT:
|
||||
parameter_point(param_name.c_str(), input->value());
|
||||
parameter_point(param_name.c_str(), node->get_float3(socket));
|
||||
break;
|
||||
case SocketType::VECTOR:
|
||||
parameter_vector(param_name.c_str(), input->value());
|
||||
parameter_vector(param_name.c_str(), node->get_float3(socket));
|
||||
break;
|
||||
case SocketType::NORMAL:
|
||||
parameter_normal(param_name.c_str(), input->value());
|
||||
parameter_normal(param_name.c_str(), node->get_float3(socket));
|
||||
break;
|
||||
case SocketType::FLOAT:
|
||||
parameter(param_name.c_str(), input->value_float());
|
||||
parameter(param_name.c_str(), node->get_float(socket));
|
||||
break;
|
||||
case SocketType::INT:
|
||||
parameter(param_name.c_str(), (int)input->value_float());
|
||||
parameter(param_name.c_str(), node->get_int(socket));
|
||||
break;
|
||||
case SocketType::STRING:
|
||||
parameter(param_name.c_str(), input->value_string());
|
||||
parameter(param_name.c_str(), node->get_string(socket));
|
||||
break;
|
||||
case SocketType::CLOSURE:
|
||||
case SocketType::UNDEFINED:
|
||||
@@ -733,6 +736,169 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
|
||||
}
|
||||
}
|
||||
|
||||
static TypeDesc array_typedesc(TypeDesc typedesc, int arraylength)
|
||||
{
|
||||
return TypeDesc((TypeDesc::BASETYPE)typedesc.basetype,
|
||||
(TypeDesc::AGGREGATE)typedesc.aggregate,
|
||||
(TypeDesc::VECSEMANTICS)typedesc.vecsemantics,
|
||||
arraylength);
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter(ShaderNode* node, const char *name)
|
||||
{
|
||||
OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
|
||||
ustring uname = ustring(name);
|
||||
const SocketType& socket = *(node->type->find_input(uname));
|
||||
|
||||
switch(socket.type)
|
||||
{
|
||||
case SocketType::BOOLEAN:
|
||||
{
|
||||
int value = node->get_bool(socket);
|
||||
ss->Parameter(name, TypeDesc::TypeInt, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::FLOAT:
|
||||
{
|
||||
float value = node->get_float(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeFloat, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::INT:
|
||||
{
|
||||
int value = node->get_int(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeInt, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::COLOR:
|
||||
{
|
||||
float3 value = node->get_float3(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeColor, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::VECTOR:
|
||||
{
|
||||
float3 value = node->get_float3(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeVector, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::POINT:
|
||||
{
|
||||
float3 value = node->get_float3(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypePoint, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::NORMAL:
|
||||
{
|
||||
float3 value = node->get_float3(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeNormal, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::POINT2:
|
||||
{
|
||||
float2 value = node->get_float2(socket);
|
||||
ss->Parameter(uname, TypeDesc(TypeDesc::FLOAT, TypeDesc::VEC2, TypeDesc::POINT), &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::STRING:
|
||||
{
|
||||
ustring value = node->get_string(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeString, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::ENUM:
|
||||
{
|
||||
ustring value = node->get_string(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeString, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::TRANSFORM:
|
||||
{
|
||||
Transform value = node->get_transform(socket);
|
||||
ss->Parameter(uname, TypeDesc::TypeMatrix, &value);
|
||||
break;
|
||||
}
|
||||
case SocketType::BOOLEAN_ARRAY:
|
||||
{
|
||||
// OSL does not support booleans, so convert to int
|
||||
const array<bool>& value = node->get_bool_array(socket);
|
||||
array<int> intvalue(value.size());
|
||||
for (size_t i = 0; i < value.size(); i++)
|
||||
intvalue[i] = value[i];
|
||||
ss->Parameter(uname, array_typedesc(TypeDesc::TypeInt, value.size()), intvalue.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::FLOAT_ARRAY:
|
||||
{
|
||||
const array<float>& value = node->get_float_array(socket);
|
||||
ss->Parameter(uname, array_typedesc(TypeDesc::TypeFloat, value.size()), value.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::INT_ARRAY:
|
||||
{
|
||||
const array<int>& value = node->get_int_array(socket);
|
||||
ss->Parameter(uname, array_typedesc(TypeDesc::TypeInt, value.size()), value.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::COLOR_ARRAY:
|
||||
case SocketType::VECTOR_ARRAY:
|
||||
case SocketType::POINT_ARRAY:
|
||||
case SocketType::NORMAL_ARRAY:
|
||||
{
|
||||
TypeDesc typedesc;
|
||||
|
||||
switch(socket.type)
|
||||
{
|
||||
case SocketType::COLOR_ARRAY: typedesc = TypeDesc::TypeColor; break;
|
||||
case SocketType::VECTOR_ARRAY: typedesc = TypeDesc::TypeVector; break;
|
||||
case SocketType::POINT_ARRAY: typedesc = TypeDesc::TypePoint; break;
|
||||
case SocketType::NORMAL_ARRAY: typedesc = TypeDesc::TypeNormal; break;
|
||||
default: assert(0); break;
|
||||
}
|
||||
|
||||
// convert to tightly packed array since float3 has padding
|
||||
const array<float3>& value = node->get_float3_array(socket);
|
||||
array<float> fvalue(value.size() * 3);
|
||||
for (size_t i = 0, j = 0; i < value.size(); i++)
|
||||
{
|
||||
fvalue[j++] = value[i].x;
|
||||
fvalue[j++] = value[i].y;
|
||||
fvalue[j++] = value[i].z;
|
||||
}
|
||||
|
||||
ss->Parameter(uname, array_typedesc(typedesc, value.size()), fvalue.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::POINT2_ARRAY:
|
||||
{
|
||||
const array<float2>& value = node->get_float2_array(socket);
|
||||
ss->Parameter(uname, array_typedesc(TypeDesc(TypeDesc::FLOAT, TypeDesc::VEC2, TypeDesc::POINT), value.size()), value.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::STRING_ARRAY:
|
||||
{
|
||||
const array<ustring>& value = node->get_string_array(socket);
|
||||
ss->Parameter(uname, array_typedesc(TypeDesc::TypeString, value.size()), value.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::TRANSFORM_ARRAY:
|
||||
{
|
||||
const array<Transform>& value = node->get_transform_array(socket);
|
||||
ss->Parameter(uname, array_typedesc(TypeDesc::TypeMatrix, value.size()), value.data());
|
||||
break;
|
||||
}
|
||||
case SocketType::CLOSURE:
|
||||
case SocketType::NODE:
|
||||
case SocketType::NODE_ARRAY:
|
||||
case SocketType::UNDEFINED:
|
||||
case SocketType::UINT:
|
||||
{
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter(const char *name, float f)
|
||||
{
|
||||
OSL::ShadingSystem *ss = (OSL::ShadingSystem*)shadingsys;
|
||||
@@ -996,6 +1162,10 @@ void OSLCompiler::add(ShaderNode * /*node*/, const char * /*name*/, bool /*isfil
|
||||
{
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter(ShaderNode * /*node*/, const char * /*name*/)
|
||||
{
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter(const char * /*name*/, float /*f*/)
|
||||
{
|
||||
}
|
||||
|
@@ -125,6 +125,8 @@ public:
|
||||
|
||||
void add(ShaderNode *node, const char *name, bool isfilepath = false);
|
||||
|
||||
void parameter(ShaderNode *node, const char *name);
|
||||
|
||||
void parameter(const char *name, float f);
|
||||
void parameter_color(const char *name, float3 f);
|
||||
void parameter_vector(const char *name, float3 f);
|
||||
|
@@ -449,17 +449,15 @@ void ShaderManager::device_free_common(Device *device, DeviceScene *dscene, Scen
|
||||
|
||||
void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderNode *closure, *out;
|
||||
|
||||
/* default surface */
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
closure = graph->add(new DiffuseBsdfNode());
|
||||
closure->input("Color")->set(make_float3(0.8f, 0.8f, 0.8f));
|
||||
out = graph->output();
|
||||
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
|
||||
diffuse->color = make_float3(0.8f, 0.8f, 0.8f);
|
||||
graph->add(diffuse);
|
||||
|
||||
graph->connect(closure->output("BSDF"), out->input("Surface"));
|
||||
graph->connect(diffuse->output("BSDF"), graph->output()->input("Surface"));
|
||||
|
||||
Shader *shader = new Shader();
|
||||
shader->name = "default_surface";
|
||||
@@ -472,12 +470,12 @@ void ShaderManager::add_default(Scene *scene)
|
||||
{
|
||||
ShaderGraph *graph = new ShaderGraph();
|
||||
|
||||
closure = graph->add(new EmissionNode());
|
||||
closure->input("Color")->set(make_float3(0.8f, 0.8f, 0.8f));
|
||||
closure->input("Strength")->set(0.0f);
|
||||
out = graph->output();
|
||||
EmissionNode *emission = new EmissionNode();
|
||||
emission->color = make_float3(0.8f, 0.8f, 0.8f);
|
||||
emission->strength = 0.0f;
|
||||
graph->add(emission);
|
||||
|
||||
graph->connect(closure->output("Emission"), out->input("Surface"));
|
||||
graph->connect(emission->output("Emission"), graph->output()->input("Surface"));
|
||||
|
||||
Shader *shader = new Shader();
|
||||
shader->name = "default_light";
|
||||
|
@@ -192,14 +192,16 @@ int SVMCompiler::stack_assign(ShaderInput *input)
|
||||
input->stack_offset = input->link->stack_offset;
|
||||
}
|
||||
else {
|
||||
Node *node = input->parent;
|
||||
|
||||
/* not linked to output -> add nodes to load default value */
|
||||
input->stack_offset = stack_find_offset(input->type());
|
||||
|
||||
if(input->type() == SocketType::FLOAT) {
|
||||
add_node(NODE_VALUE_F, __float_as_int(input->value_float()), input->stack_offset);
|
||||
add_node(NODE_VALUE_F, __float_as_int(node->get_float(input->socket_type)), input->stack_offset);
|
||||
}
|
||||
else if(input->type() == SocketType::INT) {
|
||||
add_node(NODE_VALUE_F, (int)input->value_float(), input->stack_offset);
|
||||
add_node(NODE_VALUE_F, node->get_int(input->socket_type), input->stack_offset);
|
||||
}
|
||||
else if(input->type() == SocketType::VECTOR ||
|
||||
input->type() == SocketType::NORMAL ||
|
||||
@@ -208,7 +210,7 @@ int SVMCompiler::stack_assign(ShaderInput *input)
|
||||
{
|
||||
|
||||
add_node(NODE_VALUE_V, input->stack_offset);
|
||||
add_node(NODE_VALUE_V, input->value());
|
||||
add_node(NODE_VALUE_V, node->get_float3(input->socket_type));
|
||||
}
|
||||
else /* should not get called for closure */
|
||||
assert(0);
|
||||
@@ -446,7 +448,7 @@ void SVMCompiler::generate_closure_node(ShaderNode *node,
|
||||
const char *weight_name = (current_type == SHADER_TYPE_VOLUME)? "VolumeMixWeight": "SurfaceMixWeight";
|
||||
ShaderInput *weight_in = node->input(weight_name);
|
||||
|
||||
if(weight_in && (weight_in->link || weight_in->value_float() != 1.0f))
|
||||
if(weight_in && (weight_in->link || node->get_float(weight_in->socket_type) != 1.0f))
|
||||
mix_weight_offset = stack_assign(weight_in);
|
||||
else
|
||||
mix_weight_offset = SVM_STACK_INVALID;
|
||||
|
@@ -19,16 +19,14 @@
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Blender Foundation
|
||||
# Contributor(s): Blender Foundation.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(INC
|
||||
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
)
|
||||
|
||||
set(SRC
|
||||
@@ -44,18 +42,17 @@ if (WIN32)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
list(APPEND SRC
|
||||
linux/DeckLinkAPI.h
|
||||
linux/DeckLinkAPIConfiguration.h
|
||||
linux/DeckLinkAPIDeckControl.h
|
||||
linux/DeckLinkAPIDiscovery.h
|
||||
linux/DeckLinkAPIDispatch.cpp
|
||||
linux/DeckLinkAPIModes.h
|
||||
linux/DeckLinkAPIVersion.h
|
||||
linux/DeckLinkAPITypes.h
|
||||
linux/LinuxCOM.h
|
||||
)
|
||||
list(APPEND SRC
|
||||
linux/DeckLinkAPI.h
|
||||
linux/DeckLinkAPIConfiguration.h
|
||||
linux/DeckLinkAPIDeckControl.h
|
||||
linux/DeckLinkAPIDiscovery.h
|
||||
linux/DeckLinkAPIDispatch.cpp
|
||||
linux/DeckLinkAPIModes.h
|
||||
linux/DeckLinkAPIVersion.h
|
||||
linux/DeckLinkAPITypes.h
|
||||
linux/LinuxCOM.h
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
blender_add_lib(bf_intern_decklink "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
@@ -35,24 +35,22 @@
|
||||
/* Include the OS specific Declink headers */
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <objbase.h>
|
||||
#include <comutil.h>
|
||||
#include "win/DeckLinkAPI_h.h"
|
||||
typedef unsigned int dl_size_t;
|
||||
# include <windows.h>
|
||||
# include <objbase.h>
|
||||
# include <comutil.h>
|
||||
# include "win/DeckLinkAPI_h.h"
|
||||
typedef unsigned int dl_size_t;
|
||||
#elif defined(__APPLE__)
|
||||
#error "Decklink not supported in OSX"
|
||||
# error "Decklink not supported in OSX"
|
||||
#else
|
||||
#include "linux/DeckLinkAPI.h"
|
||||
/* Windows COM API uses BOOL, linux uses bool */
|
||||
#define BOOL bool
|
||||
typedef uint32_t dl_size_t;
|
||||
# include "linux/DeckLinkAPI.h"
|
||||
/* Windows COM API uses BOOL, linux uses bool */
|
||||
# define BOOL bool
|
||||
typedef uint32_t dl_size_t;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* OS independent function to get the device iterator */
|
||||
IDeckLinkIterator* BMD_CreateDeckLinkIterator(void);
|
||||
|
||||
#endif
|
||||
#endif /* __DECKLINKAPI_H__ */
|
||||
|
@@ -1,60 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2014 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
#ifndef BMD_DECKLINKAPICONFIGURATION_v10_2_H
|
||||
#define BMD_DECKLINKAPICONFIGURATION_v10_2_H
|
||||
|
||||
#include "DeckLinkAPIConfiguration.h"
|
||||
|
||||
// Interface ID Declarations
|
||||
|
||||
BMD_CONST REFIID IID_IDeckLinkConfiguration_v10_2 = /* C679A35B-610C-4D09-B748-1D0478100FC0 */ {0xC6,0x79,0xA3,0x5B,0x61,0x0C,0x4D,0x09,0xB7,0x48,0x1D,0x04,0x78,0x10,0x0F,0xC0};
|
||||
|
||||
// Forward Declarations
|
||||
|
||||
class IDeckLinkConfiguration_v10_2;
|
||||
|
||||
/* Interface IDeckLinkConfiguration_v10_2 - DeckLink Configuration interface */
|
||||
|
||||
class IDeckLinkConfiguration_v10_2 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT SetFlag (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ bool value) = 0;
|
||||
virtual HRESULT GetFlag (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ bool *value) = 0;
|
||||
virtual HRESULT SetInt (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ int64_t value) = 0;
|
||||
virtual HRESULT GetInt (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ int64_t *value) = 0;
|
||||
virtual HRESULT SetFloat (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ double value) = 0;
|
||||
virtual HRESULT GetFloat (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ double *value) = 0;
|
||||
virtual HRESULT SetString (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ const char *value) = 0;
|
||||
virtual HRESULT GetString (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ const char **value) = 0;
|
||||
virtual HRESULT WriteConfigurationToPreferences (void) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkConfiguration_v10_2 () {} // call Release method to drop reference count
|
||||
};
|
||||
|
||||
#endif /* defined(BMD_DECKLINKAPICONFIGURATION_v10_2_H) */
|
@@ -1,109 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2009 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
**/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "DeckLinkAPI_v7_6.h"
|
||||
|
||||
#define kDeckLinkAPI_Name "libDeckLinkAPI.so"
|
||||
#define KDeckLinkPreviewAPI_Name "libDeckLinkPreviewAPI.so"
|
||||
|
||||
typedef IDeckLinkIterator* (*CreateIteratorFunc_v7_6)(void);
|
||||
typedef IDeckLinkGLScreenPreviewHelper_v7_6* (*CreateOpenGLScreenPreviewHelperFunc_v7_6)(void);
|
||||
typedef IDeckLinkVideoConversion_v7_6* (*CreateVideoConversionInstanceFunc_v7_6)(void);
|
||||
|
||||
static pthread_once_t gDeckLinkOnceControl = PTHREAD_ONCE_INIT;
|
||||
static pthread_once_t gPreviewOnceControl = PTHREAD_ONCE_INIT;
|
||||
|
||||
static CreateIteratorFunc_v7_6 gCreateIteratorFunc = NULL;
|
||||
static CreateOpenGLScreenPreviewHelperFunc_v7_6 gCreateOpenGLPreviewFunc = NULL;
|
||||
static CreateVideoConversionInstanceFunc_v7_6 gCreateVideoConversionFunc = NULL;
|
||||
|
||||
void InitDeckLinkAPI_v7_6 (void)
|
||||
{
|
||||
void *libraryHandle;
|
||||
|
||||
libraryHandle = dlopen(kDeckLinkAPI_Name, RTLD_NOW|RTLD_GLOBAL);
|
||||
if (!libraryHandle)
|
||||
{
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
return;
|
||||
}
|
||||
|
||||
gCreateIteratorFunc = (CreateIteratorFunc_v7_6)dlsym(libraryHandle, "CreateDeckLinkIteratorInstance");
|
||||
if (!gCreateIteratorFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
gCreateVideoConversionFunc = (CreateVideoConversionInstanceFunc_v7_6)dlsym(libraryHandle, "CreateVideoConversionInstance");
|
||||
if (!gCreateVideoConversionFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
}
|
||||
|
||||
void InitDeckLinkPreviewAPI_v7_6 (void)
|
||||
{
|
||||
void *libraryHandle;
|
||||
|
||||
libraryHandle = dlopen(KDeckLinkPreviewAPI_Name, RTLD_NOW|RTLD_GLOBAL);
|
||||
if (!libraryHandle)
|
||||
{
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
return;
|
||||
}
|
||||
gCreateOpenGLPreviewFunc = (CreateOpenGLScreenPreviewHelperFunc_v7_6)dlsym(libraryHandle, "CreateOpenGLScreenPreviewHelper");
|
||||
if (!gCreateOpenGLPreviewFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
}
|
||||
|
||||
IDeckLinkIterator* CreateDeckLinkIteratorInstance_v7_6 (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI_v7_6);
|
||||
|
||||
if (gCreateIteratorFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateIteratorFunc();
|
||||
}
|
||||
|
||||
IDeckLinkGLScreenPreviewHelper_v7_6* CreateOpenGLScreenPreviewHelper_v7_6 (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI_v7_6);
|
||||
pthread_once(&gPreviewOnceControl, InitDeckLinkPreviewAPI_v7_6);
|
||||
|
||||
if (gCreateOpenGLPreviewFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateOpenGLPreviewFunc();
|
||||
}
|
||||
|
||||
IDeckLinkVideoConversion_v7_6* CreateVideoConversionInstance_v7_6 (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI_v7_6);
|
||||
|
||||
if (gCreateVideoConversionFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateVideoConversionFunc();
|
||||
}
|
||||
|
@@ -1,133 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2011 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
**/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "DeckLinkAPI_v8_0.h"
|
||||
|
||||
#define kDeckLinkAPI_Name "libDeckLinkAPI.so"
|
||||
#define KDeckLinkPreviewAPI_Name "libDeckLinkPreviewAPI.so"
|
||||
|
||||
typedef IDeckLinkIterator_v8_0* (*CreateIteratorFunc)(void);
|
||||
typedef IDeckLinkAPIInformation* (*CreateAPIInformationFunc)(void);
|
||||
typedef IDeckLinkGLScreenPreviewHelper* (*CreateOpenGLScreenPreviewHelperFunc)(void);
|
||||
typedef IDeckLinkVideoConversion* (*CreateVideoConversionInstanceFunc)(void);
|
||||
|
||||
static pthread_once_t gDeckLinkOnceControl = PTHREAD_ONCE_INIT;
|
||||
static pthread_once_t gPreviewOnceControl = PTHREAD_ONCE_INIT;
|
||||
|
||||
static bool gLoadedDeckLinkAPI = false;
|
||||
|
||||
static CreateIteratorFunc gCreateIteratorFunc = NULL;
|
||||
static CreateAPIInformationFunc gCreateAPIInformationFunc = NULL;
|
||||
static CreateOpenGLScreenPreviewHelperFunc gCreateOpenGLPreviewFunc = NULL;
|
||||
static CreateVideoConversionInstanceFunc gCreateVideoConversionFunc = NULL;
|
||||
|
||||
void InitDeckLinkAPI (void)
|
||||
{
|
||||
void *libraryHandle;
|
||||
|
||||
libraryHandle = dlopen(kDeckLinkAPI_Name, RTLD_NOW|RTLD_GLOBAL);
|
||||
if (!libraryHandle)
|
||||
{
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
return;
|
||||
}
|
||||
|
||||
gLoadedDeckLinkAPI = true;
|
||||
|
||||
gCreateIteratorFunc = (CreateIteratorFunc)dlsym(libraryHandle, "CreateDeckLinkIteratorInstance_0001");
|
||||
if (!gCreateIteratorFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
gCreateAPIInformationFunc = (CreateAPIInformationFunc)dlsym(libraryHandle, "CreateDeckLinkAPIInformationInstance_0001");
|
||||
if (!gCreateAPIInformationFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
gCreateVideoConversionFunc = (CreateVideoConversionInstanceFunc)dlsym(libraryHandle, "CreateVideoConversionInstance_0001");
|
||||
if (!gCreateVideoConversionFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
}
|
||||
|
||||
void InitDeckLinkPreviewAPI (void)
|
||||
{
|
||||
void *libraryHandle;
|
||||
|
||||
libraryHandle = dlopen(KDeckLinkPreviewAPI_Name, RTLD_NOW|RTLD_GLOBAL);
|
||||
if (!libraryHandle)
|
||||
{
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
return;
|
||||
}
|
||||
gCreateOpenGLPreviewFunc = (CreateOpenGLScreenPreviewHelperFunc)dlsym(libraryHandle, "CreateOpenGLScreenPreviewHelper_0001");
|
||||
if (!gCreateOpenGLPreviewFunc)
|
||||
fprintf(stderr, "%s\n", dlerror());
|
||||
}
|
||||
|
||||
bool IsDeckLinkAPIPresent (void)
|
||||
{
|
||||
// If the DeckLink API dynamic library was successfully loaded, return this knowledge to the caller
|
||||
return gLoadedDeckLinkAPI;
|
||||
}
|
||||
|
||||
IDeckLinkIterator_v8_0* CreateDeckLinkIteratorInstance (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI);
|
||||
|
||||
if (gCreateIteratorFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateIteratorFunc();
|
||||
}
|
||||
|
||||
IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI);
|
||||
|
||||
if (gCreateAPIInformationFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateAPIInformationFunc();
|
||||
}
|
||||
|
||||
IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI);
|
||||
pthread_once(&gPreviewOnceControl, InitDeckLinkPreviewAPI);
|
||||
|
||||
if (gCreateOpenGLPreviewFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateOpenGLPreviewFunc();
|
||||
}
|
||||
|
||||
IDeckLinkVideoConversion* CreateVideoConversionInstance (void)
|
||||
{
|
||||
pthread_once(&gDeckLinkOnceControl, InitDeckLinkAPI);
|
||||
|
||||
if (gCreateVideoConversionFunc == NULL)
|
||||
return NULL;
|
||||
return gCreateVideoConversionFunc();
|
||||
}
|
||||
|
@@ -1,55 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2014 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
#ifndef BMD_DECKLINKAPI_v10_2_H
|
||||
#define BMD_DECKLINKAPI_v10_2_H
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
// Type Declarations
|
||||
|
||||
/* Enum BMDDeckLinkConfigurationID - DeckLink Configuration ID */
|
||||
|
||||
typedef uint32_t BMDDeckLinkConfigurationID_v10_2;
|
||||
enum _BMDDeckLinkConfigurationID_v10_2 {
|
||||
/* Video output flags */
|
||||
|
||||
bmdDeckLinkConfig3GBpsVideoOutput_v10_2 = '3gbs',
|
||||
};
|
||||
|
||||
/* Enum BMDAudioConnection_v10_2 - Audio connection types */
|
||||
|
||||
typedef uint32_t BMDAudioConnection_v10_2;
|
||||
enum _BMDAudioConnection_v10_2 {
|
||||
bmdAudioConnectionEmbedded_v10_2 = /* 'embd' */ 0x656D6264,
|
||||
bmdAudioConnectionAESEBU_v10_2 = /* 'aes ' */ 0x61657320,
|
||||
bmdAudioConnectionAnalog_v10_2 = /* 'anlg' */ 0x616E6C67,
|
||||
bmdAudioConnectionAnalogXLR_v10_2 = /* 'axlr' */ 0x61786C72,
|
||||
bmdAudioConnectionAnalogRCA_v10_2 = /* 'arca' */ 0x61726361
|
||||
};
|
||||
|
||||
#endif /* defined(BMD_DECKLINKAPI_v10_2_H) */
|
@@ -1,198 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2009 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
/* DeckLinkAPI_v7_1.h */
|
||||
|
||||
#ifndef __DeckLink_API_v7_1_h__
|
||||
#define __DeckLink_API_v7_1_h__
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
// "B28131B6-59AC-4857-B5AC-CD75D5883E2F"
|
||||
#define IID_IDeckLinkDisplayModeIterator_v7_1 (REFIID){0xB2,0x81,0x31,0xB6,0x59,0xAC,0x48,0x57,0xB5,0xAC,0xCD,0x75,0xD5,0x88,0x3E,0x2F}
|
||||
|
||||
// "AF0CD6D5-8376-435E-8433-54F9DD530AC3"
|
||||
#define IID_IDeckLinkDisplayMode_v7_1 (REFIID){0xAF,0x0C,0xD6,0xD5,0x83,0x76,0x43,0x5E,0x84,0x33,0x54,0xF9,0xDD,0x53,0x0A,0xC3}
|
||||
|
||||
// "EBD01AFA-E4B0-49C6-A01D-EDB9D1B55FD9"
|
||||
#define IID_IDeckLinkVideoOutputCallback_v7_1 (REFIID){0xEB,0xD0,0x1A,0xFA,0xE4,0xB0,0x49,0xC6,0xA0,0x1D,0xED,0xB9,0xD1,0xB5,0x5F,0xD9}
|
||||
|
||||
// "7F94F328-5ED4-4E9F-9729-76A86BDC99CC"
|
||||
#define IID_IDeckLinkInputCallback_v7_1 (REFIID){0x7F,0x94,0xF3,0x28,0x5E,0xD4,0x4E,0x9F,0x97,0x29,0x76,0xA8,0x6B,0xDC,0x99,0xCC}
|
||||
|
||||
// "AE5B3E9B-4E1E-4535-B6E8-480FF52F6CE5"
|
||||
#define IID_IDeckLinkOutput_v7_1 (REFIID){0xAE,0x5B,0x3E,0x9B,0x4E,0x1E,0x45,0x35,0xB6,0xE8,0x48,0x0F,0xF5,0x2F,0x6C,0xE5}
|
||||
|
||||
// "2B54EDEF-5B32-429F-BA11-BB990596EACD"
|
||||
#define IID_IDeckLinkInput_v7_1 (REFIID){0x2B,0x54,0xED,0xEF,0x5B,0x32,0x42,0x9F,0xBA,0x11,0xBB,0x99,0x05,0x96,0xEA,0xCD}
|
||||
|
||||
// "333F3A10-8C2D-43CF-B79D-46560FEEA1CE"
|
||||
#define IID_IDeckLinkVideoFrame_v7_1 (REFIID){0x33,0x3F,0x3A,0x10,0x8C,0x2D,0x43,0xCF,0xB7,0x9D,0x46,0x56,0x0F,0xEE,0xA1,0xCE}
|
||||
|
||||
// "C8B41D95-8848-40EE-9B37-6E3417FB114B"
|
||||
#define IID_IDeckLinkVideoInputFrame_v7_1 (REFIID){0xC8,0xB4,0x1D,0x95,0x88,0x48,0x40,0xEE,0x9B,0x37,0x6E,0x34,0x17,0xFB,0x11,0x4B}
|
||||
|
||||
// "C86DE4F6-A29F-42E3-AB3A-1363E29F0788"
|
||||
#define IID_IDeckLinkAudioInputPacket_v7_1 (REFIID){0xC8,0x6D,0xE4,0xF6,0xA2,0x9F,0x42,0xE3,0xAB,0x3A,0x13,0x63,0xE2,0x9F,0x07,0x88}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
class IDeckLinkDisplayModeIterator_v7_1;
|
||||
class IDeckLinkDisplayMode_v7_1;
|
||||
class IDeckLinkVideoFrame_v7_1;
|
||||
class IDeckLinkVideoInputFrame_v7_1;
|
||||
class IDeckLinkAudioInputPacket_v7_1;
|
||||
|
||||
class IDeckLinkDisplayModeIterator_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE Next (IDeckLinkDisplayMode_v7_1* *deckLinkDisplayMode) = 0;
|
||||
};
|
||||
|
||||
|
||||
class IDeckLinkDisplayMode_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE GetName (const char **name) = 0;
|
||||
virtual BMDDisplayMode STDMETHODCALLTYPE GetDisplayMode () = 0;
|
||||
virtual long STDMETHODCALLTYPE GetWidth () = 0;
|
||||
virtual long STDMETHODCALLTYPE GetHeight () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFrameRate (BMDTimeValue *frameDuration, BMDTimeScale *timeScale) = 0;
|
||||
};
|
||||
|
||||
class IDeckLinkVideoOutputCallback_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted (IDeckLinkVideoFrame_v7_1* completedFrame, BMDOutputFrameCompletionResult result) = 0;
|
||||
};
|
||||
|
||||
class IDeckLinkInputCallback_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived (IDeckLinkVideoInputFrame_v7_1* videoFrame, IDeckLinkAudioInputPacket_v7_1* audioPacket) = 0;
|
||||
};
|
||||
|
||||
// IDeckLinkOutput_v7_1. Created by QueryInterface from IDeckLink.
|
||||
class IDeckLinkOutput_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
// Display mode predicates
|
||||
virtual HRESULT STDMETHODCALLTYPE DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDDisplayModeSupport *result) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDisplayModeIterator (IDeckLinkDisplayModeIterator_v7_1* *iterator) = 0;
|
||||
|
||||
|
||||
// Video output
|
||||
virtual HRESULT STDMETHODCALLTYPE EnableVideoOutput (BMDDisplayMode displayMode) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DisableVideoOutput () = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetVideoOutputFrameMemoryAllocator (IDeckLinkMemoryAllocator* theAllocator) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateVideoFrame (int32_t width, int32_t height, int32_t rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, IDeckLinkVideoFrame_v7_1* *outFrame) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateVideoFrameFromBuffer (void* buffer, int32_t width, int32_t height, int32_t rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, IDeckLinkVideoFrame_v7_1* *outFrame) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE DisplayVideoFrameSync (IDeckLinkVideoFrame_v7_1* theFrame) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ScheduleVideoFrame (IDeckLinkVideoFrame_v7_1* theFrame, BMDTimeValue displayTime, BMDTimeValue displayDuration, BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetScheduledFrameCompletionCallback (IDeckLinkVideoOutputCallback_v7_1* theCallback) = 0;
|
||||
|
||||
|
||||
// Audio output
|
||||
virtual HRESULT STDMETHODCALLTYPE EnableAudioOutput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DisableAudioOutput () = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE WriteAudioSamplesSync (void* buffer, uint32_t sampleFrameCount, uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE BeginAudioPreroll () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EndAudioPreroll () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ScheduleAudioSamples (void* buffer, uint32_t sampleFrameCount, BMDTimeValue streamTime, BMDTimeScale timeScale, uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleCount) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE FlushBufferedAudioSamples () = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetAudioCallback (IDeckLinkAudioOutputCallback* theCallback) = 0;
|
||||
|
||||
|
||||
// Output control
|
||||
virtual HRESULT STDMETHODCALLTYPE StartScheduledPlayback (BMDTimeValue playbackStartTime, BMDTimeScale timeScale, double playbackSpeed) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE StopScheduledPlayback (BMDTimeValue stopPlaybackAtTime, BMDTimeValue *actualStopTime, BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetHardwareReferenceClock (BMDTimeScale desiredTimeScale, BMDTimeValue *elapsedTimeSinceSchedulerBegan) = 0;
|
||||
};
|
||||
|
||||
// IDeckLinkInput_v7_1. Created by QueryInterface from IDeckLink.
|
||||
class IDeckLinkInput_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDDisplayModeSupport *result) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDisplayModeIterator (IDeckLinkDisplayModeIterator_v7_1 **iterator) = 0;
|
||||
|
||||
// Video input
|
||||
virtual HRESULT STDMETHODCALLTYPE EnableVideoInput (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDVideoInputFlags flags) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DisableVideoInput () = 0;
|
||||
|
||||
// Audio input
|
||||
virtual HRESULT STDMETHODCALLTYPE EnableAudioInput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE DisableAudioInput () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE ReadAudioSamples (void* buffer, uint32_t sampleFrameCount, uint32_t *sampleFramesRead, BMDTimeValue *audioPacketTime, BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleCount) = 0;
|
||||
|
||||
// Input control
|
||||
virtual HRESULT STDMETHODCALLTYPE StartStreams () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE StopStreams () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE PauseStreams () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE SetCallback (IDeckLinkInputCallback_v7_1* theCallback) = 0;
|
||||
};
|
||||
|
||||
// IDeckLinkVideoFrame_v7_1. Created by IDeckLinkOutput::CreateVideoFrame.
|
||||
class IDeckLinkVideoFrame_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual long STDMETHODCALLTYPE GetWidth () = 0;
|
||||
virtual long STDMETHODCALLTYPE GetHeight () = 0;
|
||||
virtual long STDMETHODCALLTYPE GetRowBytes () = 0;
|
||||
virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat () = 0;
|
||||
virtual BMDFrameFlags STDMETHODCALLTYPE GetFlags () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetBytes (void* *buffer) = 0;
|
||||
};
|
||||
|
||||
// IDeckLinkVideoInputFrame_v7_1. Provided by the IDeckLinkInput_v7_1 frame arrival callback.
|
||||
class IDeckLinkVideoInputFrame_v7_1 : public IDeckLinkVideoFrame_v7_1
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFrameTime (BMDTimeValue *frameTime, BMDTimeValue *frameDuration, BMDTimeScale timeScale) = 0;
|
||||
};
|
||||
|
||||
// IDeckLinkAudioInputPacket_v7_1. Provided by the IDeckLinkInput_v7_1 callback.
|
||||
class IDeckLinkAudioInputPacket_v7_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual long STDMETHODCALLTYPE GetSampleCount () = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetBytes (void* *buffer) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetAudioPacketTime (BMDTimeValue *packetTime, BMDTimeScale timeScale) = 0;
|
||||
};
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
|
||||
#endif // __DeckLink_API_v7_1_h__
|
||||
|
@@ -1,173 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2009 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
/* DeckLinkAPI_v7_3.h */
|
||||
|
||||
#ifndef __DeckLink_API_v7_3_h__
|
||||
#define __DeckLink_API_v7_3_h__
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
#include "DeckLinkAPI_v7_6.h"
|
||||
|
||||
/* Interface ID Declarations */
|
||||
|
||||
#define IID_IDeckLinkInputCallback_v7_3 /* FD6F311D-4D00-444B-9ED4-1F25B5730AD0 */ (REFIID){0xFD,0x6F,0x31,0x1D,0x4D,0x00,0x44,0x4B,0x9E,0xD4,0x1F,0x25,0xB5,0x73,0x0A,0xD0}
|
||||
#define IID_IDeckLinkOutput_v7_3 /* 271C65E3-C323-4344-A30F-D908BCB20AA3 */ (REFIID){0x27,0x1C,0x65,0xE3,0xC3,0x23,0x43,0x44,0xA3,0x0F,0xD9,0x08,0xBC,0xB2,0x0A,0xA3}
|
||||
#define IID_IDeckLinkInput_v7_3 /* 4973F012-9925-458C-871C-18774CDBBECB */ (REFIID){0x49,0x73,0xF0,0x12,0x99,0x25,0x45,0x8C,0x87,0x1C,0x18,0x77,0x4C,0xDB,0xBE,0xCB}
|
||||
#define IID_IDeckLinkVideoInputFrame_v7_3 /* CF317790-2894-11DE-8C30-0800200C9A66 */ (REFIID){0xCF,0x31,0x77,0x90,0x28,0x94,0x11,0xDE,0x8C,0x30,0x08,0x00,0x20,0x0C,0x9A,0x66}
|
||||
|
||||
/* End Interface ID Declarations */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
class IDeckLinkVideoInputFrame_v7_3;
|
||||
|
||||
/* End Forward Declarations */
|
||||
|
||||
|
||||
/* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkOutput_v7_3 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, /* out */ BMDDisplayModeSupport *result) = 0;
|
||||
virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator_v7_6 **iterator) = 0;
|
||||
|
||||
virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
|
||||
|
||||
/* Video Output */
|
||||
|
||||
virtual HRESULT EnableVideoOutput (BMDDisplayMode displayMode, BMDVideoOutputFlags flags) = 0;
|
||||
virtual HRESULT DisableVideoOutput (void) = 0;
|
||||
|
||||
virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
|
||||
virtual HRESULT CreateVideoFrame (int32_t width, int32_t height, int32_t rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, /* out */ IDeckLinkMutableVideoFrame_v7_6 **outFrame) = 0;
|
||||
virtual HRESULT CreateAncillaryData (BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0;
|
||||
|
||||
virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame_v7_6 *theFrame) = 0;
|
||||
virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame_v7_6 *theFrame, BMDTimeValue displayTime, BMDTimeValue displayDuration, BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
|
||||
virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
|
||||
|
||||
/* Audio Output */
|
||||
|
||||
virtual HRESULT EnableAudioOutput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount, BMDAudioOutputStreamType streamType) = 0;
|
||||
virtual HRESULT DisableAudioOutput (void) = 0;
|
||||
|
||||
virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT BeginAudioPreroll (void) = 0;
|
||||
virtual HRESULT EndAudioPreroll (void) = 0;
|
||||
virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, uint32_t sampleFrameCount, BMDTimeValue streamTime, BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
|
||||
virtual HRESULT FlushBufferedAudioSamples (void) = 0;
|
||||
|
||||
virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
|
||||
|
||||
/* Output Control */
|
||||
|
||||
virtual HRESULT StartScheduledPlayback (BMDTimeValue playbackStartTime, BMDTimeScale timeScale, double playbackSpeed) = 0;
|
||||
virtual HRESULT StopScheduledPlayback (BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
|
||||
virtual HRESULT GetHardwareReferenceClock (BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *elapsedTimeSinceSchedulerBegan) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkOutput_v7_3 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
/* End Interface IDeckLinkOutput */
|
||||
|
||||
|
||||
/* Interface IDeckLinkInputCallback - Frame arrival callback. */
|
||||
|
||||
class IDeckLinkInputCallback_v7_3 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode_v7_6 *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
|
||||
virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame_v7_3 *videoFrame, /* in */ IDeckLinkAudioInputPacket *audioPacket) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkInputCallback_v7_3 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
/* End Interface IDeckLinkInputCallback */
|
||||
|
||||
|
||||
/* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkInput_v7_3 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, /* out */ BMDDisplayModeSupport *result) = 0;
|
||||
virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator_v7_6 **iterator) = 0;
|
||||
|
||||
virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
|
||||
|
||||
/* Video Input */
|
||||
|
||||
virtual HRESULT EnableVideoInput (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDVideoInputFlags flags) = 0;
|
||||
virtual HRESULT DisableVideoInput (void) = 0;
|
||||
virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
|
||||
|
||||
/* Audio Input */
|
||||
|
||||
virtual HRESULT EnableAudioInput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount) = 0;
|
||||
virtual HRESULT DisableAudioInput (void) = 0;
|
||||
virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
|
||||
|
||||
/* Input Control */
|
||||
|
||||
virtual HRESULT StartStreams (void) = 0;
|
||||
virtual HRESULT StopStreams (void) = 0;
|
||||
virtual HRESULT PauseStreams (void) = 0;
|
||||
virtual HRESULT FlushStreams (void) = 0;
|
||||
virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback_v7_3 *theCallback) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkInput_v7_3 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
/* End Interface IDeckLinkInput */
|
||||
|
||||
/* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
|
||||
|
||||
class IDeckLinkVideoInputFrame_v7_3 : public IDeckLinkVideoFrame_v7_6
|
||||
{
|
||||
public:
|
||||
virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, BMDTimeScale timeScale) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkVideoInputFrame_v7_3 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
/* End Interface IDeckLinkVideoInputFrame */
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // __DeckLink_API_v7_3_h__
|
@@ -1,404 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2009 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
/* DeckLinkAPI_v7_6.h */
|
||||
|
||||
#ifndef __DeckLink_API_v7_6_h__
|
||||
#define __DeckLink_API_v7_6_h__
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
// Interface ID Declarations
|
||||
|
||||
#define IID_IDeckLinkVideoOutputCallback_v7_6 /* E763A626-4A3C-49D1-BF13-E7AD3692AE52 */ (REFIID){0xE7,0x63,0xA6,0x26,0x4A,0x3C,0x49,0xD1,0xBF,0x13,0xE7,0xAD,0x36,0x92,0xAE,0x52}
|
||||
#define IID_IDeckLinkInputCallback_v7_6 /* 31D28EE7-88B6-4CB1-897A-CDBF79A26414 */ (REFIID){0x31,0xD2,0x8E,0xE7,0x88,0xB6,0x4C,0xB1,0x89,0x7A,0xCD,0xBF,0x79,0xA2,0x64,0x14}
|
||||
#define IID_IDeckLinkDisplayModeIterator_v7_6 /* 455D741F-1779-4800-86F5-0B5D13D79751 */ (REFIID){0x45,0x5D,0x74,0x1F,0x17,0x79,0x48,0x00,0x86,0xF5,0x0B,0x5D,0x13,0xD7,0x97,0x51}
|
||||
#define IID_IDeckLinkDisplayMode_v7_6 /* 87451E84-2B7E-439E-A629-4393EA4A8550 */ (REFIID){0x87,0x45,0x1E,0x84,0x2B,0x7E,0x43,0x9E,0xA6,0x29,0x43,0x93,0xEA,0x4A,0x85,0x50}
|
||||
#define IID_IDeckLinkOutput_v7_6 /* 29228142-EB8C-4141-A621-F74026450955 */ (REFIID){0x29,0x22,0x81,0x42,0xEB,0x8C,0x41,0x41,0xA6,0x21,0xF7,0x40,0x26,0x45,0x09,0x55}
|
||||
#define IID_IDeckLinkInput_v7_6 /* 300C135A-9F43-48E2-9906-6D7911D93CF1 */ (REFIID){0x30,0x0C,0x13,0x5A,0x9F,0x43,0x48,0xE2,0x99,0x06,0x6D,0x79,0x11,0xD9,0x3C,0xF1}
|
||||
#define IID_IDeckLinkTimecode_v7_6 /* EFB9BCA6-A521-44F7-BD69-2332F24D9EE6 */ (REFIID){0xEF,0xB9,0xBC,0xA6,0xA5,0x21,0x44,0xF7,0xBD,0x69,0x23,0x32,0xF2,0x4D,0x9E,0xE6}
|
||||
#define IID_IDeckLinkVideoFrame_v7_6 /* A8D8238E-6B18-4196-99E1-5AF717B83D32 */ (REFIID){0xA8,0xD8,0x23,0x8E,0x6B,0x18,0x41,0x96,0x99,0xE1,0x5A,0xF7,0x17,0xB8,0x3D,0x32}
|
||||
#define IID_IDeckLinkMutableVideoFrame_v7_6 /* 46FCEE00-B4E6-43D0-91C0-023A7FCEB34F */ (REFIID){0x46,0xFC,0xEE,0x00,0xB4,0xE6,0x43,0xD0,0x91,0xC0,0x02,0x3A,0x7F,0xCE,0xB3,0x4F}
|
||||
#define IID_IDeckLinkVideoInputFrame_v7_6 /* 9A74FA41-AE9F-47AC-8CF4-01F42DD59965 */ (REFIID){0x9A,0x74,0xFA,0x41,0xAE,0x9F,0x47,0xAC,0x8C,0xF4,0x01,0xF4,0x2D,0xD5,0x99,0x65}
|
||||
#define IID_IDeckLinkScreenPreviewCallback_v7_6 /* 373F499D-4B4D-4518-AD22-6354E5A5825E */ (REFIID){0x37,0x3F,0x49,0x9D,0x4B,0x4D,0x45,0x18,0xAD,0x22,0x63,0x54,0xE5,0xA5,0x82,0x5E}
|
||||
#define IID_IDeckLinkGLScreenPreviewHelper_v7_6 /* BA575CD9-A15E-497B-B2C2-F9AFE7BE4EBA */ (REFIID){0xBA,0x57,0x5C,0xD9,0xA1,0x5E,0x49,0x7B,0xB2,0xC2,0xF9,0xAF,0xE7,0xBE,0x4E,0xBA}
|
||||
#define IID_IDeckLinkVideoConversion_v7_6 /* 3EB504C9-F97D-40FE-A158-D407D48CB53B */ (REFIID){0x3E,0xB5,0x04,0xC9,0xF9,0x7D,0x40,0xFE,0xA1,0x58,0xD4,0x07,0xD4,0x8C,0xB5,0x3B}
|
||||
#define IID_IDeckLinkConfiguration_v7_6 /* B8EAD569-B764-47F0-A73F-AE40DF6CBF10 */ (REFIID){0xB8,0xEA,0xD5,0x69,0xB7,0x64,0x47,0xF0,0xA7,0x3F,0xAE,0x40,0xDF,0x6C,0xBF,0x10}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
/* Enum BMDVideoConnection - Video connection types */
|
||||
|
||||
typedef uint32_t BMDVideoConnection_v7_6;
|
||||
enum _BMDVideoConnection_v7_6 {
|
||||
bmdVideoConnectionSDI_v7_6 = 'sdi ',
|
||||
bmdVideoConnectionHDMI_v7_6 = 'hdmi',
|
||||
bmdVideoConnectionOpticalSDI_v7_6 = 'opti',
|
||||
bmdVideoConnectionComponent_v7_6 = 'cpnt',
|
||||
bmdVideoConnectionComposite_v7_6 = 'cmst',
|
||||
bmdVideoConnectionSVideo_v7_6 = 'svid'
|
||||
};
|
||||
|
||||
// Forward Declarations
|
||||
|
||||
class IDeckLinkVideoOutputCallback_v7_6;
|
||||
class IDeckLinkInputCallback_v7_6;
|
||||
class IDeckLinkDisplayModeIterator_v7_6;
|
||||
class IDeckLinkDisplayMode_v7_6;
|
||||
class IDeckLinkOutput_v7_6;
|
||||
class IDeckLinkInput_v7_6;
|
||||
class IDeckLinkTimecode_v7_6;
|
||||
class IDeckLinkVideoFrame_v7_6;
|
||||
class IDeckLinkMutableVideoFrame_v7_6;
|
||||
class IDeckLinkVideoInputFrame_v7_6;
|
||||
class IDeckLinkScreenPreviewCallback_v7_6;
|
||||
class IDeckLinkGLScreenPreviewHelper_v7_6;
|
||||
class IDeckLinkVideoConversion_v7_6;
|
||||
|
||||
|
||||
/* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
|
||||
|
||||
class IDeckLinkVideoOutputCallback_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame_v7_6 *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0;
|
||||
virtual HRESULT ScheduledPlaybackHasStopped (void) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkVideoOutputCallback_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkInputCallback - Frame arrival callback. */
|
||||
|
||||
class IDeckLinkInputCallback_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode_v7_6 *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
|
||||
virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame_v7_6* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkInputCallback_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkDisplayModeIterator - enumerates over supported input/output display modes. */
|
||||
|
||||
class IDeckLinkDisplayModeIterator_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT Next (/* out */ IDeckLinkDisplayMode_v7_6 **deckLinkDisplayMode) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkDisplayModeIterator_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkDisplayMode - represents a display mode */
|
||||
|
||||
class IDeckLinkDisplayMode_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT GetName (/* out */ const char **name) = 0;
|
||||
virtual BMDDisplayMode GetDisplayMode (void) = 0;
|
||||
virtual long GetWidth (void) = 0;
|
||||
virtual long GetHeight (void) = 0;
|
||||
virtual HRESULT GetFrameRate (/* out */ BMDTimeValue *frameDuration, /* out */ BMDTimeScale *timeScale) = 0;
|
||||
virtual BMDFieldDominance GetFieldDominance (void) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkDisplayMode_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkOutput_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* out */ BMDDisplayModeSupport *result) = 0;
|
||||
virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator_v7_6 **iterator) = 0;
|
||||
|
||||
virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback_v7_6 *previewCallback) = 0;
|
||||
|
||||
/* Video Output */
|
||||
|
||||
virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
|
||||
virtual HRESULT DisableVideoOutput (void) = 0;
|
||||
|
||||
virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
|
||||
virtual HRESULT CreateVideoFrame (/* in */ int32_t width, /* in */ int32_t height, /* in */ int32_t rowBytes, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDFrameFlags flags, /* out */ IDeckLinkMutableVideoFrame_v7_6 **outFrame) = 0;
|
||||
virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0;
|
||||
|
||||
virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame_v7_6 *theFrame) = 0;
|
||||
virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame_v7_6 *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback_v7_6 *theCallback) = 0;
|
||||
virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
|
||||
|
||||
/* Audio Output */
|
||||
|
||||
virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
|
||||
virtual HRESULT DisableAudioOutput (void) = 0;
|
||||
|
||||
virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT BeginAudioPreroll (void) = 0;
|
||||
virtual HRESULT EndAudioPreroll (void) = 0;
|
||||
virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
|
||||
virtual HRESULT FlushBufferedAudioSamples (void) = 0;
|
||||
|
||||
virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
|
||||
|
||||
/* Output Control */
|
||||
|
||||
virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
|
||||
virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
|
||||
virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
|
||||
|
||||
/* Hardware Timing */
|
||||
|
||||
virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkOutput_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkInput_v7_6 - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkInput_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* out */ BMDDisplayModeSupport *result) = 0;
|
||||
virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator_v7_6 **iterator) = 0;
|
||||
|
||||
virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback_v7_6 *previewCallback) = 0;
|
||||
|
||||
/* Video Input */
|
||||
|
||||
virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
|
||||
virtual HRESULT DisableVideoInput (void) = 0;
|
||||
virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
|
||||
|
||||
/* Audio Input */
|
||||
|
||||
virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
|
||||
virtual HRESULT DisableAudioInput (void) = 0;
|
||||
virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
|
||||
|
||||
/* Input Control */
|
||||
|
||||
virtual HRESULT StartStreams (void) = 0;
|
||||
virtual HRESULT StopStreams (void) = 0;
|
||||
virtual HRESULT PauseStreams (void) = 0;
|
||||
virtual HRESULT FlushStreams (void) = 0;
|
||||
virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback_v7_6 *theCallback) = 0;
|
||||
|
||||
/* Hardware Timing */
|
||||
|
||||
virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkInput_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkTimecode - Used for video frame timecode representation. */
|
||||
|
||||
class IDeckLinkTimecode_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual BMDTimecodeBCD GetBCD (void) = 0;
|
||||
virtual HRESULT GetComponents (/* out */ uint8_t *hours, /* out */ uint8_t *minutes, /* out */ uint8_t *seconds, /* out */ uint8_t *frames) = 0;
|
||||
virtual HRESULT GetString (/* out */ const char **timecode) = 0;
|
||||
virtual BMDTimecodeFlags GetFlags (void) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkTimecode_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
|
||||
|
||||
class IDeckLinkVideoFrame_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual long GetWidth (void) = 0;
|
||||
virtual long GetHeight (void) = 0;
|
||||
virtual long GetRowBytes (void) = 0;
|
||||
virtual BMDPixelFormat GetPixelFormat (void) = 0;
|
||||
virtual BMDFrameFlags GetFlags (void) = 0;
|
||||
virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
|
||||
|
||||
virtual HRESULT GetTimecode (BMDTimecodeFormat format, /* out */ IDeckLinkTimecode_v7_6 **timecode) = 0;
|
||||
virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkVideoFrame_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
|
||||
|
||||
class IDeckLinkMutableVideoFrame_v7_6 : public IDeckLinkVideoFrame_v7_6
|
||||
{
|
||||
public:
|
||||
virtual HRESULT SetFlags (BMDFrameFlags newFlags) = 0;
|
||||
|
||||
virtual HRESULT SetTimecode (BMDTimecodeFormat format, /* in */ IDeckLinkTimecode_v7_6 *timecode) = 0;
|
||||
virtual HRESULT SetTimecodeFromComponents (BMDTimecodeFormat format, uint8_t hours, uint8_t minutes, uint8_t seconds, uint8_t frames, BMDTimecodeFlags flags) = 0;
|
||||
virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkMutableVideoFrame_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
|
||||
|
||||
class IDeckLinkVideoInputFrame_v7_6 : public IDeckLinkVideoFrame_v7_6
|
||||
{
|
||||
public:
|
||||
virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT GetHardwareReferenceTimestamp (BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkVideoInputFrame_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
|
||||
|
||||
class IDeckLinkScreenPreviewCallback_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame_v7_6 *theFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkScreenPreviewCallback_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
|
||||
|
||||
class IDeckLinkGLScreenPreviewHelper_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
|
||||
/* Methods must be called with OpenGL context set */
|
||||
|
||||
virtual HRESULT InitializeGL (void) = 0;
|
||||
virtual HRESULT PaintGL (void) = 0;
|
||||
virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame_v7_6 *theFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkGLScreenPreviewHelper_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
|
||||
|
||||
class IDeckLinkVideoConversion_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame_v7_6* srcFrame, /* in */ IDeckLinkVideoFrame_v7_6* dstFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkVideoConversion_v7_6 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
/* Interface IDeckLinkConfiguration - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkConfiguration_v7_6 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT GetConfigurationValidator (/* out */ IDeckLinkConfiguration_v7_6 **configObject) = 0;
|
||||
virtual HRESULT WriteConfigurationToPreferences (void) = 0;
|
||||
|
||||
/* Video Output Configuration */
|
||||
|
||||
virtual HRESULT SetVideoOutputFormat (/* in */ BMDVideoConnection_v7_6 videoOutputConnection) = 0;
|
||||
virtual HRESULT IsVideoOutputActive (/* in */ BMDVideoConnection_v7_6 videoOutputConnection, /* out */ bool *active) = 0;
|
||||
|
||||
virtual HRESULT SetAnalogVideoOutputFlags (/* in */ BMDAnalogVideoFlags analogVideoFlags) = 0;
|
||||
virtual HRESULT GetAnalogVideoOutputFlags (/* out */ BMDAnalogVideoFlags *analogVideoFlags) = 0;
|
||||
|
||||
virtual HRESULT EnableFieldFlickerRemovalWhenPaused (/* in */ bool enable) = 0;
|
||||
virtual HRESULT IsEnabledFieldFlickerRemovalWhenPaused (/* out */ bool *enabled) = 0;
|
||||
|
||||
virtual HRESULT Set444And3GBpsVideoOutput (/* in */ bool enable444VideoOutput, /* in */ bool enable3GbsOutput) = 0;
|
||||
virtual HRESULT Get444And3GBpsVideoOutput (/* out */ bool *is444VideoOutputEnabled, /* out */ bool *threeGbsOutputEnabled) = 0;
|
||||
|
||||
virtual HRESULT SetVideoOutputConversionMode (/* in */ BMDVideoOutputConversionMode conversionMode) = 0;
|
||||
virtual HRESULT GetVideoOutputConversionMode (/* out */ BMDVideoOutputConversionMode *conversionMode) = 0;
|
||||
|
||||
virtual HRESULT Set_HD1080p24_to_HD1080i5994_Conversion (/* in */ bool enable) = 0;
|
||||
virtual HRESULT Get_HD1080p24_to_HD1080i5994_Conversion (/* out */ bool *enabled) = 0;
|
||||
|
||||
/* Video Input Configuration */
|
||||
|
||||
virtual HRESULT SetVideoInputFormat (/* in */ BMDVideoConnection_v7_6 videoInputFormat) = 0;
|
||||
virtual HRESULT GetVideoInputFormat (/* out */ BMDVideoConnection_v7_6 *videoInputFormat) = 0;
|
||||
|
||||
virtual HRESULT SetAnalogVideoInputFlags (/* in */ BMDAnalogVideoFlags analogVideoFlags) = 0;
|
||||
virtual HRESULT GetAnalogVideoInputFlags (/* out */ BMDAnalogVideoFlags *analogVideoFlags) = 0;
|
||||
|
||||
virtual HRESULT SetVideoInputConversionMode (/* in */ BMDVideoInputConversionMode conversionMode) = 0;
|
||||
virtual HRESULT GetVideoInputConversionMode (/* out */ BMDVideoInputConversionMode *conversionMode) = 0;
|
||||
|
||||
virtual HRESULT SetBlackVideoOutputDuringCapture (/* in */ bool blackOutInCapture) = 0;
|
||||
virtual HRESULT GetBlackVideoOutputDuringCapture (/* out */ bool *blackOutInCapture) = 0;
|
||||
|
||||
virtual HRESULT Set32PulldownSequenceInitialTimecodeFrame (/* in */ uint32_t aFrameTimecode) = 0;
|
||||
virtual HRESULT Get32PulldownSequenceInitialTimecodeFrame (/* out */ uint32_t *aFrameTimecode) = 0;
|
||||
|
||||
virtual HRESULT SetVancSourceLineMapping (/* in */ uint32_t activeLine1VANCsource, /* in */ uint32_t activeLine2VANCsource, /* in */ uint32_t activeLine3VANCsource) = 0;
|
||||
virtual HRESULT GetVancSourceLineMapping (/* out */ uint32_t *activeLine1VANCsource, /* out */ uint32_t *activeLine2VANCsource, /* out */ uint32_t *activeLine3VANCsource) = 0;
|
||||
|
||||
/* Audio Input Configuration */
|
||||
|
||||
virtual HRESULT SetAudioInputFormat (/* in */ BMDAudioConnection audioInputFormat) = 0;
|
||||
virtual HRESULT GetAudioInputFormat (/* out */ BMDAudioConnection *audioInputFormat) = 0;
|
||||
};
|
||||
|
||||
/* Functions */
|
||||
|
||||
extern "C" {
|
||||
|
||||
IDeckLinkIterator* CreateDeckLinkIteratorInstance_v7_6 (void);
|
||||
IDeckLinkGLScreenPreviewHelper_v7_6* CreateOpenGLScreenPreviewHelper_v7_6 (void);
|
||||
IDeckLinkVideoConversion_v7_6* CreateVideoConversionInstance_v7_6 (void);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // __DeckLink_API_v7_6_h__
|
@@ -1,88 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2010 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
/* DeckLinkAPI_v7_9.h */
|
||||
|
||||
#ifndef __DeckLink_API_v7_9_h__
|
||||
#define __DeckLink_API_v7_9_h__
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
// Interface ID Declarations
|
||||
#define IID_IDeckLinkDeckControl_v7_9 /* A4D81043-0619-42B7-8ED6-602D29041DF7 */ (REFIID){0xA4,0xD8,0x10,0x43,0x06,0x19,0x42,0xB7,0x8E,0xD6,0x60,0x2D,0x29,0x04,0x1D,0xF7}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
|
||||
// Forward Declarations
|
||||
class IDeckLinkDeckControl_v7_9;
|
||||
|
||||
/* Interface IDeckLinkDeckControl_v7_9 - Deck Control main interface */
|
||||
class IDeckLinkDeckControl_v7_9 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT Open (/* in */ BMDTimeScale timeScale, /* in */ BMDTimeValue timeValue, /* in */ bool timecodeIsDropFrame, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Close (/* in */ bool standbyOn) = 0;
|
||||
virtual HRESULT GetCurrentState (/* out */ BMDDeckControlMode *mode, /* out */ BMDDeckControlVTRControlState *vtrControlState, /* out */ BMDDeckControlStatusFlags *flags) = 0;
|
||||
virtual HRESULT SetStandby (/* in */ bool standbyOn) = 0;
|
||||
virtual HRESULT Play (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Stop (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT TogglePlayStop (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Eject (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GoToTimecode (/* in */ BMDTimecodeBCD timecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT FastForward (/* in */ bool viewTape, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Rewind (/* in */ bool viewTape, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT StepForward (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT StepBack (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Jog (/* in */ double rate, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Shuttle (/* in */ double rate, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetTimecodeString (/* out */ const char **currentTimeCode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetTimecode (/* out */ IDeckLinkTimecode **currentTimecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetTimecodeBCD (/* out */ BMDTimecodeBCD *currentTimecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT SetPreroll (/* in */ uint32_t prerollSeconds) = 0;
|
||||
virtual HRESULT GetPreroll (/* out */ uint32_t *prerollSeconds) = 0;
|
||||
virtual HRESULT SetExportOffset (/* in */ int32_t exportOffsetFields) = 0;
|
||||
virtual HRESULT GetExportOffset (/* out */ int32_t *exportOffsetFields) = 0;
|
||||
virtual HRESULT GetManualExportOffset (/* out */ int32_t *deckManualExportOffsetFields) = 0;
|
||||
virtual HRESULT SetCaptureOffset (/* in */ int32_t captureOffsetFields) = 0;
|
||||
virtual HRESULT GetCaptureOffset (/* out */ int32_t *captureOffsetFields) = 0;
|
||||
virtual HRESULT StartExport (/* in */ BMDTimecodeBCD inTimecode, /* in */ BMDTimecodeBCD outTimecode, /* in */ BMDDeckControlExportModeOpsFlags exportModeOps, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT StartCapture (/* in */ bool useVITC, /* in */ BMDTimecodeBCD inTimecode, /* in */ BMDTimecodeBCD outTimecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetDeviceID (/* out */ uint16_t *deviceId, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Abort (void) = 0;
|
||||
virtual HRESULT CrashRecordStart (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT CrashRecordStop (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT SetCallback (/* in */ IDeckLinkDeckControlStatusCallback *callback) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkDeckControl_v7_9 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // __DeckLink_API_v7_9_h__
|
@@ -1,63 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2011 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
#ifndef BMD_DECKLINKAPI_v8_0_H
|
||||
#define BMD_DECKLINKAPI_v8_0_H
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
// Interface ID Declarations
|
||||
|
||||
#define IID_IDeckLink_v8_0 /* 62BFF75D-6569-4E55-8D4D-66AA03829ABC */ (REFIID){0x62,0xBF,0xF7,0x5D,0x65,0x69,0x4E,0x55,0x8D,0x4D,0x66,0xAA,0x03,0x82,0x9A,0xBC}
|
||||
#define IID_IDeckLinkIterator_v8_0 /* 74E936FC-CC28-4A67-81A0-1E94E52D4E69 */ (REFIID){0x74,0xE9,0x36,0xFC,0xCC,0x28,0x4A,0x67,0x81,0xA0,0x1E,0x94,0xE5,0x2D,0x4E,0x69}
|
||||
|
||||
#if defined (__cplusplus)
|
||||
|
||||
/* Interface IDeckLink_v8_0 - represents a DeckLink device */
|
||||
|
||||
class IDeckLink_v8_0 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT GetModelName (/* out */ const char **modelName) = 0;
|
||||
};
|
||||
|
||||
/* Interface IDeckLinkIterator_v8_0 - enumerates installed DeckLink hardware */
|
||||
|
||||
class IDeckLinkIterator_v8_0 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT Next (/* out */ IDeckLink_v8_0 **deckLinkInstance) = 0;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
IDeckLinkIterator_v8_0* CreateDeckLinkIteratorInstance_v8_0 (void);
|
||||
};
|
||||
|
||||
#endif // defined __cplusplus
|
||||
|
||||
#endif /* defined(BMD_DECKLINKAPI_v8_0_H) */
|
||||
|
@@ -1,111 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2011 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
#ifndef BMD_DECKLINKAPI_v8_1_H
|
||||
#define BMD_DECKLINKAPI_v8_1_H
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
|
||||
// Interface ID Declarations
|
||||
|
||||
#define IID_IDeckLinkDeckControlStatusCallback_v8_1 /* E5F693C1-4283-4716-B18F-C1431521955B */ (REFIID){0xE5,0xF6,0x93,0xC1,0x42,0x83,0x47,0x16,0xB1,0x8F,0xC1,0x43,0x15,0x21,0x95,0x5B}
|
||||
#define IID_IDeckLinkDeckControl_v8_1 /* 522A9E39-0F3C-4742-94EE-D80DE335DA1D */ (REFIID){0x52,0x2A,0x9E,0x39,0x0F,0x3C,0x47,0x42,0x94,0xEE,0xD8,0x0D,0xE3,0x35,0xDA,0x1D}
|
||||
|
||||
|
||||
/* Enum BMDDeckControlVTRControlState_v8_1 - VTR Control state */
|
||||
|
||||
typedef uint32_t BMDDeckControlVTRControlState_v8_1;
|
||||
enum _BMDDeckControlVTRControlState_v8_1 {
|
||||
bmdDeckControlNotInVTRControlMode_v8_1 = 'nvcm',
|
||||
bmdDeckControlVTRControlPlaying_v8_1 = 'vtrp',
|
||||
bmdDeckControlVTRControlRecording_v8_1 = 'vtrr',
|
||||
bmdDeckControlVTRControlStill_v8_1 = 'vtra',
|
||||
bmdDeckControlVTRControlSeeking_v8_1 = 'vtrs',
|
||||
bmdDeckControlVTRControlStopped_v8_1 = 'vtro'
|
||||
};
|
||||
|
||||
|
||||
/* Interface IDeckLinkDeckControlStatusCallback_v8_1 - Deck control state change callback. */
|
||||
|
||||
class IDeckLinkDeckControlStatusCallback_v8_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT TimecodeUpdate (/* in */ BMDTimecodeBCD currentTimecode) = 0;
|
||||
virtual HRESULT VTRControlStateChanged (/* in */ BMDDeckControlVTRControlState_v8_1 newState, /* in */ BMDDeckControlError error) = 0;
|
||||
virtual HRESULT DeckControlEventReceived (/* in */ BMDDeckControlEvent event, /* in */ BMDDeckControlError error) = 0;
|
||||
virtual HRESULT DeckControlStatusChanged (/* in */ BMDDeckControlStatusFlags flags, /* in */ uint32_t mask) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkDeckControlStatusCallback_v8_1 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
/* Interface IDeckLinkDeckControl_v8_1 - Deck Control main interface */
|
||||
|
||||
class IDeckLinkDeckControl_v8_1 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT Open (/* in */ BMDTimeScale timeScale, /* in */ BMDTimeValue timeValue, /* in */ bool timecodeIsDropFrame, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Close (/* in */ bool standbyOn) = 0;
|
||||
virtual HRESULT GetCurrentState (/* out */ BMDDeckControlMode *mode, /* out */ BMDDeckControlVTRControlState_v8_1 *vtrControlState, /* out */ BMDDeckControlStatusFlags *flags) = 0;
|
||||
virtual HRESULT SetStandby (/* in */ bool standbyOn) = 0;
|
||||
virtual HRESULT SendCommand (/* in */ uint8_t *inBuffer, /* in */ uint32_t inBufferSize, /* out */ uint8_t *outBuffer, /* out */ uint32_t *outDataSize, /* in */ uint32_t outBufferSize, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Play (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Stop (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT TogglePlayStop (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Eject (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GoToTimecode (/* in */ BMDTimecodeBCD timecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT FastForward (/* in */ bool viewTape, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Rewind (/* in */ bool viewTape, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT StepForward (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT StepBack (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Jog (/* in */ double rate, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Shuttle (/* in */ double rate, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetTimecodeString (/* out */ const char **currentTimeCode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetTimecode (/* out */ IDeckLinkTimecode **currentTimecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetTimecodeBCD (/* out */ BMDTimecodeBCD *currentTimecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT SetPreroll (/* in */ uint32_t prerollSeconds) = 0;
|
||||
virtual HRESULT GetPreroll (/* out */ uint32_t *prerollSeconds) = 0;
|
||||
virtual HRESULT SetExportOffset (/* in */ int32_t exportOffsetFields) = 0;
|
||||
virtual HRESULT GetExportOffset (/* out */ int32_t *exportOffsetFields) = 0;
|
||||
virtual HRESULT GetManualExportOffset (/* out */ int32_t *deckManualExportOffsetFields) = 0;
|
||||
virtual HRESULT SetCaptureOffset (/* in */ int32_t captureOffsetFields) = 0;
|
||||
virtual HRESULT GetCaptureOffset (/* out */ int32_t *captureOffsetFields) = 0;
|
||||
virtual HRESULT StartExport (/* in */ BMDTimecodeBCD inTimecode, /* in */ BMDTimecodeBCD outTimecode, /* in */ BMDDeckControlExportModeOpsFlags exportModeOps, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT StartCapture (/* in */ bool useVITC, /* in */ BMDTimecodeBCD inTimecode, /* in */ BMDTimecodeBCD outTimecode, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT GetDeviceID (/* out */ uint16_t *deviceId, /* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT Abort (void) = 0;
|
||||
virtual HRESULT CrashRecordStart (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT CrashRecordStop (/* out */ BMDDeckControlError *error) = 0;
|
||||
virtual HRESULT SetCallback (/* in */ IDeckLinkDeckControlStatusCallback_v8_1 *callback) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkDeckControl_v8_1 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
#endif // BMD_DECKLINKAPI_v8_1_H
|
@@ -1,81 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2012 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
#ifndef BMD_DECKLINKAPI_v9_2_H
|
||||
#define BMD_DECKLINKAPI_v9_2_H
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
|
||||
// Interface ID Declarations
|
||||
|
||||
#define IID_IDeckLinkInput_v9_2 /* 6D40EF78-28B9-4E21-990D-95BB7750A04F */ (REFIID){0x6D,0x40,0xEF,0x78,0x28,0xB9,0x4E,0x21,0x99,0x0D,0x95,0xBB,0x77,0x50,0xA0,0x4F}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
/* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkInput_v9_2 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
|
||||
virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
|
||||
|
||||
virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
|
||||
|
||||
/* Video Input */
|
||||
|
||||
virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
|
||||
virtual HRESULT DisableVideoInput (void) = 0;
|
||||
virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
|
||||
|
||||
/* Audio Input */
|
||||
|
||||
virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
|
||||
virtual HRESULT DisableAudioInput (void) = 0;
|
||||
virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
|
||||
|
||||
/* Input Control */
|
||||
|
||||
virtual HRESULT StartStreams (void) = 0;
|
||||
virtual HRESULT StopStreams (void) = 0;
|
||||
virtual HRESULT PauseStreams (void) = 0;
|
||||
virtual HRESULT FlushStreams (void) = 0;
|
||||
virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0;
|
||||
|
||||
/* Hardware Timing */
|
||||
|
||||
virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkInput_v9_2 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // BMD_DECKLINKAPI_v9_2_H
|
@@ -1,98 +0,0 @@
|
||||
/* -LICENSE-START-
|
||||
** Copyright (c) 2013 Blackmagic Design
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person or organization
|
||||
** obtaining a copy of the software and accompanying documentation covered by
|
||||
** this license (the "Software") to use, reproduce, display, distribute,
|
||||
** execute, and transmit the Software, and to prepare derivative works of the
|
||||
** Software, and to permit third-parties to whom the Software is furnished to
|
||||
** do so, all subject to the following:
|
||||
**
|
||||
** The copyright notices in the Software and this entire statement, including
|
||||
** the above license grant, this restriction and the following disclaimer,
|
||||
** must be included in all copies of the Software, in whole or in part, and
|
||||
** all derivative works of the Software, unless such copies or derivative
|
||||
** works are solely in the form of machine-executable object code generated by
|
||||
** a source language processor.
|
||||
**
|
||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
** DEALINGS IN THE SOFTWARE.
|
||||
** -LICENSE-END-
|
||||
*/
|
||||
|
||||
#ifndef BMD_DECKLINKAPI_v9_9_H
|
||||
#define BMD_DECKLINKAPI_v9_9_H
|
||||
|
||||
#include "DeckLinkAPI.h"
|
||||
|
||||
|
||||
// Interface ID Declarations
|
||||
|
||||
#define IID_IDeckLinkOutput_v9_9 /* A3EF0963-0862-44ED-92A9-EE89ABF431C7 */ (REFIID){0xA3,0xEF,0x09,0x63,0x08,0x62,0x44,0xED,0x92,0xA9,0xEE,0x89,0xAB,0xF4,0x31,0xC7}
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
/* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
|
||||
|
||||
class IDeckLinkOutput_v9_9 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
|
||||
virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
|
||||
|
||||
virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
|
||||
|
||||
/* Video Output */
|
||||
|
||||
virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
|
||||
virtual HRESULT DisableVideoOutput (void) = 0;
|
||||
|
||||
virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
|
||||
virtual HRESULT CreateVideoFrame (/* in */ int32_t width, /* in */ int32_t height, /* in */ int32_t rowBytes, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDFrameFlags flags, /* out */ IDeckLinkMutableVideoFrame **outFrame) = 0;
|
||||
virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0;
|
||||
|
||||
virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
|
||||
virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
|
||||
virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
|
||||
|
||||
/* Audio Output */
|
||||
|
||||
virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
|
||||
virtual HRESULT DisableAudioOutput (void) = 0;
|
||||
|
||||
virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT BeginAudioPreroll (void) = 0;
|
||||
virtual HRESULT EndAudioPreroll (void) = 0;
|
||||
virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
|
||||
|
||||
virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
|
||||
virtual HRESULT FlushBufferedAudioSamples (void) = 0;
|
||||
|
||||
virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
|
||||
|
||||
/* Output Control */
|
||||
|
||||
virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
|
||||
virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
|
||||
virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
|
||||
virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
|
||||
virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0;
|
||||
|
||||
/* Hardware Timing */
|
||||
|
||||
virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~IDeckLinkOutput_v9_9 () {}; // call Release method to drop reference count
|
||||
};
|
||||
|
||||
#endif // defined(__cplusplus)
|
||||
#endif // BMD_DECKLINKAPI_v9_9_H
|
@@ -894,7 +894,7 @@ void LbmFsgrSolver::cpDebugDisplay(int dispset)
|
||||
// dot influence
|
||||
if((mpControl->mDebugCpscale>0.) && cpDots) {
|
||||
glPointSize(mpControl->mDebugCpscale * 8.);
|
||||
glBegin(GL_POINTS);
|
||||
GPUBegin(GL_POINTS);
|
||||
for(int i=0; i<cparts->getSize(); i++) {
|
||||
if((cpHideIna)&&( (cparts->getParticle(i)->influence<=0.) || (cparts->getParticle(i)->size<=0.) )) continue;
|
||||
ntlVec3Gfx org( vec2G(cparts->getParticle(i)->pos ) );
|
||||
@@ -911,7 +911,7 @@ void LbmFsgrSolver::cpDebugDisplay(int dispset)
|
||||
// cp positions
|
||||
if((mpControl->mDebugCpscale>0.) && cpDots) {
|
||||
glPointSize(mpControl->mDebugCpscale * 3.);
|
||||
glBegin(GL_POINTS);
|
||||
GPUBegin(GL_POINTS);
|
||||
glColor3f( 0,1,0 );
|
||||
}
|
||||
for(int i=0; i<cparts->getSize(); i++) {
|
||||
@@ -934,7 +934,7 @@ void LbmFsgrSolver::cpDebugDisplay(int dispset)
|
||||
const float scale = mpControl->mDebugAvgVelScale;
|
||||
|
||||
glColor3f( 1.0,1.0,1 );
|
||||
glBegin(GL_LINES);
|
||||
GPUBegin(GL_LINES);
|
||||
for(int i=0; i<cparts->getSize(); i++) {
|
||||
if((cpHideIna)&&( (cparts->getParticle(i)->influence<=0.) || (cparts->getParticle(i)->size<=0.) )) continue;
|
||||
ntlVec3Gfx org( vec2G(cparts->getParticle(i)->pos ) );
|
||||
@@ -955,7 +955,7 @@ void LbmFsgrSolver::cpDebugDisplay(int dispset)
|
||||
// debug, for use of e.g. LBMGET_FORCE LbmControlData *mpControl = this;
|
||||
# define TESTGET_FORCE(lev,i,j,k) mpControl->mCpForces[lev][ ((k*mLevel[lev].lSizey)+j)*mLevel[lev].lSizex+i ]
|
||||
|
||||
glBegin(GL_LINES);
|
||||
GPUBegin(GL_LINES);
|
||||
//const int lev=0;
|
||||
for(int lev=0; lev<=mMaxRefine; lev++) {
|
||||
FSGR_FORIJK_BOUNDS(lev) {
|
||||
|
@@ -1782,7 +1782,7 @@ void LbmFsgrSolver::debugDisplayNode(int dispset, CellIdentifierInterface* cell
|
||||
case FLUIDDISPVelocities: {
|
||||
// dont use cube display
|
||||
LbmVec vel = this->getCellVelocity( cell, set );
|
||||
glBegin(GL_LINES);
|
||||
GPUBegin(GL_LINES);
|
||||
glColor3f( 0.0,0.0,0.0 );
|
||||
glVertex3f( org[0], org[1], org[2] );
|
||||
org += vec2G(vel * 10.0 * cscale);
|
||||
|
@@ -287,8 +287,7 @@ const bool GLXEW_ARB_create_context_robustness =
|
||||
attribs[i++] = 0;
|
||||
|
||||
/* Create a GL 3.x context */
|
||||
if (m_fbconfig)
|
||||
{
|
||||
if (m_fbconfig) {
|
||||
m_context = glXCreateContextAttribsARB(m_display, m_fbconfig, s_sharedContext, true, attribs);
|
||||
}
|
||||
else {
|
||||
|
@@ -63,7 +63,7 @@ static bool is_crappy_intel_card()
|
||||
|
||||
GHOST_ContextWGL::GHOST_ContextWGL(
|
||||
bool stereoVisual,
|
||||
bool alphaBackground,
|
||||
bool alphaBackground,
|
||||
GHOST_TUns16 numOfAASamples,
|
||||
HWND hWnd,
|
||||
HDC hDC,
|
||||
@@ -79,7 +79,7 @@ GHOST_ContextWGL::GHOST_ContextWGL(
|
||||
m_contextMajorVersion(contextMajorVersion),
|
||||
m_contextMinorVersion(contextMinorVersion),
|
||||
m_contextFlags(contextFlags),
|
||||
m_alphaBackground(alphaBackground),
|
||||
m_alphaBackground(alphaBackground),
|
||||
m_contextResetNotificationStrategy(contextResetNotificationStrategy),
|
||||
m_hGLRC(NULL)
|
||||
#ifdef WITH_GLEW_MX
|
||||
|
@@ -125,8 +125,7 @@ HRESULT __stdcall GHOST_DropTargetWin32::DragEnter(IDataObject *pDataObject, DWO
|
||||
*/
|
||||
HRESULT __stdcall GHOST_DropTargetWin32::DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
{
|
||||
if (m_window->canAcceptDragOperation())
|
||||
{
|
||||
if (m_window->canAcceptDragOperation()) {
|
||||
*pdwEffect = allowedDropEffect(*pdwEffect);
|
||||
}
|
||||
else {
|
||||
@@ -154,8 +153,7 @@ HRESULT __stdcall GHOST_DropTargetWin32::DragLeave(void)
|
||||
HRESULT __stdcall GHOST_DropTargetWin32::Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
|
||||
{
|
||||
void *data = getGhostData(pDataObject);
|
||||
if (m_window->canAcceptDragOperation())
|
||||
{
|
||||
if (m_window->canAcceptDragOperation()) {
|
||||
*pdwEffect = allowedDropEffect(*pdwEffect);
|
||||
|
||||
}
|
||||
@@ -189,15 +187,13 @@ GHOST_TDragnDropTypes GHOST_DropTargetWin32::getGhostType(IDataObject *pDataObje
|
||||
* conversion, but we do the conversion ourself with WC_NO_BEST_FIT_CHARS.
|
||||
*/
|
||||
FORMATETC fmtetc = { CF_TEXT, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
|
||||
if (pDataObject->QueryGetData(&fmtetc) == S_OK)
|
||||
{
|
||||
if (pDataObject->QueryGetData(&fmtetc) == S_OK) {
|
||||
return GHOST_kDragnDropTypeString;
|
||||
}
|
||||
|
||||
// Filesnames
|
||||
fmtetc.cfFormat = CF_HDROP;
|
||||
if (pDataObject->QueryGetData(&fmtetc) == S_OK)
|
||||
{
|
||||
if (pDataObject->QueryGetData(&fmtetc) == S_OK) {
|
||||
return GHOST_kDragnDropTypeFilenames;
|
||||
}
|
||||
|
||||
|
@@ -167,11 +167,9 @@ void GHOST_EventManager::removeWindowEvents(GHOST_IWindow *window)
|
||||
{
|
||||
TEventStack::iterator iter;
|
||||
iter = m_events.begin();
|
||||
while (iter != m_events.end())
|
||||
{
|
||||
while (iter != m_events.end()) {
|
||||
GHOST_IEvent *event = *iter;
|
||||
if (event->getWindow() == window)
|
||||
{
|
||||
if (event->getWindow() == window) {
|
||||
GHOST_PRINT("GHOST_EventManager::removeWindowEvents(): removing event\n");
|
||||
/*
|
||||
* Found an event for this window, remove it.
|
||||
@@ -191,11 +189,9 @@ void GHOST_EventManager::removeTypeEvents(GHOST_TEventType type, GHOST_IWindow *
|
||||
{
|
||||
TEventStack::iterator iter;
|
||||
iter = m_events.begin();
|
||||
while (iter != m_events.end())
|
||||
{
|
||||
while (iter != m_events.end()) {
|
||||
GHOST_IEvent *event = *iter;
|
||||
if ((event->getType() == type) && (!window || (event->getWindow() == window)))
|
||||
{
|
||||
if ((event->getType() == type) && (!window || (event->getWindow() == window))) {
|
||||
GHOST_PRINT("GHOST_EventManager::removeTypeEvents(): removing event\n");
|
||||
/*
|
||||
* Found an event of this type for the window, remove it.
|
||||
|
@@ -378,8 +378,7 @@ void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64
|
||||
|
||||
NDOF_ButtonT button = (button_number < m_buttonCount) ? m_hidMap[button_number] : NDOF_BUTTON_NONE;
|
||||
|
||||
switch (button)
|
||||
{
|
||||
switch (button) {
|
||||
case NDOF_BUTTON_NONE:
|
||||
#ifdef DEBUG_NDOF_BUTTONS
|
||||
printf("discarded\n");
|
||||
|
@@ -830,7 +830,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType,
|
||||
window->updateDrawingContext();
|
||||
pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) );
|
||||
//Mouse up event is trapped by the resizing event loop, so send it anyway to the window manager
|
||||
pushEvent(new GHOST_EventButton(getMilliSeconds(), GHOST_kEventButtonUp, window, convertButton(0)));
|
||||
pushEvent(new GHOST_EventButton(getMilliSeconds(), GHOST_kEventButtonUp, window, GHOST_kButtonMaskLeft));
|
||||
//m_ignoreWindowSizedMessages = true;
|
||||
}
|
||||
break;
|
||||
@@ -1278,19 +1278,29 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
|
||||
switch ([event type]) {
|
||||
case NSLeftMouseDown:
|
||||
pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonDown, window, GHOST_kButtonMaskLeft));
|
||||
handleTabletEvent(event); //Handle tablet events combined with mouse events
|
||||
break;
|
||||
case NSRightMouseDown:
|
||||
pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonDown, window, GHOST_kButtonMaskRight));
|
||||
handleTabletEvent(event); //Handle tablet events combined with mouse events
|
||||
break;
|
||||
case NSOtherMouseDown:
|
||||
pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonDown, window, convertButton([event buttonNumber])));
|
||||
//Handle tablet events combined with mouse events
|
||||
handleTabletEvent(event);
|
||||
handleTabletEvent(event); //Handle tablet events combined with mouse events
|
||||
break;
|
||||
|
||||
case NSLeftMouseUp:
|
||||
pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonUp, window, GHOST_kButtonMaskLeft));
|
||||
handleTabletEvent(event); //Handle tablet events combined with mouse events
|
||||
break;
|
||||
case NSRightMouseUp:
|
||||
pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonUp, window, GHOST_kButtonMaskRight));
|
||||
handleTabletEvent(event); //Handle tablet events combined with mouse events
|
||||
break;
|
||||
case NSOtherMouseUp:
|
||||
pushEvent(new GHOST_EventButton([event timestamp] * 1000, GHOST_kEventButtonUp, window, convertButton([event buttonNumber])));
|
||||
//Handle tablet events combined with mouse events
|
||||
handleTabletEvent(event);
|
||||
handleTabletEvent(event); //Handle tablet events combined with mouse events
|
||||
break;
|
||||
|
||||
case NSLeftMouseDragged:
|
||||
|
@@ -76,8 +76,7 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *version
|
||||
|
||||
HRESULT hResult = SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16);
|
||||
|
||||
if (hResult == S_OK)
|
||||
{
|
||||
if (hResult == S_OK) {
|
||||
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
|
||||
strcat(knownpath, "\\Blender Foundation\\Blender\\");
|
||||
strcat(knownpath, versionstr);
|
||||
@@ -94,8 +93,7 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionst
|
||||
|
||||
HRESULT hResult = SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16);
|
||||
|
||||
if (hResult == S_OK)
|
||||
{
|
||||
if (hResult == S_OK) {
|
||||
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
|
||||
strcat(knownpath, "\\Blender Foundation\\Blender\\");
|
||||
strcat(knownpath, versionstr);
|
||||
|
@@ -1545,8 +1545,7 @@ static bool isStartedFromCommandPrompt()
|
||||
|
||||
int GHOST_SystemWin32::toggleConsole(int action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
switch (action) {
|
||||
case 3: // startup: hide if not started from command prompt
|
||||
{
|
||||
if (isStartedFromCommandPrompt()) {
|
||||
|
@@ -420,8 +420,7 @@ static Bool init_timestamp_scanner(Display *, XEvent *event, XPointer arg)
|
||||
{
|
||||
init_timestamp_data *data =
|
||||
reinterpret_cast<init_timestamp_data *>(arg);
|
||||
switch (event->type)
|
||||
{
|
||||
switch (event->type) {
|
||||
case ButtonPress:
|
||||
case ButtonRelease:
|
||||
data->timestamp = event->xbutton.time;
|
||||
@@ -1964,8 +1963,7 @@ int GHOST_X11_ApplicationIOErrorHandler(Display * /*display*/)
|
||||
static bool match_token(const char *haystack, const char *needle)
|
||||
{
|
||||
const char *p, *q;
|
||||
for (p = haystack; *p; )
|
||||
{
|
||||
for (p = haystack; *p; ) {
|
||||
while (*p && isspace(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
|
@@ -38,8 +38,8 @@
|
||||
#define glAccum DO_NOT_USE_glAccum
|
||||
#undef glAlphaFunc
|
||||
#define glAlphaFunc DO_NOT_USE_glAlphaFunc
|
||||
#undef glBegin
|
||||
#define glBegin DO_NOT_USE_glBegin
|
||||
#undef GPUBegin
|
||||
#define GPUBegin DO_NOT_USE_GPUBegin
|
||||
#undef glBitmap
|
||||
#define glBitmap DO_NOT_USE_glBitmap
|
||||
#undef glCallList
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
set(INC
|
||||
.
|
||||
# XXX, bad level include!
|
||||
../../source/blender/blenlib
|
||||
)
|
||||
|
||||
@@ -37,5 +38,4 @@ set(SRC
|
||||
dvpapi.h
|
||||
)
|
||||
|
||||
|
||||
blender_add_lib(bf_intern_gpudirect "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user