Skip to content

Commit 6a6581a

Browse files
Son HuaSon Hua
Son Hua
authored and
Son Hua
committed
Initial commit
0 parents  commit 6a6581a

File tree

1,336 files changed

+406864
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,336 files changed

+406864
-0
lines changed

.agignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies
2+
build
3+
data
4+
Mitsuba.app
5+
scenes

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Documentation
2+
doc/apidocs/*
3+
doc/*.aux
4+
doc/*.log
5+
doc/*.out
6+
doc/*.toc
7+
doc/*.bbl
8+
doc/*.blg
9+
doc/main.pdf
10+
doc/plugins_generated.tex
11+
12+
# Build-related
13+
.sconf_temp
14+
build/release
15+
build/debug
16+
debian
17+
.sconsign.dblite
18+
config.py
19+
config.log
20+
*.pyc
21+
22+
# MSVC++-related
23+
build/mitsuba-msvc2010.sdf
24+
build/mitsuba-msvc2010.suo
25+
build/mitsuba-msvc2010.vcxproj.user
26+
data/windows/mitsuba_res.res
27+
dist
28+
build/mitsuba-msvc2010.v12.suo
29+
build/mitsuba-msvc2010.opensdf
30+
31+
# Debugging history files
32+
\.gdb_history
33+
34+
# Dependencies
35+
dependencies
36+
37+
# OSX binaries and byproducts
38+
Mitsuba.app
39+
.DS_Store
40+
41+
# Imported geometry and some default output types
42+
/meshes
43+
/textures
44+
mitsuba.*.log
45+
*.exr
46+
47+
# Eclipse CDT project files
48+
.externalToolBuilders
49+
.settings
50+
.cproject
51+
.project
52+
/.idea/
53+
/cmake-build-debug/
54+
/cmake-build-release/

.hgignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Documentation
2+
^doc/apidocs/.*$
3+
^doc/.*\.aux$
4+
^doc/.*\.log$
5+
^doc/.*\.out$
6+
^doc/.*\.toc$
7+
^doc/.*\.bbl$
8+
^doc/.*\.blg$
9+
^doc/main.pdf$
10+
^doc/plugins_generated.tex$
11+
12+
# Build-related
13+
^\.sconf_temp/.*$
14+
^build/release/.*$
15+
^build/debug/.*$
16+
^debian/.*$
17+
^.sconsign.dblite$
18+
^config.py$
19+
^config.log$
20+
.*\.pyc$
21+
22+
# MSVC++-related
23+
^build/mitsuba-msvc2010.sdf$
24+
^build/mitsuba-msvc2010.suo$
25+
^build/mitsuba-msvc2010.vcxproj.user$
26+
^data/windows/mitsuba_res.res$
27+
^dist/.*$
28+
29+
# Debugging history files
30+
^\.gdb_history$
31+
32+
# Dependencies
33+
^dependencies/.*$
34+
35+
# OSX binaries and byproducts
36+
^Mitsuba.app/.*$
37+
^\.DS_Store$
38+
39+
# Imported geometry and some default output types
40+
^meshes/.*$
41+
^textures/.*$
42+
^mitsuba.*.log$
43+
.*\.exr$
44+
45+
# Eclipse CDT project files
46+
^.externalToolBuilders/.*$
47+
^.settings/.*$
48+
^.cproject$
49+
^.project$

.hgtags

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
41af3c689b9d334a79f665e82f2cb095643a4654 v0.1.1
2+
9486893d5591dff34697f7757c09694843edf3fc v0.1.2
3+
79c172eb257c17855510f1fc74847a0ef0787ecf v0.1.3
4+
2c14d0f9b54f52fb0ab2abbd630398b85079897d v0.2.0
5+
e3c0182ba64b77319ce84c9e2a8581649e68273d v0.2.1
6+
cb6e89af8012fac22cc0f3c5ad247c98c701bdda v0.3.0
7+
ee26517b27207353b0c8a7d357bcb4977b5d93fb v0.4.0
8+
7db07694ea00eb1655f7a1adcc3ae880e8e116f9 v0.4.1
9+
13a39b11aceee517c19d2e2cec2e6b875546062c v0.4.2
10+
f1b73d39617071297167cc7ce96f3892f21105fc v0.4.3
11+
bd6ddacdf7955e51d9b80be639c282d4974e6f56 v0.4.4
12+
454ebc86e4bd5b3c1d5eb6585099e66ccd8522fe v0.4.5
13+
e6a8a0178556bbce63a2a154191351aa58285623 v0.5.0

.ycm_extra_conf.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import os
2+
import re
3+
import ast
4+
5+
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
6+
7+
flags = []
8+
pattern = re.compile('^([A-Z0-9]+)\s*=\s*(\[.*\])')
9+
with open(os.path.join(SCRIPT_PATH, "config.py")) as f:
10+
for line in f:
11+
result = pattern.search(line)
12+
if result is None:
13+
continue
14+
key = result.group(1)
15+
if 'LINK' in flags or (not 'FLAGS' in key and not 'INCLUDE' in key):
16+
continue
17+
try:
18+
result = ast.literal_eval(result.group(2))
19+
if 'INCLUDE' in key:
20+
flags += [ '-I' + path.replace('#', '') for path in result ]
21+
else:
22+
flags += result
23+
except:
24+
pass
25+
26+
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
27+
if not working_directory:
28+
return list(flags)
29+
new_flags = []
30+
make_next_absolute = False
31+
path_flags = ['-isystem', '-I', '-iquote', '--sysroot=']
32+
for flag in flags:
33+
new_flag = flag
34+
35+
if make_next_absolute:
36+
make_next_absolute = False
37+
if not flag.startswith('/'):
38+
new_flag = os.path.join(working_directory, flag)
39+
40+
for path_flag in path_flags:
41+
if flag == path_flag:
42+
make_next_absolute = True
43+
break
44+
45+
if flag.startswith(path_flag):
46+
path = flag[len(path_flag):]
47+
new_flag = path_flag + os.path.join(working_directory, path)
48+
break
49+
50+
if new_flag:
51+
new_flags.append(new_flag)
52+
return new_flags
53+
54+
def FlagsForFile(filename, **kwargs):
55+
final_flags = MakeRelativePathsInFlagsAbsolute(flags, SCRIPT_PATH) + ['-x', 'c++']
56+
return {
57+
'flags': final_flags,
58+
'do_cache': True
59+
}

CMakeLists.txt

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# Experimental CMake file for Mitusba
2+
# Tested only on Windows and Linux (Ubuntu 10.10)
3+
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
4+
5+
# Internal variable to know whether this is the first time CMake runs
6+
if (NOT DEFINED MTS_CMAKE_INIT)
7+
set(MTS_CMAKE_INIT ON CACHE INTERNAL "Is this the initial CMake run?")
8+
else()
9+
set(MTS_CMAKE_INIT OFF CACHE INTERNAL "Is this the initial CMake run?")
10+
endif()
11+
12+
# Allow to override the default project name "mitsuba"
13+
if (NOT DEFINED MTS_PROJECT_NAME)
14+
set(MTS_PROJECT_NAME "mitsuba")
15+
endif()
16+
project(${MTS_PROJECT_NAME})
17+
18+
# Tell cmake where to find the additional modules
19+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/data/cmake")
20+
# Make sure the cmake-provided modules use the versions they expect
21+
if(NOT CMAKE_VERSION VERSION_LESS "2.8.4")
22+
cmake_policy(SET CMP0017 NEW)
23+
endif()
24+
25+
# Enable folders for projects in Visual Studio
26+
if (CMAKE_GENERATOR MATCHES "Visual Studio")
27+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
28+
endif()
29+
30+
# Remove Debug from CMAKE_CONFIGURATION_TYPES as the dependencies do not contain the necessary debug libraries
31+
if(MSVC AND CMAKE_CONFIGURATION_TYPES)
32+
set(CMAKE_CONFIGURATION_TYPES Release MinSizeRel RelWithDebInfo)
33+
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
34+
"Remove Debug from available configuration types"
35+
FORCE)
36+
endif()
37+
38+
39+
# make config 'RelWithDebInfo' debuggable by disabling optimizations
40+
if(MSVC)
41+
# /MD link against release libs, /Od disable optimizations, /Ob0
42+
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "/O2")
43+
string(REGEX REPLACE "/O2" "/Od" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
44+
endif()
45+
if(CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "/O2")
46+
string(REGEX REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
47+
endif()
48+
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "/Ob1")
49+
string(REGEX REPLACE "/Ob1" "/Ob0" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
50+
endif()
51+
if(CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "/Ob1")
52+
string(REGEX REPLACE "/Ob1" "/Ob0" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
53+
endif()
54+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /RTC1")
55+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /RTC1")
56+
list(REMOVE_DUPLICATES CMAKE_C_FLAGS_RELWITHDEBINFO)
57+
list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS_RELWITHDEBINFO)
58+
endif()
59+
60+
# Set CMAKE_BUILD_TYPE to Release by default
61+
if (MTS_CMAKE_INIT AND DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE)
62+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
63+
"Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
64+
endif()
65+
66+
# Load the required modules
67+
include (MitsubaUtil)
68+
include (MtsGetVersionInfo)
69+
include (CheckCXXSourceCompiles)
70+
include (CMakeDependentOption)
71+
72+
# Read the version information
73+
MTS_GET_VERSION_INFO()
74+
if (MTS_HAS_VALID_REV)
75+
message(STATUS "mitsuba ${MTS_VERSION}-hg${MTS_REV_ID} (${MTS_DATE})")
76+
else()
77+
message(STATUS "mitsuba ${MTS_VERSION} (${MTS_DATE})")
78+
endif()
79+
80+
# Setup the build options
81+
include (MitsubaBuildOptions)
82+
83+
# Find the external libraries and setup the paths
84+
include (MitsubaExternal)
85+
86+
# Main mitsuba include directory
87+
include_directories("include")
88+
89+
# ===== Prerequisite resources =====
90+
91+
# Process the XML schemas
92+
add_subdirectory(data/schema)
93+
# Add the IOR database
94+
add_subdirectory(data/ior)
95+
# Microfacet precomputed data
96+
add_subdirectory(data/microfacet)
97+
98+
99+
# ===== Build the support libraries ====
100+
101+
# Core support library
102+
add_subdirectory(src/libcore)
103+
# Rendering-related APIs
104+
add_subdirectory(src/librender)
105+
# Hardware acceleration
106+
add_subdirectory(src/libhw)
107+
# Bidirectional support library
108+
add_subdirectory(src/libbidir)
109+
# Python binding library
110+
if (BUILD_PYTHON)
111+
add_subdirectory(src/libpython)
112+
elseif(NOT PYTHON_FOUND)
113+
message(STATUS "Python was not found. The bindings will not be built.")
114+
endif()
115+
116+
117+
# Additional files to add to main executables
118+
if(APPLE)
119+
set(MTS_DARWIN_STUB "${CMAKE_CURRENT_SOURCE_DIR}/src/mitsuba/darwin_stub.mm")
120+
set(MTS_WINDOWS_STUB "")
121+
elseif(WIN32)
122+
set(MTS_DARWIN_STUB "")
123+
set(MTS_WINDOWS_STUB "${CMAKE_CURRENT_SOURCE_DIR}/data/windows/wmain_stub.cpp")
124+
else()
125+
set(MTS_DARWIN_STUB "")
126+
set(MTS_WINDOWS_STUB "")
127+
endif()
128+
129+
130+
# ===== Build the applications =====
131+
132+
# Build the command-line binaries
133+
add_subdirectory(src/mitsuba)
134+
135+
# Build the COLLADA converter
136+
if (COLLADA_FOUND)
137+
add_subdirectory(src/converter)
138+
else()
139+
message(STATUS "Collada DOM was not found. The importer will not be built.")
140+
endif()
141+
142+
# Build the Qt-based GUI binaries
143+
if (BUILD_GUI)
144+
add_subdirectory(src/mtsgui)
145+
elseif(NOT QT4_FOUND)
146+
message(STATUS "Qt4 was not found. The mitsuba gui will not be built.")
147+
endif()
148+
149+
150+
# ===== Build the plugins =====
151+
152+
# Utilities
153+
add_subdirectory(src/utils)
154+
# Surface scattering models
155+
add_subdirectory(src/bsdfs)
156+
# Phase functions
157+
add_subdirectory(src/phase)
158+
# Intersection shapes
159+
add_subdirectory(src/shapes)
160+
# Sample generators
161+
add_subdirectory(src/samplers)
162+
# Reconstruction filters
163+
add_subdirectory(src/rfilters)
164+
# Film implementations
165+
add_subdirectory(src/films)
166+
# Sensors
167+
add_subdirectory(src/sensors)
168+
# Emitters
169+
add_subdirectory(src/emitters)
170+
# Participating media
171+
add_subdirectory(src/medium)
172+
# Volumetric data sources
173+
add_subdirectory(src/volume)
174+
# Sub-surface integrators
175+
add_subdirectory(src/subsurface)
176+
# Texture types
177+
add_subdirectory(src/textures)
178+
# Integrators
179+
add_subdirectory(src/integrators)
180+
# Testcases
181+
add_subdirectory(src/tests)
182+
183+
184+
# ===== Packaging =====
185+
186+
# Use a subdirectory to enforce that packaging runs after all other targets
187+
add_subdirectory(data/cmake/packaging)

0 commit comments

Comments
 (0)