merged the python-0.3.0 branch into the main branch

metadata
Wenzel Jakob 2011-08-21 18:54:46 -04:00
commit 98b6b65416
308 changed files with 4478 additions and 1760 deletions

View File

@ -34,6 +34,8 @@ build('src/librender/SConscript')
build('src/libhw/SConscript')
# Bidirectional support library
build('src/libbidir/SConscript')
# Python binding library
build('src/libpython/SConscript')
# ===== Build the applications =====
env = env.Clone()
@ -45,11 +47,12 @@ mainEnv = build('src/mitsuba/SConscript')
converter_objects = build('src/converter/SConscript', ['mainEnv'])
# Build the Qt-based GUI binaries
build('src/qtgui/SConscript', ['mainEnv', 'converter_objects'], duplicate=True)
build('src/mtsgui/SConscript', ['mainEnv', 'converter_objects'], duplicate=True)
env['SHLIBPREFIX']=''
# ===== Build the plugins =====
env['SHLIBPREFIX']=''
Export('env')
# Utilities

View File

@ -1,4 +1,4 @@
import multiprocessing
import re, multiprocessing
Import('sys', 'os', 'SCons', 'resources')
@ -14,15 +14,20 @@ print("Using configuation file \"%s\"" % configFile)
AddOption("--parallelize", dest="parallelize", action='store_true', help='Parallelize to the available number of cores?')
parallelize = GetOption('parallelize')
EnsureSConsVersion(2, 0, 0)
if parallelize == True:
SetOption('num_jobs', multiprocessing.cpu_count())
if not os.path.exists(configFile):
print 'A configuration file must be selected! Have a look at http://www.mitsuba-renderer.org/docs.html'
print '\nA configuration file must be selected! Have a look at http://www.mitsuba-renderer.org/docs.html'
Exit(1)
if (sys.platform == 'win32' or sys.platform == 'darwin') and not os.path.exists(GetBuildPath('#dependencies')):
print 'The dependencies are missing -- see http://www.mitsuba-renderer.org/devblog/archives/11-Build-system-changes.html'
if not os.path.exists(GetBuildPath('#dependencies')):
print '\nThe build dependency files are missing -- please check them out'
print 'from Mercurial by running the following command *inside* the '
print 'Mitsuba directory:\n'
print '$ hg clone https://www.mitsuba-renderer.org/hg/dependencies\n'
Exit(1)
# Parse configuration options
@ -32,14 +37,17 @@ vars.Add('DISTDIR', 'Target directory for the final build')
vars.Add('CXX', 'C++ compiler')
vars.Add('CC', 'C compiler')
vars.Add('CXXFLAGS', 'C++ flags')
vars.Add('CCFLAGS', 'C compiler flags')
vars.Add('SHCXXFLAGS', 'C++ flags (for shared libraries)')
vars.Add('SHCXXFLAGS', 'Extra C++ flags (for shared libraries)')
vars.Add('CCFLAGS', 'Extra C++ flags (for C files)')
vars.Add('LINK', 'Linker')
vars.Add('LINKFLAGS', 'Linker flags')
vars.Add('SHLINKFLAGS', 'Linker flags (dynamic libraries)')
vars.Add('BASEINCLUDE', 'Base include path')
vars.Add('BASELIB', 'Base libraries')
vars.Add('BASELIBDIR', 'Base library search path')
vars.Add('PYTHONINCLUDE', 'Python include path')
vars.Add('PYTHONLIB', 'Python libraries')
vars.Add('PYTHONLIBDIR', 'Python library path')
vars.Add('XERCESINCLUDE', 'Xerces-C include path')
vars.Add('XERCESLIB', 'Xerces-C libraries')
vars.Add('XERCESLIBDIR', 'Xerces-C library path')
@ -81,6 +89,8 @@ except Exception:
hasQt = False
hasCollada=True
hasPython = True
env.Append(CPPPATH=env['BASEINCLUDE'])
env.Append(CPPFLAGS=[])
env.Append(LIBPATH=[])
@ -137,6 +147,8 @@ if env.has_key('COLLADAINCLUDE'):
env.Prepend(CPPPATH=env['COLLADAINCLUDE'])
if env.has_key('COLLADALIBDIR'):
env.Prepend(LIBPATH=env['COLLADALIBDIR'])
if env.has_key('PYTHONINCLUDE'):
env.Prepend(CPPPATH=env['PYTHONINCLUDE'])
if not conf.CheckCXX():
print 'Could not compile a simple C++ fragment, verify that ' + \
@ -159,6 +171,9 @@ if not conf.CheckCXXHeader('xercesc/dom/DOMLSParser.hpp'):
if not conf.CheckCXXHeader('dae.h'):
hasCollada = False
print 'COLLADA DOM is missing: not building the COLLADA importer'
if not conf.CheckCXXHeader('pyconfig.h'):
hasPython = False
print 'Python is missing: not building the python support library'
if not conf.CheckCXXHeader('boost/math/distributions/students_t.hpp'):
print 'Boost is missing (install libboost-dev)!'
Exit(1)
@ -214,6 +229,29 @@ else:
print MTS_VERSION
Export('MTS_VERSION')
versionFilename = GetBuildPath('#dependencies/version')
versionMismatch = False
if not os.path.exists(versionFilename):
versionMismatch = True
depVersion = "<unknown>"
else:
with open(versionFilename) as f:
depVersion = f.readline().strip()
if MTS_VERSION != depVersion:
versionMismatch = True
if versionMismatch:
print '\nThe dependency directory and your Mitsuba codebase have different version'
print 'numbers! Your copy of Mitsuba has version %s, whereas the dependencies ' % MTS_VERSION
print 'have version %s. Please bring them into sync, either by running\n' % depVersion
print '$ hg update -r v%s\n' % depVersion
print 'in the Mitsuba directory, or by running\n'
print '$ cd dependencies'
print '$ hg pull'
print '$ hg update -r v%s\n' % MTS_VERSION
Exit(1)
env = conf.Finish()
dist = GetOption('dist') != None
@ -222,10 +260,68 @@ Export('dist')
def osxlibinst_build_function(self, target, source, pkgname = None, use_own = None):
inst = self.Install(target, source)
prefix, name = os.path.split(source)
self.AddPostAction(inst, 'install_name_tool -id @executable_path/../Frameworks/' + name + ' $TARGET')
self.AddPostAction(inst, 'install_name_tool -id @loader_path/../Frameworks/' + name + ' $TARGET')
return inst
def osxlibinst_as_build_function(self, target, source, pkgname = None, use_own = None):
inst = self.InstallAs(target, source)
prefix, name = os.path.split(source)
self.AddPostAction(inst, 'install_name_tool -id @loader_path/../Frameworks/' + name + ' $TARGET')
return inst
def remove_flag(env, flag):
try:
env['CXXFLAGS'].remove(flag)
return True
except:
return False
def match_pattern(x, patterns):
match = False
for pattern in patterns:
if re.search(pattern, x):
match = True
break
return match
def remove_flags(env, patterns):
env['CCFLAGS'][:] = [ x for x in env['CCFLAGS'] if not match_pattern(x, patterns) ]
env['CXXFLAGS'][:] = [ x for x in env['CXXFLAGS'] if not match_pattern(x, patterns) ]
env['LINKFLAGS'][:] = [ x for x in env['LINKFLAGS'] if not match_pattern(x, patterns) ]
def append_flag(env, value):
env['CXXFLAGS'].append(value)
env.__class__.RemoveFlag = remove_flag
env.__class__.RemoveFlags = remove_flags
env.__class__.AppendFlag = append_flag
env.__class__.OSXLibInst = osxlibinst_build_function
env.__class__.OSXLibInstAs = osxlibinst_as_build_function
def configure_for_objective_cpp(env):
# The OSX Objective C++ compiler does not permit the following flags
env.RemoveFlags(['-fstrict-aliasing', '-ftree-vectorize',
'-std=c\+\+0x'])
# Remove Intel compiler-specific optimization flags
env.RemoveFlags(['-x.*', '-ax.*', '-ipo', '-no-prec-div',
'-fp-model', 'fast=.*', '-wd.*', '-openmp'])
env['CCFLAGS'] += ['-fno-strict-aliasing']
# Enforce GCC usage (Intel compiler doesn't handle Objective C/C++)
env['CXX'] = 'g++'
env['CC'] = 'gcc'
def relax_compiler_settings(env):
# Relax the compiler settings when compiling heavy templated code
# (e.g. Boost::Spirit parsers, etc., which don't necessarily have
# to be that fast)
env.RemoveFlags(['-g', '/Z7', '-ipo', '/GL'])
if env.RemoveFlag('-O3'):
env.AppendFlag('-Os')
if env.RemoveFlag('/O2'):
env.AppendFlag('/O1')
env.__class__.ConfigureForObjectiveCPP = configure_for_objective_cpp
env.__class__.RelaxCompilerSettings = relax_compiler_settings
if hasCollada:
env.Append(CPPDEFINES = [['MTS_HAS_COLLADA', 1]] )
@ -237,6 +333,6 @@ if sys.platform == 'win32':
env['LINKCOM'] = [env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1']
env['SHLINKCOM'] = [env['SHLINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2']
env.Export('hasQt', 'hasCollada', 'resources')
env.Export('hasQt', 'hasCollada', 'hasPython', 'resources')
Return('env')

View File

@ -1,10 +1,21 @@
import fnmatch
Import('env', 'os', 'sys', 'plugins', 'dist',
'MTS_VERSION', 'hasQt', 'hasCollada')
'MTS_VERSION', 'hasQt', 'hasCollada', 'hasPython')
installTargets = []
def fixOSXPluginPath(plugin):
return env.AddPostAction(plugin,
'install_name_tool -change @loader_path/../Frameworks/libmitsuba-core.dylib @loader_path/../Contents/Frameworks/libmitsuba-core.dylib ${TARGET}; ' +
'install_name_tool -change @loader_path/../Frameworks/libmitsuba-render.dylib @loader_path/../Contents/Frameworks/libmitsuba-render.dylib ${TARGET}; ' +
'install_name_tool -change @loader_path/../Frameworks/libmitsuba-hw.dylib @loader_path/../Contents/Frameworks/libmitsuba-hw.dylib ${TARGET}; ' +
'install_name_tool -change @loader_path/../Frameworks/libmitsuba-bidir.dylib @loader_path/../Contents/Frameworks/libmitsuba-bidir.dylib ${TARGET}; ' +
'install_name_tool -change @loader_path/../Frameworks/libboost_system.dylib @loader_path/../Contents/Frameworks/libboost_system.dylib ${TARGET}; ' +
'install_name_tool -change @loader_path/../Frameworks/libboost_filesystem.dylib @loader_path/../Contents/Frameworks/libboost_filesystem.dylib ${TARGET};' +
'install_name_tool -change @loader_path/../Frameworks/libboost_python.dylib @loader_path/../Contents/Frameworks/libboost_python.dylib ${TARGET}'
)
def install(target, paths, prefix = None):
global installTargets
if prefix == None:
@ -15,6 +26,17 @@ def install(target, paths, prefix = None):
else:
installTargets += env.Install(target, prefix + '/' + path)
def installAs(target, path, prefix = None):
global installTargets
if prefix == None:
prefix = env['BUILDDIR']
if os.path.splitext(path)[1] == '.dylib':
result = env.OSXLibInstAs(target, prefix + '/' + path)
else:
result = env.InstallAs(target, prefix + '/' + path)
installTargets += result
return result
if not 'DISTDIR' in env:
print 'The \"DISTDIR\" variable is missing. Please update your configuration file!'
Exit(1)
@ -33,7 +55,9 @@ if sys.platform == 'linux2':
installTargets += env.Install(os.path.join(distDir, 'plugins'), plugin)
install(distDir, ['libcore/libmitsuba-core.so', 'libhw/libmitsuba-hw.so',
'librender/libmitsuba-render.so', 'libbidir/libmitsuba-bidir.so'])
install(distDir, ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil', 'qtgui/mtsgui'])
if hasPython:
install(os.path.join(distDir, 'python'), ['libpython/mitsuba.so'])
install(distDir, ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil', 'mtsgui/mtsgui'])
if hasCollada:
install(distDir, ['converter/mtsimport'])
if sys.platform == 'win32':
@ -58,11 +82,14 @@ if sys.platform == 'win32':
install(distDir, ['mitsuba/mitsuba.exe', 'mitsuba/mtssrv.exe', 'mitsuba/mtsutil.exe'])
install(distDir, ['libcore/libmitsuba-core.dll', 'libhw/libmitsuba-hw.dll',
'librender/libmitsuba-render.dll', 'libbidir/libmitsuba-bidir.dll'])
if hasPython:
installAs(os.path.join(distDir, 'python/mitsuba.pyd'), 'libpython/mitsuba.dll')
install(distDir, ['Iex.dll', 'Half.dll','IlmThread.dll', 'Imath.dll','IlmImf.dll','zlib1.dll',
'libpng13.dll', 'jpeg62.dll', 'pthreadVCE2.dll', 'xerces-c_3_0.dll', 'glew32mx.dll'],
prefix=dllprefix)
install(distDir, ['libcollada14dom23.dll', 'boost_system-%s-mt-1_44.dll' % compilerType,
'boost_filesystem-%s-mt-1_44.dll' % compilerType], dllprefix + '/' + compilerType + '/')
install(distDir, ['libcollada14dom23.dll', 'boost_python-%s-mt-1_44.dll' % compilerType,
'boost_system-%s-mt-1_44.dll' % compilerType, 'boost_filesystem-%s-mt-1_44.dll' % compilerType],
dllprefix + '/' + compilerType + '/')
if 'WIN64' in env['CXXFLAGS']:
installTargets += env.Install(distDir, '#dependencies/windows/bin/vcredist_2010_sp1_x64.exe')
else:
@ -73,12 +100,13 @@ if sys.platform == 'win32':
install(distDir, ['libmmd.dll', 'libiomp5md.dll'], prefix = env['REDIST_PATH'])
if hasQt:
install(distDir, ['qtgui/mtsgui.exe'])
install(distDir, ['mtsgui/mtsgui.exe'])
install(distDir, ['QtCore4.dll', 'QtGui4.dll', 'QtXml4.dll',
'QtNetwork4.dll', 'QtOpenGL4.dll', 'QtXmlPatterns4.dll'], prefix = env['QT4_BINPATH'])
elif sys.platform == 'darwin':
for i in plugins:
installTargets += env.Install(os.path.join(distDir, 'plugins'), i)
plugin = env.Install(os.path.join(distDir, 'plugins'), i)
installTargets += fixOSXPluginPath(plugin)
install(os.path.join(distDir, 'Contents/MacOS'), ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil'])
if hasCollada:
install(os.path.join(distDir, 'Contents/MacOS'), ['converter/mtsimport'])
@ -91,31 +119,36 @@ elif sys.platform == 'darwin':
install(frameworkDir, ['libcore/libmitsuba-core.dylib', 'libhw/libmitsuba-hw.dylib',
'librender/libmitsuba-render.dylib', 'libbidir/libmitsuba-bidir.dylib'])
if hasPython:
plugin = installAs(os.path.join(distDir, 'python/mitsuba.so'), 'libpython/mitsuba.dylib')
installTargets += fixOSXPluginPath(plugin)
install(frameworkDir, [
'GLEW.framework/Resources/libs/libGLEW.dylib', 'OpenEXR.framework/Resources/lib/libHalf.6.dylib',
'OpenEXR.framework/Resources/lib/libIex.6.dylib', 'OpenEXR.framework/Resources/lib/libImath.6.dylib',
'OpenEXR.framework/Resources/lib/libIlmThread.6.dylib', 'OpenEXR.framework/Resources/lib/libIlmImf.6.dylib',
'Xerces-C.framework/Resources/lib/libxerces-c-3.0.dylib', 'libpng.framework/Resources/lib/libpng.dylib',
'libjpeg.framework/Resources/lib/libjpeg.dylib', 'libboost.framework/Resources/lib/libboost_system.dylib',
'libjpeg.framework/Resources/lib/libjpeg.dylib', 'libboost.framework/Resources/lib/libboost_python.dylib',
'libboost.framework/Resources/lib/libboost_system.dylib',
'libboost.framework/Resources/lib/libboost_filesystem.dylib'], '#dependencies/darwin')
if hasCollada:
install(frameworkDir, [
'Collada14Dom.framework/Resources/lib/libCollada14Dom.dylib'], '#dependencies/darwin')
if hasQt:
install(os.path.join(distDir, 'Contents/MacOS'), ['qtgui/mtsgui'])
install(os.path.join(distDir, 'Contents/MacOS'), ['mtsgui/mtsgui'])
install(os.path.join(distDir, 'Contents/MacOS'), ['mtsgui/symlinks_install'])
installTargets += env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtCore.framework/Versions/4/QtCore')
opengl = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL')
xml = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtXml.framework/Versions/4/QtXml')
xmlpatterns = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns')
network = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork')
gui = env.OSXLibInst(frameworkDir, '/Library/Frameworks/QtGui.framework/Versions/4/QtGui')
installTargets += env.AddPostAction(xml, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(xmlpatterns, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(xmlpatterns, 'install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork $TARGET')
installTargets += env.AddPostAction(network, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(gui, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(opengl, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(opengl, 'install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui $TARGET')
installTargets += env.AddPostAction(xml, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(xmlpatterns, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(xmlpatterns, 'install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @loader_path/../Frameworks/QtNetwork $TARGET')
installTargets += env.AddPostAction(network, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(gui, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(opengl, 'install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../Frameworks/QtCore $TARGET')
installTargets += env.AddPostAction(opengl, 'install_name_tool -change QtGui.framework/Versions/4/QtGui @loader_path/../Frameworks/QtGui $TARGET')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources'), '/Library/Frameworks//QtGui.framework/Versions/4/Resources/qt_menu.nib')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources/PreviewSettings.nib'), '#data/darwin/PreviewSettings.nib/designable.nib')
installTargets += env.Install(os.path.join(distDir, 'Contents/Resources/PreviewSettings.nib'), '#data/darwin/PreviewSettings.nib/keyedobjects.nib')

View File

@ -1,9 +1,9 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk']
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.6', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-arch', 'x86_64', '-mmacosx-version-min=10.6', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk', '-Wl,-headerpad,128']
BASEINCLUDE = ['#include']
BASELIB = ['m', 'pthread', 'gomp']
OEXRINCLUDE = ['#dependencies/darwin/OpenEXR.framework/Headers/OpenEXR']
@ -25,6 +25,8 @@ GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.6/Headers']
PYTHONLIB = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -1,9 +1,9 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'i386', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-mmacosx-version-min=10.5', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk']
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'i386', '-mmacosx-version-min=10.6', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-mmacosx-version-min=10.6', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk', '-Wl,-headerpad,128']
BASEINCLUDE = ['#include']
BASELIB = ['m', 'pthread', 'gomp']
OEXRINCLUDE = ['#dependencies/darwin/OpenEXR.framework/Headers/OpenEXR']
@ -25,6 +25,8 @@ GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.6/Headers']
PYTHONLIB = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -1,9 +1,9 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.5', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'x86_64', '-mmacosx-version-min=10.5', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk']
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.6', '-march=nocona', '-msse2', '-mfpmath=sse', '-ftree-vectorize', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-O3', '-Wall', '-g', '-pipe', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp', '-fstrict-aliasing', '-fsched-interblock', '-freorder-blocks']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'x86_64', '-mmacosx-version-min=10.6', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk', '-Wl,-headerpad,128']
BASEINCLUDE = ['#include']
BASELIB = ['m', 'pthread', 'gomp']
OEXRINCLUDE = ['#dependencies/darwin/OpenEXR.framework/Headers/OpenEXR']
@ -25,6 +25,8 @@ GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.6/Headers']
PYTHONLIB = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -0,0 +1,33 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'icpc'
CC = 'icc'
CCFLAGS = ['-arch', 'i386', '-mmacosx-version-min=10.6', '-mfpmath=sse', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-O3', '-ipo', '-no-prec-div', '-xSSSE3', '-fp-model', 'fast=2', '-openmp', '-wd279', '-Wall', '-g', '-pipe']
CXXFLAGS = ['$CCFLAGS', '-std=c++0x', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'i386', '-mmacosx-version-min=10.6', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk', '-openmp', '-Wl,-headerpad,128']
BASEINCLUDE = ['#include']
BASELIB = ['m', 'pthread', 'gomp']
OEXRINCLUDE = ['#dependencies/darwin/OpenEXR.framework/Headers/OpenEXR']
OEXRLIBDIR = ['#dependencies/darwin/OpenEXR.framework/Resources/lib']
OEXRLIB = ['Half', 'IlmImf', 'Imath', 'z']
PNGINCLUDE = ['#dependencies/darwin/libpng.framework/Headers']
PNGLIBDIR = ['#dependencies/darwin/libpng.framework/Resources/lib']
PNGLIB = ['png']
JPEGINCLUDE = ['#dependencies/darwin/libjpeg.framework/Headers']
JPEGLIBDIR = ['#dependencies/darwin/libjpeg.framework/Resources/lib']
JPEGLIB = ['jpeg']
XERCESINCLUDE = ['#dependencies/darwin/Xerces-C.framework/Headers']
XERCESLIBDIR = ['#dependencies/darwin/Xerces-C.framework/Resources/lib']
XERCESLIB = ['xerces-c']
GLINCLUDE = ['#dependencies/darwin/GLEW.framework/Headers']
GLLIBDIR = ['#dependencies/darwin/GLEW.framework/Resources/libs']
GLLIB = ['GLEW', 'objc']
GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.6/Headers']
PYTHONLIB = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -0,0 +1,33 @@
BUILDDIR = '#build/release'
DISTDIR = '#Mitsuba.app'
CXX = 'icpc'
CC = 'icc'
CCFLAGS = ['-arch', 'x86_64', '-mmacosx-version-min=10.6', '-mfpmath=sse', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-O3', '-ipo', '-xSSSE3', '-fp-model', 'fast=2', '-openmp', '-wd279', '-Wall', '-g', '-pipe']
CXXFLAGS = ['$CCFLAGS', '-std=c++0x', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT']
LINKFLAGS = ['-framework', 'OpenGL', '-framework', 'Cocoa', '-arch', 'x86_64', '-mmacosx-version-min=10.6', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk', '-openmp', '-Wl,-headerpad,128']
BASEINCLUDE = ['#include']
BASELIB = ['m', 'pthread', 'gomp']
OEXRINCLUDE = ['#dependencies/darwin/OpenEXR.framework/Headers/OpenEXR']
OEXRLIBDIR = ['#dependencies/darwin/OpenEXR.framework/Resources/lib']
OEXRLIB = ['Half', 'IlmImf', 'Imath', 'z']
PNGINCLUDE = ['#dependencies/darwin/libpng.framework/Headers']
PNGLIBDIR = ['#dependencies/darwin/libpng.framework/Resources/lib']
PNGLIB = ['png']
JPEGINCLUDE = ['#dependencies/darwin/libjpeg.framework/Headers']
JPEGLIBDIR = ['#dependencies/darwin/libjpeg.framework/Resources/lib']
JPEGLIB = ['jpeg']
XERCESINCLUDE = ['#dependencies/darwin/Xerces-C.framework/Headers']
XERCESLIBDIR = ['#dependencies/darwin/Xerces-C.framework/Resources/lib']
XERCESLIB = ['xerces-c']
GLINCLUDE = ['#dependencies/darwin/GLEW.framework/Headers']
GLLIBDIR = ['#dependencies/darwin/GLEW.framework/Resources/libs']
GLLIB = ['GLEW', 'objc']
GLFLAGS = ['-DGLEW_MX']
BOOSTINCLUDE = ['#dependencies']
BOOSTLIB = ['boost_filesystem', 'boost_system']
BOOSTLIBDIR = ['#dependencies/darwin/libboost.framework/Resources/lib']
PYTHONINCLUDE = ['/System/Library/Frameworks/Python.framework/Versions/2.6/Headers']
PYTHONLIB = ['boost_python', 'boost_system', 'Python']
COLLADAINCLUDE = ['#dependencies/windows/include/colladadom', '#dependencies/windows/include/colladadom/1.4']
COLLADALIB = ['libCollada14Dom']
COLLADALIBDIR = ['#dependencies/darwin/Collada14Dom.framework/Resources/lib']

View File

@ -1,3 +1,5 @@
import sys, os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'icl'
@ -24,6 +26,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc100']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,3 +1,5 @@
import sys, os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'icl'
@ -24,6 +26,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc100']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,10 +1,12 @@
import os
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'g++'
CC = 'gcc'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-O0', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp']
LINKFLAGS = []
SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC']
SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC', '-lstdc++']
BASEINCLUDE = ['#include']
BASELIB = ['dl', 'm', 'pthread', 'gomp']
OEXRINCLUDE = ['/usr/include/OpenEXR']
@ -15,6 +17,14 @@ XERCESINCLUDE = []
XERCESLIB = ['xerces-c']
GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11']
GLFLAGS = ['-DGLEW_MX']
BOOSTLIB = ['libboost_system', 'libboost_filesystem']
BOOSTLIB = ['boost_system', 'boost_filesystem']
COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4']
COLLADALIB = ['libcollada14dom']
COLLADALIB = ['collada14dom']
PYTHONINCLUDE = []
PYTHONLIB = ['boost_python']
for entry in os.popen("python-config --cflags --libs").read().split():
if entry[:2] == '-I':
PYTHONINCLUDE += [entry[2:]]
if entry[:2] == '-l':
PYTHONLIB += [entry[2:]]

View File

@ -1,10 +1,12 @@
import os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'g++'
CC = 'gcc'
CXX = 'g++'
CC = 'gcc'
CXXFLAGS = ['-O3', '-Wall', '-g', '-pipe', '-march=nocona', '-msse2', '-ftree-vectorize', '-mfpmath=sse', '-funsafe-math-optimizations', '-fno-rounding-math', '-fno-signaling-nans', '-fomit-frame-pointer', '-DMTS_DEBUG', '-DSINGLE_PRECISION', '-DSPECTRUM_SAMPLES=3', '-DMTS_SSE', '-DMTS_HAS_COHERENT_RT', '-fopenmp']
LINKFLAGS = []
SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC']
SHLINKFLAGS = ['-rdynamic', '-shared', '-fPIC', '-lstdc++']
BASEINCLUDE = ['#include']
BASELIB = ['dl', 'm', 'pthread', 'gomp']
OEXRINCLUDE = ['/usr/include/OpenEXR']
@ -15,6 +17,14 @@ XERCESINCLUDE = []
XERCESLIB = ['xerces-c']
GLLIB = ['GL', 'GLU', 'GLEWmx', 'Xxf86vm', 'X11']
GLFLAGS = ['-DGLEW_MX']
BOOSTLIB = ['libboost_system', 'libboost_filesystem']
BOOSTLIB = ['boost_system', 'boost_filesystem']
COLLADAINCLUDE = ['/usr/include/collada-dom', '/usr/include/collada-dom/1.4']
COLLADALIB = ['libcollada14dom']
COLLADALIB = ['collada14dom']
PYTHONINCLUDE = []
PYTHONLIB = ['boost_python']
for entry in os.popen("python-config --cflags --libs").read().split():
if entry[:2] == '-I':
PYTHONINCLUDE += [entry[2:]]
if entry[:2] == '-l':
PYTHONLIB += [entry[2:]]

View File

@ -1,8 +1,10 @@
import sys, os
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Od', '/Z7', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc90']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,11 +1,13 @@
import sys, os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
CXXFLAGS = ['/nologo', '/O2', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86'
MSVC_VERSION = '9.0'
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc90']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,8 +1,10 @@
import sys, os
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Od', '/Z7', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc90']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,11 +1,13 @@
import sys, os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
CXXFLAGS = ['/nologo', '/O2', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86_64'
MSVC_VERSION = '9.0'
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc90']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,8 +1,10 @@
import sys, os
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Od', '/Z7', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc100']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,11 +1,13 @@
import sys, os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
CXXFLAGS = ['/nologo', '/O2', '/fp:fast', '/arch:SSE2' ,'/D', 'WIN32', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86'
MSVC_VERSION = '10.0'
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib32', '#dependencies/windows/lib32/vc100']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,8 +1,10 @@
import sys, os
BUILDDIR = '#build/debug'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Od', '/Z7', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc100']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -1,11 +1,13 @@
import sys, os
BUILDDIR = '#build/release'
DISTDIR = '#dist'
CXX = 'cl'
CC = 'cl'
# /Ox=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /O2=optimize for speed, global optimizations, intrinsic functions, favor fast code, frame pointer omission
# /EHsc=C++ exceptions, /fp:fast=Enable reasonable FP optimizations, /GS-=No buffer security checks, /GL=whole program optimizations
# To include debug information add '/Z7' to CXXFLAGS and '/DEBUG' to LINKFLAGS
CXXFLAGS = ['/nologo', '/Ox', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
CXXFLAGS = ['/nologo', '/O2', '/fp:fast', '/D', 'WIN32', '/D', 'WIN64', '/W3', '/EHsc', '/GS-', '/GL', '/MD', '/D', 'MTS_DEBUG', '/D', 'SINGLE_PRECISION', '/D', 'SPECTRUM_SAMPLES=3', '/D', 'MTS_SSE', '/D', 'MTS_HAS_COHERENT_RT', '/D', '_CONSOLE', '/D', 'NDEBUG', '/openmp']
SHCXXFLAGS = CXXFLAGS
TARGET_ARCH = 'x86_64'
MSVC_VERSION = '10.0'
@ -25,6 +27,9 @@ JPEGLIB = ['jpeg62']
GLLIB = ['opengl32', 'glu32', 'glew32mx', 'gdi32', 'user32']
GLFLAGS = ['/D', 'GLEW_MX']
BASELIBDIR = ['#dependencies/windows/lib64', '#dependencies/windows/lib64/vc100']
PYTHONINCLUDE = [os.path.join(os.path.split(sys.executable)[0], 'include')]
PYTHONLIBDIR = [os.path.join(os.path.split(sys.executable)[0], 'libs')]
PYTHONLIB = ['boost_python-vc100-mt-1_44']
SHLIBPREFIX = 'lib'
SHLIBSUFFIX = '.dll'
PROGSUFFIX = '.exe'

View File

@ -367,57 +367,57 @@
<File RelativePath="..\.\src\phase\microflake.cpp"/>
<File RelativePath="..\.\src\phase\microflake_fiber.h"/>
</Filter>
<Filter Name="qtgui">
<File RelativePath="..\.\src\qtgui\aboutdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\aboutdlg.h"/>
<File RelativePath="..\.\src\qtgui\acknowledgmentdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\acknowledgmentdlg.h"/>
<File RelativePath="..\.\src\qtgui\addserverdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\addserverdlg.h"/>
<File RelativePath="..\.\src\qtgui\common.h"/>
<File RelativePath="..\.\src\qtgui\glwidget.cpp"/>
<File RelativePath="..\.\src\qtgui\glwidget.h"/>
<File RelativePath="..\.\src\qtgui\importdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\importdlg.h"/>
<File RelativePath="..\.\src\qtgui\loaddlg.cpp"/>
<File RelativePath="..\.\src\qtgui\loaddlg.h"/>
<File RelativePath="..\.\src\qtgui\locateresourcedlg.cpp"/>
<File RelativePath="..\.\src\qtgui\locateresourcedlg.h"/>
<File RelativePath="..\.\src\qtgui\logwidget.cpp"/>
<File RelativePath="..\.\src\qtgui\logwidget.h"/>
<File RelativePath="..\.\src\qtgui\main.cpp"/>
<File RelativePath="..\.\src\qtgui\mainwindow.cpp"/>
<File RelativePath="..\.\src\qtgui\mainwindow.h"/>
<File RelativePath="..\.\src\qtgui\preview.cpp"/>
<File RelativePath="..\.\src\qtgui\preview.h"/>
<File RelativePath="..\.\src\qtgui\previewsettingsdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\previewsettingsdlg.h"/>
<File RelativePath="..\.\src\qtgui\previewsettingsdlg_cocoa.cpp"/>
<File RelativePath="..\.\src\qtgui\previewsettingsdlg_cocoa.h"/>
<File RelativePath="..\.\src\qtgui\preview_proc.cpp"/>
<File RelativePath="..\.\src\qtgui\preview_proc.h"/>
<File RelativePath="..\.\src\qtgui\programsettingsdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\programsettingsdlg.h"/>
<File RelativePath="..\.\src\qtgui\rendersettingsdlg.cpp"/>
<File RelativePath="..\.\src\qtgui\rendersettingsdlg.h"/>
<Filter Name="mtsgui">
<File RelativePath="..\.\src\mtsgui\aboutdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\aboutdlg.h"/>
<File RelativePath="..\.\src\mtsgui\acknowledgmentdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\acknowledgmentdlg.h"/>
<File RelativePath="..\.\src\mtsgui\addserverdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\addserverdlg.h"/>
<File RelativePath="..\.\src\mtsgui\common.h"/>
<File RelativePath="..\.\src\mtsgui\glwidget.cpp"/>
<File RelativePath="..\.\src\mtsgui\glwidget.h"/>
<File RelativePath="..\.\src\mtsgui\importdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\importdlg.h"/>
<File RelativePath="..\.\src\mtsgui\loaddlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\loaddlg.h"/>
<File RelativePath="..\.\src\mtsgui\locateresourcedlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\locateresourcedlg.h"/>
<File RelativePath="..\.\src\mtsgui\logwidget.cpp"/>
<File RelativePath="..\.\src\mtsgui\logwidget.h"/>
<File RelativePath="..\.\src\mtsgui\main.cpp"/>
<File RelativePath="..\.\src\mtsgui\mainwindow.cpp"/>
<File RelativePath="..\.\src\mtsgui\mainwindow.h"/>
<File RelativePath="..\.\src\mtsgui\preview.cpp"/>
<File RelativePath="..\.\src\mtsgui\preview.h"/>
<File RelativePath="..\.\src\mtsgui\previewsettingsdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\previewsettingsdlg.h"/>
<File RelativePath="..\.\src\mtsgui\previewsettingsdlg_cocoa.cpp"/>
<File RelativePath="..\.\src\mtsgui\previewsettingsdlg_cocoa.h"/>
<File RelativePath="..\.\src\mtsgui\preview_proc.cpp"/>
<File RelativePath="..\.\src\mtsgui\preview_proc.h"/>
<File RelativePath="..\.\src\mtsgui\programsettingsdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\programsettingsdlg.h"/>
<File RelativePath="..\.\src\mtsgui\rendersettingsdlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\rendersettingsdlg.h"/>
<Filter Name="resources">
</Filter>
<File RelativePath="..\.\src\qtgui\save.cpp"/>
<File RelativePath="..\.\src\qtgui\save.h"/>
<File RelativePath="..\.\src\qtgui\sceneimporter.cpp"/>
<File RelativePath="..\.\src\qtgui\sceneimporter.h"/>
<File RelativePath="..\.\src\qtgui\sceneinfodlg.cpp"/>
<File RelativePath="..\.\src\qtgui\sceneinfodlg.h"/>
<File RelativePath="..\.\src\qtgui\sceneloader.cpp"/>
<File RelativePath="..\.\src\qtgui\sceneloader.h"/>
<File RelativePath="..\.\src\qtgui\server.cpp"/>
<File RelativePath="..\.\src\qtgui\server.h"/>
<File RelativePath="..\.\src\qtgui\tabbar.cpp"/>
<File RelativePath="..\.\src\qtgui\tabbar.h"/>
<File RelativePath="..\.\src\qtgui\updatedlg.cpp"/>
<File RelativePath="..\.\src\qtgui\updatedlg.h"/>
<File RelativePath="..\.\src\qtgui\xmltreemodel.cpp"/>
<File RelativePath="..\.\src\qtgui\xmltreemodel.h"/>
<File RelativePath="..\.\src\mtsgui\save.cpp"/>
<File RelativePath="..\.\src\mtsgui\save.h"/>
<File RelativePath="..\.\src\mtsgui\sceneimporter.cpp"/>
<File RelativePath="..\.\src\mtsgui\sceneimporter.h"/>
<File RelativePath="..\.\src\mtsgui\sceneinfodlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\sceneinfodlg.h"/>
<File RelativePath="..\.\src\mtsgui\sceneloader.cpp"/>
<File RelativePath="..\.\src\mtsgui\sceneloader.h"/>
<File RelativePath="..\.\src\mtsgui\server.cpp"/>
<File RelativePath="..\.\src\mtsgui\server.h"/>
<File RelativePath="..\.\src\mtsgui\tabbar.cpp"/>
<File RelativePath="..\.\src\mtsgui\tabbar.h"/>
<File RelativePath="..\.\src\mtsgui\updatedlg.cpp"/>
<File RelativePath="..\.\src\mtsgui\updatedlg.h"/>
<File RelativePath="..\.\src\mtsgui\xmltreemodel.cpp"/>
<File RelativePath="..\.\src\mtsgui\xmltreemodel.h"/>
</Filter>
<Filter Name="rfilters">
<File RelativePath="..\.\src\rfilters\box.cpp"/>

View File

@ -135,53 +135,53 @@
</ClInclude>
<ClInclude Include="..\.\src\phase\microflake_fiber.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\aboutdlg.h">
<ClInclude Include="..\.\src\mtsgui\aboutdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\acknowledgmentdlg.h">
<ClInclude Include="..\.\src\mtsgui\acknowledgmentdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\addserverdlg.h">
<ClInclude Include="..\.\src\mtsgui\addserverdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\common.h">
<ClInclude Include="..\.\src\mtsgui\common.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\glwidget.h">
<ClInclude Include="..\.\src\mtsgui\glwidget.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\importdlg.h">
<ClInclude Include="..\.\src\mtsgui\importdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\loaddlg.h">
<ClInclude Include="..\.\src\mtsgui\loaddlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\locateresourcedlg.h">
<ClInclude Include="..\.\src\mtsgui\locateresourcedlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\logwidget.h">
<ClInclude Include="..\.\src\mtsgui\logwidget.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\mainwindow.h">
<ClInclude Include="..\.\src\mtsgui\mainwindow.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\preview.h">
<ClInclude Include="..\.\src\mtsgui\preview.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\previewsettingsdlg.h">
<ClInclude Include="..\.\src\mtsgui\previewsettingsdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\previewsettingsdlg_cocoa.h">
<ClInclude Include="..\.\src\mtsgui\previewsettingsdlg_cocoa.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\preview_proc.h">
<ClInclude Include="..\.\src\mtsgui\preview_proc.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\programsettingsdlg.h">
<ClInclude Include="..\.\src\mtsgui\programsettingsdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\rendersettingsdlg.h">
<ClInclude Include="..\.\src\mtsgui\rendersettingsdlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\save.h">
<ClInclude Include="..\.\src\mtsgui\save.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\sceneimporter.h">
<ClInclude Include="..\.\src\mtsgui\sceneimporter.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\sceneinfodlg.h">
<ClInclude Include="..\.\src\mtsgui\sceneinfodlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\sceneloader.h">
<ClInclude Include="..\.\src\mtsgui\sceneloader.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\server.h">
<ClInclude Include="..\.\src\mtsgui\server.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\tabbar.h">
<ClInclude Include="..\.\src\mtsgui\tabbar.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\updatedlg.h">
<ClInclude Include="..\.\src\mtsgui\updatedlg.h">
</ClInclude>
<ClInclude Include="..\.\src\qtgui\xmltreemodel.h">
<ClInclude Include="..\.\src\mtsgui\xmltreemodel.h">
</ClInclude>
<ClInclude Include="..\.\src\shapes\instance.h">
</ClInclude>
@ -769,53 +769,53 @@
</ClCompile>
<ClCompile Include="..\.\src\phase\microflake.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\aboutdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\aboutdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\acknowledgmentdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\acknowledgmentdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\addserverdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\addserverdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\glwidget.cpp">
<ClCompile Include="..\.\src\mtsgui\glwidget.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\importdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\importdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\loaddlg.cpp">
<ClCompile Include="..\.\src\mtsgui\loaddlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\locateresourcedlg.cpp">
<ClCompile Include="..\.\src\mtsgui\locateresourcedlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\logwidget.cpp">
<ClCompile Include="..\.\src\mtsgui\logwidget.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\main.cpp">
<ClCompile Include="..\.\src\mtsgui\main.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\mainwindow.cpp">
<ClCompile Include="..\.\src\mtsgui\mainwindow.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\preview.cpp">
<ClCompile Include="..\.\src\mtsgui\preview.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\previewsettingsdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\previewsettingsdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\previewsettingsdlg_cocoa.cpp">
<ClCompile Include="..\.\src\mtsgui\previewsettingsdlg_cocoa.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\preview_proc.cpp">
<ClCompile Include="..\.\src\mtsgui\preview_proc.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\programsettingsdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\programsettingsdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\rendersettingsdlg.cpp">
<ClCompile Include="..\.\src\mtsgui\rendersettingsdlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\save.cpp">
<ClCompile Include="..\.\src\mtsgui\save.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\sceneimporter.cpp">
<ClCompile Include="..\.\src\mtsgui\sceneimporter.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\sceneinfodlg.cpp">
<ClCompile Include="..\.\src\mtsgui\sceneinfodlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\sceneloader.cpp">
<ClCompile Include="..\.\src\mtsgui\sceneloader.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\server.cpp">
<ClCompile Include="..\.\src\mtsgui\server.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\tabbar.cpp">
<ClCompile Include="..\.\src\mtsgui\tabbar.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\updatedlg.cpp">
<ClCompile Include="..\.\src\mtsgui\updatedlg.cpp">
</ClCompile>
<ClCompile Include="..\.\src\qtgui\xmltreemodel.cpp">
<ClCompile Include="..\.\src\mtsgui\xmltreemodel.cpp">
</ClCompile>
<ClCompile Include="..\.\src\rfilters\box.cpp">
</ClCompile>

View File

@ -59,10 +59,10 @@
<Filter Include="Source Files\phase">
<UniqueIdentifier>{629f51ab-8f77-4abd-9c1c-38e13b2db010}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\qtgui">
<Filter Include="Source Files\mtsgui">
<UniqueIdentifier>{7922cc88-966d-4a2a-ad99-0f932bf0eda3}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\qtgui\resources">
<Filter Include="Source Files\mtsgui\resources">
<UniqueIdentifier>{12abdb4a-638a-4680-b01d-af8075fc74ee}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\rfilters">
@ -559,77 +559,77 @@
<ClCompile Include="..\.\src\phase\microflake.cpp">
<Filter>Source Files\phase</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\aboutdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\aboutdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\acknowledgmentdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\acknowledgmentdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\addserverdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\addserverdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\glwidget.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\glwidget.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\importdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\importdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\loaddlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\loaddlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\locateresourcedlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\locateresourcedlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\logwidget.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\logwidget.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\main.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\main.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\mainwindow.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\mainwindow.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\preview.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\preview.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\previewsettingsdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\previewsettingsdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\previewsettingsdlg_cocoa.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\previewsettingsdlg_cocoa.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\preview_proc.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\preview_proc.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\programsettingsdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\programsettingsdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\rendersettingsdlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\rendersettingsdlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\save.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\save.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\sceneimporter.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\sceneimporter.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\sceneinfodlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\sceneinfodlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\sceneloader.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\sceneloader.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\server.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\server.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\tabbar.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\tabbar.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\updatedlg.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\updatedlg.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\qtgui\xmltreemodel.cpp">
<Filter>Source Files\qtgui</Filter>
<ClCompile Include="..\.\src\mtsgui\xmltreemodel.cpp">
<Filter>Source Files\mtsgui</Filter>
</ClCompile>
<ClCompile Include="..\.\src\rfilters\box.cpp">
<Filter>Source Files\rfilters</Filter>
@ -804,77 +804,77 @@
<ClInclude Include="..\.\src\phase\microflake_fiber.h">
<Filter>Source Files\phase</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\aboutdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\aboutdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\acknowledgmentdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\acknowledgmentdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\addserverdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\addserverdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\common.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\common.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\glwidget.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\glwidget.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\importdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\importdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\loaddlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\loaddlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\locateresourcedlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\locateresourcedlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\logwidget.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\logwidget.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\mainwindow.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\mainwindow.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\preview.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\preview.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\previewsettingsdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\previewsettingsdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\previewsettingsdlg_cocoa.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\previewsettingsdlg_cocoa.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\preview_proc.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\preview_proc.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\programsettingsdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\programsettingsdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\rendersettingsdlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\rendersettingsdlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\save.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\save.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\sceneimporter.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\sceneimporter.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\sceneinfodlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\sceneinfodlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\sceneloader.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\sceneloader.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\server.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\server.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\tabbar.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\tabbar.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\updatedlg.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\updatedlg.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\qtgui\xmltreemodel.h">
<Filter>Source Files\qtgui</Filter>
<ClInclude Include="..\.\src\mtsgui\xmltreemodel.h">
<Filter>Source Files\mtsgui</Filter>
</ClInclude>
<ClInclude Include="..\.\src\shapes\instance.h">
<Filter>Source Files\shapes</Filter>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,32 @@
# Contributer: N30N <archlinux@alunamation.com>
# Contributer: Wenzel Jakob <wenzel@mitsuba-renderer.org>
pkgname="collada-dom"
pkgver=2.3.1
pkgrel=1
pkgdesc="An API that provides a C++ object representation of a COLLADA XML instance document."
url="http://collada-dom.sourceforge.net/"
license=("MIT")
arch=("i686" "x86_64")
depends=("libxml2" "boost" "pcre") #"libminizip"
# makedepends=()
source=("http://downloads.sourceforge.net/${pkgname}/collada_dom-${pkgver}-src.tgz")
md5sums=("a74d19c1187806a713cec90c2f0f692c")
build() {
cd ${pkgname}-${pkgver}/dom
make project=dom
}
package() {
cd ${pkgname}-${pkgver}/dom
install -d ${pkgdir}/usr/lib ${pkgdir}/usr/include
make prefix=${pkgdir}/usr project=dom install
mv ${pkgdir}/usr/include/colladadom ${pkgdir}/usr/include/collada-dom
install -m755 build/linux-1.4/libminizip.so* ${pkgdir}/usr/lib
install -D -m644 license.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
# vim: set noet ff=unix:

View File

@ -0,0 +1,64 @@
# Contributer: N30N <archlinux@alunamation.com>
# Contributer: Alex Combas <blenderwell@gmail.com>
# Contributer: Wenzel Jakob <wenzel@mitsuba-renderer.org>
pkgname="mitsuba-hg"
pkgver=1
pkgrel=1
pkgdesc="Mitsuba physically based renderer"
url="http://mitsuba-renderer.org/"
license=("GPL3")
arch=("i686" "x86_64")
depends=("xerces-c" "glew" "openexr" "boost" "libpng" "libjpeg" "qt" "collada-dom")
makedepends=("mercurial" "scons")
provides=("mitsuba")
_hgroot="https://mitsuba-renderer.org/hg"
_hgrepo="mitsuba"
build() {
cd ${_hgrepo}
cp build/config-linux.py config.py
if [ -e dependencies ]; then
cd dependencies
hg pull -u
cd ..
else
hg clone https://www.mitsuba-renderer.org/hg/dependencies
fi
scons --jobs=$[${MAKEFLAGS/-j/} - 1]
}
package() {
install -d \
${pkgdir}/usr/bin \
${pkgdir}/usr/lib \
${pkgdir}/usr/share/mitsuba/plugins \
${pkgdir}/usr/share/mitsuba/data/schema \
${pkgdir}/usr/share/mitsuba/data/ior \
${pkgdir}/usr/share/applications \
${pkgdir}/usr/share/pixmaps \
${pkgdir}/usr/include/mitsuba/{core,hw,render,bidir} \
${pkgdir}/usr/lib/python2.7/lib-dynload
cd ${_hgrepo}
install -m755 dist/mitsuba dist/mtsgui dist/mtsimport dist/mtssrv dist/mtsutil ${pkgdir}/usr/bin
install -m755 dist/libmitsuba-core.so \
dist/libmitsuba-hw.so \
dist/libmitsuba-render.so \
dist/libmitsuba-bidir.so \
${pkgdir}/usr/lib
install -m755 dist/plugins/* ${pkgdir}/usr/share/mitsuba/plugins
install -m644 dist/data/schema/* ${pkgdir}/usr/share/mitsuba/data/schema
install -m644 dist/data/ior/* ${pkgdir}/usr/share/mitsuba/data/ior
install -m644 dist/python/mitsuba.so ${pkgdir}/usr/lib/python2.7/lib-dynload
install -m644 data/linux/mitsuba.desktop ${pkgdir}/usr/share/applications
install -m644 src/mtsgui/resources/mitsuba48.png ${pkgdir}/usr/share/pixmaps
install -m644 include/mitsuba/*.h ${pkgdir}/usr/include/mitsuba
install -m644 include/mitsuba/core/* ${pkgdir}/usr/include/mitsuba/core
install -m644 include/mitsuba/render/* ${pkgdir}/usr/include/mitsuba/render
install -m644 include/mitsuba/hw/* ${pkgdir}/usr/include/mitsuba/hw
install -m644 include/mitsuba/bidir/* ${pkgdir}/usr/include/mitsuba/bidir
}
# vim: set noet ff=unix:

View File

@ -1,6 +1,27 @@
mitsuba (0.3.0-1) unstable; urgency=low
* Initial python bindings
* Added basic Python bindings that can be used to instantiate plugins
and control rendering processes.
* Spectral rendering: most of the code pertaining to spectral
rendering has seen a significant overhaul. It is now faster and
in certain cases more accurate.
* Flexible material classes: this release introduces a robust and
very general suite of eight physically-based smooth and rough
(microfacet-based) material classes.
* Material modifiers: two new material modifiers (bump & coating)
can be applied to BSDFs to create new materials.
* Material verification: the sampling methods of all material
models in Mitsuba are now automatically verified with the help
of statistical hypothesis tests (using Chi^2-tests).
* Generated documentation: there is now a javadoc-like system,
which extracts documentation directly from the plugin source code
and stitches it into a LaTeX reference document.
* lookAt: Mitsuba inherited a bug from PBRT, where the <lookAt>
tag changed the handedness of the coordinate system. This is now
fixed--also, the syntax of this tag has changed to make it easier to read.
* Scene portability: A new conversion tool ensures that old and incompatible
scenes can be translated into the scene description format of the
most recent version.
-- Wenzel Jakob <wenzel@cs.cornell.edu> Mon, 14 Aug 2011 00:00:00 -0400

View File

@ -6,8 +6,9 @@ dist/mtsimport /usr/bin
dist/libmitsuba-hw.so /usr/lib
dist/libmitsuba-render.so /usr/lib
dist/libmitsuba-core.so /usr/lib
dist/python/mitsuba.so /usr/lib/pyshared/python2.7
dist/libmitsuba-bidir.so /usr/lib
dist/python/mitsuba.so /usr/lib/pymodules/pythonPYTHONVERSION
dist/plugins/* /usr/share/mitsuba/plugins
dist/data/* /usr/share/mitsuba/data
src/qtgui/resources/mitsuba48.png /usr/share/pixmaps
src/mtsgui/resources/mitsuba48.png /usr/share/pixmaps
data/linux/mitsuba.desktop /usr/share/applications

View File

@ -9,6 +9,8 @@
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
PYTHONVERSION = `python-config --includes | sed -e 's/^.*python\([0-9\.]*\).*/\1/'`
clean:
dh_testdir
dh_testroot
@ -28,6 +30,7 @@ binary-arch:
scons -j 2
dh_installdirs
dh_auto_install
cat debian/mitsuba.install.template | sed -e s/PYTHONVERSION/$(PYTHONVERSION)/ > debian/mitsuba.install
dh_install
dh_installmenu
dh_compress

View File

@ -0,0 +1,66 @@
Name: mitsuba
Version: 0.3.0
Release: 1%{?dist}
Summary: Mitsuba renderer
Group: Applications/Graphics
License: GPL-3
URL: http://www.mitsuba-renderer.org
Source: %{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc-c++ scons boost-devel qt4-devel OpenEXR-devel xerces-c-devel python-devel glew-devel collada-dom-devel
Requires: boost qt4 OpenEXR-libs xerces-c python libGLEWmx collada-dom
%description
Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures.
The program currently runs on Linux, MacOS X and Microsoft Windows and makes use of SSE2 optimizations on x86 and x86_64 platforms. So far, its main use has been as a testbed for algorithm development in computer graphics, but there are many other interesting applications.
Mitsuba comes with a command-line interface as well as a graphical frontend to interactively explore scenes. While navigating, a rough preview is shown that becomes increasingly accurate as soon as all movements are stopped. Once a viewpoint has been chosen, a wide range of rendering techniques can be used to generate images, and their parameters can be tuned from within the program.
%package devel
Summary: Mitsuba development files
Requires: boost-devel qt4-devel OpenEXR-devel xerces-c-devel python-devel glew-devel collada-dom-devel
%description devel
This package contains the development headers, which are needed when
building custom plugins and other extensions for Mitsuba.
%prep
%setup -q
%build
cp build/config-linux.py config.py
scons
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/python2.7/lib-dynload
mkdir -p $RPM_BUILD_ROOT/usr/share/mitsuba/plugins
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
mkdir -p $RPM_BUILD_ROOT/usr/include
strip dist/lib* dist/mtsgui dist/mitsuba dist/mtssrv dist/mtsutil
strip dist/plugins/* dist/python/*
cp dist/libmitsuba-*.so $RPM_BUILD_ROOT%{_libdir}
cp dist/mtsgui $RPM_BUILD_ROOT%{_bindir}
cp dist/mitsuba $RPM_BUILD_ROOT%{_bindir}
cp dist/mtssrv $RPM_BUILD_ROOT%{_bindir}
cp dist/mtsutil $RPM_BUILD_ROOT%{_bindir}
cp dist/python/mitsuba.so $RPM_BUILD_ROOT%{_libdir}/python2.7/lib-dynload
cp dist/plugins/* $RPM_BUILD_ROOT/usr/share/mitsuba/plugins
cp -Rdp dist/data $RPM_BUILD_ROOT/usr/share/mitsuba/data
cp src/mtsgui/resources/mitsuba48.png $RPM_BUILD_ROOT/usr/share/pixmaps
cp data/linux/mitsuba.desktop $RPM_BUILD_ROOT/usr/share/applications
cp -Rdp include/mitsuba $RPM_BUILD_ROOT/usr/include/mitsuba
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_libdir}/libmitsuba-*.so
%{_libdir}/python2.7/lib-dynload/mitsuba.so
%{_bindir}/*
/usr/share/pixmaps/mitsuba48.png
/usr/share/applications/mitsuba.desktop
/usr/share/mitsuba/*
%files devel
/usr/include/*
%changelog
* Mon Aug 15 2010 Wenzel Jakob <wenzel@cs.cornell.edu> 0.3.0%{?dist}
- First official Fedora Core build

View File

@ -25,20 +25,20 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = Mitsuba
PROJECT_NAME = "Mitsuba Renderer"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.2.0
PROJECT_NUMBER = 0.3.0
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/apidocs
OUTPUT_DIRECTORY = /home/httpd/mitsuba-renderer.org/htdocs/api
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@ -236,7 +236,7 @@ EXTENSION_MAPPING =
# func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = NO
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
@ -590,7 +590,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = include/mitsuba/core include/mitsuba/render doc/doxyfiles
INPUT = include/mitsuba/core include/mitsuba/render include/mitsuba/hw include/mitsuba/bidir doc/doxyfiles
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@ -718,7 +718,7 @@ INLINE_SOURCES = NO
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
STRIP_CODE_COMMENTS = NO
# If the REFERENCED_BY_RELATION tag is set to YES
# then for each documented function all documented
@ -836,7 +836,7 @@ HTML_ALIGN_MEMBERS = YES
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
HTML_DYNAMIC_SECTIONS = YES
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
@ -978,7 +978,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
DISABLE_INDEX = YES
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
@ -993,7 +993,7 @@ ENUM_VALUES_PER_LINE = 4
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = NO
GENERATE_TREEVIEW = YES
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
@ -1405,7 +1405,7 @@ MSCGEN_PATH =
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
HIDE_UNDOC_RELATIONS = NO
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization

View File

@ -190,6 +190,7 @@ might start the with parameters such as the following
$\texttt{\$}$ mitsuba -xj 2 -c machine1;machine2;... animation/frame_*.xml
\end{shell}
\subsection{Direct connection server}
\label{sec:mtssrv}
A Mitsuba compute node can be created using the \code{mtssrv} executable. By default,
it will listen on port 7554:
\begin{shell}

View File

@ -8,7 +8,7 @@ software construction tool. There are some differences between the different ope
more details, please refer to one of the next sections depending on which one you use.
\subsection{Common steps}
To get started, you will need to download a recent version of Mitsuba. Make sure that you have the Mercurial (\url{http://mercurial.selenic.com/}) versioning system installed\footnote{On Windows, you might also want the convenient TortoiseHG shell extension (\url{http://tortoisehg.bitbucket.org/}) to run the subsequent steps directly from the Explorer.} and enter the following at the command prompt:
To get started, you will need to download a recent version of Mitsuba. Make sure that you have the Mercurial (\url{http://mercurial.selenic.com/}) versioning system installed\footnote{On Windows, you might want to use the convenient TortoiseHG shell extension (\url{http://tortoisehg.bitbucket.org/}) to run the subsequent steps directly from the Explorer.} and enter the following at the command prompt:
\begin{shell}
$\texttt{\$}$ hg clone https://www.mitsuba-renderer.org/hg/mitsuba
\end{shell}
@ -32,6 +32,8 @@ build/config-msvc2010-win32.py
build/config-msvc2010-win64.py
build/config-icl12-msvc2010-win32.py
build/config-icl12-msvc2010-win64.py
build/config-icl12-darwin-x86_64.py
build/config-icl12-darwin-x86.py
\end{shell}
\subsection{Compilation flags}
@ -77,7 +79,7 @@ First, run
$\text{\$}$ sudo apt-get install build-essential scons mercurial qt4-dev-tools libpng12-dev
libjpeg62-dev libilmbase-dev libxerces-c3-dev libboost1.42-all-dev
libopenexr-dev libglewmx1.5-dev libxxf86vm-dev libpcrecpp0
libboost-system-dev libboost-filesystem-dev libboost-dev
libboost-system-dev libboost-filesystem-dev libboost-python-dev libboost-dev
\end{shell}
Please ensure that the installed version of the boost libraries is 1.42 or later.
To get COLLADA support, you will also need to install the \texttt{collada-dom} packages or build it from scratch. Here, we install the \code{x86\_64} binaries and development headers that can be found in the \texttt{dependencies/linux} directory\footnote{The directory also contains source packages in case these binaries don't work for you.}:
@ -93,7 +95,7 @@ If all goes well, SCons should finish successfully within a few minutes:
\begin{shell}
scons: $\texttt{done}$ building targets.
\end{shell}
To be able to run the renderer from the command line, you will also have to import it into your path:
To be able to run the renderer from the command line, you will first have to import it into your path:
\begin{shell}
$\text{\$}$ . setpath.sh
\end{shell}
@ -155,16 +157,14 @@ into the \code{/etc/apt/sources.list} file.
\subsection{Building on Fedora Core}
You'll first need to install a number of dependencies. It is assumed here
that you are using Fedora Core, hence some of the package may be named differently if you are
using another distribution.
that you are using FC15, hence some of the package may be named differently if you are
using another version.
First, run
\begin{shell}
$\text{\$}$ yum install mercurial gcc-c++ scons boost-devel qt4-devel OpenEXR-devel xerces-c-devel
$\text{\$}$ yum install mercurial gcc-c++ scons boost-devel qt4-devel OpenEXR-devel xerces-c-devel python-devel glew-devel collada-dom-devel
\end{shell}
You will also need the \texttt{glew-mx} and \texttt{collada-dom} packages, which are not included in the Fedora package repository.
You can grab source, \texttt{i386}, and \text{x86\_64} \texttt{RPM} files at the following location: \texttt{http://www.mitsuba-renderer.org/releases}.
After installing them, simply run
Afterwards, simply run
\begin{shell}
$\text{\$}$ scons
\end{shell}
@ -173,71 +173,68 @@ If all goes well, SCons should finish successfully within a few minutes:
\begin{shell}
scons: $\texttt{done}$ building targets.
\end{shell}
To be able to run the renderer from the command line, you will also have to import it into your path:
To be able to run the renderer from the command line, you will first have to import it into your path:
\begin{shell}
$\text{\$}$ . setpath.sh
\end{shell}
(note the period at the beginning -- this assumes that you are using \code{bash}).
Having set up everything, you can now move on to \secref{basics}.
\subsubsection{Creating Fedora Core packages}
To create \code{RPM} packages, you will need to install the \code{RPM} development tools:
\begin{shell}
$\text{\$}$ yum install rpmdevtools
\end{shell}
Once this is done, run the following command in your home directory:
\begin{shell}
$\text{\$}$ rpmdev-setuptree
\end{shell}
and create a Mitsuba source package in the appropriate directory:
\begin{shell}
$\text{\$}$ ln -s mitsuba mitsuba-$\code{\MitsubaVersion}$
$\text{\$}$ tar czvf rpmbuild/SOURCES/mitsuba-$\code{\MitsubaVersion}$.tar.gz mitsuba-$\code{\MitsubaVersion}$/.
\end{shell}
Finally, \code{rpmbuilder} can be invoked to create the package:
\begin{shell}
$\text{\$}$ rpmbuild -bb mitsuba-$\code{\MitsubaVersion}$/data/linux/fedora/mitsuba.spec
\end{shell}
After this command finishes, its output can be found in the directory \code{rpmbuild/RPMS}.
\subsection{Building on Arch Linux}
There are two ways to install Mitsuba on Archlinux, the Arch way, and the other way.
The Arch Way is to use the Aur software repository.
Accessing software in the Aur repository is easiest when using a script called \texttt{packer}.
First download packer then use \texttt{makepkg} to build and install it.
The \texttt{-is} flags will prompt you for your sudo password and then install the package after it has finished building as well as install any needed dependencies.
You'll first need to install a number of dependencies:
\begin{shell}
$\text{\$}$ mkdir packer && cd packer
$\text{\$}$ wget http://aur.archlinux.org/packages/packer/packer/PKGBUILD
$\text{\$}$ makepkg -is
$\text{\$}$ sudo pacman -S gcc xerces-c glew openexr boost libpng libjpeg qt scons mercurial python
\end{shell}
Next, use packer to automatically download, build, and install Mitsuba as well as any needed dependencies.
The optional \code{--noedit} flag is used if you do not wish to edit the files after they are downloaded.
The optional \code{--noconfirm} flag is used if you do not wish to confirm each step of the installation.
For COLLADA support, you will also have to install the \code{collada-dom}
library. For this, you can either install the binary package available on
the Mitsuba website, or you can compile it yourself using the \code{PKGBUILD}
supplied with Mitsuba, i.e.
\begin{shell}
$\text{\$}$ sudo packer -S --noedit --noconfirm mitsuba-hg glewmx collada-dom
$\text{\$}$ cd <some-temporary-directory>
$\text{\$}$ cp <path-to-mitsuba>/data/linux/arch/collada-dom/PKGBUILD .
$\text{\$}$ makepkg PKGBUILD
<..compiling..>
$\text{\$}$ sudo pacman -U <generated package file>
\end{shell}
Periodically you may wish to update Mitsuba to the latest version.
To do this simply reinstall it and packer will pull and build the latest version.
Once all dependencies are taken care of, simply run
\begin{shell}
$\text{\$}$ sudo packer -S --noedit --noconfirm mitsuba-hg
$\text{\$}$ scons
\end{shell}
Alternatively you can skip using packer and manually download the files and install them one at a time yourself.
First install glewmx
inside the Mitsuba directory. In the case that you have multiple processors, you might want to parallelize the build by appending \code{-j }\emph{core count} to the command.
If all goes well, SCons should finish successfully within a few minutes:
\begin{shell}
$\text{\$}$ mkdir glewmx && cd glewmx
$\text{\$}$ wget http://aur.archlinux.org/packages/glewmx/glewmx/PKGBUILD
$\text{\$}$ makepkg -is
scons: $\texttt{done}$ building targets.
\end{shell}
And then collada-dom
To be able to run the renderer from the command line, you will first have to import it into your path:
\begin{shell}
$\text{\$}$ mkdir collada-dom && cd collada-dom
$\text{\$}$ wget http://aur.archlinux.org/packages/collada-dom/collada-dom/PKGBUILD
$\text{\$}$ makepkg -is
$\text{\$}$ . setpath.sh
\end{shell}
And finally Mitsuba
\begin{shell}
$\text{\$}$ mkdir mitsuba-hg && cd mitsuba-hg
$\text{\$}$ wget http://aur.archlinux.org/packages/mitsuba-hg/mitsuba-hg/PKGBUILD
$\text{\$}$ makepkg -is
\end{shell}
To uninstall do this
\begin{shell}
$\text{\$}$ sudo pacman -R mitsuba-hg glewmx collada-dom
\end{shell}
After installing you will be able to run the renderer from the command line.
(note the period at the beginning -- this assumes that you are using \code{bash}).
Having set up everything, you can now move on to \secref{basics}.
If for some reason you are unable access the Aur files, they are also hosted at
(\url{https://www.mitsuba-renderer.org/releases/contrib/archlinux/}).
\subsubsection{Creating Arch Linux packages}
Mitsuba ships with a \code{PKGBUILD} file, which automatically builds
a package from the most recent repository version:
\begin{shell}
$\text{\$}$ makepkg data/linux/arch/mitsuba/PKGBUILD
\end{shell}
\subsection{Building on Windows}
On the Windows platform, Mitsuba already includes most of the dependencies in precompiled form.

View File

@ -1,12 +1,30 @@
\section{Development Guide}
\part{Development guide}
This chapter and the subsequent ones will provide an overview
of the the coding conventions and general architecture of Mitsuba.
You should only read them if if you wish to interface with the API
in some way (e.g. by developing your own plugins). The coding style
section is only relevant if you plan to submit patches, which should
go into the main codebase.
section is only relevant if you plan to submit patches that are meant
to become part of the main codebase.
\subsection{Coding style}
\section{Code structure}
Mitsuba is split into four basic support libraries:
\begin{itemize}
\item The core library (\code{libcore}) implements basic functionality such as
cross-platform file and bitmap I/O, data structures, scheduling, as well as logging and plugin management.
\item The rendering library (\code{librender}) contains abstractions
needed to load and represent scenes containing light sources, shapes, materials, and participating media.
\item The hardware acceleration library (\code{libhw})
implements a cross-platform display library, an object-oriented OpenGL
wrapper, as well as support for rendering interactive previews of scenes.
\item Finally, the bidirectional library (\code{libbidir})
contains a support layer that is used to implement bidirectional rendering algorithms such as
Bidirectional Path Tracing and Metropolis Light Transport.
\end{itemize}
A detailed reference of these APIs is available at
\url{http://www.mitsuba-renderer.org/api}. The next sections
present a few basic examples to get familiar with them.
\section{Coding style}
\paragraph{Indentation:} The Mitsuba codebase uses tabs for indentation,
which expand to \emph{four} spaces. Please make sure that you configure your editor
this way, otherwise the source code layout will look garbled.
@ -74,10 +92,10 @@ However, anything pertaining to the API should go into the header file.
\paragraph{Boost:} Use the boost libraries whenever this helps to save
time or write more compact code.
\paragraph{Classes vs structures:}In Mitsuba, classes \emph{always} go onto the heap,
\paragraph{Classes vs structures:}In Mitsuba, classes usually go onto the heap,
whereas structures may be allocated both on the stack and the heap.
Classes that derive from \code{Object} usually implement a protected virtual
Classes that derive from \code{Object} implement a protected virtual
deconstructor, which explicitly prevents them from being allocated on the stack.
The only way they can be deallocated is using the built-in reference
counting. This is done using the \code{ref<>} template, e.g.

View File

@ -1,36 +1,64 @@
/**
\defgroup libcore Core library
This module contains the core support API of Mitsuba
This library contains the core support API of Mitsuba
*/
/**
\defgroup librender Render library
This module contains the rendering-related API of Mitsuba
This library contains the rendering-related API of Mitsuba
*/
/**
\defgroup libhw Hardware acceleration library
This library contains the hardware acceleration API of Mitsuba
*/
/**
\defgroup libbidir Bidirectional support library
This library contains a support layer used to develop bidirectional
rendering techniques.
*/
/**
\defgroup libpython Python bindings
This module references all classes that have Python bindings
*/
/**
\mainpage Mitsuba Renderer API Documentation
<center><span style="color:red">Warning:</span> The generated API documentation is still very new and currently incomplete.</center>
<h2>Basic Information</h2>
<p>Welcome to the Mitsuba API documentation. <a href="http:/www.mitsuba-renderer.org">Mitsuba</a>
is a modular open-source rendering framework, which consists of a small set of core libraries
and over 100 different plugins that implement functionality ranging from materials and light
sources to complete rendering algorithms. This page provides information on the interface to these core
libraries needed to develop custom plugins.</p>
<center>
<p>The API documentation tracks the current development branch and is automatically
regenerated every hour. Note that it is not a substitute for the reference manual!
If you are planning to do any kind of serious development with Mitsuba, it is recommended that you
first read one the following documents (preferably the latter)</p>
- <a href="http://www.mitsuba-renderer.org/documentation.pdf">Reference Manual (Current release)</a>
- <a href="http://www.mitsuba-renderer.org/documentation-beta.pdf">Reference Manual (Development version)</a>
<a href="http://www.mitsuba-renderer.org">www.mitsuba-renderer.org</a>
<h2>API Structure</h2>
<p>Mitsuba is split into four basic support libraries. Please use the links below to view their
contents:
</p><p>
The <a href="group__libcore.html">core library (<tt>libcore</tt>)</a> implements basic
functionality such as cross-platform file and bitmap I/O, data structures, scheduling, as well as logging
and plugin management.</p>
<p>The <a href="group__librender.html">rendering library (<tt>librender</tt>)</a> contains abstractions
needed to load and represent scenes containing light sources, shapes, materials, and participating media.</p>
<p>The <a href="group__libhw.html">hardware acceleration library (<tt>libhw</tt>)</a>
implements a cross-platform display library, an object-oriented OpenGL
wrapper, as well as support for rendering interactive previews of scenes.
<p>Finally, the <a href="group__libbidir.html">bidirectional library (<tt>libbidir</tt>)</a>
contains a support layer that is used to implement bidirectional rendering algorithms such as
Bidirectional Path Tracing and Metropolis Light Transport. </p>
<p>Mitsuba also exposes a subset of these libraries via Python bindings. To see
a listing of all exported classes, <a href="group__libpython.html">click here</a>.</p>
<table width=1000 border=0 style="border: 0px solid #EEEEEE"><tr><td>
<div class="featuretitle">Basic Information</div>
- <a href="http://www.mitsuba-renderer.org/documentation.pdf">Reference Manual (PDF)</a>
<div class="featuretitle">API Documentation</div>
- <a href="annotated.html">Annotated Class List</a>
- <a href="classes.html">Alphabetical Class List</a>
- <a href="hierarchy.html">Class Hierarchy</a>
<div class="featuretitle">Community</div>
<h2>Community</h2>
- <a href="http://www.mitsuba-renderer.org/devblog">Development Blog</a>
- <a href="https://www.mitsuba-renderer.org/bugtracker/projects/mitsuba">Bug Tracker</a>
- <a href="https://www.mitsuba-renderer.org/hg">List of repositories</a>
</td></tr></table>
</center>
- <a href="https://www.mitsuba-renderer.org/hg/">List of repositories</a>
*/

674
doc/images/logo_plain.pdf Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,17 @@
\section{Introduction}
\part{Using Mitsuba}
\textbf{Disclaimer:} This is manual documents the usage, file format, and
internal design of the Mitsuba rendering system. It is currently a work
in progress, hence some parts may still be incomplete or missing.
\subsection{About Mitsuba}
\section{About Mitsuba}
Mitsuba is a research-oriented rendering system in the style of PBRT
(\url{www.pbrt.org}), from which it derives much inspiration.
It is written in portable C++, implements unbiased as well
as biased techniques, and contains heavy optimizations targeted
towards current CPU architectures.
towards current CPU architectures.
Mitsuba is extremely modular: it consists of a small set of core libraries
and over 100 different plugins that implement functionality ranging
from materials and light sources to complete rendering algorithms.
In comparison to other open source renderers, Mitsuba places a strong
emphasis on experimental rendering techniques, such as path-based
@ -46,13 +49,24 @@ it can get.
The renderer also tries to be very conservative in its use of memory, which allows it to handle
large scenes (>30 million triangles) and multi-gigabyte heterogeneous volumes on consumer hardware.
\parheader{Realism and accuracy:} Mitsuba comes with a large repository of physically-based
reflectance models for surfaces and participating media. These implementations
are designed so that they can be used to build complex shader networks, while
providing enough flexibility to be compatible with a wide range of different
rendering techniques, including path tracing, photon mapping, hardware-accelerated rendering
and bidirectional methods.
The unbiased path tracers in Mitsuba are battle-proven and produce
reference-quality results that can be used for predictive rendering, and to verify
implementations of other rendering methods.
\parheader{Usability:}
Mitsuba comes with a graphical user interface to interactively explore scenes. Once a suitable
viewpoint has been found, it is straightforward to perform renderings using any of the
implemented rendering techniques, while tweaking their parameters to find the most suitable
settings. Experimental integration into Blender 2.5 is also available.
\subsection{License}
\section{License}
Mitsuba is free software and can be redistributed and modified under the terms of the GNU General
Public License (Version 3) as provided by the Free Software Foundation.

View File

@ -81,6 +81,8 @@
% Listings settings
\lstset{
basicstyle = \small\ttfamily\raggedright,
commentstyle=\color{lstcomment}\itshape,
stringstyle=\color{lstattrib},
mathescape = true,
frame = lrtb,
backgroundcolor = \color{lstshade},
@ -111,6 +113,7 @@
},
}
% Set up textpos
\TPGrid{68}{108}
@ -125,6 +128,8 @@
{}
\lstnewenvironment{cpp}[1][]{\lstset{language=c++, #1}}
{}
\lstnewenvironment{python}[1][]{\lstset{language=Python, #1}}
{}
\lstnewenvironment{xml}[1][]{\lstset{language=xml, #1}}
{}
\lstnewenvironment{console}[1][]{\lstset{basicstyle=\footnotesize\ttfamily, float, #1}}
@ -133,6 +138,7 @@
% ----- 8< ----- 8< ------
\title{
\includegraphics[width=4cm]{images/logo_plain.pdf}\\\vspace{2cm}
Mitsuba Documentation\\\vspace{3mm}
\large Version \MitsubaVersion
}
@ -152,9 +158,10 @@
\include{format}
\IfFileExists{plugins_generated.tex}{\include{plugins_generated}}{}
%\include{import}
%\include{development}
%\include{integrator}
%\include{parallelization}
\include{development}
\include{integrator}
\include{parallelization}
\include{python}
\include{acknowledgements}
\bibliographystyle{acm}

295
doc/python.tex Normal file
View File

@ -0,0 +1,295 @@
\section{Python integration}
\label{sec:python}
A recent feature of Mitsuba is a simple Python interface to the renderer API.
While the interface is still limited at this point, it can already be
used for many useful purposes. To access the API, start your Python
interpreter and enter
\begin{python}
import mitsuba
\end{python}
For this to work on MacOS X, you will first have to run the ``\emph{Apple
Menu}$\to$\emph{Command-line access}'' menu item from within Mitsuba.
On Windows and non-packaged Linux builds, you may have to update the extension
search path before issuing the \code{import} command, e.g.:
\begin{python}
import sys
# Update the extension search path
# (may vary depending on your setup)
sys.path.append('dist/python')
import mitsuba
\end{python}
For an overview of the currently exposed API subset, please refer
to the following page: \url{http://www.mitsuba-renderer.org/api/group__libpython.html}.
\subsection{Basics}
Generally, the Python API tries to mimic the C++ API as closely as possible.
Where applicable, the Python classes and methods replicate overloaded operators,
overridable virtual function calls, and default arguments. Under rare circumstances,
some features are inherently non-portable due to fundamental differences between the
two programming languages. In this case, the API documentation will contain further
information.
Mitsuba's linear algebra-related classes are usable with essentially the
same syntax as their C++ versions --- for example, the following snippet
creates and rotates a unit vector.
\begin{python}
import mitsuba
from mitsuba.core import *
# Create a normalized direction vector
myVector = normalize(Vector(1.0, 2.0, 3.0))
# 90 deg. rotation around the Y axis
trafo = Transform.rotate(Vector(0, 1, 0), 90)
# Apply the rotation and display the result
print(trafo * myVector)
\end{python}
\subsection{Recipes}
The following section contains a series of ``recipes'' on how to do
certain things with the help of the Python bindings.
\subsubsection{Loading a scene}
The following script demonstrates how to use the
\code{FileResolver} and \code{SceneHandler} classes to
load a Mitsuba scene from an XML file:
\begin{python}
import mitsuba
from mitsuba.core import *
from mitsuba.render import SceneHandler
# Get a reference to the thread's file resolver
fileResolver = Thread.getThread().getFileResolver()
# Add the search path needed to load plugins
fileResolver.addPath('<path to mitsuba directory>')
# Add the search path needed to load scene resources
fileResolver.addPath('<path to scene directory>')
# Optional: supply parameters that can be accessed
# by the scene (e.g. as $\text{\color{lstcomment}\itshape\texttt{\$}}$myParameter)
paramMap = StringMap()
paramMap['myParameter'] = 'value'
# Load the scene from an XML file
scene = SceneHandler.loadScene(fileResolver, paramMap)
# Display a textual summary of the scene's contents
print(scene)
\end{python}
\subsubsection{Rendering a loaded scene}
Once a scene has been loaded, it can be rendered as follows:
\begin{python}
from mitsuba.core import *
from mitsuba.render import RenderQueue, RenderJob
import multiprocessing
scheduler = Scheduler.getInstance()
# Start up the scheduling system with one worker per local core
for i in range(0, multiprocessing.cpu_count()):
scheduler.registerWorker(LocalWorker('wrk%i' % i))
scheduler.start()
# Create a queue for tracking render jobs
queue = RenderQueue()
scene.setDestinationFile('renderedResult')
# Create a render job and insert it into the queue
job = RenderJob('myRenderJob', scene, queue)
job.start()
# Wait for all jobs to finish and release resources
queue.waitLeft(0)
queue.join()
# Print some statistics about the rendering process
print(Statistics.getInstance().getStats())
\end{python}
\subsubsection{Rendering over the network}
To render over the network, you must first set up one or
more machines that run the \code{mtssrv} server (see \secref{mtssrv}).
A network node can then be registered with the scheduler as follows:
\begin{python}
# Connect to a socket on a named host or IP address
# 7554 is the default port of 'mtssrv'
stream = SocketStream('128.84.103.222', 7554)
# Create a remote worker instance that communicates over the stream
remoteWorker = RemoteWorker('netWorker', stream)
scheduler = Scheduler.getInstance()
# Register the remote worker (and any other potential workers)
scheduler.registerWorker(remoteWorker)
scheduler.start()
\end{python}
\subsubsection{Constructing custom scenes from Python}
Dynamically constructing Mitsuba scenes entails loading a series of external
plugins, instantiating them with custom parameters, and finally assembling
them into an object graph.
For instance, the following snippet shows how to create a basic
perspective camera with a film that writes PNG images:
\begin{python}
from mitsuba.core import *
pmgr = PluginManager.getInstance()
# Encodes parameters on how to instantiate the 'perspective' plugin
cameraProps = Properties('perspective')
cameraProps['toWorld'] = Transform.lookAt(
Point(0, 0, -10), # Camera origin
Point(0, 0, 0), # Camera target
Vector(0, 1, 0) # 'up' vector
)
cameraProps['fov'] = 45.0
# Encodes parameters on how to instantiate the 'pngfilm' plugin
filmProps = Properties('pngfilm')
filmProps['width'] = 1920
filmProps['height'] = 1080
# Load and instantiate the plugins
camera = pmgr.createObject(cameraProps)
film = pmgr.createObject(filmProps)
# First configure the film and then add it to the camera
film.configure()
camera.addChild('film', film)
# Now, the camera can be configured
camera.configure()
\end{python}
The above code fragment uses the plugin manager to construct a
\code{Camera} instance from an external plugin named
\texttt{perspective.so/dll/dylib} and adds a child object
named \texttt{film}, which is a \texttt{Film} instance loaded from the
plugin \texttt{pngfilm.so/dll/dylib}.
Each time after instantiating a plugin, all child objects are added, and
finally the plugin's \code{configure()} method must be called.
Creating scenes in this manner ends up being rather laborious.
Since Python comes with a powerful dynamically-typed dictionary
primitive, Mitsuba additionally provides a more ``pythonic''
alternative that makes use of this facility:
\begin{python}
from mitsuba.core import *
pmgr = PluginManager.getInstance()
camera = pmgr.create({
'type' : 'perspective',
'toWorld' : Transform.lookAt(
Point(0, 0, -10),
Point(0, 0, 0),
Vector(0, 1, 0)
),
'film' : {
'type' : 'pngfilm',
'width' : 1920,
'height' : 1080
}
})
\end{python}
This code does exactly the same as the previous snippet.
By the time \code{PluginManager.create} returns, the object
hierarchy has already been assembled, and the
\code{configure()} method of every object
has been called.
Finally, here is an full example that creates a basic scene
which can be rendered. It describes a sphere lit by a point
light, rendered using the direct illumination integrator.
\begin{python}
from mitsuba.core import *
from mitsuba.render import Scene
scene = Scene()
# Create a camera, film & sample generator
scene.addChild(pmgr.create({
'type' : 'perspective',
'toWorld' : Transform.lookAt(
Point(0, 0, -10),
Point(0, 0, 0),
Vector(0, 1, 0)
),
'film' : {
'type' : 'pngfilm',
'width' : 1920,
'height' : 1080
},
'sampler' : {
'type' : 'ldsampler',
'sampleCount' : 2
}
}))
# Set the integrator
scene.addChild(pmgr.create({
'type' : 'direct'
}))
# Add a light source
scene.addChild(pmgr.create({
'type' : 'point',
'position' : Point(5, 0, -10),
'intensity' : Spectrum(100)
}))
# Add a shape
scene.addChild(pmgr.create({
'type' : 'sphere',
'center' : Point(0, 0, 0),
'radius' : 1.0,
'bsdf' : {
'type' : 'diffuse',
'reflectance' : Spectrum(0.4)
}
}))
\end{python}
\subsubsection{Taking control of the logging system}
Many operations in Mitsuba will print one or more log messages
during their execution. By default, they will be printed to the console,
which may be undesirable. Similar to the C++ side, it is possible to define
custom \code{Formatter} and \code{Appender} classes to interpret and direct
the flow of these messages.
Roughly, a \code{Formatter} turns detailed
information about a logging event into a human-readable string, and a
\code{Appender} routes it to some destination (e.g. by appending it to
a file or a log viewer in a graphical user interface). Here is an example
of how to activate such extensions:
\begin{python}
import mitsuba
from mitsuba.core import *
class MyFormatter(Formatter):
def format(self, logLevel, sourceClass, sourceThread, message, filename, line):
return '%s (log level: %s, thread: %s, class %s, file %s, line %i)' % \
(message, str(logLevel), sourceThread.getName(), sourceClass,
filename, line)
class MyAppender(Appender):
def append(self, logLevel, message):
print(message)
def logProgress(self, progress, name, formatted, eta):
print('Progress message: ' + formatted)
# Get the logger associated with the current thread
logger = Thread.getThread().getLogger()
logger.setFormatter(MyFormatter())
logger.clearAppenders()
logger.addAppender(MyAppender())
logger.setLogLevel(EDebug)
Log(EInfo, 'Test message')
\end{python}

View File

@ -24,12 +24,15 @@
MTS_NAMESPACE_BEGIN
/**
* Specialized sampler implementation used to seed MLT-style algorithm. Allows
* to query for the current sample index, which can later be used to rewind
* \brief Specialized sampler implementation used to seed MLT-style algorithm.
*
* Allows to query for the current sample index, which can later be used to rewind
* back to this state. In the case of MLT, this makes it possible to sample paths
* approximately proportional to their contribution without actually having
* to store millions of path. Note that `rewinding' is naive -- it just
* resets & regenerates the whole random number sequence, which might be slow.
*
* \ingroup libbidir
*/
class MTS_EXPORT_BIDIR ReplayableSampler : public Sampler {
public:
@ -52,7 +55,7 @@ public:
virtual void generate();
/// Manually set the current sample index
virtual void setSampleIndex(uint64_t sampleIndex);
virtual void setSampleIndex(size_t sampleIndex);
/// Retrieve the next component value from the current sample
virtual Float next1D();

View File

@ -295,6 +295,7 @@ template <typename T> struct TAABB {
* various convenience functions to query or change them.
*
* \ingroup libcore
* \ingroup libpython
*/
struct MTS_EXPORT_CORE AABB : public TAABB<Point> {
public:
@ -345,6 +346,10 @@ public:
/** \brief Calculate the near and far ray-AABB intersection
* points (if they exist).
*
* \remark In the Python bindings, this function returns the
* \c nearT and \c farT values as a tuple (or \c None, when no
* intersection was found)
*/
FINLINE bool rayIntersect(const Ray &ray, Float &nearT, Float &farT) const {
nearT = -std::numeric_limits<Float>::infinity();

View File

@ -22,8 +22,9 @@
MTS_NAMESPACE_BEGIN
/**
* NaN-aware slab test using SSE by Thierry Berger-Perrin (Intersects against
* 4 rays simultaneously). Returns false if none of the rays intersect.
* NaN-aware slab test using SSE by Thierry Berger-Perrin (Intersects
* against 4 rays simultaneously). Returns false if none of the rays
* intersect.
*/
FINLINE bool AABB::rayIntersectPacket(const RayPacket4 &ray,
RayInterval4 &interval) const {

View File

@ -27,6 +27,7 @@ MTS_NAMESPACE_BEGIN
* for logging-relevant information
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Appender : public Object {
public:
@ -39,10 +40,14 @@ public:
* \param name Title of the progress message
* \param formatted Formatted string representation of the message
* \param eta Estimated time until 100% is reached.
* \param ptr Custom pointer payload
* \param ptr Custom pointer payload. This is used to express the
* context of a progress message. When rendering a scene, it
* will usually contain a pointer to the associated \c RenderJob.
* \remark The \c ptr argument is missing in the Python bindings
*/
virtual void logProgress(Float progress, const std::string &name,
const std::string &formatted, const std::string &eta, const void *ptr) = 0;
const std::string &formatted, const std::string &eta,
const void *ptr) = 0;
MTS_DECLARE_CLASS()
protected:

View File

@ -31,6 +31,7 @@ MTS_NAMESPACE_BEGIN
* This class can efficiently handle 1-bit masks
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Bitmap : public Object {
public:
@ -66,7 +67,7 @@ public:
void save(EFileFormat format, Stream *stream, int compression = 5) const;
/// Return the image's title identifier
inline const std::string &getTile() const { return m_title; }
inline const std::string &getTitle() const { return m_title; }
/// Return the image's author identifier
inline const std::string &getAuthor() const { return m_author; }
@ -89,29 +90,41 @@ public:
/// Set the image's gamma identifier (-1: sRGB)
inline void setGamma(Float gamma) { m_gamma = gamma; }
/// Access the underlying raster
/**
* \brief Access the underlying raster
* \remark This function is not exposed in the Python bindings
*/
inline unsigned char *getData() { return m_data; }
/// Access the underlying bit raster
/**
* \brief Access the underlying raster
* \remark This function is not exposed in the Python bindings
*/
inline const unsigned char *getData() const { return m_data; }
/// Access the underlying raster (only meant for 128bpp images)
/**
* \brief Access the underlying raster (128bpp images)
* \remark This function is not exposed in the Python bindings
*/
inline float *getFloatData() { return (float *) m_data; }
/// Access the underlying raster (only meant for 128bpp images)
/**
* \brief Access the underlying raster (128bpp images)
* \remark This function is not exposed in the Python bindings
*/
inline const float *getFloatData() const { return (const float *) m_data; }
/// Return the bitmap width
inline const int getWidth() const { return m_width; }
inline int getWidth() const { return m_width; }
/// Return the bitmap height
inline const int getHeight() const { return m_height; }
inline int getHeight() const { return m_height; }
/// Return the bitmap's bits per pixel
inline const int getBitsPerPixel() const { return m_bpp; }
inline int getBitsPerPixel() const { return m_bpp; }
/// Return the bitmap size in bytes
inline const size_t getSize() const { return m_size; }
inline size_t getSize() const { return m_size; }
/// Return some human-readable information about this bitmap
std::string toString() const;

View File

@ -26,6 +26,7 @@ MTS_NAMESPACE_BEGIN
/** \brief Bounding sphere data structure in three dimensions
*
* \ingroup libcore
* \ingroup libpython
*/
struct BSphere {
Point center;
@ -59,7 +60,6 @@ struct BSphere {
/// Expand the bounding sphere radius to contain another point.
inline void expandBy(const Point p) {
Vector dir = p - center;
radius = std::max(radius, (p-center).length());
}
@ -81,6 +81,10 @@ struct BSphere {
/**
* \brief Calculate the intersection points with the given ray
* \return \c true if the ray intersects the bounding sphere
*
* \remark In the Python bindings, this function returns the
* \c nearT and \c farT values as a tuple (or \c None, when no
* intersection was found)
*/
inline bool rayIntersect(const Ray &ray, Float &nearHit, Float &farHit) const {
Vector originToCenter = center - ray.o;

View File

@ -46,7 +46,7 @@ MTS_NAMESPACE_BEGIN
*
* Given a probability distribution with the following interface
*
* <code>
* \code
* class MyDistribution {
* // Sample a (optionally weighted) direction. A non-unity weight
* // in the return value is needed when the sampling distribution
@ -56,11 +56,11 @@ MTS_NAMESPACE_BEGIN
* /// Compute the probability density for the specified direction and measure
* Float pdf(const Vector &direction, EMeasure) const;
* };
* </code>
* \endcode
*
* the code in this class might be used as follows
*
* <code>
* \code
* MyDistribution myDistrInstance;
* ChiSquare chiSqr;
*
@ -75,7 +75,8 @@ MTS_NAMESPACE_BEGIN
*
* if (!chiSqr.runTest())
* Log(EError, "Uh oh -- test failed, the implementation is probably incorrect!");
* </code>
* \endcode
* \ingroup libcore
*/
class MTS_EXPORT_CORE ChiSquare : public Object {
public:
@ -129,8 +130,7 @@ public:
* errors in a system based on finite-precision arithmetic, it
* may be a good idea to tolerate at least a few samples without
* immediately rejecting the null hypothesis. This parameter
* sets this threshold. The default value is <number of
* sample> * 1e-4f
* sets this threshold. The default value is \c number-of-samples*1e-4f
*/
inline void setTolerance(Float tolerance) { m_tolerance = tolerance; }

View File

@ -37,6 +37,7 @@ MTS_NAMESPACE_BEGIN
*
* \sa ref, Object
* \ingroup libcore
* \ingroup librender
*/
class MTS_EXPORT_CORE Class {
public:
@ -124,11 +125,34 @@ private:
/*! @{ */
/**
* \brief Return the \ref Class object corresponding to a named class.
*
* Call the Macro without quotes, e.g. \c MTS_CLASS(SerializableObject)
*/
#define MTS_CLASS(x) x::m_theClass
/**
* \brief This macro must be used in the declaration of
* all classes derived from \ref Object.
* \brief This macro must be used in the initial definition in
* classes that derive from \ref Object.
*
* This is needed for the basic RTTI support provided by Mitsuba objects.
* For instance, a class definition might look like the following:
*
* \code
* class MyObject : public Object {
* public:
* MyObject();
*
* /// Important: declare RTTI data structures
* MTS_DECLARE_CLASS()
* protected:
* /// Important: needs to declare a protected virtual destructor
* virtual ~MyObject();
*
* };
* \endcode
*
*/
#define MTS_DECLARE_CLASS() \
virtual const Class *getClass() const; \
@ -137,6 +161,17 @@ public: \
/**
* \brief Creates basic RTTI support for a class
*
* This macro or one of its variants should be invoked in the main
* implementation \c .cpp file of any class that derives from \ref Object.
* This is needed for the basic RTTI support provided by Mitsuba objects.
* For instance, the corresponding piece for the example shown in the
* documentation of \ref MTS_DECLARE_CLASS might look like this:
*
* \code
* MTS_IMPLEMENT_CLASS(MyObject, false, Object)
* \endcode
*
* \param name Name of the class
* \param abstract \c true if the class contains pure virtual methods
* \param super Name of the parent class
@ -148,8 +183,13 @@ public: \
}
/**
* \brief Creates basic RTTI support for a class. Assumes that
* the class can be instantiated by name.
* \brief Creates basic RTTI support for a class. To be used when the class
* has a \a simple constructor (i.e. one wich does not take any arguments)
*
* This macro or one of its variants should be invoked in the main
* implementation \c .cpp file of any class that derives from \ref Object.
* This is needed for the basic RTTI support provided by Mitsuba objects.
*
* \param name Name of the class
* \param abstract \c true if the class contains pure virtual methods
* \param super Name of the parent class
@ -164,8 +204,13 @@ public: \
}
/**
* \brief Creates basic RTTI support for a class. Assumes that
* the class can be unserialized from a binary data stream.
* \brief Creates basic RTTI support for a class. To be used when the class
* can be unserialized from a binary data stream.
*
* This macro or one of its variants should be invoked in the main
* implementation \c .cpp file of any class that derives from \ref Object.
* This is needed for the basic RTTI support provided by Mitsuba objects.
*
* \param name Name of the class
* \param abstract \c true if the class contains pure virtual methods
* \param super Name of the parent class
@ -180,9 +225,14 @@ public: \
}
/**
* \brief Creates basic RTTI support for a class. Assumes that
* the class can be unserialized from a binary data stream as well
* as instantiated by name.
* \brief Creates basic RTTI support for a class. To be used when the class
* can be unserialized from a binary data stream as well as instantiated
* by a constructor that does not take any arguments.
*
* This macro or one of its variants should be invoked in the main
* implementation \c .cpp file of any class that derives from \ref Object.
* This is needed for the basic RTTI support provided by Mitsuba objects.
*
* \param name Name of the class
* \param abstract \c true if the class contains pure virtual methods
* \param super Name of the parent class

View File

@ -33,6 +33,7 @@ MTS_NAMESPACE_BEGIN
* requests in the XML file.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE ConfigurableObject : public SerializableObject {
public:
@ -48,6 +49,9 @@ public:
/// Add a child (default implementation throws an error)
virtual void addChild(const std::string &name, ConfigurableObject *child);
/// Add an unnamed child
inline void addChild(ConfigurableObject *child) { addChild("", child); }
/** \brief Configure the object (called \a once after construction
and addition of all child ConfigurableObjects) */
virtual void configure();

View File

@ -21,13 +21,8 @@
/* Choice of precision */
#ifdef DOUBLE_PRECISION
#define Float double
#define Epsilon 1e-6
#else
#ifndef SINGLE_PRECISION
#define SINGLE_PRECISION
#endif
#define Float float
#define Epsilon 1e-4f
#endif

View File

@ -31,6 +31,7 @@ MTS_NAMESPACE_BEGIN
* quantities (e.g. \ref cosTheta(), \ref tanTheta, ..).
*
* \ingroup libcore
* \ingroup libpython
*/
struct Frame {
Vector s, t;
@ -62,7 +63,7 @@ struct Frame {
}
/// Serialize to a binary data stream
inline void serialize (Stream *stream) const {
inline void serialize(Stream *stream) const {
s.serialize(stream);
t.serialize(stream);
n.serialize(stream);
@ -133,14 +134,14 @@ struct Frame {
/** \brief Assuming that the given direction is in the local coordinate
* system, return the squared sine of the phi parameter in spherical
* coordinates */
inline static Float sinPhiSquared(const Vector &v) {
inline static Float sinPhi2(const Vector &v) {
return clamp(v.y * v.y / sinTheta2(v), 0.0f, 1.0f);
}
/** \brief Assuming that the given direction is in the local coordinate
* system, return the squared cosine of the phi parameter in spherical
* coordinates */
inline static Float cosPhiSquared(const Vector &v) {
inline static Float cosPhi2(const Vector &v) {
return clamp(v.x * v.x / sinTheta2(v), 0.0f, 1.0f);
}

View File

@ -36,6 +36,7 @@ MTS_NAMESPACE_BEGIN
* operating systems).
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE FileResolver : public Object {
public:
@ -61,6 +62,8 @@ public:
*
* In comparison to \ref resolve(), this funtion returns all
* matches instead of only the first one.
*
* \remark This function is not exposed in the Python bindings
*/
std::vector<fs::path> resolveAll(const fs::path &path) const;
@ -75,10 +78,10 @@ public:
/// Add a search path to the resolver
void addPath(const fs::path &path);
/// Clear all stored search paths
void clear();
/// Return a human-readable string representation
std::string toString() const;

View File

@ -33,6 +33,7 @@ MTS_NAMESPACE_BEGIN
* WIN32 API when used on Windows.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE FileStream : public Stream {
public:

View File

@ -89,25 +89,36 @@ template <typename T> struct TPoint2;
template <typename T> struct TPoint3;
template <typename T> struct TPoint4;
template <typename T> struct TQuaternion;
/// \ingroup libpython
typedef TVector2<Float> Vector2;
/// \ingroup libpython
typedef TVector2<int> Vector2i;
typedef TVector2<float> Vector2f;
typedef TVector2<double> Vector2d;
/// \ingroup libpython
typedef TVector3<Float> Vector;
/// \ingroup libpython
typedef TVector3<Float> Vector3;
/// \ingroup libpython
typedef TVector3<int> Vector3i;
typedef TVector3<float> Vector3f;
typedef TVector3<double> Vector3d;
/// \ingroup libpython
typedef TVector4<Float> Vector4;
typedef TVector4<int> Vector4i;
typedef TVector4<float> Vector4f;
typedef TVector4<double> Vector4d;
/// \ingroup libpython
typedef TPoint2<Float> Point2;
/// \ingroup libpython
typedef TPoint2<int> Point2i;
typedef TPoint2<float> Point2f;
typedef TPoint2<double> Point2d;
/// \ingroup libpython
typedef TPoint3<Float> Point;
/// \ingroup libpython
typedef TPoint3<Float> Point3;
/// \ingroup libpython
typedef TPoint3<int> Point3i;
typedef TPoint3<float> Point3f;
typedef TPoint3<double> Point3d;

View File

@ -1,338 +0,0 @@
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2011 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__GRID_H)
#define __GRID_H
#include <mitsuba/mitsuba.h>
MTS_NAMESPACE_BEGIN
/**
* \brief Uniform 3D grid for storing and manipulating arbitrary quantities
*
* \ingroup libcore
*/
template <typename ValueType> class Grid {
public:
/// Construct a new grid with the given resolution (initialized to zero)
Grid(const Vector3i &res, const AABB &aabb) : m_res(res), m_aabb(aabb) {
m_slab = res.x*res.y;
m_numCells = m_slab*res.z;
m_cells = new ValueType[m_numCells];
for (int i=0; i<3; ++i)
m_cellWidth[i] = m_aabb.getExtents()[i] / (Float) res[i];
clear();
}
/// Unserialize a grid from a binary data stream
Grid(Stream *stream) {
m_res = Vector3i(stream);
m_aabb = AABB(stream);
m_slab = m_res.x*m_res.y;
m_numCells = m_slab*m_res.z;
m_cells = new ValueType[m_numCells];
stream->read(m_cells, sizeof(ValueType)*m_numCells);
for (int i=0; i<3; ++i)
m_cellWidth[i] = m_aabb.getExtents()[i] / (Float) m_res[i];
}
/// Serialize a grid to a binary data stream
inline void serialize(Stream *stream) const {
m_res.serialize(stream);
m_aabb.serialize(stream);
for (int i=0; i<3; ++i)
stream->writeSingle((float) m_aabb.min[i]);
for (int i=0; i<3; ++i)
stream->writeSingle((float) m_aabb.max[i]);
stream->write(m_cells, sizeof(ValueType)*m_numCells);
}
/// Reset everything to zero
inline void clear() {
memset(m_cells, 0, sizeof(ValueType) * m_numCells);
}
/// Add the values from another grid of identical shape and type
inline void operator+=(const Grid<ValueType> &grid) {
SAssert(grid.m_numCells == m_numCells);
for (size_t i=0; i<m_numCells; ++i)
m_cells[i] += grid.m_cells[i];
}
/// Multiply all entries by a constant
inline void operator*=(Float value) {
for (size_t i=0; i<m_numCells; ++i)
m_cells[i] *= value;
}
/// Return the grid AABB
inline const AABB &getAABB() const { return m_aabb; }
/// Return the grid resolution
inline const Vector3i &getResolution() const { return m_res; }
/// Return the cell size
inline const Vector &getCellWidth() const { return m_cellWidth; }
/// Perform a lookup
inline ValueType &operator()(int x, int y, int z) {
return m_cells[x + y*m_res.x + z*m_slab];
}
/// Perform a lookup (const version)
inline const ValueType &operator()(int x, int y, int z) const {
return m_cells[x + y*m_res.x + z*m_slab];
}
/// Return a pointer to the underlying array
inline ValueType *getData() const { return m_cells; }
/// Return a string representation
std::string toString() const {
std::ostringstream oss;
oss << m_aabb.min.x << " " << m_aabb.max.x << " " << m_res.x << endl;
oss << m_aabb.min.y << " " << m_aabb.max.y << " " << m_res.y << endl;
oss << m_aabb.min.z << " " << m_aabb.max.z << " " << m_res.z << endl;
for (int z=0; z<m_res.z; ++z)
for (int y=0; y<m_res.y; ++y)
for (int x=0; x<m_res.x; ++x)
oss << m_cells[x + y*m_res.x + z*m_slab] << " ";
return oss.str();
}
/// Modify the voxel containing a certain point
void setValue(const Point &p, ValueType value) {
/* Intersect with the voxel grid */
if (!m_aabb.contains(p)) {
std::ostringstream oss;
oss << "The grid " << m_aabb.toString() << " does not contain the "
"position " << p.toString() << "!" << endl;
throw std::runtime_error(oss.str());
}
Vector pos = p - m_aabb.min;
Vector3i dpos(
std::max(0, std::min((int) (pos.x / m_cellWidth.x), m_res.x-1)),
std::max(0, std::min((int) (pos.y / m_cellWidth.y), m_res.y-1)),
std::max(0, std::min((int) (pos.z / m_cellWidth.z), m_res.z-1))
);
m_cells[dpos.x + dpos.y * m_res.x + dpos.z * m_slab] = value;
}
/// Apply the given functor to a grid cell
template <typename Functor> void apply(const Point &p, const Functor &functor) {
/* Intersect with the voxel grid */
if (!m_aabb.contains(p)) {
std::ostringstream oss;
oss << "The grid " << m_aabb.toString() << " does not contain the "
"position " << p.toString() << "!" << endl;
throw std::runtime_error(oss.str());
}
Vector pos = p - m_aabb.min;
Vector3i dpos(
std::max(0, std::min((int) (pos.x / m_cellWidth.x), m_res.x-1)),
std::max(0, std::min((int) (pos.y / m_cellWidth.y), m_res.y-1)),
std::max(0, std::min((int) (pos.z / m_cellWidth.z), m_res.z-1))
);
int index = dpos.x + dpos.y * m_res.x + dpos.z * m_slab;
m_cells[index] = functor(m_cells[index]);
}
/**
* Apply the given functor to a grid cell - don't throw an error if
* the point is not part of the grid. Returns 'true' upon success
*/
template <typename Functor> bool applyIfContained(const Point &p, const Functor &functor) {
if (!m_aabb.contains(p))
return false;
Vector pos = p - m_aabb.min;
Vector3i dpos(
std::max(0, std::min((int) (pos.x / m_cellWidth.x), m_res.x-1)),
std::max(0, std::min((int) (pos.y / m_cellWidth.y), m_res.y-1)),
std::max(0, std::min((int) (pos.z / m_cellWidth.z), m_res.z-1))
);
int index = dpos.x + dpos.y * m_res.x + dpos.z * m_slab;
m_cells[index] = functor(m_cells[index]);
return true;
}
/**
* \brief Rasterize a ray to the grid and apply the functor to
* every traversed cell
*/
template <typename Functor> void rasterize(const Ray &ray, Functor &functor) {
Float mint, maxt, t;
/* Intersect with the voxel grid */
if (!m_aabb.rayIntersect(ray, mint, maxt))
return;
/* Find the covered range in the ray space */
mint = std::max(mint, ray.mint); maxt = std::max(mint, std::min(maxt, ray.maxt));
if (mint == maxt)
return;
/* Compute the discrete coordinates of the first intersected voxel */
Vector pos = ray(mint) - m_aabb.min;
Vector3i dpos(
std::max(0, std::min((int) (pos.x / m_cellWidth.x), m_res.x-1)),
std::max(0, std::min((int) (pos.y / m_cellWidth.y), m_res.y-1)),
std::max(0, std::min((int) (pos.z / m_cellWidth.z), m_res.z-1))
);
t = mint;
/* Precompute useful traversal information */
Vector corner1 = Vector(dpos.x * m_cellWidth.x,
dpos.y * m_cellWidth.y, dpos.z * m_cellWidth.z);
Vector corner2 = Vector((dpos.x+1) * m_cellWidth.x,
(dpos.y+1) * m_cellWidth.y, (dpos.z+1) * m_cellWidth.z);
Vector delta, next;
Vector3i step, bounds;
for (int i=0; i<3; ++i) {
if (std::abs(ray.d[i]) < Epsilon) {
delta[i] = 0; step[i] = 0; next[i] =
std::numeric_limits<Float>::infinity();
} else if (ray.d[i] > 0) {
delta[i] = m_cellWidth[i]/ray.d[i];
next[i] = mint + (corner2[i] - pos[i]) / ray.d[i];
step[i] = 1;
bounds[i] = m_res[i];
} else {
delta[i] = -m_cellWidth[i]/ray.d[i];
next[i] = mint + (corner1[i] - pos[i]) / ray.d[i];
step[i] = -1;
bounds[i] = -1;
}
}
/* Walk through the voxel grid (3D DDA) */
while (true) {
Float nextT = std::min(std::min(std::min(next.x, next.y), next.z), maxt);
const int arrayIdx = dpos.x + dpos.y * m_res.x + dpos.z * m_slab;
m_cells[arrayIdx] = functor(m_cells[arrayIdx], nextT - t);
t = nextT;
if (next.x <= next.y && next.x <= next.z) {
if (next.x > maxt)
break;
dpos.x += step.x;
if (dpos.x == bounds.x)
break;
next.x += delta.x;
} else if (next.y <= next.x && next.y <= next.z) {
if (next.y > maxt)
break;
dpos.y += step.y;
if (dpos.y == bounds.y)
break;
next.y += delta.y;
} else {
if (next.z > maxt)
break;
dpos.z += step.z;
if (dpos.z == bounds.z)
break;
next.z += delta.z;
}
}
}
/// Return a string representation (MATLAB format)
std::string toStringMATLAB() const {
std::ostringstream oss;
oss << "v=reshape([";
for (int z=0; z<m_res.z; ++z) // intentional order (matlab array conventions..)
for (int x=0; x<m_res.x; ++x)
for (int y=0; y<m_res.y; ++y)
oss << m_cells[x + y*m_res.x + z*m_slab] << " ";
oss << "], " << m_res.x << "," << m_res.y << "," << m_res.z << ");" << endl;
oss << "[X Y Z]=meshgrid( ..." << endl;
oss << "\tlinspace(" << m_aabb.min.x << ", " << m_aabb.max.x << ", " << m_res.x << "), ..." << endl;
oss << "\tlinspace(" << m_aabb.min.y << ", " << m_aabb.max.y << ", " << m_res.y << "), ..." << endl;
oss << "\tlinspace(" << m_aabb.min.z << ", " << m_aabb.max.z << ", " << m_res.z << ") ..." << endl;
oss << ");" << endl;
return oss.str();
}
/// Do a lookup using trilinear interpolation
ValueType lookup(const Point &_p) const {
Point p = Point(_p - m_aabb.min);
Float x = p.x / m_cellWidth.x - .5f;
Float y = p.y / m_cellWidth.y - .5f;
Float z = p.z / m_cellWidth.z - .5f;
const int i = (int) x, j = (int) y, k = (int) z,
pos=i+j*m_res.x+k*m_slab;
if (i < 0 || j < 0 || k < 0 || i >= m_res.x-1 ||
j >= m_res.y || k >= m_res.z)
return ValueType();
const Float alpha = x-i,
beta = y-j,
gamma = z-k;
const ValueType
A1 = m_cells[pos],
B1 = (i+1<m_res.x) ? m_cells[pos+1] : ValueType(0),
C1 = (j+1<m_res.y) ? m_cells[pos+m_res.x] : ValueType(0),
D1 = (i+1<m_res.x && j+1<m_res.y) ? m_cells[pos+m_res.x+1] : ValueType(0);
ValueType A2, B2, C2, D2;
if (k + 1 < m_res.z) {
A2 = m_cells[pos+m_slab];
B2 = (i+1<m_res.x) ? m_cells[pos+1+m_slab] : ValueType(0);
C2 = (j+1<m_res.y) ? m_cells[pos+m_res.x+m_slab] : ValueType(0);
D2 = (i+1<m_res.x && j+1<m_res.y) ? m_cells[pos+m_res.x+m_slab+1] : ValueType(0);
} else {
A2 = B2 = C2 = D2 = ValueType(0);
}
return (A1 * ((1-alpha) * (1-beta))
+ B1 * ( alpha * (1-beta))
+ C1 * ((1-alpha) * beta)
+ D1 * alpha * beta) * (1-gamma)
+ (A2 * ((1-alpha) * (1-beta))
+ B2 * ( alpha * (1-beta))
+ C2 * ((1-alpha) * beta)
+ D2 * alpha * beta) * gamma;
}
/// Release all memory
~Grid() {
delete[] m_cells;
}
private:
Vector3i m_res;
AABB m_aabb;
size_t m_numCells;
size_t m_slab;
Vector m_cellWidth;
ValueType *m_cells;
};
MTS_NAMESPACE_END
#endif /* __GRID_H */

View File

@ -54,12 +54,13 @@ MTS_NAMESPACE_BEGIN
/*! \addtogroup libcore */
/*! @{ */
/// Assert that a condition is true (to be used \a inside of classes that derive from \ref Object)
#define Assert(cond) do { \
if (!(cond)) Log(EError, "Assertion \"%s\" failed in %s:%i", \
#cond, __FILE__, __LINE__); \
} while (0)
/// ``Static'' assertion (to be used outside of classes that derive from Object)
/// ``Static'' assertion (to be used \a outside of classes that derive from \ref Object)
#define SAssert(cond) do { \
if (!(cond)) SLog(EError, "Assertion \"%s\" failed in %s:%i", \
#cond, __FILE__, __LINE__); \
@ -90,6 +91,7 @@ MTS_NAMESPACE_BEGIN
* registered Appender.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Logger : public Object {
public:
@ -103,6 +105,8 @@ public:
* \param fileName Source file of the message creator
* \param lineNumber Source line number of the message creator
* \param fmt printf-style string formatter
* \note This function is not exposed in the Python bindings.
* Instead, please use \cc mitsuba.core.Log
*/
void log(ELogLevel level, const Class *theClass,
const char *fileName, int lineNumber,
@ -114,7 +118,10 @@ public:
* \param name Title of the progress message
* \param formatted Formatted string representation of the message
* \param eta Estimated time until 100% is reached.
* \param ptr Custom pointer payload
* \param ptr Custom pointer payload. This is used to express the
* context of a progress message. When rendering a scene, it
* will usually contain a pointer to the associated \c RenderJob.
* \remark The \c ptr argument is missing in the Python bindings
*/
void logProgress(Float progress, const std::string &name,
const std::string &formatted, const std::string &eta,
@ -122,7 +129,7 @@ public:
/// Set the log level (everything below will be ignored)
void setLogLevel(ELogLevel level);
/**
* \brief Set the error log level (this level and anything
* above will throw exceptions).
@ -146,9 +153,12 @@ public:
/// Remove an appender from this logger
void removeAppender(Appender *appender);
/// Remove all appenders from this logger
void clearAppenders();
/// Return the number of registered appenders
inline size_t getAppenderCount() const { return m_appenders.size(); }
/// Return one of the appenders
inline Appender *getAppender(size_t index) { return m_appenders[index]; }

View File

@ -87,7 +87,8 @@ public:
// Obtain value of the cached function for k
V get(const K& k, bool &hit) {
// Attempt to find existing record
const typename cache_type::left_iterator it = m_cache.left.find(k);
const typename cache_type::left_iterator it
= m_cache.left.find(k);
if (it == m_cache.left.end()) {
// We dont have it:

View File

@ -80,7 +80,6 @@ public:
memcpy(m, mtx.m, sizeof(T) * M * N);
}
/// Initialize with the identity matrix
void setIdentity() {
for (int i=0; i<M; ++i)
@ -188,6 +187,14 @@ public:
return *this;
}
/// Matrix-scalar addition
inline const Matrix &operator-=(T value) {
for (int i=0; i<M; ++i)
for (int j=0; j<N; ++j)
m[i][j] -= value;
return *this;
}
/// Component-wise negation
inline Matrix operator-() const {
Matrix result;
@ -582,6 +589,7 @@ public:
/**
* \brief Basic 4x4 matrix data type
* \ingroup libcore
* \ingroup libpython
*/
struct MTS_EXPORT_CORE Matrix4x4 : public Matrix<4, 4, Float> {
inline Matrix4x4() { }
@ -678,6 +686,10 @@ template <typename T, int M1, int N1, int M2, int N2> inline Matrix<M1, N2, T>
return result;
}
template <typename T, int M, int N> inline Matrix<M, N, T> operator*(T f, const Matrix<M, N, T> &m) {
return m*f;
}
/**
* \brief Fast 3x3 eigenvalue decomposition
*

View File

@ -24,10 +24,12 @@
MTS_NAMESPACE_BEGIN
/**
* Basic memory pool -- allows repeated allocation & deallocation
* of objects of the same type, while attempting to keep them
* contiguous in memory and having only minimal interaction with the
* underlying allocator.
* \brief Basic memory pool for efficient allocation and deallocation
* of objects of the same type.
*
* This class attempts to keep most instances contiguous in memory, while
* having only minimal interaction with the underlying allocator.
*
* \ingroup libcore
*/
template <typename T> class MemoryPool {

View File

@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__MMAP_H)
#define __MMAP_H

View File

@ -23,13 +23,16 @@
MTS_NAMESPACE_BEGIN
/** \brief Abstract interface for objects that reference shared network resources.
/** \brief Abstract interface for objects that reference shared network
* resources.
*
* When a networked object is serialized as part of a parallel process executed on
* multiple machines, the object is first given the opportunity to bind named resources
* to the process (by a call to <tt>\ref bindUsedResources()</tt>). These will then be
* distributed to all participating compute servers. Once unserialized on the remote side,
* <tt>\ref wakeup()</tt> is called to let the object re-associate with the shared resources.
* When a networked object is serialized as part of a parallel process
* executed on multiple machines, the object is first given the
* opportunity to bind named resources to the process (by a call to
* \ref bindUsedResources()). These will then be distributed to all
* participating compute servers. Once unserialized on the remote side,
* \ref wakeup() is called to let the object re-associate with the
* shared resources.
*
* \ingroup libcore
*/

View File

@ -32,6 +32,7 @@ MTS_NAMESPACE_BEGIN
* is in how instances of <tt>Normal</tt> are treated by linear transformations.
*
* \ingroup libcore
* \ingroup libpython
*/
struct Normal : public TVector3<Float> {
/** \brief Construct a new normal without initializing it.

View File

@ -33,6 +33,7 @@ MTS_NAMESPACE_BEGIN
*
* \sa ref, Class
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Object {
public:

View File

@ -74,6 +74,7 @@
#define MTS_MODULE_RENDER 2
#define MTS_MODULE_HW 3
#define MTS_MODULE_BIDIR 4
#define MTS_MODULE_PYTHON 5
#define MTS_EXPORT __declspec(dllexport)
#define MTS_IMPORT __declspec(dllimport)
@ -98,6 +99,11 @@
#else
#define MTS_EXPORT_BIDIR __declspec(dllimport)
#endif
#if MTS_BUILD_MODULE == MTS_MODULE_PYTHON
#define MTS_EXPORT_PYTHON __declspec(dllexport)
#else
#define MTS_EXPORT_PYTHON __declspec(dllimport)
#endif
#define SIZE_T_FMT "%Iu"
#define BOOST_FILESYSTEM_NO_LIB
@ -108,6 +114,7 @@
#define MTS_EXPORT_RENDER
#define MTS_EXPORT_HW
#define MTS_EXPORT_BIDIR
#define MTS_EXPORT_PYTHON
#include <stdint.h>
#define SIZE_T_FMT "%zd"
@ -123,19 +130,25 @@
/* Compile with Boost filesystem v2 */
#define BOOST_FILESYSTEM_VERSION 2
/* Use ELF support for thread-local storage on Linux? This
* is potentially faster but causes problems when dynamically
* loading Mitsuba from Python, so let's keep it disabled for now
*/
#define MTS_USE_ELF_TLS 0
#include <string>
MTS_NAMESPACE_BEGIN
#if defined(__OSX__)
extern void __ubi_autorelease_init();
extern void __ubi_autorelease_shutdown();
extern void __ubi_autorelease_begin();
extern void __ubi_autorelease_end();
extern std::string __ubi_bundlepath();
extern void __ubi_chdir_to_bundlepath();
extern void __ubi_init_cocoa();
#define MTS_AUTORELEASE_BEGIN() __ubi_autorelease_begin();
#define MTS_AUTORELEASE_END() __ubi_autorelease_end();
extern void __mts_autorelease_init();
extern void __mts_autorelease_shutdown();
extern void __mts_autorelease_begin();
extern void __mts_autorelease_end();
extern std::string __mts_bundlepath();
extern void __mts_chdir_to_bundlepath();
extern void __mts_init_cocoa();
#define MTS_AUTORELEASE_BEGIN() __mts_autorelease_begin();
#define MTS_AUTORELEASE_END() __mts_autorelease_end();
#define MTS_AMBIGUOUS_SIZE_T 1
#else
#define MTS_AUTORELEASE_BEGIN()

View File

@ -30,8 +30,8 @@ MTS_NAMESPACE_BEGIN
* \brief Abstract plugin class -- represents loadable configurable objects
* and utilities.
*
* Please see the <tt>\ref ConfigurableObject</tt> and
* <tt>\ref Utility</tt> classes for details
* Please see the \ref ConfigurableObject and \ref Utility classes for
* details.
*
* \ingroup libcore
*/
@ -82,12 +82,50 @@ private:
CreateUtilityFunc m_createUtility;
};
/**
* \brief The plugin manager is responsible for resolving and
* loading external plugins.
*
* Ordinarily, this class will be used by making repeated calls to
* the \ref createObject() methods. The generated instances are then
* assembled into a final object graph, such as a scene. One such
* examples is the \ref SceneHandler class, which parses an XML
* scene file by esentially translating the XML elements into calls
* to \ref createObject().
*
* Since this kind of construction method can be tiresome when
* dynamically building scenes from Python, this class has an
* additional Python-only method \c create(), which works as follows:
*
* \code
* from mitsuba.core import *
*
* pmgr = PluginManager.getInstance()
* camera = pmgr.create({
* "type" : "perspective",
* "toWorld" : Transform.lookAt(
* Point(0, 0, -10),
* Point(0, 0, 0),
* Vector(0, 1, 0)
* ),
* "film" : {
* "type" : "pngfilm",
* "width" : 1920,
* "height" : 1080
* }
* })
* \endcode
*
* The above snippet constructs a \ref Camera instance from a
* plugin named \c perspective.so/dll/dylib and adds a child object
* named \c film, which is a \ref Film instance loaded from the
* plugin \c pngfilm.so/dll/dylib. By the time the function
* returns, the object hierarchy has already been assembled, and the
* \ref ConfigurableObject::configure() methods of every object
* has been called.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE PluginManager : public Object {
public:
@ -103,7 +141,9 @@ public:
std::vector<std::string> getLoadedPlugins() const;
/**
* \brief Instantiate an object using a plugin
* \brief Instantiate a plugin, verify its type,
* and return the newly created instance.
*
* \param classType Expected type of the plugin. An
* exception will be thrown if it turns out not
* to derive from this class.
@ -116,6 +156,18 @@ public:
const Properties &props
);
/**
* \brief Instantiate a plugin and return the new
* instance (without verifying its type).
*
* \param props A \ref Properties instance containing
* all information required to find and construct
* the plugin.
*/
ConfigurableObject *createObject(
const Properties &props
);
/// Initializes the global plugin manager instance
static void staticInitialization();

View File

@ -21,12 +21,25 @@
#include <mitsuba/mitsuba.h>
#include <mitsuba/core/transform.h>
#include <boost/variant.hpp>
MTS_NAMESPACE_BEGIN
/** \brief Associative map for values of various types. Used to
* construct subclasses of <tt>ConfigurableObject</tt>.
/** \brief Associative parameter map for constructing
* subclasses of \ref ConfigurableObject.
*
* Note that the Python bindings for this class do not implement
* the various type-dependent getters and setters. Instead, they
* are accessed just like a normal Python map, e.g:
*
* \code
* myProps = mitsuba.core.Properties("pluginName")
* myProps["stringProperty"] = "hello"
* myProps["spectrumProperty"] = mitsuba.core.Spectrum(1.0)
* \endcode
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Properties {
public:
@ -40,6 +53,8 @@ public:
EFloat,
/// 3D point
EPoint,
/// 3D vector
EVector,
/// 4x4 transform for homogeneous coordinates
ETransform,
/// Discretized color spectrum
@ -73,43 +88,46 @@ public:
inline void setID(const std::string &id) { m_id = id; }
/// Set a boolean value
void setBoolean(const std::string &name, bool value, bool warnDuplicates = true);
void setBoolean(const std::string &name, const bool &value, bool warnDuplicates = true);
/// Get an boolean value
bool getBoolean(const std::string &name) const;
/// Get an boolean value (with default);
bool getBoolean(const std::string &name, bool defVal) const;
bool getBoolean(const std::string &name, const bool &defVal) const;
/// Set an integer value
void setInteger(const std::string &name, int value, bool warnDuplicates = true);
void setInteger(const std::string &name, const int &value, bool warnDuplicates = true);
/// Get an integer value
int getInteger(const std::string &name) const;
/// Get an integer value (with default);
int getInteger(const std::string &name, int defVal) const;
int getInteger(const std::string &name, const int &defVal) const;
/// Set an integer value
void setLong(const std::string &name, int64_t value, bool warnDuplicates = true);
void setLong(const std::string &name, const int64_t &value, bool warnDuplicates = true);
/// Get an integer value
int64_t getLong(const std::string &name) const;
/// Get an integer value (with default);
int64_t getLong(const std::string &name, int64_t defVal) const;
int64_t getLong(const std::string &name, const int64_t &defVal) const;
/// Set a size value
void setSize(const std::string &name, const size_t &value, bool warnDuplicates = true);
/// Get a size value
size_t getSize(const std::string &name) const;
/// Get an size value (with default);
size_t getSize(const std::string &name, size_t defVal) const;
size_t getSize(const std::string &name, const size_t &defVal) const;
/// Set a single precision floating point value
void setFloat(const std::string &name, Float value, bool warnDuplicates = true);
void setFloat(const std::string &name, const Float &value, bool warnDuplicates = true);
/// Get a single precision floating point value
Float getFloat(const std::string &name) const;
/// Get a single precision floating point value (with default)
Float getFloat(const std::string &name, Float defVal) const;
Float getFloat(const std::string &name, const Float &defVal) const;
/// Set an arbitrary data value
void setData(const std::string &name, Data value, bool warnDuplicates = true);
void setData(const std::string &name, const Data &value, bool warnDuplicates = true);
/// Get an arbitrary data value
Data getData(const std::string &name) const;
/// Get an arbitrary data value (with default)
Data getData(const std::string &name, Data defVal) const;
Data getData(const std::string &name, const Data &defVal) const;
/// Set a linear transformation
void setTransform(const std::string &name, const Transform &value, bool warnDuplicates = true);
@ -131,6 +149,9 @@ public:
Point getPoint(const std::string &name) const;
/// Get a 3d point (with default)
Point getPoint(const std::string &name, const Point &defVal) const;
/// Set a 3d vector
void setVector(const std::string &name, const Vector &value, bool warnDuplicates = true);
/// Get a 3d vector
Vector getVector(const std::string &name) const;
/// Get a 3d vector (with default)
@ -144,11 +165,18 @@ public:
std::string getString(const std::string &name, const std::string &defVal) const;
/// Store an array containing the names of all stored properties
inline void putPropertyNames(std::vector<std::string> &results) const {
inline void putNames(std::vector<std::string> &results) const {
for (std::map<std::string, Element>::const_iterator it = m_elements.begin();
it != m_elements.end(); ++it)
results.push_back((*it).first);
}
/// Return an array containing the names of all stored properties
inline std::vector<std::string> getNames() const {
std::vector<std::string> results;
putNames(results);
return results;
}
/// Manually mark a certain property as queried
void markQueried(const std::string &name) const;
@ -169,20 +197,12 @@ public:
std::string toString() const;
private:
/// \cond
typedef boost::variant<
bool, int64_t, Float, Point, Vector, Transform,
Spectrum, std::string, Data> ElementData;
struct Element {
EPropertyType type;
union {
bool v_boolean;
int64_t v_long;
Float v_float;
Data v_data;
};
// not allowed in union (constructor)
Point v_point;
Vector v_vector;
Transform v_transform;
Spectrum v_spectrum;
std::string v_string;
ElementData data;
mutable bool queried;
};
/// \endcond

View File

@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__QUADRATURE_H)
#define __QUADRATURE_H

View File

@ -90,6 +90,7 @@ MTS_NAMESPACE_BEGIN
/**
* \brief %Random number generator based on Mersenne Twister
* by Takuji Nishimura and Makoto Matsumoto.
* \ingroup libpython
*/
class MTS_EXPORT_CORE Random : public SerializableObject {
public:
@ -117,11 +118,15 @@ public:
/// Seed the random generator with a single 64bit value
void seed(uint64_t value = 5489ULL);
/// Seed the random generator from another random generator
void seed(Random *random);
/// Seed the random generator from an array
/**
* \brief Seed the random generator from an array
* \remark This function is currently not exposed
* by the Python bindings
*/
void seed(uint64_t *values, uint64_t length);
/// Return an integer on the [0, 2^63-1]-interval
@ -141,6 +146,9 @@ public:
* given STL container.
*
* See Knuth, TAoCP Vol. 2 (3rd 3d), Section 3.4.2.
*
* \remark This function is currently not exposed
* by the Python bindings
*/
template <typename Iterator> void shuffle(Iterator it1, Iterator it2) {
for (Iterator it = it2 - 1; it > it1; --it)

View File

@ -30,6 +30,7 @@ MTS_NAMESPACE_BEGIN
* to alignment purposes and should not be changed.
*
* \ingroup libcore
* \ingroup libpython
*/
struct Ray {
Point o; ///< Ray origin
@ -107,7 +108,13 @@ struct Ray {
#endif
}
/// Return 3d coordinates of a point on the ray
/**
* \brief Return 3D coordinates of a point along the ray
*
* \remark In the Python bindings, this operator is
* exposed as a function named \c eval -- i.e.
* position lookups should be written as \c ray.eval(t)
*/
inline Point operator() (Float t) const { return o + t * d; }
/// Return a string representation of this ray

View File

@ -33,8 +33,16 @@ MTS_NAMESPACE_BEGIN
/**
* \brief Abstract work unit -- represents a small amount of information
* that encodes part of a larger processing task.
* that encodes part of a larger processing task.
*
* Instead of the usual serialization function and unserialization
* constructor, implementations of this class supply \ref load()
* and \ref save() methods that can be used for essentially the
* same purpose, but without requiring any memory allocations.
*
* \sa WorkProcessor
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE WorkUnit : public Object {
public:
@ -58,8 +66,16 @@ protected:
/**
* \brief Abstract work result -- represents the result of a
* processed <tt>\ref WorkUnit</tt> instance.
* processed \ref WorkUnit instance.
*
* Instead of the usual serialization function and unserialization
* constructor, implementations of this class supply \ref load()
* and \ref save() methods that can be used for essentially the
* same purpose, but without requiring any memory allocations.
*
* \sa WorkProcessor
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE WorkResult : public Object {
public:
@ -80,16 +96,24 @@ protected:
/**
* \brief Abstract work processor -- takes work units and turns them into
* <tt>WorkResult</tt> instances.
*\ref WorkResult instances.
*
* When executing a parallel task using Mitsuba's scheduling system, the
* actual work is done in an implementation of this interface.
*
* The class is serializable so that it can be sent over the network if
* required. It is possible to keep local state in <tt>WorkProcessor</tt>
* required. It is possible to keep local state in \ref WorkProcessor
* instances (e.g. scratch space for computations), though anything not
* returned in the form of <tt>WorkResult</tt>s will eventually be lost.
* Each worker (both locally and remotely) has its own <tt>WorkProcessor</tt>,
* returned in the form of a \ref WorkResult will eventually be lost.
* Each \ref Worker (both locally and remotely) has its own \ref WorkProcessor,
* and therefore no form of locking is required within instances of this class.
*
* \sa WorkUnit
* \sa WorkResult
* \sa ParallelProcess
* \sa Scheduler
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE WorkProcessor : public SerializableObject {
friend class Scheduler;
@ -102,10 +126,11 @@ public:
/**
* \brief Create a copy of this work processor instance.
*
* Note: Before the cloned work processor is used, its
* prepare() method will be called - therefore, state
* that is initialized there does not have to be copied.
*
* \remark In practice, before the cloned work processor
* is actually used, its \ref prepare() method will be called.
* Therefore, any state that is initialized in \ref prepeare()
* does not have to be copied.
*/
virtual ref<WorkProcessor> clone() const = 0;
@ -154,18 +179,20 @@ protected:
/**
* \brief Abstract parallelizable task.
*
* Models a larger piece of work that can be split into independent
* `units' and subsequently farmed out over a cluster or processed locally.
* After the work units have been completed, the results are pieced back
* together to a solution of the original large-scale problem. This class
* implements the core logic running on the central scheduling server,
* i.e. the part that is responsible for generating work units and
* Instances of this class model a larger piece of work that can be split
* into independent `units' and subsequently farmed out over a cluster or
* processed locally. After the work units have been completed, the results
* are pieced back together to a solution of the original large-scale problem.
*
* This class implements the core logic running on the central scheduling
* server, i.e. the part that is responsible for generating work units and
* accepting their results. The module that performs the actual computation
* is an instance of <tt>WorkProcessor</tt>, which is also specified here.
* is an instance of \ref WorkProcessor, which is also specified here.
* Finally, the this class references `resources', which denote
* chunks of globally shared read-only data required during execution.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE ParallelProcess : public Object {
friend class Scheduler;
@ -184,18 +211,18 @@ public:
/**
* \brief Generate a piece of work.
*
* Takes a pre-allocated <tt>\ref WorkUnit</tt> instance of
* Takes a pre-allocated \ref WorkUnit instance of
* the appropriate sub-type and size (as specified by
* <tt>\ref ParallelProcess::getWorkUnitName()</tt>) and
* \ref ParallelProcess::getWorkUnitName()) and
* fills it with the appropriate content. Returns ESuccess
* on success and EFailure or EPause when no more work is
* left -- in that case, the work unit will be ignored and
* the process completed (\ref EFailure) or temporarily
* paused (\ref EPause). When \ref EPause was used,
* resubmission via <tt>\ref Scheduler::schedule()</tt> will
* resubmission via \ref Scheduler::schedule() will
* be required once more work is available. In some cases, it
* is useful to distribute 'nearby' pieces of work to the same
* processor -- the <tt>worker</tt> parameter can be used to
* processor -- the \c worker parameter can be used to
* implement this.
* This function should run as quickly as possible, since it
* will be executed while the scheduler mutex is held. A
@ -216,7 +243,7 @@ public:
* in \ref generateWork().
*
* When a work unit is only partially completed due to
* a call to <tt>Scheduler::cancel</tt>, the second
* a call to \ref Scheduler::cancel(), the second
* parameter is set to true.
* A thrown exception will lead to the termination of
* the parallel process.
@ -239,7 +266,7 @@ public:
* \brief Query the return status of a process after its
* execution has finished.
*
* Returns one of <tt>\ref Success, \ref Failure or \ref Unknown</tt>
* Returns one of \ref Success, \ref Failure or \ref Unknown.
* (\ref EUnknown means that the process is either still running
* or has never been scheduled).
*/
@ -314,11 +341,12 @@ class Worker;
*
* Accepts parallelizable jobs and distributes their computational load
* both locally and remotely. This is done by associating different types
* of <tt>\ref Worker</tt>s with the scheduler. These try to acquire work
* of \ref Worker instances with the scheduler. These try to acquire work
* units from the scheduler, which are then executed on the current machine
* or sent to remote nodes over a network connection.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Scheduler : public Object {
friend class Worker;
@ -338,7 +366,7 @@ public:
* or canceled prematurely.
*
* Returns false if the process does not exist or has already
* finished by the time <tt>\ref wait()</tt> is invoked.
* finished by the time \ref wait() is invoked.
*/
bool wait(const ParallelProcess *process);
@ -369,8 +397,8 @@ public:
* \a Manifold means that in comparison to the previous method, a separate
* instance is provided for every core. An example where this is useful
* is to distribute random generator state when performing parallel
* Monte Carlo simulations. <tt>resources</tt> must be a vector whose
* length is equal to <tt>\ref getCoreCount()</tt>.
* Monte Carlo simulations. \c resources must be a vector whose
* length is equal to \ref getCoreCount().
*/
int registerManifoldResource(std::vector<SerializableObject *> &resources);
@ -422,7 +450,7 @@ public:
* running workers.
*
* Any currently scheduled work units are still completed.
* Processing can be resumed via <tt>\ref start()</tt>.
* Processing can be resumed via \ref start().
*/
void pause();
@ -464,7 +492,7 @@ public:
int inflight;
/* Is the parallel process still generating work */
bool morework;
/* Was the process cancelled using <tt>cancel()</tt>?*/
/* Was the process cancelled using \c cancel()?*/
bool cancelled;
/* Is the process currently in the queue? */
bool active;
@ -642,6 +670,7 @@ private:
/**
* \brief Base class of all worker implementations
* \ingroup libpython
*/
class MTS_EXPORT_CORE Worker : public Thread {
friend class Scheduler;
@ -727,6 +756,7 @@ protected:
* it locally.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE LocalWorker : public Worker {
public:

View File

@ -43,6 +43,7 @@ class StreamBackend;
* it to a processing node reachable through a \ref Stream.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE RemoteWorker : public Worker {
friend class RemoteWorkerReader;

View File

@ -29,6 +29,7 @@ MTS_NAMESPACE_BEGIN
* RTTI macros \ref MTS_IMPLEMENT_CLASS_S or \ref MTS_IMPLEMENT_CLASS_IS.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE SerializableObject : public Object {
public:
@ -58,6 +59,7 @@ protected:
* object graph has the same structure.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE InstanceManager : public Object {
friend class SerializableObject;

View File

@ -33,7 +33,9 @@ namespace ublas = boost::numeric::ublas;
struct SHVector;
/**
* \brief Stores the diagonal blocks of a spherical harmonic rotation matrix
* \brief Stores the diagonal blocks of a spherical harmonic
* rotation matrix
*
* \ingroup libcore
*/
struct MTS_EXPORT_CORE SHRotation {
@ -65,14 +67,14 @@ struct MTS_EXPORT_CORE SHRotation {
*
* The Mathematica equivalent of the basis functions implemented here is:
*
* <pre>
* \code
* SphericalHarmonicQ[l_, m_, \[Theta]_, \[Phi]_] :=
* Piecewise[{
* {SphericalHarmonicY[l, m, \[Theta], \[Phi]], m == 0},
* {Sqrt[2]*Re[SphericalHarmonicY[l, m, \[Theta], \[Phi]]], m > 0},
* {Sqrt[2]*Im[SphericalHarmonicY[l, -m, \[Theta], \[Phi]]], m < 0}
* }]
* </pre>
* \endcode
*
* \ingroup libcore
*/
@ -338,10 +340,10 @@ public:
*/
static void rotation(const Transform &t, SHRotation &rot);
/** \brief Precomputes normalization coefficients for the first few bands */
/// Precomputes normalization coefficients for the first few bands
static void staticInitialization();
/// Free the memory taken by staticInitialization()
/// Free the memory taken up by staticInitialization()
static void staticShutdown();
protected:
/// Helper function for rotation() -- computes a diagonal block based on the previous level

View File

@ -1,229 +0,0 @@
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2011 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__SHEXP4D_H)
#define __SHEXP4D_H
#include <mitsuba/core/shvector.h>
MTS_NAMESPACE_BEGIN
/**
* \brief Stores a 4D function f(wi, wo) (such as a BRDF or phase function)
* using a 2D table of spherical harmonics expansions.
*
* Discretization occurs in the 'wi' space. Lookups interpolate amongst
* the 4 adjacent samples.
*
* \ingroup libcore
*/
struct SHVector4D {
public:
/// Construct an invalid expandion
inline SHVector4D() : m_resTheta(0), m_resPhi(0), m_bands(0) {
}
/// Allocate memory for the specified resolution and number of bands
inline SHVector4D(int resTheta, int resPhi, int bands)
: m_resTheta(resTheta), m_resPhi(resPhi), m_bands(bands), m_data((resTheta+1)*resPhi) {
for (size_t i=0; i<m_data.size(); ++i)
m_data[i] = SHVector(bands);
}
/// Unserialize from a stream
inline SHVector4D(Stream *stream) {
m_resTheta = stream->readInt();
m_resPhi = stream->readInt();
m_bands = stream->readInt();
m_data.resize((m_resTheta+1)*m_resPhi);
for (size_t i=0; i<m_data.size(); ++i)
m_data[i] = SHVector(stream);
SLog(EInfo, "Unserialized a %ix%i discretization (%i SH bands)",
m_resTheta, m_resPhi, m_bands);
}
/// Project the given function f(wi, wo)
template<typename Functor> void project(const Functor &f, int res = 32) {
SAssert(res % 2 == 0);
/* Nested composite Simpson's rule */
Float hExt = M_PI / res,
hInt = (2*M_PI)/(res*2);
Vector *wi = new Vector[(m_resTheta+1) * m_resPhi];
Float *values = new Float[(m_resTheta+1) * m_resPhi];
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
wi[o*m_resPhi+p] = sphericalDirection(o * M_PI / (Float) m_resTheta,
p * 2 * M_PI / (Float) m_resPhi);
Float *sinPhi = (Float *) alloca(sizeof(Float)*m_bands),
*cosPhi = (Float *) alloca(sizeof(Float)*m_bands);
for (int i=0; i<=res; ++i) {
Float theta = hExt*i, cosTheta = std::cos(theta);
Float weightExt = (i & 1) ? (Float) 4 : (Float) 2;
if (i == 0 || i == res)
weightExt = 1;
SLog(EInfo, "4D projection: %i%% done", (int) (100*i/(Float) res));
for (int j=0; j<=res*2; ++j) {
Float phi = hInt*j;
Float weightInt = (j & 1) ? (Float) 4 : (Float) 2;
if (j == 0 || j == 2*res)
weightInt = 1;
for (int m=0; m<m_bands; ++m) {
sinPhi[m] = std::sin((m+1)*phi);
cosPhi[m] = std::cos((m+1)*phi);
}
Float weight = std::sin(theta)*weightInt*weightExt;
Vector wo = sphericalDirection(theta, phi);
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
values[o*m_resPhi+p] = f(wi[o*m_resPhi+p], wo) * weight;
for (int l=0; l<m_bands; ++l) {
for (int m=1; m<=l; ++m) {
Float L = SHVector::legendre(l, m, cosTheta) * SHVector::normalization(l, m);
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
m_data[o*m_resPhi+p](l, -m) += values[o*m_resPhi+p] * SQRT_TWO * sinPhi[m-1] * L;
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
m_data[o*m_resPhi+p](l, m) += values[o*m_resPhi+p] * SQRT_TWO * cosPhi[m-1] * L;
}
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
m_data[o*m_resPhi+p](l, 0) += values[o*m_resPhi+p]
* SHVector::legendre(l, 0, cosTheta) * SHVector::normalization(l, 0);
}
}
}
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
for (int l=0; l<m_bands; ++l)
for (int m=-l; m<=l; ++m)
m_data[o*m_resPhi+p](l,m) *= hExt*hInt/9;
delete[] wi;
delete[] values;
}
/// Offset all stored projections to mask negative areas
inline void offsetNegativeRegions(int res) {
for (int o=0; o<=m_resTheta; ++o) {
for (int p=0; p<m_resPhi; ++p) {
SHVector &vec = m_data[o*m_resPhi+p];
Float minimum = vec.findMinimum(res);
vec.offset(std::max((Float) 0, -minimum));
cout << "Minimum now: " << minimum << endl;
minimum = vec.findMinimum(res);
cout << "Minimum was: " << minimum << endl;
}
}
}
/// Normalize all stored projections to ensure they are proper distributions
inline void normalize() {
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
m_data[o*m_resPhi+p].normalize();
}
/// Offset all stored projections by a constant value
inline void offset(Float value) {
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
m_data[o*m_resPhi+p].offset(value);
}
/// Perform an interpolated lookup and save to 'vec' (any content will be overwritten)
inline void lookup(const Vector &wi, SHVector &vec) const {
SAssert(vec.getBands() == m_bands);
Point2 sph = toSphericalCoordinates(wi);
if (sph.y<0)
sph.y += 2*M_PI;
Float theta = sph.x * m_resTheta/M_PI;
Float phi = sph.y * m_resPhi/(2*M_PI);
int i0 = (int) std::floor(theta), i1 = (int) std::ceil(theta);
int j0 = (int) std::floor(phi), j1 = (int) std::ceil(phi);
Float alpha = theta - (Float) i0;
Float beta = phi - (Float) j0;
i0 = std::min(std::max(i0, 0), m_resTheta);
i1 = std::min(std::max(i1, 0), m_resTheta);
j0 = std::min(std::max(j0, 0), m_resPhi);
j1 = std::min(std::max(j1, 0), m_resPhi);
if (j0 == m_resPhi) j0 = 0;
if (j1 == m_resPhi) j1 = 0;
vec.clear();
vec.madd((1-alpha)*(1-beta), m_data[i0*m_resPhi+j0]);
vec.madd(alpha*(1-beta), m_data[i1*m_resPhi+j0]);
vec.madd((1-alpha)*beta, m_data[i0*m_resPhi+j1]);
vec.madd(alpha*beta, m_data[i1*m_resPhi+j1]);
}
/// Serialize to a binary data stream
inline void serialize(Stream *stream) const {
stream->writeInt(m_resTheta);
stream->writeInt(m_resPhi);
stream->writeInt(m_bands);
for (size_t i=0; i<m_data.size(); ++i)
m_data[i].serialize(stream);
}
/// Return the number of SH coefficient bands
inline int getBands() const {
return m_bands;
}
/// Get the energy per band
inline Float energy(int band) const {
Float result = 0;
for (int o=0; o<=m_resTheta; ++o)
for (int p=0; p<m_resPhi; ++p)
result += m_data[o*m_resPhi+p].energy(band);
return result;
}
inline std::string toString() const {
std::ostringstream oss;
oss << "SHVector4D[resTheta=" << m_resTheta
<< ", resPhi=" << m_resPhi
<< ", bands=" << m_bands
<< ", size=" << m_bands*m_bands*m_data.size()*sizeof(Float) / 1024
<< " KiB]";
return oss.str();
}
private:
int m_resTheta, m_resPhi, m_bands;
std::vector<SHVector> m_data;
};
MTS_NAMESPACE_END
#endif /* __SHEXP4D_H */

View File

@ -45,6 +45,7 @@ MTS_NAMESPACE_BEGIN
* that it is a function over the reals (as opposed to the discrete
* spectrum, which only stores samples for a discrete set of wavelengths).
*
* \ingroup libpython
* \ingroup libcore
*/
class MTS_EXPORT_CORE ContinuousSpectrum {
@ -74,6 +75,9 @@ public:
* implementation will return zero.
*/
virtual Float average(Float lambdaMin, Float lambdaMax) const;
/// \brief Return a string representation
virtual std::string toString() const = 0;
/// Virtual destructor
virtual ~ContinuousSpectrum() { }
@ -106,6 +110,9 @@ public:
* per unit wavelength (nm^-1) per steradian (sr^-1)
*/
virtual Float eval(Float lambda) const;
/// Return a string representation
std::string toString() const;
private:
Float m_temperature;
};
@ -147,6 +154,9 @@ public:
* The returned value is in units of 1/meter.
*/
virtual Float eval(Float lambda) const;
/// Return a string representation
std::string toString() const;
private:
Float m_precomp;
};
@ -171,6 +181,9 @@ public:
/// Virtual destructor
virtual ~ProductSpectrum() { }
/// Return a string representation
std::string toString() const;
private:
const ContinuousSpectrum &m_spec1;
const ContinuousSpectrum &m_spec2;
@ -187,6 +200,7 @@ private:
* spectrum.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE InterpolatedSpectrum : public ContinuousSpectrum {
public:
@ -194,10 +208,7 @@ public:
* \brief Create a new interpolated spectrum with space
* for the specified number of samples
*/
inline InterpolatedSpectrum(size_t size = 0) {
m_wavelengths.reserve(size);
m_values.reserve(size);
}
InterpolatedSpectrum(size_t size = 0);
/**
* \brief Create a interpolated spectrum instance from
@ -269,7 +280,7 @@ public:
/// Virtual destructor
virtual ~InterpolatedSpectrum() { }
private:
protected:
std::vector<Float> m_wavelengths, m_values;
};
@ -290,6 +301,7 @@ private:
* The implementation of this class is based on PBRT.
*
* \ingroup libcore
* \ingroup libpython
*/
struct MTS_EXPORT_CORE Spectrum {
public:
@ -398,7 +410,7 @@ public:
s[i] *= spd.s[i];
return *this;
}
/// Perform a component-wise division by another spectrum
inline Spectrum& operator/=(const Spectrum &spd) {
for (int i=0; i<SPECTRUM_SAMPLES; i++)

View File

@ -25,6 +25,8 @@ MTS_NAMESPACE_BEGIN
/**
* \brief Simple natural cubic spline interpolation
*
* \ingroup libcore
*/
class MTS_EXPORT_CORE CubicSpline : public SerializableObject {
public:

View File

@ -39,6 +39,9 @@ MTS_NAMESPACE_BEGIN
* pageant.exe is required to load and authenticate the key.
*
* Note: SSH streams are set to use network byte order by default.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE SSHStream : public Stream {
public:
@ -47,10 +50,11 @@ public:
// =============================================================
/**
* Create a new SSH stream. The timeout parameter specifies specifies
* the maximum amount of time that can be spent before failing to
* create the initial connection. This feature is unsupported
* (and ignored) on Windows.
* \brief Create a new SSH stream.
*
* The timeout parameter specifies specifies the maximum amount of
* time that can be spent before failing to create the initial
* connection. This feature is unsupported (and ignored) on Windows.
*
* \param userName Username to use for the authentication
* \param hostName Destination host name

View File

@ -36,6 +36,7 @@ MTS_NAMESPACE_BEGIN
* order (= big endian).
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE SocketStream : public Stream {
public:
@ -43,7 +44,10 @@ public:
//! @{ \name Constructors
// =============================================================
/// Create a stream from an existing socket
/**
* \brief Create a stream from an existing socket
* \remark This function is not exposed in the Python bindings
*/
#if defined(WIN32)
SocketStream(SOCKET socket);
#else

View File

@ -257,7 +257,11 @@ private:
/** \brief Collects various rendering statistics and presents them
* in a human-readable form.
*
* \remark Only the \ref getInstance(), \ref getStats(), and
* \ref printStats() functions are implemented in the Python bindings.
*
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Statistics : public Object {
public:

View File

@ -27,9 +27,9 @@ using __gnu_cxx::compose1;
#else
#include <functional>
/// \cond
// (Don't include in the documentation)
namespace std {
/// \cond
// (Don't include in the documentation)
template <class _Pair> struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
const typename _Pair::first_type& operator()(const _Pair& __x) const {
return __x.first;
@ -59,7 +59,6 @@ namespace std {
template <class _Operation1, class _Operation2> inline unary_compose<_Operation1,_Operation2> compose1(const _Operation1& __fn1, const _Operation2& __fn2) {
return unary_compose<_Operation1,_Operation2>(__fn1, __fn2);
}
/// @endcond
#if defined(_MSC_VER)
#include <float.h>
@ -122,5 +121,6 @@ inline bool mts_isnan(double f) {
return std::fpclassify(f) == FP_NAN;
}
#endif
/// @endcond
#endif

View File

@ -50,6 +50,7 @@ private:
* \sa FileStream, MemoryStream, SocketStream,
* ConsoleStream, SSHStream, ZStream
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Stream : public Object {
public:

View File

@ -27,6 +27,7 @@ MTS_NAMESPACE_BEGIN
* \headerfile mitsuba/core/thread.h mitsuba/mitsuba.h
* \brief Cross-platform thread implementation
* \ingroup libcore
* \ingroup libpython
*/
class MTS_EXPORT_CORE Thread : public Object {
public:
@ -47,6 +48,8 @@ public:
* (will be shown in debug messages)
* \param stackSize Initial stack size of the thread
* (0 = default)
* \remark Note that it is currently not possible to
* construct Thread instances from Python
*/
Thread(const std::string &name,
unsigned int stackSize = 0);
@ -61,6 +64,9 @@ public:
*/
bool setPriority(EThreadPriority priority);
/// Return the thread priority
inline EThreadPriority getPriority() const { return m_priority; }
/**
* \brief Specify whether or not this thread is critical
*
@ -73,19 +79,16 @@ public:
/// Return the value of the critical flag
inline bool getCritical() const { return m_critical; }
/// Return the thread priority
inline EThreadPriority getPriority() const { return m_priority; }
/// Return the thread's stack size
inline int getStackSize() const { return m_stackSize; }
/// Return the thread ID
#if defined(__OSX__)
inline static int getID() { return getThread()->m_id; }
#elif defined(WIN32)
#if defined(WIN32)
inline static int getID() { return (int) GetCurrentThreadId(); }
#else
#elif MTS_USE_ELF_TLS == 1
inline static int getID() { return m_id; }
#else
inline static int getID() { return getThread()->m_id; }
#endif
/// Return the name of this thread
@ -184,11 +187,12 @@ private:
#if defined(__LINUX__) || defined(__OSX__)
static int m_idCounter;
static ref<Mutex> m_idMutex;
#endif
#if defined(__OSX__)
#if MTS_USE_ELF_TLS == 1
static __thread int m_id
__attribute__((tls_model("global-dynamic")));
#else
int m_id;
#elif defined(__LINUX__)
static int __thread m_id;
#endif
#endif
};

View File

@ -27,6 +27,7 @@ MTS_NAMESPACE_BEGIN
/**
* \brief Encapsulates a 4x4 linear transformation and its inverse
* \ingroup libcore
* \ingroup libpython
*/
struct MTS_EXPORT_CORE Transform {
public:
@ -98,7 +99,12 @@ public:
return true;
}
/// Matrix-vector multiplication for points in 3d space
/**
* \brief Matrix-vector multiplication for points in 3d space
*
* \remark In the Python bindings, this is function implemented as
* the multiplication operator (\c __mul__).
*/
inline Point operator()(const Point &p) const {
Float x = m_transform.m[0][0] * p.x + m_transform.m[0][1] * p.y
+ m_transform.m[0][2] * p.z + m_transform.m[0][3];
@ -129,7 +135,10 @@ public:
return Point(x,y,z);
}
/// Matrix-vector multiplication for points in 3d space (no temporaries)
/**
* \brief Matrix-vector multiplication for points in 3d space (no temporaries)
* \remark This function is not available in the Python bindings
*/
inline void operator()(const Point &p, Point &dest) const {
dest.x = m_transform.m[0][0] * p.x + m_transform.m[0][1] * p.y
+ m_transform.m[0][2] * p.z + m_transform.m[0][3];
@ -148,7 +157,11 @@ public:
dest /= w;
}
/// Matrix-vector multiplication for vectors in 3d space
/**
* \brief Matrix-vector multiplication for vectors in 3d space
* \remark In the Python bindings, this is function implemented as
* the multiplication operator (\c __mul__).
*/
inline Vector operator()(const Vector &v) const {
Float x = m_transform.m[0][0] * v.x + m_transform.m[0][1] * v.y
+ m_transform.m[0][2] * v.z;
@ -159,7 +172,10 @@ public:
return Vector(x, y, z);
}
/// Matrix-vector multiplication for vectors in 3d space (no temporaries)
/**
* \brief Matrix-vector multiplication for vectors in 3d space (no temporaries)
* \remark This function is not available in the Python bindings
*/
inline void operator()(const Vector &v, Vector &dest) const {
dest.x = m_transform.m[0][0] * v.x + m_transform.m[0][1] * v.y
+ m_transform.m[0][2] * v.z;
@ -169,7 +185,11 @@ public:
+ m_transform.m[2][2] * v.z;
}
/// Matrix-normal multiplication
/**
* \brief Matrix-normal multiplication
* \remark In the Python bindings, this is function implemented as
* the multiplication operator (\c __mul__).
*/
inline Normal operator()(const Normal &v) const {
Float x = m_invTransform.m[0][0] * v.x + m_invTransform.m[1][0] * v.y
+ m_invTransform.m[2][0] * v.z;
@ -180,7 +200,10 @@ public:
return Normal(x, y, z);
}
/// Matrix-normal multiplication (no temporaries)
/**
* \brief Matrix-normal multiplication (no temporaries)
* \remark This function is not available in the Python bindings
*/
inline void operator()(const Normal &v, Normal &dest) const {
dest.x = m_invTransform.m[0][0] * v.x + m_invTransform.m[1][0] * v.y
+ m_invTransform.m[2][0] * v.z;
@ -190,7 +213,11 @@ public:
+ m_invTransform.m[2][2] * v.z;
}
/// 4D matrix-vector multiplication
/**
* \brief 4D matrix-vector multiplication
* \remark In the Python bindings, this is function implemented as
* the multiplication operator (\c __mul__).
*/
inline Vector4 operator()(const Vector4 &v) const {
Float x = m_transform.m[0][0] * v.x + m_transform.m[0][1] * v.y
+ m_transform.m[0][2] * v.z + m_transform.m[0][3] * v.w;
@ -203,7 +230,10 @@ public:
return Vector4(x,y,z,w);
}
/// 4D matrix-vector multiplication
/**
* \brief 4D matrix-vector multiplication (no temporaries)
* \remark This function is not available in the Python bindings
*/
inline void operator()(const Vector4 &v, Vector4 &dest) const {
dest.x = m_transform.m[0][0] * v.x + m_transform.m[0][1] * v.y
+ m_transform.m[0][2] * v.z + m_transform.m[0][3] * v.w;
@ -215,7 +245,21 @@ public:
+ m_transform.m[3][2] * v.z + m_transform.m[3][3] * v.w;
}
/// Transform a ray. Assumes that there is no scaling
/**
* \brief Transform a ray. Assumes that there is no scaling
* \remark In the Python bindings, this is function implemented as
* the multiplication operator (\c __mul__).
*/
inline Ray operator()(const Ray &a) const {
Ray result;
operator()(a, result);
return result;
}
/**
* \brief Transform a ray. Assumes that there is no scaling (no temporaries)
* \remark This function is not available in the Python bindings
*/
inline void operator()(const Ray &a, Ray &b) const {
b.mint = a.mint;
b.maxt = a.maxt;

View File

@ -49,7 +49,7 @@ extern MTS_EXPORT_CORE std::string indent(const std::string &string, int amount=
extern MTS_EXPORT_CORE std::string formatString(const char *pFmt, ...);
/**
* Convert a time difference (in ms) to a string representation
* \brief Convert a time difference (in ms) to a string representation
* \param time Time value in milliseconds
* \param precise When set to true, a higher-precision string representation
* is generated.
@ -104,9 +104,10 @@ extern MTS_EXPORT_CORE std::string getHostName();
extern MTS_EXPORT_CORE std::string getFQDN();
/**
* Enable floating point exceptions (to catch NaNs, overflows,
* arithmetic with infinity). On Intel processors, this applies
* to both x87 and SSE2 math
* \brief Enable floating point exceptions (to catch NaNs, overflows,
* arithmetic with infinity).
*
* On Intel processors, this applies to both x87 and SSE2 math
*
* \return \c true if floating point exceptions were active
* before calling the function
@ -114,7 +115,7 @@ extern MTS_EXPORT_CORE std::string getFQDN();
extern MTS_EXPORT_CORE bool enableFPExceptions();
/**
* Disable floating point exceptions
* \brief Disable floating point exceptions
*
* \return \c true if floating point exceptions were active
* before calling the function
@ -149,6 +150,8 @@ template<typename T> inline T endianness_swap(T value) {
}
/**
* \brief Apply an arbitrary permutation to an array in linear time
*
* This algorithm is based on Donald Knuth's book
* "The Art of Computer Programming, Volume 3: Sorting and Searching"
* (1st edition, section 5.2, page 595)
@ -256,6 +259,7 @@ extern MTS_EXPORT_CORE uint32_t roundToPowerOfTwo(uint32_t i);
extern MTS_EXPORT_CORE uint64_t roundToPowerOfTwo(uint64_t i);
#if defined(MTS_AMBIGUOUS_SIZE_T)
/// Round an integer to the next power of two
inline size_t roundToPowerOfTwo(size_t value) {
if (sizeof(size_t) == 8) /// will be optimized away
return (size_t) roundToPowerOfTwo((uint64_t) value);
@ -264,7 +268,7 @@ inline size_t roundToPowerOfTwo(size_t value) {
}
#endif
//// Windowed sinc filter (Lanczos envelope, tau=number of cycles)
/// Windowed sinc filter (Lanczos envelope, tau=number of cycles)
extern MTS_EXPORT_CORE Float lanczosSinc(Float t, Float tau = 2);
/**
@ -275,7 +279,8 @@ extern MTS_EXPORT_CORE bool solveQuadratic(Float a, Float b,
Float c, Float &x0, Float &x1);
/**
* Calculate the radical inverse function
* \brief Calculate the radical inverse function
*
* (Implementation based on "Instant Radiosity" by Alexander Keller
* in Computer Graphics Proceedings, Annual Conference Series,
* SIGGRAPH 97, pp. 49-56.
@ -283,7 +288,8 @@ extern MTS_EXPORT_CORE bool solveQuadratic(Float a, Float b,
extern MTS_EXPORT_CORE Float radicalInverse(int b, size_t i);
/**
* Incrementally calculate the radical inverse function
* \brief Incrementally calculate the radical inverse function
*
* (Implementation based on "Instant Radiosity" by Alexander Keller
* in Computer Graphics Proceedings, Annual Conference Series,
* SIGGRAPH 97, pp. 49-56.
@ -426,7 +432,7 @@ extern MTS_EXPORT_CORE Point2 squareToStdNormal(const Point2 &sample);
// -----------------------------------------------------------------------
/**
* Calculates the unpolarized fresnel reflection coefficient for a
* \brief Calculates the unpolarized fresnel reflection coefficient for a
* dielectric material
*
* \param cosThetaI
@ -442,7 +448,7 @@ extern MTS_EXPORT_CORE Float fresnelDielectric(Float cosThetaI,
Float cosThetaT, Float etaI, Float etaT);
/**
* Calculates the unpolarized fresnel reflection coefficient for a
* \brief Calculates the unpolarized fresnel reflection coefficient for a
* dielectric material. Handles incidence from either sides.
*
* \param cosThetaI
@ -456,7 +462,7 @@ extern MTS_EXPORT_CORE Float fresnel(Float cosThetaI, Float extIOR,
Float intIOR);
/**
* Calculates the unpolarized fresnel reflection coefficient on
* \brief Calculates the unpolarized fresnel reflection coefficient on
* an interface to a conductor.
*
* \param cosThetaI

View File

@ -21,15 +21,23 @@
MTS_NAMESPACE_BEGIN
/// Current release of Mitsuba
/**
* \brief Current release of Mitsuba
* \ingroup libcore
*/
#define MTS_VERSION "0.3.0"
// Year of this release
/**
* \brief Year of the current release
* \ingroup libcore
*/
#define MTS_YEAR "2011"
/**
* \brief A simple data structure for representing and comparing
* Mitsuba version strings
* \brief A simple data structure for representing and
* comparing Mitsuba version strings
*
* \ingroup libcore
*/
struct MTS_EXPORT_CORE Version {
public:

View File

@ -34,6 +34,7 @@ MTS_NAMESPACE_BEGIN
* \brief Constant spectrum-valued texture
*
* Includes a \ref Shader implementation for hardware rendering
* \ingroup libhw
*/
class MTS_EXPORT_HW ConstantSpectrumTexture : public Texture {
public:
@ -82,6 +83,7 @@ protected:
* \brief Constant float-valued texture
*
* Includes a \ref Shader implementation for hardware rendering
* \ingroup libhw
*/
class MTS_EXPORT_HW ConstantFloatTexture : public Texture {
public:
@ -130,6 +132,7 @@ protected:
* \brief Componentwise addition of two textures
*
* Includes a \ref Shader implementation for hardware rendering
* \ingroup libhw
*/
class MTS_EXPORT_HW SpectrumAdditionTexture : public Texture {
public:
@ -181,6 +184,7 @@ protected:
* \brief Componentwise subtraction of two textures
*
* Includes a \ref Shader implementation for hardware rendering
* \ingroup libhw
*/
class MTS_EXPORT_HW SpectrumSubtractionTexture : public Texture {
public:
@ -232,6 +236,7 @@ protected:
* \brief Componentwise product of two textures
*
* Includes a \ref Shader implementation for hardware rendering
* \ingroup libhw
*/
class MTS_EXPORT_HW SpectrumProductTexture : public Texture {
public:

View File

@ -28,6 +28,7 @@ class Renderer;
/** \brief The device event structure encapsulates event
* information such as mouse movement or key presses
* \ingroup libhw
*/
struct MTS_EXPORT_HW DeviceEvent {
public:
@ -114,6 +115,7 @@ private:
};
/** \brief Abstract device event callback
* \ingroup libhw
*/
class MTS_EXPORT_HW DeviceEventListener {
public:
@ -128,6 +130,7 @@ protected:
};
/** \brief An abstract drawing device
* \ingroup libhw
*/
class MTS_EXPORT_HW Device : public Object {
public:

View File

@ -28,6 +28,7 @@ MTS_NAMESPACE_BEGIN
*
* A FreeType2-based generation tool is located in the directory
* 'tools/linux/fontgen'. Only Latin-1 is supported at the moment.
* \ingroup libhw
*/
class MTS_EXPORT_HW Font : public Object {
public:

View File

@ -25,6 +25,7 @@
MTS_NAMESPACE_BEGIN
/** \brief OpenGL-based GPUGeometry implementation
* \ingroup libhw
*/
class MTS_EXPORT_HW GLGeometry : public GPUGeometry {
friend class GLRenderer;

View File

@ -26,6 +26,7 @@ MTS_NAMESPACE_BEGIN
/** \brief OpenGL shader class -- responsible from compiling
* and linking GLSL fragments
* \ingroup libhw
*/
class MTS_EXPORT_HW GLProgram : public GPUProgram {
public:

View File

@ -46,6 +46,7 @@ MTS_NAMESPACE_BEGIN
/**
* \brief OpenGL implementation of the \ref Renderer interface
* \ingroup libhw
*/
class MTS_EXPORT_HW GLRenderer : public Renderer {
public:

View File

@ -25,6 +25,7 @@
MTS_NAMESPACE_BEGIN
/** \brief OpenGL-based GPUSync implementation
* \ingroup libhw
*/
class MTS_EXPORT_HW GLSync : public GPUSync {
public:

View File

@ -25,6 +25,7 @@
MTS_NAMESPACE_BEGIN
/** \brief OpenGL-based GPUTexture implementation
* \ingroup libhw
*/
class MTS_EXPORT_HW GLTexture : public GPUTexture {
public:

View File

@ -24,6 +24,7 @@
MTS_NAMESPACE_BEGIN
/** \brief X Windows OpenGL-capable (GLX) device
* \ingroup libhw
*/
class MTS_EXPORT_HW GLXDevice : public X11Device {
public:

View File

@ -25,6 +25,7 @@
MTS_NAMESPACE_BEGIN
/** \brief GLX (XFree86) renderer
* \ingroup libhw
*/
class MTS_EXPORT_HW GLXRenderer : public GLRenderer {
public:

View File

@ -24,10 +24,11 @@
MTS_NAMESPACE_BEGIN
/** \brief Abstract geometry storage on a graphics card
* \ingroup libhw
*/
class MTS_EXPORT_HW GPUGeometry : public Object {
public:
/// Create an empty program
/// Create an empty geometry object
GPUGeometry(const TriMesh *mesh);
/// Return the name of this geometry object

View File

@ -24,6 +24,7 @@
MTS_NAMESPACE_BEGIN
/** \brief Abstract shader program (for fragment/vertex shading)
* \ingroup libhw
*/
class MTS_EXPORT_HW GPUProgram : public Object {
public:

View File

@ -25,6 +25,7 @@ MTS_NAMESPACE_BEGIN
/** \brief Abstract GPU synchronization object implementing
* a memory fence operation.
* \ingroup libhw
*/
class MTS_EXPORT_HW GPUSync : public Object {
public:

View File

@ -26,6 +26,7 @@ MTS_NAMESPACE_BEGIN
/** \brief A data structure for 1/2/3D and cube texture mapping. Also
* has optional render-to-texture functionality.
* \ingroup libhw
*/
class MTS_EXPORT_HW GPUTexture : public Object {
public:

View File

@ -29,6 +29,7 @@
MTS_NAMESPACE_BEGIN
/** \brief A MacOS X (NSGL) OpenGL Renderer
* \ingroup libhw
*/
class MTS_EXPORT_HW NSGLRenderer : public GLRenderer {
public:

Some files were not shown because too many files have changed in this diff Show More