Compare commits
633 Commits
tmp-textur
...
eevee-moti
Author | SHA1 | Date | |
---|---|---|---|
d8f46a4452 | |||
a737ca11e1 | |||
92520f1791 | |||
fd14d1cceb | |||
6a1a894df1 | |||
a809631ff2 | |||
f12fe3c23e | |||
16595b9ea1 | |||
5549fa5466 | |||
f79856f9fb | |||
24d39620fb | |||
c02baf8b50 | |||
c73ee8d998 | |||
c98f92f998 | |||
4f9d1a5765 | |||
526e8a3da1 | |||
a03ebe9431 | |||
a61ba6c73d | |||
33359237fe | |||
3d18bd5c51 | |||
49af2f85c3 | |||
a364032dff | |||
e44045745d | |||
e22098616c | |||
![]() |
ed00b5def6 | ||
8ac06377a5 | |||
a0c947ed4c | |||
9385d887d1 | |||
95aa8ffed5 | |||
665acd2903 | |||
f028760b83 | |||
3f648f5b42 | |||
e43a948a2c | |||
e916817520 | |||
cc064acf0f | |||
a76fc2f7ed | |||
2c463a8250 | |||
0439094105 | |||
bfa5eceb89 | |||
faf5f7b63d | |||
63930c41bc | |||
0621c13b3e | |||
14bd92b12f | |||
91462fbb31 | |||
4f314ee5b9 | |||
eee35ebdfb | |||
b05fa123d7 | |||
5fab2ce500 | |||
e7744caf64 | |||
474b288933 | |||
20658e6a29 | |||
4b39de677d | |||
84d4447bc5 | |||
4c172f7ca6 | |||
2d695367a7 | |||
a9dfad831b | |||
b0ac7a89b0 | |||
9b784668ae | |||
74ec37b70c | |||
1d0017089c | |||
3ea04d3e11 | |||
6fe32d7fd6 | |||
d62bbf4079 | |||
93c8955a72 | |||
a58dc25b07 | |||
cc26041d36 | |||
a7ea07c677 | |||
0852d13bbd | |||
044b824c9d | |||
eda58c47b8 | |||
4fefe3ac3b | |||
a71f073dfb | |||
75ce20a000 | |||
0ca0ad5318 | |||
84a0a6d16c | |||
f367f1e5a5 | |||
00f8cfd4ac | |||
d12f6a90b1 | |||
d4315040ad | |||
146473f083 | |||
82f51fe913 | |||
df50104e1c | |||
fc8a7a44b2 | |||
edb4e553f5 | |||
2d1b560a4e | |||
a4bb4b6e65 | |||
48ca66cfe7 | |||
46e0ec05ef | |||
63a40ed422 | |||
d3f83d9f95 | |||
d1932a8ed6 | |||
819ebc9901 | |||
cb9de95d61 | |||
77789a1904 | |||
075156de9f | |||
69b67d4f07 | |||
53d1a729cc | |||
ee64b595da | |||
e1cc9aa7f2 | |||
b37fca650e | |||
0cb59866af | |||
4622434c34 | |||
![]() |
84a5bd9135 | ||
4e9efa80ca | |||
9d75f23566 | |||
37d68871b7 | |||
c23b1de2cf | |||
3ffb52d114 | |||
b7150183e7 | |||
75008dc4b9 | |||
8522b429b5 | |||
5620a09e0d | |||
f7c0f1b8b8 | |||
7d2b4ae9c6 | |||
128296129a | |||
74b0713d8a | |||
874a078d86 | |||
d68e29b62c | |||
9bb7d6ed68 | |||
d8678e02ec | |||
50258d55e7 | |||
7a0ad20e5f | |||
1355d9cc8c | |||
f88d59ecf8 | |||
0c4bc09092 | |||
70a27d0a63 | |||
f326b6a18e | |||
8ded0dd4d5 | |||
e5062a775e | |||
13aa113d7d | |||
9f7d84b656 | |||
0a907657d4 | |||
b5846ebce7 | |||
6f96dfabe5 | |||
bf4198cdaf | |||
e3396d8bfc | |||
d8876e78a1 | |||
1c189aa70a | |||
335c1e48ee | |||
4f4141c8f4 | |||
6e53b28898 | |||
e54fb1b819 | |||
826769d1c7 | |||
34b4dca9f1 | |||
0e040ef3fb | |||
f71a2fc6c3 | |||
460c1d8e20 | |||
4d168e0b8c | |||
1f6d1213d2 | |||
11ba9eec70 | |||
917ab4fbf9 | |||
c175ff19d8 | |||
f50222ba2e | |||
b4ef87afb6 | |||
24904301e5 | |||
112c86fd5d | |||
281319653e | |||
ccbf858bb8 | |||
00961d062a | |||
dc6cee4724 | |||
8f25cfdbfd | |||
3e07d958f1 | |||
561a81eb24 | |||
f6524032ca | |||
a7de01aaa9 | |||
5f7007a962 | |||
1626c526f8 | |||
ab2b9821fc | |||
eb31037503 | |||
01132d4a83 | |||
5ff8a2ca0e | |||
b8afd4e8bb | |||
f0f666541e | |||
959267ffcc | |||
766b3037eb | |||
ee4732ca22 | |||
ce9a64c454 | |||
a99a8061ae | |||
6c6658ccc0 | |||
aed11c673e | |||
03a693922d | |||
5198cb1813 | |||
6c114a139b | |||
033b6a7fb4 | |||
9b3fda0357 | |||
a5e56efc98 | |||
18b57d3e2c | |||
9a3d54943a | |||
1800127355 | |||
cf3e617913 | |||
125acdf933 | |||
0eb969dd99 | |||
1d066050b6 | |||
5146034aa9 | |||
![]() |
7bd73f562a | ||
f5781384ae | |||
a39cc5ae4d | |||
b74cc23dc4 | |||
fc672ce8e2 | |||
60b8db587f | |||
f0047e6754 | |||
0f1361bbc3 | |||
5340556710 | |||
7949953b1e | |||
a77350cce2 | |||
69c9204026 | |||
26fb0d4258 | |||
c3e88fdd03 | |||
a943b65f1b | |||
4df20c058d | |||
2ee95e91f7 | |||
70ad18b94d | |||
b91b90f0dd | |||
b16a85fe0b | |||
9b099c8612 | |||
4e70e0e384 | |||
846dde590f | |||
0f64de6b9b | |||
e9659d0e6e | |||
859505a3da | |||
1270984e13 | |||
b77834ceb1 | |||
a8afe509da | |||
0ee98c654e | |||
abeda01ac6 | |||
67b17684e6 | |||
ff5d24f8be | |||
f797a5406d | |||
a6cd77bad1 | |||
0a41a85bf3 | |||
b78fb8b987 | |||
74fa600ede | |||
d850daf416 | |||
43294e5f49 | |||
60a786e711 | |||
5ed2ed28ab | |||
dc69747f72 | |||
e4e8259d39 | |||
2396daf921 | |||
a1d55bdd53 | |||
473aaa389c | |||
56da8dae67 | |||
0e6c648f3f | |||
7d32a259bf | |||
1c5479167f | |||
48075b2c05 | |||
ce7409fd13 | |||
5e55153c89 | |||
191edd224a | |||
f2d5c53966 | |||
e8b8e16b24 | |||
fe6be70875 | |||
e3a32a22bf | |||
0aa2c10ad1 | |||
8b347fc2cd | |||
fd63220a35 | |||
9e96c6d054 | |||
b2d1c4873f | |||
c7329da14b | |||
0b28f0410c | |||
b168c255aa | |||
ba5b303c88 | |||
1d72fc5a1a | |||
d71f9b9886 | |||
f2a0532111 | |||
15ed2f841c | |||
caca3d9c97 | |||
c7a2ed69be | |||
c604d2762f | |||
733a3e3a70 | |||
3da4724f72 | |||
fd061f61c7 | |||
3b4ef08d68 | |||
41866070d3 | |||
953c232db3 | |||
e8592a0412 | |||
10b34ad697 | |||
5837de6879 | |||
7534bbfa34 | |||
1438c1cfd5 | |||
30395a491f | |||
c7c3908b8e | |||
0f32029522 | |||
78017916f7 | |||
465a9f65de | |||
1a23b0be97 | |||
f9892bd6cf | |||
244ed645e0 | |||
fe13f3db81 | |||
67a617e196 | |||
7aa47083d0 | |||
![]() |
e723ec04fb | ||
67b10fcc22 | |||
b94ab93dfb | |||
a4e0bccb87 | |||
0849af4591 | |||
86385d7ebd | |||
bd68312cb6 | |||
2cdfc1b4af | |||
fc1bb36668 | |||
26aa64b688 | |||
ef0ff4aaf2 | |||
dbb1f56e55 | |||
de9c04c287 | |||
51cd6d22c5 | |||
15a24f3d7f | |||
![]() |
211b6c29f7 | ||
96eab08755 | |||
b2dcff4c21 | |||
054923c860 | |||
47bdb28841 | |||
91cc1f38ae | |||
866e067d65 | |||
4184371fb0 | |||
df17ee202b | |||
![]() |
82e3bd4bbb | ||
![]() |
3c9f80c898 | ||
![]() |
dc8475ec6a | ||
cda1540858 | |||
![]() |
3384bb2c66 | ||
0e14eb7b31 | |||
75015f27ba | |||
d4f1efad00 | |||
3e4c8d48aa | |||
55f8758b87 | |||
59bfcd8c5d | |||
9b0543389b | |||
6f21137722 | |||
53cb1a32db | |||
3b6e223a03 | |||
f0df4d6c35 | |||
2749e6a639 | |||
2004f9a342 | |||
45b5f4e3df | |||
a5e9f024f2 | |||
2e52b3206c | |||
650dedfd10 | |||
a1f9eebc0b | |||
47eccac21c | |||
ee4bafc63a | |||
beef67d1df | |||
ea92f8207a | |||
e391b3e0fb | |||
a87eee65fc | |||
7fc0053c27 | |||
85098bdb89 | |||
071cc71fb0 | |||
dcdbcf1ec1 | |||
![]() |
ffb3365fb2 | ||
0465086223 | |||
52cc412e0f | |||
572c472754 | |||
4153606edd | |||
b08caeb92b | |||
ca09625dcc | |||
417ebc3845 | |||
bd3ab27410 | |||
1743326889 | |||
cdf0d95a50 | |||
6a70d7e09f | |||
9d9f35d946 | |||
5ef44dd83f | |||
9713df4e92 | |||
2c204432df | |||
e69f70e11f | |||
50994eace6 | |||
b18c2a3c41 | |||
eba3aa1837 | |||
b82cb0ad32 | |||
38cfcdd51b | |||
cb59ef1032 | |||
![]() |
0749cff957 | ||
![]() |
752139556f | ||
![]() |
bf34b0c8f4 | ||
0a00fbd265 | |||
21443056b7 | |||
43ec8c287f | |||
cecda64e2e | |||
bdda53fdb2 | |||
074d469165 | |||
ae2f21f378 | |||
ea516bed72 | |||
6aef27602a | |||
b724922f1a | |||
428c0f9ad5 | |||
c6957e50e8 | |||
81f817e7b4 | |||
17d8e7f833 | |||
de6c935261 | |||
![]() |
9c410c77eb | ||
59e793d3bd | |||
a8907e409a | |||
![]() |
c7280ce65b | ||
7881c251f3 | |||
![]() |
389d550412 | ||
18cda8be87 | |||
98c301d25e | |||
f58e76119a | |||
4f3e686cad | |||
8b63c6241d | |||
1d4bae8566 | |||
3778f168f6 | |||
5c54a609a9 | |||
91fb07f361 | |||
3cce8afe2c | |||
b0038b8d73 | |||
45dbc38a8b | |||
8d670546f9 | |||
31cf87a29e | |||
19f3f6cd85 | |||
c204e3348c | |||
9936e23b85 | |||
10966926ce | |||
520f08aa56 | |||
49bd44f5c8 | |||
81c33f0ba7 | |||
c71be9a552 | |||
946ae26349 | |||
c315e56434 | |||
89cd9f110b | |||
d4483b6d15 | |||
f18ed7ad89 | |||
![]() |
b5cfb23fa7 | ||
![]() |
adf9ff6359 | ||
![]() |
42dcb1090b | ||
![]() |
102a7ae2d9 | ||
![]() |
95e3356a27 | ||
d0e028a78e | |||
d5a92b188b | |||
fcccee0c33 | |||
14af27e63d | |||
4cb883b6b2 | |||
6f1056ae63 | |||
ba711824b3 | |||
347c191292 | |||
9d725fc0cf | |||
ec26260132 | |||
515e8e4f7c | |||
55598269d2 | |||
a574478d90 | |||
3d014fa815 | |||
63bcee81f6 | |||
2ee94c954d | |||
a9689737b3 | |||
664c608fb7 | |||
691a1e3357 | |||
![]() |
907cab45ff | ||
c93a88413d | |||
![]() |
43853d0528 | ||
![]() |
a86b5df005 | ||
![]() |
67795c90fc | ||
d1bc233ffe | |||
1d2b89304a | |||
![]() |
582d3153a1 | ||
7022c73249 | |||
8ec59757d1 | |||
654fde2dd2 | |||
e115b7b06d | |||
5510d5825b | |||
d1f4adab24 | |||
dbdb8a3355 | |||
5ec18ae4ab | |||
2deb6c5177 | |||
![]() |
1be79dc2a0 | ||
![]() |
155cd03599 | ||
![]() |
b8bcbaaf0e | ||
![]() |
82cbf93f20 | ||
![]() |
6cbb56418f | ||
![]() |
a099478cad | ||
3923062d13 | |||
a9073ccb68 | |||
ff1040c6fe | |||
59b730b643 | |||
c7a7dc743d | |||
bf690ecd39 | |||
68d6b73fde | |||
1335f2d272 | |||
806db47fd8 | |||
3d2f143000 | |||
4ddb7a33a4 | |||
5c8ccad652 | |||
122cb1aea8 | |||
16943c0146 | |||
d35a33ef72 | |||
cdcbcca25e | |||
d7282537f0 | |||
80d6421f28 | |||
0b793514fa | |||
79e529c5ec | |||
7e80aa7ca6 | |||
735119dd0f | |||
49c295813b | |||
28d9368538 | |||
efa4ae17f0 | |||
8cd17a9529 | |||
42cb1e3a2c | |||
c971731b8f | |||
38b50fe393 | |||
15bcfc5b19 | |||
12c42738f3 | |||
8e9fdd2f31 | |||
a444400900 | |||
1e0de7c2ea | |||
6a8193e505 | |||
ece54172d0 | |||
16aef5dc4a | |||
ad4cef38e3 | |||
614d70a87d | |||
717d968fb9 | |||
5d8515ed86 | |||
b5ef644ef6 | |||
444ca1a117 | |||
39cf673132 | |||
98197343e8 | |||
be03a756e5 | |||
0ff665e4ce | |||
4886a704b3 | |||
6fc9d106ad | |||
0d089ce881 | |||
4ab36c4393 | |||
57aae2a355 | |||
c81a5f58f8 | |||
67fe31d751 | |||
7c0bea0d65 | |||
![]() |
e490dc4346 | ||
bab5fbb66c | |||
1c3b2b5dd8 | |||
![]() |
ecc15c55d4 | ||
7836242065 | |||
355d129965 | |||
1f7a791a53 | |||
2e73e1390e | |||
7ed7901c00 | |||
43af0f4d16 | |||
6c1cf395f2 | |||
a739dc67ef | |||
e5458fa4e5 | |||
a8551f93e6 | |||
f772a4b8fa | |||
eb5422828a | |||
5171d86806 | |||
![]() |
de257b6366 | ||
00674c12cc | |||
18f33f293b | |||
9aea7dc7c6 | |||
9b0f65c4a6 | |||
5f63344e84 | |||
a2baf50242 | |||
1f223b9a1f | |||
78eae89c39 | |||
a1c9d42584 | |||
4102e7ed81 | |||
d8733539b7 | |||
f3cf29ac96 | |||
4114e89020 | |||
14b1c55e11 | |||
299682bde7 | |||
d3275178fe | |||
35bd596876 | |||
2299f6b5a7 | |||
e790f1a8dc | |||
23520cbd13 | |||
2a692e05c8 | |||
13e17cbd47 | |||
b44c3ac1e9 | |||
4835a09bb1 | |||
13b10ab852 | |||
fc2bb44e94 | |||
5a1ab3e9ae | |||
825d5c9992 | |||
2dd6d0ce4b | |||
49f59092e7 | |||
ecc395e473 | |||
77fdd189e4 | |||
495a98d623 | |||
4e8693ffcd | |||
5254ffa17b | |||
39aa122a0e | |||
4a9a8611f2 | |||
4464a9425b | |||
c19cc7ef81 | |||
6fbeded285 | |||
31cb4133b9 | |||
52c356c199 | |||
396bf6ca78 | |||
6d4dc22e17 | |||
28d81f7b24 | |||
9f1f7ba2bb | |||
f53ae843b3 | |||
ce0db0d329 | |||
2ba3214a21 | |||
7a51eb5340 | |||
219ce574b5 | |||
1b06d5742e | |||
ec0ba8e3b5 | |||
026eba8523 | |||
8b849f39e8 | |||
849f5bee19 | |||
b01d2ea72a | |||
e0ff032711 | |||
7a37db6125 | |||
deaff945d0 | |||
df8cbdc696 | |||
a8a6b3627a | |||
0270941b70 | |||
7e9480b6cd | |||
dc3f404a70 | |||
3c40d2485f | |||
1a60aba46f | |||
d65f60764b | |||
baa1886791 | |||
9ef272bae3 | |||
87e9557cd1 | |||
60bed34f16 | |||
1c467d77de | |||
693b88f152 | |||
3651ebb1db | |||
7aef17d361 | |||
417f0d720b | |||
ed58e3656a | |||
7b9a6f823b | |||
2f2fb4453f | |||
f9f6042bcf | |||
16fd236e14 | |||
8cd42410c5 | |||
0213d9f865 | |||
bd6abacc04 | |||
c42e68c484 | |||
a83ad13c49 | |||
7ebb1f2ff3 | |||
5de40f4838 | |||
52f8ba66cb | |||
536142e12f |
@@ -257,6 +257,10 @@ ForEachMacros:
|
|||||||
- SURFACE_QUAD_ITER_BEGIN
|
- SURFACE_QUAD_ITER_BEGIN
|
||||||
- foreach
|
- foreach
|
||||||
- ED_screen_areas_iter
|
- ED_screen_areas_iter
|
||||||
|
- SLOT_PROBING_BEGIN
|
||||||
|
- SET_SLOT_PROBING_BEGIN
|
||||||
|
- MAP_SLOT_PROBING_BEGIN
|
||||||
|
- VECTOR_SET_SLOT_PROBING_BEGIN
|
||||||
|
|
||||||
# Use once we bump the minimum version to version 8.
|
# Use once we bump the minimum version to version 8.
|
||||||
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
|
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
|
||||||
|
@@ -32,6 +32,7 @@ Convenience Targets
|
|||||||
* debug: Build a debug binary.
|
* debug: Build a debug binary.
|
||||||
* full: Enable all supported dependencies & options.
|
* full: Enable all supported dependencies & options.
|
||||||
* lite: Disable non essential features for a smaller binary and faster build.
|
* lite: Disable non essential features for a smaller binary and faster build.
|
||||||
|
* release Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
|
||||||
* headless: Build without an interface (renderfarm or server automation).
|
* headless: Build without an interface (renderfarm or server automation).
|
||||||
* cycles: Build Cycles standalone only, without Blender.
|
* cycles: Build Cycles standalone only, without Blender.
|
||||||
* bpy: Build as a python module which can be loaded from python directly.
|
* bpy: Build as a python module which can be loaded from python directly.
|
||||||
@@ -207,6 +208,10 @@ ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
|
|||||||
BUILD_DIR:=$(BUILD_DIR)_lite
|
BUILD_DIR:=$(BUILD_DIR)_lite
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" $(CMAKE_CONFIG_ARGS)
|
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" $(CMAKE_CONFIG_ARGS)
|
||||||
endif
|
endif
|
||||||
|
ifneq "$(findstring release, $(MAKECMDGOALS))" ""
|
||||||
|
BUILD_DIR:=$(BUILD_DIR)_release
|
||||||
|
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_release.cmake" $(CMAKE_CONFIG_ARGS)
|
||||||
|
endif
|
||||||
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_cycles
|
BUILD_DIR:=$(BUILD_DIR)_cycles
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" $(CMAKE_CONFIG_ARGS)
|
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" $(CMAKE_CONFIG_ARGS)
|
||||||
@@ -317,6 +322,7 @@ all: .FORCE
|
|||||||
debug: all
|
debug: all
|
||||||
full: all
|
full: all
|
||||||
lite: all
|
lite: all
|
||||||
|
release: all
|
||||||
cycles: all
|
cycles: all
|
||||||
headless: all
|
headless: all
|
||||||
bpy: all
|
bpy: all
|
||||||
|
@@ -38,6 +38,7 @@ set(ALEMBIC_EXTRA_ARGS
|
|||||||
-DBoost_DEBUG=ON
|
-DBoost_DEBUG=ON
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
-DBoost_NO_BOOST_CMAKE=ON
|
||||||
-DILMBASE_ROOT=${LIBDIR}/openexr
|
-DILMBASE_ROOT=${LIBDIR}/openexr
|
||||||
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
|
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
|
||||||
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||||
|
@@ -26,10 +26,20 @@ set(EMBREE_EXTRA_ARGS
|
|||||||
-DEMBREE_RAY_MASK=ON
|
-DEMBREE_RAY_MASK=ON
|
||||||
-DEMBREE_FILTER_FUNCTION=ON
|
-DEMBREE_FILTER_FUNCTION=ON
|
||||||
-DEMBREE_BACKFACE_CULLING=OFF
|
-DEMBREE_BACKFACE_CULLING=OFF
|
||||||
-DEMBREE_TASKING_SYSTEM=INTERNAL
|
|
||||||
-DEMBREE_MAX_ISA=AVX2
|
-DEMBREE_MAX_ISA=AVX2
|
||||||
|
-DEMBREE_TASKING_SYSTEM=TBB
|
||||||
|
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
|
||||||
|
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(TBB_STATIC_LIBRARY)
|
||||||
|
set(EMBREE_EXTRA_ARGS
|
||||||
|
${EMBREE_EXTRA_ARGS}
|
||||||
|
-DEMBREE_TBB_LIBRARY_NAME=tbb_static
|
||||||
|
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_static
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
|
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
|
||||||
else()
|
else()
|
||||||
@@ -44,6 +54,12 @@ ExternalProject_Add(external_embree
|
|||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/embree
|
INSTALL_DIR ${LIBDIR}/embree
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_dependencies(
|
||||||
|
external_embree
|
||||||
|
external_tbb
|
||||||
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|
||||||
if(BUILD_MODE STREQUAL Release)
|
if(BUILD_MODE STREQUAL Release)
|
||||||
|
@@ -31,10 +31,6 @@ if(BUILD_MODE STREQUAL Release)
|
|||||||
COMMAND # jpeg rename libfile + copy include
|
COMMAND # jpeg rename libfile + copy include
|
||||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
|
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
|
||||||
# OpenImageIO
|
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
|
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
|
|
||||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
|
|
||||||
# png
|
# png
|
||||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
|
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
|
||||||
@@ -55,9 +51,7 @@ endif()
|
|||||||
|
|
||||||
if(BUILD_MODE STREQUAL Debug)
|
if(BUILD_MODE STREQUAL Debug)
|
||||||
add_custom_target(Harvest_Debug_Results
|
add_custom_target(Harvest_Debug_Results
|
||||||
# OpenImageIO
|
COMMAND
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
|
|
||||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
|
|
||||||
# hdf5
|
# hdf5
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
|
||||||
DEPENDS Package_Python
|
DEPENDS Package_Python
|
||||||
|
@@ -42,20 +42,17 @@ if(WIN32)
|
|||||||
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
|
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
|
||||||
endif()
|
endif()
|
||||||
else(WIN32)
|
else(WIN32)
|
||||||
# autoconf for unix
|
# cmake for unix
|
||||||
if(APPLE)
|
set(JPEG_EXTRA_ARGS
|
||||||
set(JPEG_EXTRA_ARGS --host x86_64-apple-darwin --with-jpeg8)
|
-DWITH_JPEG8=ON
|
||||||
else()
|
-DENABLE_STATIC=ON
|
||||||
set(JPEG_EXTRA_ARGS --with-jpeg8)
|
-DENABLE_SHARED=OFF
|
||||||
endif()
|
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpg/lib)
|
||||||
|
|
||||||
ExternalProject_Add(external_jpeg
|
ExternalProject_Add(external_jpeg
|
||||||
URL ${JPEG_URI}
|
URL ${JPEG_URI}
|
||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
URL_HASH MD5=${JPEG_HASH}
|
URL_HASH MD5=${JPEG_HASH}
|
||||||
CONFIGURE_COMMAND ${CONFIGURE_ENV} && autoreconf -fiv && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jpg NASM=yasm ${JPEG_EXTRA_ARGS}
|
|
||||||
BUILD_IN_SOURCE 1
|
|
||||||
BUILD_COMMAND ${CONFIGURE_ENV} && make install
|
|
||||||
PREFIX ${BUILD_DIR}/jpg
|
PREFIX ${BUILD_DIR}/jpg
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/jpg
|
INSTALL_DIR ${LIBDIR}/jpg
|
||||||
|
@@ -32,7 +32,7 @@ endif()
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(PNG_LIBNAME libpng16_static${LIBEXT})
|
set(PNG_LIBNAME libpng16_static${LIBEXT})
|
||||||
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
|
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
|
||||||
set(OPENJPEG_POSTFIX _msvc)
|
set(OPENJPEG_POSTFIX _msvc)
|
||||||
else()
|
else()
|
||||||
set(PNG_LIBNAME libpng${LIBEXT})
|
set(PNG_LIBNAME libpng${LIBEXT})
|
||||||
@@ -49,23 +49,17 @@ endif()
|
|||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(OPENJPEG_FLAGS
|
set(OPENJPEG_FLAGS
|
||||||
-DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
|
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg_msvc
|
||||||
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
|
|
||||||
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjp2${LIBEXT}
|
|
||||||
-DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjp2${LIBEXT}
|
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(OPENJPEG_FLAGS
|
set(OPENJPEG_FLAGS
|
||||||
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
|
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg
|
||||||
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OPENIMAGEIO_EXTRA_ARGS
|
set(OPENIMAGEIO_EXTRA_ARGS
|
||||||
-DBUILDSTATIC=ON
|
-DBUILD_SHARED_LIBS=OFF
|
||||||
${OPENIMAGEIO_LINKSTATIC}
|
${OPENIMAGEIO_LINKSTATIC}
|
||||||
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/openexr/
|
|
||||||
-DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
|
||||||
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
||||||
-DBoost_USE_MULTITHREADED=ON
|
-DBoost_USE_MULTITHREADED=ON
|
||||||
-DBoost_USE_STATIC_LIBS=ON
|
-DBoost_USE_STATIC_LIBS=ON
|
||||||
@@ -73,7 +67,16 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
|||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
-DBoost_NO_BOOST_CMAKE=ON
|
||||||
-OIIO_BUILD_CPP11=ON
|
-OIIO_BUILD_CPP11=ON
|
||||||
|
-DUSE_LIBSQUISH=OFF
|
||||||
|
-DUSE_QT5=OFF
|
||||||
|
-DUSE_NUKE=OFF
|
||||||
|
-DUSE_OPENVDB=OFF
|
||||||
|
-DUSE_BZIP2=OFF
|
||||||
|
-DUSE_FREETYPE=OFF
|
||||||
|
-DUSE_DCMTK=OFF
|
||||||
|
-DUSE_LIBHEIF=OFF
|
||||||
-DUSE_OPENGL=OFF
|
-DUSE_OPENGL=OFF
|
||||||
-DUSE_TBB=OFF
|
-DUSE_TBB=OFF
|
||||||
-DUSE_FIELD3D=OFF
|
-DUSE_FIELD3D=OFF
|
||||||
@@ -81,15 +84,12 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
|||||||
-DUSE_PYTHON=OFF
|
-DUSE_PYTHON=OFF
|
||||||
-DUSE_GIF=OFF
|
-DUSE_GIF=OFF
|
||||||
-DUSE_OPENCV=OFF
|
-DUSE_OPENCV=OFF
|
||||||
-DUSE_OPENSSL=OFF
|
|
||||||
-DUSE_OPENJPEG=ON
|
-DUSE_OPENJPEG=ON
|
||||||
-DUSE_FFMPEG=OFF
|
-DUSE_FFMPEG=OFF
|
||||||
-DUSE_PTEX=OFF
|
-DUSE_PTEX=OFF
|
||||||
-DUSE_FREETYPE=OFF
|
-DUSE_FREETYPE=OFF
|
||||||
-DUSE_LIBRAW=OFF
|
-DUSE_LIBRAW=OFF
|
||||||
-DUSE_PYTHON=OFF
|
-DUSE_OPENCOLORIO=OFF
|
||||||
-DUSE_PYTHON3=OFF
|
|
||||||
-DUSE_OCIO=OFF
|
|
||||||
-DUSE_WEBP=${WITH_WEBP}
|
-DUSE_WEBP=${WITH_WEBP}
|
||||||
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
|
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
|
||||||
-DOIIO_BUILD_TESTS=OFF
|
-DOIIO_BUILD_TESTS=OFF
|
||||||
@@ -103,17 +103,13 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
|||||||
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
|
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
|
||||||
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
|
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
|
||||||
${OPENJPEG_FLAGS}
|
${OPENJPEG_FLAGS}
|
||||||
-DOCIO_PATH=${LIBDIR}/opencolorio/
|
|
||||||
-DOpenEXR_USE_STATIC_LIBS=On
|
-DOpenEXR_USE_STATIC_LIBS=On
|
||||||
-DOPENEXR_HOME=${LIBDIR}/openexr/
|
|
||||||
-DILMBASE_INCLUDE_PATH=${LIBDIR}/openexr/
|
|
||||||
-DILMBASE_PACKAGE_PREFIX=${LIBDIR}/openexr/
|
|
||||||
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
|
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
|
||||||
|
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
|
||||||
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||||
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||||
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||||
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||||
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
|
|
||||||
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
|
||||||
-DSTOP_ON_WARNING=OFF
|
-DSTOP_ON_WARNING=OFF
|
||||||
${WEBP_FLAGS}
|
${WEBP_FLAGS}
|
||||||
@@ -125,27 +121,38 @@ ExternalProject_Add(external_openimageio
|
|||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
URL_HASH MD5=${OPENIMAGEIO_HASH}
|
URL_HASH MD5=${OPENIMAGEIO_HASH}
|
||||||
PREFIX ${BUILD_DIR}/openimageio
|
PREFIX ${BUILD_DIR}/openimageio
|
||||||
PATCH_COMMAND
|
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff
|
||||||
${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff &&
|
|
||||||
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_static_libs.diff
|
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/openimageio
|
INSTALL_DIR ${LIBDIR}/openimageio
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies(
|
add_dependencies(
|
||||||
external_openimageio
|
external_openimageio
|
||||||
external_png external_zlib
|
external_png
|
||||||
|
external_zlib
|
||||||
external_openexr
|
external_openexr
|
||||||
external_jpeg
|
external_jpeg
|
||||||
external_boost
|
external_boost
|
||||||
external_tiff
|
external_tiff
|
||||||
external_opencolorio
|
|
||||||
external_openjpeg${OPENJPEG_POSTFIX}
|
external_openjpeg${OPENJPEG_POSTFIX}
|
||||||
${WEBP_DEP}
|
${WEBP_DEP}
|
||||||
)
|
)
|
||||||
if(NOT WIN32)
|
|
||||||
add_dependencies(
|
if(WIN32)
|
||||||
external_openimageio
|
if(BUILD_MODE STREQUAL Release)
|
||||||
external_opencolorio_extra
|
ExternalProject_Add_Step(external_openimageio after_install
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe
|
||||||
|
|
||||||
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
if(BUILD_MODE STREQUAL Debug)
|
||||||
|
ExternalProject_Add_Step(external_openimageio after_install
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
|
||||||
|
DEPENDEES install
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
@@ -27,6 +27,7 @@ set(OPENVDB_EXTRA_ARGS
|
|||||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
-DBoost_USE_STATIC_RUNTIME=OFF
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
-DBoost_NO_BOOST_CMAKE=ON
|
||||||
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
||||||
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
|
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
|
||||||
-DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/
|
-DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/
|
||||||
|
@@ -44,6 +44,7 @@ set(OSL_EXTRA_ARGS
|
|||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
-DBoost_NO_BOOST_CMAKE=ON
|
||||||
-DLLVM_DIRECTORY=${LIBDIR}/llvm
|
-DLLVM_DIRECTORY=${LIBDIR}/llvm
|
||||||
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
|
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
|
||||||
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
|
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
|
||||||
|
@@ -25,7 +25,7 @@ set(PNG_EXTRA_ARGS
|
|||||||
ExternalProject_Add(external_png
|
ExternalProject_Add(external_png
|
||||||
URL ${PNG_URI}
|
URL ${PNG_URI}
|
||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
URL_HASH MD5=${PNG_HASH}
|
URL_HASH SHA256=${PNG_HASH}
|
||||||
PREFIX ${BUILD_DIR}/png
|
PREFIX ${BUILD_DIR}/png
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/png
|
INSTALL_DIR ${LIBDIR}/png
|
||||||
|
@@ -22,6 +22,8 @@ set(USD_EXTRA_ARGS
|
|||||||
-DBoost_USE_STATIC_LIBS=ON
|
-DBoost_USE_STATIC_LIBS=ON
|
||||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
-DBoost_USE_STATIC_RUNTIME=OFF
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
-DBoost_NO_BOOST_CMAKE=ON
|
||||||
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
|
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
|
||||||
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
|
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
|
||||||
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
|
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
|
||||||
|
@@ -24,13 +24,13 @@ set(OPENAL_VERSION 1.20.1)
|
|||||||
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
|
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
|
||||||
set(OPENAL_HASH 556695068ce8375b89986083d810fd35)
|
set(OPENAL_HASH 556695068ce8375b89986083d810fd35)
|
||||||
|
|
||||||
set(PNG_VERSION 1.6.35)
|
set(PNG_VERSION 1.6.37)
|
||||||
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.xz)
|
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.xz)
|
||||||
set(PNG_HASH 678b7e696a62a193ed3503b04bf449d6)
|
set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
|
||||||
|
|
||||||
set(JPEG_VERSION 1.5.3)
|
set(JPEG_VERSION 2.0.4)
|
||||||
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
|
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
|
||||||
set(JPEG_HASH 5b7549d440b86c98a517355c102d155e)
|
set(JPEG_HASH 44c43e4a9fb352f47090804529317c88)
|
||||||
|
|
||||||
set(BOOST_VERSION 1.70.0)
|
set(BOOST_VERSION 1.70.0)
|
||||||
set(BOOST_VERSION_NODOTS 1_70_0)
|
set(BOOST_VERSION_NODOTS 1_70_0)
|
||||||
@@ -113,9 +113,9 @@ set(OPENCOLLADA_VERSION v1.6.68)
|
|||||||
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
|
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
|
||||||
set(OPENCOLLADA_HASH ee7dae874019fea7be11613d07567493)
|
set(OPENCOLLADA_HASH ee7dae874019fea7be11613d07567493)
|
||||||
|
|
||||||
set(OPENCOLORIO_VERSION 1.1.0)
|
set(OPENCOLORIO_VERSION 1.1.1)
|
||||||
set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
|
set(OPENCOLORIO_URI https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
|
||||||
set(OPENCOLORIO_HASH 802d8f5b1d1fe316ec5f76511aa611b8)
|
set(OPENCOLORIO_HASH 23d8b9ac81599305539a5a8674b94a3d)
|
||||||
|
|
||||||
set(LLVM_VERSION 9.0.1)
|
set(LLVM_VERSION 9.0.1)
|
||||||
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
|
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
|
||||||
@@ -127,17 +127,17 @@ set(CLANG_HASH 13468e4a44940efef1b75e8641752f90)
|
|||||||
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
||||||
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
|
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
|
||||||
|
|
||||||
set(OPENIMAGEIO_VERSION 1.8.13)
|
set(OPENIMAGEIO_VERSION 2.1.15.0)
|
||||||
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
|
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
|
||||||
set(OPENIMAGEIO_HASH f5526c3c9878029ee900d84856683f93)
|
set(OPENIMAGEIO_HASH f03aa5e3ac4795af04771ee4146e9832)
|
||||||
|
|
||||||
set(TIFF_VERSION 4.0.9)
|
set(TIFF_VERSION 4.1.0)
|
||||||
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
|
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
|
||||||
set(TIFF_HASH 54bad211279cc93eb4fca31ba9bfdc79)
|
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
|
||||||
|
|
||||||
set(OSL_VERSION 1.10.9)
|
set(OSL_VERSION 1.10.10)
|
||||||
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
|
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
|
||||||
set(OSL_HASH a94f1e8506f7e8f5e993653de5c5fa00)
|
set(OSL_HASH 00dec08a93c8084e53848b9ad047889f)
|
||||||
|
|
||||||
set(PYTHON_VERSION 3.7.4)
|
set(PYTHON_VERSION 3.7.4)
|
||||||
set(PYTHON_SHORT_VERSION 3.7)
|
set(PYTHON_SHORT_VERSION 3.7)
|
||||||
@@ -199,12 +199,10 @@ set(XVIDCORE_VERSION 1.3.7)
|
|||||||
set(XVIDCORE_URI https://downloads.xvid.com/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
|
set(XVIDCORE_URI https://downloads.xvid.com/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
|
||||||
set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce2d)
|
set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce2d)
|
||||||
|
|
||||||
# This has to be in sync with the version in blenders /extern folder.
|
set(OPENJPEG_VERSION 2.3.1)
|
||||||
set(OPENJPEG_VERSION 2.3.0)
|
|
||||||
set(OPENJPEG_SHORT_VERSION 2.3)
|
set(OPENJPEG_SHORT_VERSION 2.3)
|
||||||
# Use slightly newer commit after release which includes a cmake fix
|
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
|
||||||
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/66297f07a43.zip)
|
set(OPENJPEG_HASH 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9)
|
||||||
set(OPENJPEG_HASH 8242b18d908c7c42174e4231a741cfa7ce7c26b6ed5c9644feb9df7b3054310b)
|
|
||||||
|
|
||||||
set(FFMPEG_VERSION 4.2.3)
|
set(FFMPEG_VERSION 4.2.3)
|
||||||
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
|
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
|
||||||
@@ -214,9 +212,9 @@ set(FFTW_VERSION 3.3.8)
|
|||||||
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
|
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
|
||||||
set(FFTW_HASH 8aac833c943d8e90d51b697b27d4384d)
|
set(FFTW_HASH 8aac833c943d8e90d51b697b27d4384d)
|
||||||
|
|
||||||
set(ICONV_VERSION 1.15)
|
set(ICONV_VERSION 1.16)
|
||||||
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
|
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
|
||||||
set(ICONV_HASH ace8b5f2db42f7b3b3057585e80d9808)
|
set(ICONV_HASH 7d2a800b952942bb2880efb00cfd524c)
|
||||||
|
|
||||||
set(LAPACK_VERSION 3.6.0)
|
set(LAPACK_VERSION 3.6.0)
|
||||||
set(LAPACK_URI http://www.netlib.org/lapack/lapack-${LAPACK_VERSION}.tgz)
|
set(LAPACK_URI http://www.netlib.org/lapack/lapack-${LAPACK_VERSION}.tgz)
|
||||||
@@ -263,9 +261,9 @@ set(LCMS_VERSION 2.9)
|
|||||||
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
|
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
|
||||||
set(LCMS_HASH 8de1b7724f578d2995c8fdfa35c3ad0e)
|
set(LCMS_HASH 8de1b7724f578d2995c8fdfa35c3ad0e)
|
||||||
|
|
||||||
set(PUGIXML_VERSION 1.9)
|
set(PUGIXML_VERSION 1.10)
|
||||||
set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v1.9.tar.gz)
|
set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v${PUGIXML_VERSION}.tar.gz)
|
||||||
set(PUGIXML_HASH 9346ca1dce2c48f1748c12fdac41a714)
|
set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
|
||||||
|
|
||||||
set(FLEXBISON_VERSION 2.5.5)
|
set(FLEXBISON_VERSION 2.5.5)
|
||||||
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
|
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
|
||||||
@@ -295,9 +293,9 @@ set(SQLITE_VERSION 3.24.0)
|
|||||||
set(SQLITE_URI https://www.sqlite.org/2018/sqlite-src-3240000.zip)
|
set(SQLITE_URI https://www.sqlite.org/2018/sqlite-src-3240000.zip)
|
||||||
set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
|
set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
|
||||||
|
|
||||||
set(EMBREE_VERSION 3.8.0)
|
set(EMBREE_VERSION 3.10.0)
|
||||||
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
||||||
set(EMBREE_HASH ac504d5426945fe25dec1267e0c39d52)
|
set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)
|
||||||
|
|
||||||
set(USD_VERSION 19.11)
|
set(USD_VERSION 19.11)
|
||||||
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
|
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
|
||||||
|
@@ -378,6 +378,7 @@ CLANG_FORMAT_VERSION_MIN="6.0"
|
|||||||
|
|
||||||
PYTHON_VERSION="3.7.4"
|
PYTHON_VERSION="3.7.4"
|
||||||
PYTHON_VERSION_MIN="3.7"
|
PYTHON_VERSION_MIN="3.7"
|
||||||
|
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_MIN
|
||||||
PYTHON_FORCE_BUILD=false
|
PYTHON_FORCE_BUILD=false
|
||||||
PYTHON_FORCE_REBUILD=false
|
PYTHON_FORCE_REBUILD=false
|
||||||
PYTHON_SKIP=false
|
PYTHON_SKIP=false
|
||||||
@@ -436,7 +437,7 @@ OSL_FORCE_REBUILD=false
|
|||||||
OSL_SKIP=false
|
OSL_SKIP=false
|
||||||
|
|
||||||
# OpenSubdiv needs to be compiled for now
|
# OpenSubdiv needs to be compiled for now
|
||||||
OSD_VERSION="3.4.0_RC2"
|
OSD_VERSION="3.4.3"
|
||||||
OSD_VERSION_MIN=$OSD_VERSION
|
OSD_VERSION_MIN=$OSD_VERSION
|
||||||
OSD_FORCE_BUILD=false
|
OSD_FORCE_BUILD=false
|
||||||
OSD_FORCE_REBUILD=false
|
OSD_FORCE_REBUILD=false
|
||||||
@@ -468,7 +469,7 @@ OPENCOLLADA_FORCE_BUILD=false
|
|||||||
OPENCOLLADA_FORCE_REBUILD=false
|
OPENCOLLADA_FORCE_REBUILD=false
|
||||||
OPENCOLLADA_SKIP=false
|
OPENCOLLADA_SKIP=false
|
||||||
|
|
||||||
EMBREE_VERSION="3.8.0"
|
EMBREE_VERSION="3.10.0"
|
||||||
EMBREE_FORCE_BUILD=false
|
EMBREE_FORCE_BUILD=false
|
||||||
EMBREE_FORCE_REBUILD=false
|
EMBREE_FORCE_REBUILD=false
|
||||||
EMBREE_SKIP=false
|
EMBREE_SKIP=false
|
||||||
@@ -478,14 +479,14 @@ OIDN_FORCE_BUILD=false
|
|||||||
OIDN_FORCE_REBUILD=false
|
OIDN_FORCE_REBUILD=false
|
||||||
OIDN_SKIP=false
|
OIDN_SKIP=false
|
||||||
|
|
||||||
FFMPEG_VERSION="4.0.2"
|
FFMPEG_VERSION="4.2.3"
|
||||||
FFMPEG_VERSION_MIN="2.8.4"
|
FFMPEG_VERSION_MIN="2.8.4"
|
||||||
FFMPEG_FORCE_BUILD=false
|
FFMPEG_FORCE_BUILD=false
|
||||||
FFMPEG_FORCE_REBUILD=false
|
FFMPEG_FORCE_REBUILD=false
|
||||||
FFMPEG_SKIP=false
|
FFMPEG_SKIP=false
|
||||||
_ffmpeg_list_sep=";"
|
_ffmpeg_list_sep=";"
|
||||||
|
|
||||||
XR_OPENXR_VERSION="1.0.6"
|
XR_OPENXR_VERSION="1.0.8"
|
||||||
XR_OPENXR_FORCE_BUILD=false
|
XR_OPENXR_FORCE_BUILD=false
|
||||||
XR_OPENXR_FORCE_REBUILD=false
|
XR_OPENXR_FORCE_REBUILD=false
|
||||||
XR_OPENXR_SKIP=false
|
XR_OPENXR_SKIP=false
|
||||||
@@ -1029,7 +1030,7 @@ Those libraries should be available as packages in all recent distributions (opt
|
|||||||
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
||||||
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
||||||
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
|
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
|
||||||
* libsdl1.2, libglew, [libglewmx].\""
|
* libsdl2, libglew, [libglewmx].\""
|
||||||
|
|
||||||
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
||||||
|
|
||||||
@@ -1535,11 +1536,13 @@ _update_deps_tbb() {
|
|||||||
OSD_FORCE_REBUILD=true
|
OSD_FORCE_REBUILD=true
|
||||||
OPENVDB_FORCE_REBUILD=true
|
OPENVDB_FORCE_REBUILD=true
|
||||||
USD_FORCE_REBUILD=true
|
USD_FORCE_REBUILD=true
|
||||||
|
EMBREE_FORCE_REBUILD=true
|
||||||
OIDN_FORCE_REBUILD=true
|
OIDN_FORCE_REBUILD=true
|
||||||
if [ "$_is_building" = true ]; then
|
if [ "$_is_building" = true ]; then
|
||||||
OSD_FORCE_BUILD=true
|
OSD_FORCE_BUILD=true
|
||||||
OPENVDB_FORCE_BUILD=true
|
OPENVDB_FORCE_BUILD=true
|
||||||
USD_FORCE_BUILD=true
|
USD_FORCE_BUILD=true
|
||||||
|
EMBREE_FORCE_BUILD=true
|
||||||
OIDN_FORCE_BUILD=true
|
OIDN_FORCE_BUILD=true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -2985,7 +2988,7 @@ compile_Embree() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# To be changed each time we make edits that would modify the compiled results!
|
# To be changed each time we make edits that would modify the compiled results!
|
||||||
embree_magic=9
|
embree_magic=10
|
||||||
_init_embree
|
_init_embree
|
||||||
|
|
||||||
# Clean install if needed!
|
# Clean install if needed!
|
||||||
@@ -3039,9 +3042,13 @@ compile_Embree() {
|
|||||||
cmake_d="$cmake_d -D EMBREE_RAY_MASK=ON"
|
cmake_d="$cmake_d -D EMBREE_RAY_MASK=ON"
|
||||||
cmake_d="$cmake_d -D EMBREE_FILTER_FUNCTION=ON"
|
cmake_d="$cmake_d -D EMBREE_FILTER_FUNCTION=ON"
|
||||||
cmake_d="$cmake_d -D EMBREE_BACKFACE_CULLING=OFF"
|
cmake_d="$cmake_d -D EMBREE_BACKFACE_CULLING=OFF"
|
||||||
cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=INTERNAL"
|
|
||||||
cmake_d="$cmake_d -D EMBREE_MAX_ISA=AVX2"
|
cmake_d="$cmake_d -D EMBREE_MAX_ISA=AVX2"
|
||||||
|
|
||||||
|
cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=TBB"
|
||||||
|
if [ -d $INST/tbb ]; then
|
||||||
|
make_d="$make_d EMBREE_TBB_ROOT=$INST/tbb"
|
||||||
|
fi
|
||||||
|
|
||||||
cmake $cmake_d ../
|
cmake $cmake_d ../
|
||||||
|
|
||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
@@ -3517,7 +3524,7 @@ install_DEB() {
|
|||||||
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
|
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
|
||||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
||||||
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||||
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
|
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
|
||||||
# libglewmx-dev (broken in deb testing currently...)
|
# libglewmx-dev (broken in deb testing currently...)
|
||||||
|
|
||||||
VORBIS_USE=true
|
VORBIS_USE=true
|
||||||
@@ -3668,9 +3675,11 @@ install_DEB() {
|
|||||||
INFO "Forced Python/NumPy building, as requested..."
|
INFO "Forced Python/NumPy building, as requested..."
|
||||||
_do_compile_python=true
|
_do_compile_python=true
|
||||||
else
|
else
|
||||||
check_package_DEB python$PYTHON_VERSION_MIN-dev
|
check_package_version_ge_DEB python3-dev $PYTHON_VERSION_MIN
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
install_packages_DEB python$PYTHON_VERSION_MIN-dev
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
|
install_packages_DEB python3-dev
|
||||||
clean_Python
|
clean_Python
|
||||||
PRINT ""
|
PRINT ""
|
||||||
if [ "$NUMPY_SKIP" = true ]; then
|
if [ "$NUMPY_SKIP" = true ]; then
|
||||||
@@ -4163,7 +4172,7 @@ install_RPM() {
|
|||||||
THEORA_DEV="libtheora-devel"
|
THEORA_DEV="libtheora-devel"
|
||||||
|
|
||||||
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
|
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
|
||||||
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL-devel \
|
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
|
||||||
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
||||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||||
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
||||||
@@ -4290,8 +4299,10 @@ install_RPM() {
|
|||||||
INFO "Forced Python/NumPy building, as requested..."
|
INFO "Forced Python/NumPy building, as requested..."
|
||||||
_do_compile_python=true
|
_do_compile_python=true
|
||||||
else
|
else
|
||||||
check_package_version_match_RPM python3-devel $PYTHON_VERSION_MIN
|
check_package_version_ge_RPM python3-devel $PYTHON_VERSION_MIN
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
install_packages_RPM python3-devel
|
install_packages_RPM python3-devel
|
||||||
clean_Python
|
clean_Python
|
||||||
PRINT ""
|
PRINT ""
|
||||||
@@ -4724,7 +4735,7 @@ install_ARCH() {
|
|||||||
|
|
||||||
_packages="$BASE_DEVEL git cmake \
|
_packages="$BASE_DEVEL git cmake \
|
||||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||||
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw \
|
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
|
||||||
libxml2 yaml-cpp tinyxml python-requests jemalloc"
|
libxml2 yaml-cpp tinyxml python-requests jemalloc"
|
||||||
|
|
||||||
OPENJPEG_USE=true
|
OPENJPEG_USE=true
|
||||||
@@ -4815,6 +4826,8 @@ install_ARCH() {
|
|||||||
else
|
else
|
||||||
check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
|
check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
|
||||||
|
|
||||||
install_packages_ARCH python
|
install_packages_ARCH python
|
||||||
clean_Python
|
clean_Python
|
||||||
PRINT ""
|
PRINT ""
|
||||||
@@ -5405,11 +5418,11 @@ print_info() {
|
|||||||
PRINT " $_1"
|
PRINT " $_1"
|
||||||
_buildargs="$_buildargs $_1"
|
_buildargs="$_buildargs $_1"
|
||||||
|
|
||||||
_1="-D PYTHON_VERSION=$PYTHON_VERSION_MIN"
|
_1="-D PYTHON_VERSION=$PYTHON_VERSION_INSTALLED"
|
||||||
PRINT " $_1"
|
PRINT " $_1"
|
||||||
_buildargs="$_buildargs $_1"
|
_buildargs="$_buildargs $_1"
|
||||||
if [ -d "$INST/python-$PYTHON_VERSION_MIN" ]; then
|
if [ -d "$INST/python-$PYTHON_VERSION_INSTALLED" ]; then
|
||||||
_1="-D PYTHON_ROOT_DIR=$INST/python-$PYTHON_VERSION_MIN"
|
_1="-D PYTHON_ROOT_DIR=$INST/python-$PYTHON_VERSION_INSTALLED"
|
||||||
PRINT " $_1"
|
PRINT " $_1"
|
||||||
_buildargs="$_buildargs $_1"
|
_buildargs="$_buildargs $_1"
|
||||||
fi
|
fi
|
||||||
|
36
build_files/build_environment/patches/openimageio.diff
Normal file
36
build_files/build_environment/patches/openimageio.diff
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
diff -Naur orig/CMakeLists.txt external_openimageio/CMakeLists.txt
|
||||||
|
--- orig/CMakeLists.txt 2020-05-10 21:43:52 -0600
|
||||||
|
+++ external_openimageio/CMakeLists.txt 2020-05-13 17:03:35 -0600
|
||||||
|
@@ -170,7 +170,7 @@
|
||||||
|
add_subdirectory (src/iinfo)
|
||||||
|
add_subdirectory (src/maketx)
|
||||||
|
add_subdirectory (src/oiiotool)
|
||||||
|
- add_subdirectory (src/testtex)
|
||||||
|
+ #add_subdirectory (src/testtex)
|
||||||
|
add_subdirectory (src/iv)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
diff -Naur orig/src/cmake/compiler.cmake external_openimageio/src/cmake/compiler.cmake
|
||||||
|
--- orig/src/cmake/compiler.cmake 2020-05-10 21:43:52 -0600
|
||||||
|
+++ external_openimageio/src/cmake/compiler.cmake 2020-05-13 17:02:54 -0600
|
||||||
|
@@ -172,6 +172,7 @@
|
||||||
|
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
|
||||||
|
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
|
||||||
|
add_definitions (-DJAS_WIN_MSVC_BUILD)
|
||||||
|
+ add_definitions (-DOPJ_STATIC)
|
||||||
|
endif (MSVC)
|
||||||
|
|
||||||
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
|
||||||
|
diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/include/OpenImageIO/platform.h
|
||||||
|
--- orig/src/include/OpenImageIO/platform.h 2020-05-10 21:43:52 -0600
|
||||||
|
+++ external_openimageio/src/include/OpenImageIO/platform.h 2020-05-13 17:04:36 -0600
|
||||||
|
@@ -41,6 +41,9 @@
|
||||||
|
# ifndef NOMINMAX
|
||||||
|
# define NOMINMAX
|
||||||
|
# endif
|
||||||
|
+# ifndef NOGDI
|
||||||
|
+# define NOGDI
|
||||||
|
+# endif
|
||||||
|
# include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
@@ -1,26 +0,0 @@
|
|||||||
Index: OpenImageIO/osdep.h
|
|
||||||
===================================================================
|
|
||||||
--- OpenImageIO/osdep.h (revision 61595)
|
|
||||||
+++ OpenImageIO/osdep.h (working copy)
|
|
||||||
@@ -34,6 +34,7 @@
|
|
||||||
# define WIN32_LEAN_AND_MEAN
|
|
||||||
# define VC_EXTRALEAN
|
|
||||||
# define NOMINMAX
|
|
||||||
+# define NOGDI
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Index: OpenImageIO/platform.h
|
|
||||||
===================================================================
|
|
||||||
--- OpenImageIO/platform.h (revision 61595)
|
|
||||||
+++ OpenImageIO/platform.h (working copy)
|
|
||||||
@@ -77,6 +77,9 @@
|
|
||||||
# ifndef NOMINMAX
|
|
||||||
# define NOMINMAX
|
|
||||||
# endif
|
|
||||||
+# ifndef NOGDI
|
|
||||||
+# define NOGDI
|
|
||||||
+# endif
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
@@ -1,22 +0,0 @@
|
|||||||
diff -Naur external_openimageio.orig/src/cmake/compiler.cmake external_openimageio/src/cmake/compiler.cmake
|
|
||||||
--- external_openimageio.orig/src/cmake/compiler.cmake 2018-07-31 23:45:19 -0600
|
|
||||||
+++ external_openimageio/src/cmake/compiler.cmake 2018-08-16 12:50:12 -0600
|
|
||||||
@@ -152,6 +152,7 @@
|
|
||||||
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
|
|
||||||
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
|
|
||||||
add_definitions (-DJAS_WIN_MSVC_BUILD)
|
|
||||||
+ add_definitions (-DOPJ_STATIC)
|
|
||||||
endif (MSVC)
|
|
||||||
|
|
||||||
# Use ccache if found
|
|
||||||
--- external_openimageio.orig/CMakeLists.txt 2018-07-31 23:45:19 -0600
|
|
||||||
+++ external_openimageio/CMakeLists.txt 2018-08-17 15:22:56 -0600
|
|
||||||
@@ -169,7 +169,7 @@
|
|
||||||
add_subdirectory (src/iinfo)
|
|
||||||
add_subdirectory (src/maketx)
|
|
||||||
add_subdirectory (src/oiiotool)
|
|
||||||
- add_subdirectory (src/testtex)
|
|
||||||
+# add_subdirectory (src/testtex)
|
|
||||||
add_subdirectory (src/iv)
|
|
||||||
endif ()
|
|
||||||
|
|
@@ -48,3 +48,22 @@ diff -Naur OpenShadingLanguage-Release-1.9.9/src/liboslexec/llvm_util.cpp extern
|
|||||||
|
|
||||||
size_t
|
size_t
|
||||||
LLVM_Util::total_jit_memory_held ()
|
LLVM_Util::total_jit_memory_held ()
|
||||||
|
diff -Naur OpenShadingLanguage-Release-1.9.9/CMakeLists.txt external_osl/CMakeLists.txt
|
||||||
|
--- orig/CMakeLists.txt 2020-01-27 16:22:31 -0700
|
||||||
|
+++ external_osl/CMakeLists.txt 2020-05-13 18:04:52 -0600
|
||||||
|
@@ -102,10 +102,11 @@
|
||||||
|
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
|
||||||
|
set (CUDA_TARGET_ARCH "sm_35" CACHE STRING "CUDA GPU architecture (e.g. sm_35)")
|
||||||
|
|
||||||
|
-# set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
|
||||||
|
-# if (USE_OIIO_STATIC)
|
||||||
|
-# add_definitions ("-DOIIO_STATIC_BUILD=1")
|
||||||
|
-# endif ()
|
||||||
|
+set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
|
||||||
|
+if (USE_OIIO_STATIC)
|
||||||
|
+ add_definitions ("-DOIIO_STATIC_BUILD=1")
|
||||||
|
+ add_definitions ("-DOIIO_STATIC_DEFINE=1")
|
||||||
|
+endif ()
|
||||||
|
|
||||||
|
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
|
||||||
|
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
@@ -78,27 +78,26 @@ class VersionInfo:
|
|||||||
blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
|
blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
|
||||||
|
|
||||||
version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
|
version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
|
||||||
self.version = "%d.%d" % (version_number // 100, version_number % 100)
|
version_number_patch = int(self._parse_header_file(blender_h, 'BLENDER_VERSION_PATCH'))
|
||||||
self.version_char = self._parse_header_file(blender_h, 'BLENDER_VERSION_CHAR')
|
version_numbers = (version_number // 100, version_number % 100, version_number_patch)
|
||||||
|
self.short_version = "%d.%02d" % (version_numbers[0], version_numbers[1])
|
||||||
|
self.version = "%d.%02d.%d" % version_numbers
|
||||||
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
|
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
|
||||||
self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER')
|
self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER')
|
||||||
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
|
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
|
||||||
|
|
||||||
if self.version_cycle == "release":
|
if self.version_cycle == "release":
|
||||||
# Final release
|
# Final release
|
||||||
self.full_version = self.version + self.version_char
|
self.full_version = self.version
|
||||||
self.is_development_build = False
|
self.is_development_build = False
|
||||||
elif self.version_cycle == "rc":
|
elif self.version_cycle == "rc":
|
||||||
# Release candidate
|
# Release candidate
|
||||||
version_cycle = self.version_cycle + self.version_cycle_number
|
version_cycle = self.version_cycle + self.version_cycle_number
|
||||||
if len(self.version_char) == 0:
|
|
||||||
self.full_version = self.version + version_cycle
|
self.full_version = self.version + version_cycle
|
||||||
else:
|
|
||||||
self.full_version = self.version + self.version_char + '-' + version_cycle
|
|
||||||
self.is_development_build = False
|
self.is_development_build = False
|
||||||
else:
|
else:
|
||||||
# Development build
|
# Development build
|
||||||
self.full_version = self.version + self.version_char + '-' + self.hash
|
self.full_version = self.version + '-' + self.hash
|
||||||
self.is_development_build = True
|
self.is_development_build = True
|
||||||
|
|
||||||
def _parse_header_file(self, filename, define):
|
def _parse_header_file(self, filename, define):
|
||||||
|
@@ -167,7 +167,7 @@ def pack_linux(builder):
|
|||||||
buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable])
|
buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable])
|
||||||
|
|
||||||
print("Stripping python...")
|
print("Stripping python...")
|
||||||
py_target = os.path.join(builder.install_dir, info.version)
|
py_target = os.path.join(builder.install_dir, info.short_version)
|
||||||
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
|
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
|
||||||
|
|
||||||
# Construct package name
|
# Construct package name
|
||||||
|
@@ -756,8 +756,7 @@ function(get_blender_version)
|
|||||||
# - BLENDER_VERSION (major.minor)
|
# - BLENDER_VERSION (major.minor)
|
||||||
# - BLENDER_VERSION_MAJOR
|
# - BLENDER_VERSION_MAJOR
|
||||||
# - BLENDER_VERSION_MINOR
|
# - BLENDER_VERSION_MINOR
|
||||||
# - BLENDER_SUBVERSION (used for internal versioning mainly)
|
# - BLENDER_VERSION_PATCH
|
||||||
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
|
|
||||||
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
|
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
|
||||||
|
|
||||||
# So cmake depends on BKE_blender.h, beware of inf-loops!
|
# So cmake depends on BKE_blender.h, beware of inf-loops!
|
||||||
@@ -767,25 +766,15 @@ function(get_blender_version)
|
|||||||
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
|
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
|
||||||
|
|
||||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
|
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
|
||||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}")
|
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" _out_version_patch "${_contents}")
|
||||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}")
|
|
||||||
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
|
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
|
||||||
|
|
||||||
if(NOT ${_out_version} MATCHES "[0-9]+")
|
if(NOT ${_out_version} MATCHES "[0-9]+")
|
||||||
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
|
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ${_out_subversion} MATCHES "[0-9]+")
|
if(NOT ${_out_version_patch} MATCHES "[0-9]+")
|
||||||
message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
|
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_PATCH")
|
||||||
endif()
|
|
||||||
|
|
||||||
# clumsy regex, only single char are ok but it could be unset
|
|
||||||
|
|
||||||
string(LENGTH "${_out_version_char}" _out_version_char_len)
|
|
||||||
if(NOT _out_version_char_len EQUAL 1)
|
|
||||||
set(_out_version_char "")
|
|
||||||
elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
|
|
||||||
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
|
if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
|
||||||
@@ -795,23 +784,11 @@ function(get_blender_version)
|
|||||||
math(EXPR _out_version_major "${_out_version} / 100")
|
math(EXPR _out_version_major "${_out_version} / 100")
|
||||||
math(EXPR _out_version_minor "${_out_version} % 100")
|
math(EXPR _out_version_minor "${_out_version} % 100")
|
||||||
|
|
||||||
# for packaging, alpha to numbers
|
|
||||||
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
|
|
||||||
if(${_out_version_char_empty})
|
|
||||||
set(_out_version_char_index "0")
|
|
||||||
else()
|
|
||||||
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
|
|
||||||
list(FIND _char_ls ${_out_version_char} _out_version_char_index)
|
|
||||||
math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# output vars
|
# output vars
|
||||||
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
|
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
|
||||||
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
|
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
|
||||||
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
|
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
|
||||||
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
|
set(BLENDER_VERSION_PATCH "${_out_version_patch}" PARENT_SCOPE)
|
||||||
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
|
|
||||||
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
|
|
||||||
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
|
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@@ -7,7 +7,7 @@ set(PROJECT_VENDOR "Blender Foundation")
|
|||||||
|
|
||||||
set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
|
set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
|
||||||
set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
|
set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
|
||||||
set(PATCH_VERSION ${BLENDER_VERSION_CHAR_INDEX})
|
set(PATCH_VERSION ${BLENDER_VERSION_PATCH})
|
||||||
|
|
||||||
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||||
set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
|
set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
|
||||||
|
@@ -478,7 +478,7 @@ if(WITH_OPENIMAGEIO)
|
|||||||
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
|
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
|
||||||
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
|
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
|
||||||
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
|
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
|
||||||
add_definitions(-DOIIO_STATIC_BUILD)
|
add_definitions(-DOIIO_STATIC_DEFINE)
|
||||||
add_definitions(-DOIIO_NO_SSE=1)
|
add_definitions(-DOIIO_NO_SSE=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -7,15 +7,14 @@ BASE_DIR="$PWD"
|
|||||||
|
|
||||||
blender_srcdir=$(dirname -- $0)/../..
|
blender_srcdir=$(dirname -- $0)/../..
|
||||||
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||||
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
blender_version_patch=$(grep "BLENDER_VERSION_PATCH\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||||
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
||||||
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
|
|
||||||
|
|
||||||
|
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100).$blender_version_patch
|
||||||
if [ "$blender_version_cycle" = "release" ] ; then
|
if [ "$blender_version_cycle" = "release" ] ; then
|
||||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
|
|
||||||
SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
|
SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
|
||||||
else
|
else
|
||||||
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
|
VERSION=$VERSION-$blender_version_cycle
|
||||||
SUBMODULE_EXCLUDE="^$" # dummy regex
|
SUBMODULE_EXCLUDE="^$" # dummy regex
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -119,4 +119,24 @@ Examples
|
|||||||
To try these examples, just copy them into Blenders text editor and execute them.
|
To try these examples, just copy them into Blenders text editor and execute them.
|
||||||
To keep the examples relatively small, they just register a draw function that can't easily be removed anymore.
|
To keep the examples relatively small, they just register a draw function that can't easily be removed anymore.
|
||||||
Blender has to be restarted in order to delete the draw handlers.
|
Blender has to be restarted in order to delete the draw handlers.
|
||||||
|
|
||||||
|
3D Lines with Single Color
|
||||||
|
--------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import bpy
|
||||||
|
import gpu
|
||||||
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
|
coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)]
|
||||||
|
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||||
|
batch = batch_for_shader(shader, 'LINES', {"pos": coords})
|
||||||
|
|
||||||
|
|
||||||
|
def draw():
|
||||||
|
shader.bind()
|
||||||
|
shader.uniform_float("color", (1, 1, 0, 1))
|
||||||
|
batch.draw(shader)
|
||||||
|
|
||||||
|
|
||||||
|
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
||||||
|
@@ -1,41 +1,65 @@
|
|||||||
"""
|
"""
|
||||||
Rendering the 3D View into a Texture
|
Custom Shader for dotted 3D Line
|
||||||
------------------------------------
|
--------------------------------
|
||||||
|
|
||||||
The scene has to have a camera for this example to work.
|
In this example the arc length (distance to the first point on the line) is calculated in every vertex.
|
||||||
You could also make this independent of a specific camera,
|
Between the vertex and fragment shader that value is automatically interpolated
|
||||||
but Blender does not expose good functions to create view and projection matrices yet.
|
for all points that will be visible on the screen.
|
||||||
|
In the fragment shader the ``sin`` of the arc length is calculated.
|
||||||
|
Based on the result a decision is made on whether the fragment should be drawn or not.
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import bgl
|
|
||||||
import gpu
|
import gpu
|
||||||
from gpu_extras.presets import draw_texture_2d
|
from random import random
|
||||||
|
from mathutils import Vector
|
||||||
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
WIDTH = 512
|
vertex_shader = '''
|
||||||
HEIGHT = 256
|
uniform mat4 u_ViewProjectionMatrix;
|
||||||
|
|
||||||
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
|
in vec3 position;
|
||||||
|
in float arcLength;
|
||||||
|
|
||||||
|
out float v_ArcLength;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
v_ArcLength = arcLength;
|
||||||
|
gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
fragment_shader = '''
|
||||||
|
uniform float u_Scale;
|
||||||
|
|
||||||
|
in float v_ArcLength;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
|
||||||
|
gl_FragColor = vec4(1.0);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
coords = [Vector((random(), random(), random())) * 5 for _ in range(5)]
|
||||||
|
|
||||||
|
arc_lengths = [0]
|
||||||
|
for a, b in zip(coords[:-1], coords[1:]):
|
||||||
|
arc_lengths.append(arc_lengths[-1] + (a - b).length)
|
||||||
|
|
||||||
|
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
||||||
|
batch = batch_for_shader(
|
||||||
|
shader, 'LINE_STRIP',
|
||||||
|
{"position": coords, "arcLength": arc_lengths},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
context = bpy.context
|
shader.bind()
|
||||||
scene = context.scene
|
matrix = bpy.context.region_data.perspective_matrix
|
||||||
|
shader.uniform_float("u_ViewProjectionMatrix", matrix)
|
||||||
view_matrix = scene.camera.matrix_world.inverted()
|
shader.uniform_float("u_Scale", 10)
|
||||||
|
batch.draw(shader)
|
||||||
projection_matrix = scene.camera.calc_matrix_camera(
|
|
||||||
context.evaluated_depsgraph_get(), x=WIDTH, y=HEIGHT)
|
|
||||||
|
|
||||||
offscreen.draw_view3d(
|
|
||||||
scene,
|
|
||||||
context.view_layer,
|
|
||||||
context.space_data,
|
|
||||||
context.region,
|
|
||||||
view_matrix,
|
|
||||||
projection_matrix)
|
|
||||||
|
|
||||||
bgl.glDisable(bgl.GL_DEPTH_TEST)
|
|
||||||
draw_texture_2d(offscreen.color_texture, (10, 10), WIDTH, HEIGHT)
|
|
||||||
|
|
||||||
|
|
||||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
|
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
"""
|
|
||||||
Custom Shader for dotted 3D Line
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
In this example the arc length (distance to the first point on the line) is calculated in every vertex.
|
|
||||||
Between the vertex and fragment shader that value is automatically interpolated
|
|
||||||
for all points that will be visible on the screen.
|
|
||||||
In the fragment shader the ``sin`` of the arc length is calculated.
|
|
||||||
Based on the result a decision is made on whether the fragment should be drawn or not.
|
|
||||||
"""
|
|
||||||
import bpy
|
|
||||||
import gpu
|
|
||||||
from random import random
|
|
||||||
from mathutils import Vector
|
|
||||||
from gpu_extras.batch import batch_for_shader
|
|
||||||
|
|
||||||
vertex_shader = '''
|
|
||||||
uniform mat4 u_ViewProjectionMatrix;
|
|
||||||
|
|
||||||
in vec3 position;
|
|
||||||
in float arcLength;
|
|
||||||
|
|
||||||
out float v_ArcLength;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
v_ArcLength = arcLength;
|
|
||||||
gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
|
|
||||||
fragment_shader = '''
|
|
||||||
uniform float u_Scale;
|
|
||||||
|
|
||||||
in float v_ArcLength;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
|
|
||||||
gl_FragColor = vec4(1.0);
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
|
|
||||||
coords = [Vector((random(), random(), random())) * 5 for _ in range(5)]
|
|
||||||
|
|
||||||
arc_lengths = [0]
|
|
||||||
for a, b in zip(coords[:-1], coords[1:]):
|
|
||||||
arc_lengths.append(arc_lengths[-1] + (a - b).length)
|
|
||||||
|
|
||||||
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
|
||||||
batch = batch_for_shader(
|
|
||||||
shader, 'LINE_STRIP',
|
|
||||||
{"position": coords, "arcLength": arc_lengths},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
|
||||||
shader.bind()
|
|
||||||
matrix = bpy.context.region_data.perspective_matrix
|
|
||||||
shader.uniform_float("u_ViewProjectionMatrix", matrix)
|
|
||||||
shader.uniform_float("u_Scale", 10)
|
|
||||||
batch.draw(shader)
|
|
||||||
|
|
||||||
|
|
||||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
|
@@ -1,19 +1,45 @@
|
|||||||
"""
|
"""
|
||||||
3D Lines with Single Color
|
Triangle with Custom Shader
|
||||||
--------------------------
|
---------------------------
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
from gpu_extras.batch import batch_for_shader
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)]
|
vertex_shader = '''
|
||||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
uniform mat4 viewProjectionMatrix;
|
||||||
batch = batch_for_shader(shader, 'LINES', {"pos": coords})
|
|
||||||
|
in vec3 position;
|
||||||
|
out vec3 pos;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
pos = position;
|
||||||
|
gl_Position = viewProjectionMatrix * vec4(position, 1.0f);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
fragment_shader = '''
|
||||||
|
uniform float brightness;
|
||||||
|
|
||||||
|
in vec3 pos;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_FragColor = vec4(pos * brightness, 1.0);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
coords = [(1, 1, 1), (2, 0, 0), (-2, -1, 3)]
|
||||||
|
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
||||||
|
batch = batch_for_shader(shader, 'TRIS', {"position": coords})
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
shader.bind()
|
shader.bind()
|
||||||
shader.uniform_float("color", (1, 1, 0, 1))
|
matrix = bpy.context.region_data.perspective_matrix
|
||||||
|
shader.uniform_float("viewProjectionMatrix", matrix)
|
||||||
|
shader.uniform_float("brightness", 0.5)
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,45 +1,29 @@
|
|||||||
"""
|
"""
|
||||||
Triangle with Custom Shader
|
Wireframe Cube using Index Buffer
|
||||||
---------------------------
|
---------------------------------
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
from gpu_extras.batch import batch_for_shader
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
vertex_shader = '''
|
coords = (
|
||||||
uniform mat4 viewProjectionMatrix;
|
(-1, -1, -1), (+1, -1, -1),
|
||||||
|
(-1, +1, -1), (+1, +1, -1),
|
||||||
|
(-1, -1, +1), (+1, -1, +1),
|
||||||
|
(-1, +1, +1), (+1, +1, +1))
|
||||||
|
|
||||||
in vec3 position;
|
indices = (
|
||||||
out vec3 pos;
|
(0, 1), (0, 2), (1, 3), (2, 3),
|
||||||
|
(4, 5), (4, 6), (5, 7), (6, 7),
|
||||||
|
(0, 4), (1, 5), (2, 6), (3, 7))
|
||||||
|
|
||||||
void main()
|
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||||
{
|
batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
|
||||||
pos = position;
|
|
||||||
gl_Position = viewProjectionMatrix * vec4(position, 1.0f);
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
|
|
||||||
fragment_shader = '''
|
|
||||||
uniform float brightness;
|
|
||||||
|
|
||||||
in vec3 pos;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_FragColor = vec4(pos * brightness, 1.0);
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
|
|
||||||
coords = [(1, 1, 1), (2, 0, 0), (-2, -1, 3)]
|
|
||||||
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
|
||||||
batch = batch_for_shader(shader, 'TRIS', {"position": coords})
|
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
shader.bind()
|
shader.bind()
|
||||||
matrix = bpy.context.region_data.perspective_matrix
|
shader.uniform_float("color", (1, 0, 0, 1))
|
||||||
shader.uniform_float("viewProjectionMatrix", matrix)
|
|
||||||
shader.uniform_float("brightness", 0.5)
|
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,30 +1,39 @@
|
|||||||
"""
|
"""
|
||||||
Wireframe Cube using Index Buffer
|
Mesh with Random Vertex Colors
|
||||||
---------------------------------
|
------------------------------
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
|
import bgl
|
||||||
|
import numpy as np
|
||||||
|
from random import random
|
||||||
from gpu_extras.batch import batch_for_shader
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
coords = (
|
mesh = bpy.context.active_object.data
|
||||||
(-1, -1, -1), (+1, -1, -1),
|
mesh.calc_loop_triangles()
|
||||||
(-1, +1, -1), (+1, +1, -1),
|
|
||||||
(-1, -1, +1), (+1, -1, +1),
|
|
||||||
(-1, +1, +1), (+1, +1, +1))
|
|
||||||
|
|
||||||
indices = (
|
vertices = np.empty((len(mesh.vertices), 3), 'f')
|
||||||
(0, 1), (0, 2), (1, 3), (2, 3),
|
indices = np.empty((len(mesh.loop_triangles), 3), 'i')
|
||||||
(4, 5), (4, 6), (5, 7), (6, 7),
|
|
||||||
(0, 4), (1, 5), (2, 6), (3, 7))
|
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
mesh.vertices.foreach_get(
|
||||||
batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
|
"co", np.reshape(vertices, len(mesh.vertices) * 3))
|
||||||
|
mesh.loop_triangles.foreach_get(
|
||||||
|
"vertices", np.reshape(indices, len(mesh.loop_triangles) * 3))
|
||||||
|
|
||||||
|
vertex_colors = [(random(), random(), random(), 1) for _ in range(len(mesh.vertices))]
|
||||||
|
|
||||||
|
shader = gpu.shader.from_builtin('3D_SMOOTH_COLOR')
|
||||||
|
batch = batch_for_shader(
|
||||||
|
shader, 'TRIS',
|
||||||
|
{"pos": vertices, "color": vertex_colors},
|
||||||
|
indices=indices,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
shader.bind()
|
bgl.glEnable(bgl.GL_DEPTH_TEST)
|
||||||
shader.uniform_float("color", (1, 0, 0, 1))
|
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
bgl.glDisable(bgl.GL_DEPTH_TEST)
|
||||||
|
|
||||||
|
|
||||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
||||||
|
@@ -1,39 +1,26 @@
|
|||||||
"""
|
"""
|
||||||
Mesh with Random Vertex Colors
|
2D Rectangle
|
||||||
------------------------------
|
------------
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
import bgl
|
|
||||||
import numpy as np
|
|
||||||
from random import random
|
|
||||||
from gpu_extras.batch import batch_for_shader
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
mesh = bpy.context.active_object.data
|
vertices = (
|
||||||
mesh.calc_loop_triangles()
|
(100, 100), (300, 100),
|
||||||
|
(100, 200), (300, 200))
|
||||||
|
|
||||||
vertices = np.empty((len(mesh.vertices), 3), 'f')
|
indices = (
|
||||||
indices = np.empty((len(mesh.loop_triangles), 3), 'i')
|
(0, 1, 2), (2, 1, 3))
|
||||||
|
|
||||||
mesh.vertices.foreach_get(
|
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
|
||||||
"co", np.reshape(vertices, len(mesh.vertices) * 3))
|
batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)
|
||||||
mesh.loop_triangles.foreach_get(
|
|
||||||
"vertices", np.reshape(indices, len(mesh.loop_triangles) * 3))
|
|
||||||
|
|
||||||
vertex_colors = [(random(), random(), random(), 1) for _ in range(len(mesh.vertices))]
|
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('3D_SMOOTH_COLOR')
|
|
||||||
batch = batch_for_shader(
|
|
||||||
shader, 'TRIS',
|
|
||||||
{"pos": vertices, "color": vertex_colors},
|
|
||||||
indices=indices,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
bgl.glEnable(bgl.GL_DEPTH_TEST)
|
shader.bind()
|
||||||
|
shader.uniform_float("color", (0, 0.5, 0.5, 1.0))
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
bgl.glDisable(bgl.GL_DEPTH_TEST)
|
|
||||||
|
|
||||||
|
|
||||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
|
||||||
|
@@ -1,25 +1,36 @@
|
|||||||
"""
|
"""
|
||||||
2D Rectangle
|
2D Image
|
||||||
------------
|
--------
|
||||||
|
|
||||||
|
To use this example you have to provide an image that should be displayed.
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
|
import bgl
|
||||||
from gpu_extras.batch import batch_for_shader
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
|
||||||
vertices = (
|
IMAGE_NAME = "Untitled"
|
||||||
(100, 100), (300, 100),
|
image = bpy.data.images[IMAGE_NAME]
|
||||||
(100, 200), (300, 200))
|
|
||||||
|
|
||||||
indices = (
|
shader = gpu.shader.from_builtin('2D_IMAGE')
|
||||||
(0, 1, 2), (2, 1, 3))
|
batch = batch_for_shader(
|
||||||
|
shader, 'TRI_FAN',
|
||||||
|
{
|
||||||
|
"pos": ((100, 100), (200, 100), (200, 200), (100, 200)),
|
||||||
|
"texCoord": ((0, 0), (1, 0), (1, 1), (0, 1)),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
|
if image.gl_load():
|
||||||
batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)
|
raise Exception()
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
|
bgl.glActiveTexture(bgl.GL_TEXTURE0)
|
||||||
|
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
|
||||||
|
|
||||||
shader.bind()
|
shader.bind()
|
||||||
shader.uniform_float("color", (0, 0.5, 0.5, 1.0))
|
shader.uniform_int("image", 0)
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,37 +1,86 @@
|
|||||||
"""
|
"""
|
||||||
2D Image
|
Generate a texture using Offscreen Rendering
|
||||||
--------
|
--------------------------------------------
|
||||||
|
|
||||||
To use this example you have to provide an image that should be displayed.
|
#. Create an :class:`gpu.types.GPUOffScreen` object.
|
||||||
|
#. Draw some circles into it.
|
||||||
|
#. Make a new shader for drawing a planar texture in 3D.
|
||||||
|
#. Draw the generated texture using the new shader.
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
import bgl
|
import bgl
|
||||||
|
from mathutils import Matrix
|
||||||
from gpu_extras.batch import batch_for_shader
|
from gpu_extras.batch import batch_for_shader
|
||||||
|
from gpu_extras.presets import draw_circle_2d
|
||||||
|
|
||||||
IMAGE_NAME = "Untitled"
|
# Create and fill offscreen
|
||||||
image = bpy.data.images[IMAGE_NAME]
|
##########################################
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('2D_IMAGE')
|
offscreen = gpu.types.GPUOffScreen(512, 512)
|
||||||
|
|
||||||
|
with offscreen.bind():
|
||||||
|
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
|
||||||
|
with gpu.matrix.push_pop():
|
||||||
|
# reset matrices -> use normalized device coordinates [-1, 1]
|
||||||
|
gpu.matrix.load_matrix(Matrix.Identity(4))
|
||||||
|
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
|
||||||
|
|
||||||
|
amount = 10
|
||||||
|
for i in range(-amount, amount + 1):
|
||||||
|
x_pos = i / amount
|
||||||
|
draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, 200)
|
||||||
|
|
||||||
|
|
||||||
|
# Drawing the generated texture in 3D space
|
||||||
|
#############################################
|
||||||
|
|
||||||
|
vertex_shader = '''
|
||||||
|
uniform mat4 modelMatrix;
|
||||||
|
uniform mat4 viewProjectionMatrix;
|
||||||
|
|
||||||
|
in vec2 position;
|
||||||
|
in vec2 uv;
|
||||||
|
|
||||||
|
out vec2 uvInterp;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
uvInterp = uv;
|
||||||
|
gl_Position = viewProjectionMatrix * modelMatrix * vec4(position, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
fragment_shader = '''
|
||||||
|
uniform sampler2D image;
|
||||||
|
|
||||||
|
in vec2 uvInterp;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_FragColor = texture(image, uvInterp);
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
||||||
batch = batch_for_shader(
|
batch = batch_for_shader(
|
||||||
shader, 'TRI_FAN',
|
shader, 'TRI_FAN',
|
||||||
{
|
{
|
||||||
"pos": ((100, 100), (200, 100), (200, 200), (100, 200)),
|
"position": ((-1, -1), (1, -1), (1, 1), (-1, 1)),
|
||||||
"texCoord": ((0, 0), (1, 0), (1, 1), (0, 1)),
|
"uv": ((0, 0), (1, 0), (1, 1), (0, 1)),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if image.gl_load():
|
|
||||||
raise Exception()
|
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
bgl.glActiveTexture(bgl.GL_TEXTURE0)
|
bgl.glActiveTexture(bgl.GL_TEXTURE0)
|
||||||
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
|
bgl.glBindTexture(bgl.GL_TEXTURE_2D, offscreen.color_texture)
|
||||||
|
|
||||||
shader.bind()
|
shader.bind()
|
||||||
shader.uniform_int("image", 0)
|
shader.uniform_float("modelMatrix", Matrix.Translation((1, 2, 3)) @ Matrix.Scale(3, 4))
|
||||||
|
shader.uniform_float("viewProjectionMatrix", bpy.context.region_data.perspective_matrix)
|
||||||
|
shader.uniform_float("image", 0)
|
||||||
batch.draw(shader)
|
batch.draw(shader)
|
||||||
|
|
||||||
|
|
||||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
|
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
||||||
|
@@ -1,23 +1,28 @@
|
|||||||
"""
|
"""
|
||||||
Generate a texture using Offscreen Rendering
|
Copy Offscreen Rendering result back to RAM
|
||||||
--------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
#. Create an :class:`gpu.types.GPUOffScreen` object.
|
This will create a new image with the given name.
|
||||||
#. Draw some circles into it.
|
If it already exists, it will override the existing one.
|
||||||
#. Make a new shader for drawing a planar texture in 3D.
|
|
||||||
#. Draw the generated texture using the new shader.
|
Currently almost all of the execution time is spent in the last line.
|
||||||
|
In the future this will hopefully be solved by implementing the Python buffer protocol
|
||||||
|
for :class:`bgl.Buffer` and :class:`bpy.types.Image.pixels` (aka ``bpy_prop_array``).
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
import gpu
|
||||||
import bgl
|
import bgl
|
||||||
|
import random
|
||||||
from mathutils import Matrix
|
from mathutils import Matrix
|
||||||
from gpu_extras.batch import batch_for_shader
|
|
||||||
from gpu_extras.presets import draw_circle_2d
|
from gpu_extras.presets import draw_circle_2d
|
||||||
|
|
||||||
# Create and fill offscreen
|
IMAGE_NAME = "Generated Image"
|
||||||
##########################################
|
WIDTH = 512
|
||||||
|
HEIGHT = 512
|
||||||
|
RING_AMOUNT = 10
|
||||||
|
|
||||||
offscreen = gpu.types.GPUOffScreen(512, 512)
|
|
||||||
|
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
|
||||||
|
|
||||||
with offscreen.bind():
|
with offscreen.bind():
|
||||||
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
|
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
|
||||||
@@ -26,61 +31,20 @@ with offscreen.bind():
|
|||||||
gpu.matrix.load_matrix(Matrix.Identity(4))
|
gpu.matrix.load_matrix(Matrix.Identity(4))
|
||||||
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
|
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
|
||||||
|
|
||||||
amount = 10
|
for i in range(RING_AMOUNT):
|
||||||
for i in range(-amount, amount + 1):
|
draw_circle_2d(
|
||||||
x_pos = i / amount
|
(random.uniform(-1, 1), random.uniform(-1, 1)),
|
||||||
draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, 200)
|
(1, 1, 1, 1), random.uniform(0.1, 1), 20)
|
||||||
|
|
||||||
|
buffer = bgl.Buffer(bgl.GL_BYTE, WIDTH * HEIGHT * 4)
|
||||||
|
bgl.glReadBuffer(bgl.GL_BACK)
|
||||||
|
bgl.glReadPixels(0, 0, WIDTH, HEIGHT, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
|
||||||
|
|
||||||
|
offscreen.free()
|
||||||
|
|
||||||
|
|
||||||
# Drawing the generated texture in 3D space
|
if not IMAGE_NAME in bpy.data.images:
|
||||||
#############################################
|
bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)
|
||||||
|
image = bpy.data.images[IMAGE_NAME]
|
||||||
vertex_shader = '''
|
image.scale(WIDTH, HEIGHT)
|
||||||
uniform mat4 modelMatrix;
|
image.pixels = [v / 255 for v in buffer]
|
||||||
uniform mat4 viewProjectionMatrix;
|
|
||||||
|
|
||||||
in vec2 position;
|
|
||||||
in vec2 uv;
|
|
||||||
|
|
||||||
out vec2 uvInterp;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
uvInterp = uv;
|
|
||||||
gl_Position = viewProjectionMatrix * modelMatrix * vec4(position, 0.0, 1.0);
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
|
|
||||||
fragment_shader = '''
|
|
||||||
uniform sampler2D image;
|
|
||||||
|
|
||||||
in vec2 uvInterp;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
gl_FragColor = texture(image, uvInterp);
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
|
|
||||||
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
|
||||||
batch = batch_for_shader(
|
|
||||||
shader, 'TRI_FAN',
|
|
||||||
{
|
|
||||||
"position": ((-1, -1), (1, -1), (1, 1), (-1, 1)),
|
|
||||||
"uv": ((0, 0), (1, 0), (1, 1), (0, 1)),
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def draw():
|
|
||||||
bgl.glActiveTexture(bgl.GL_TEXTURE0)
|
|
||||||
bgl.glBindTexture(bgl.GL_TEXTURE_2D, offscreen.color_texture)
|
|
||||||
|
|
||||||
shader.bind()
|
|
||||||
shader.uniform_float("modelMatrix", Matrix.Translation((1, 2, 3)) @ Matrix.Scale(3, 4))
|
|
||||||
shader.uniform_float("viewProjectionMatrix", bpy.context.region_data.perspective_matrix)
|
|
||||||
shader.uniform_float("image", 0)
|
|
||||||
batch.draw(shader)
|
|
||||||
|
|
||||||
|
|
||||||
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
|
|
||||||
|
@@ -1,50 +1,41 @@
|
|||||||
"""
|
"""
|
||||||
Copy Offscreen Rendering result back to RAM
|
Rendering the 3D View into a Texture
|
||||||
-------------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
This will create a new image with the given name.
|
The scene has to have a camera for this example to work.
|
||||||
If it already exists, it will override the existing one.
|
You could also make this independent of a specific camera,
|
||||||
|
but Blender does not expose good functions to create view and projection matrices yet.
|
||||||
Currently almost all of the execution time is spent in the last line.
|
|
||||||
In the future this will hopefully be solved by implementing the Python buffer protocol
|
|
||||||
for :class:`bgl.Buffer` and :class:`bpy.types.Image.pixels` (aka ``bpy_prop_array``).
|
|
||||||
"""
|
"""
|
||||||
import bpy
|
import bpy
|
||||||
import gpu
|
|
||||||
import bgl
|
import bgl
|
||||||
import random
|
import gpu
|
||||||
from mathutils import Matrix
|
from gpu_extras.presets import draw_texture_2d
|
||||||
from gpu_extras.presets import draw_circle_2d
|
|
||||||
|
|
||||||
IMAGE_NAME = "Generated Image"
|
|
||||||
WIDTH = 512
|
WIDTH = 512
|
||||||
HEIGHT = 512
|
HEIGHT = 256
|
||||||
RING_AMOUNT = 10
|
|
||||||
|
|
||||||
|
|
||||||
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
|
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
|
||||||
|
|
||||||
with offscreen.bind():
|
|
||||||
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
|
|
||||||
with gpu.matrix.push_pop():
|
|
||||||
# reset matrices -> use normalized device coordinates [-1, 1]
|
|
||||||
gpu.matrix.load_matrix(Matrix.Identity(4))
|
|
||||||
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
|
|
||||||
|
|
||||||
for i in range(RING_AMOUNT):
|
def draw():
|
||||||
draw_circle_2d(
|
context = bpy.context
|
||||||
(random.uniform(-1, 1), random.uniform(-1, 1)),
|
scene = context.scene
|
||||||
(1, 1, 1, 1), random.uniform(0.1, 1), 20)
|
|
||||||
|
|
||||||
buffer = bgl.Buffer(bgl.GL_BYTE, WIDTH * HEIGHT * 4)
|
view_matrix = scene.camera.matrix_world.inverted()
|
||||||
bgl.glReadBuffer(bgl.GL_BACK)
|
|
||||||
bgl.glReadPixels(0, 0, WIDTH, HEIGHT, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
|
|
||||||
|
|
||||||
offscreen.free()
|
projection_matrix = scene.camera.calc_matrix_camera(
|
||||||
|
context.evaluated_depsgraph_get(), x=WIDTH, y=HEIGHT)
|
||||||
|
|
||||||
|
offscreen.draw_view3d(
|
||||||
|
scene,
|
||||||
|
context.view_layer,
|
||||||
|
context.space_data,
|
||||||
|
context.region,
|
||||||
|
view_matrix,
|
||||||
|
projection_matrix)
|
||||||
|
|
||||||
|
bgl.glDisable(bgl.GL_DEPTH_TEST)
|
||||||
|
draw_texture_2d(offscreen.color_texture, (10, 10), WIDTH, HEIGHT)
|
||||||
|
|
||||||
|
|
||||||
if not IMAGE_NAME in bpy.data.images:
|
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
|
||||||
bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)
|
|
||||||
image = bpy.data.images[IMAGE_NAME]
|
|
||||||
image.scale(WIDTH, HEIGHT)
|
|
||||||
image.pixels = [v / 255 for v in buffer]
|
|
||||||
|
@@ -403,32 +403,21 @@ MODULE_GROUPING = {
|
|||||||
|
|
||||||
# -------------------------------BLENDER----------------------------------------
|
# -------------------------------BLENDER----------------------------------------
|
||||||
|
|
||||||
blender_version_strings = [str(v) for v in bpy.app.version]
|
|
||||||
is_release = bpy.app.version_cycle in {"rc", "release"}
|
|
||||||
|
|
||||||
# converting bytes to strings, due to T30154
|
# converting bytes to strings, due to T30154
|
||||||
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
|
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
|
||||||
|
|
||||||
if is_release:
|
# '2.83.0 Beta' or '2.83.0' or '2.83.1'
|
||||||
# '2.62a'
|
BLENDER_VERSION_DOTS = bpy.app.version_string
|
||||||
BLENDER_VERSION_DOTS = ".".join(blender_version_strings[:2]) + bpy.app.version_char
|
|
||||||
else:
|
|
||||||
# '2.62.1'
|
|
||||||
BLENDER_VERSION_DOTS = ".".join(blender_version_strings)
|
|
||||||
|
|
||||||
if BLENDER_REVISION != "Unknown":
|
if BLENDER_REVISION != "Unknown":
|
||||||
# '2.62a SHA1' (release) or '2.62.1 SHA1' (non-release)
|
# SHA1 Git hash
|
||||||
BLENDER_VERSION_HASH = BLENDER_REVISION
|
BLENDER_VERSION_HASH = BLENDER_REVISION
|
||||||
else:
|
else:
|
||||||
# Fallback: Should not be used
|
# Fallback: Should not be used
|
||||||
BLENDER_VERSION_HASH = "Hash Unknown"
|
BLENDER_VERSION_HASH = "Hash Unknown"
|
||||||
|
|
||||||
if is_release:
|
# '2_83'
|
||||||
# '2_62a_release'
|
BLENDER_VERSION_PATH = "%d_%d" % (bpy.app.version[0], bpy.app.version[1])
|
||||||
BLENDER_VERSION_PATH = "%s%s_release" % ("_".join(blender_version_strings[:2]), bpy.app.version_char)
|
|
||||||
else:
|
|
||||||
# '2_62_1'
|
|
||||||
BLENDER_VERSION_PATH = "_".join(blender_version_strings)
|
|
||||||
|
|
||||||
# --------------------------DOWNLOADABLE FILES----------------------------------
|
# --------------------------DOWNLOADABLE FILES----------------------------------
|
||||||
|
|
||||||
@@ -699,11 +688,13 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
|
|||||||
doc = undocumented_message(module_name, type_name, identifier)
|
doc = undocumented_message(module_name, type_name, identifier)
|
||||||
|
|
||||||
if type(descr) == GetSetDescriptorType:
|
if type(descr) == GetSetDescriptorType:
|
||||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
fw(ident + ".. attribute:: %s\n" % identifier)
|
||||||
|
fw(ident + " :noindex:\n\n")
|
||||||
write_indented_lines(ident + " ", fw, doc, False)
|
write_indented_lines(ident + " ", fw, doc, False)
|
||||||
fw("\n")
|
fw("\n")
|
||||||
elif type(descr) == MemberDescriptorType: # same as above but use 'data'
|
elif type(descr) == MemberDescriptorType: # same as above but use 'data'
|
||||||
fw(ident + ".. data:: %s\n\n" % identifier)
|
fw(ident + ".. data:: %s\n" % identifier)
|
||||||
|
fw(ident + " :noindex:\n\n")
|
||||||
write_indented_lines(ident + " ", fw, doc, False)
|
write_indented_lines(ident + " ", fw, doc, False)
|
||||||
fw("\n")
|
fw("\n")
|
||||||
elif type(descr) in {MethodDescriptorType, ClassMethodDescriptorType}:
|
elif type(descr) in {MethodDescriptorType, ClassMethodDescriptorType}:
|
||||||
@@ -743,11 +734,14 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
|
|||||||
'''
|
'''
|
||||||
# readonly properties use "data" directive, variables use "attribute" directive
|
# readonly properties use "data" directive, variables use "attribute" directive
|
||||||
if py_prop.fset is None:
|
if py_prop.fset is None:
|
||||||
fw(ident + ".. data:: %s\n\n" % identifier)
|
fw(ident + ".. data:: %s\n" % identifier)
|
||||||
|
fw(ident + " :noindex:\n\n")
|
||||||
else:
|
else:
|
||||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
fw(ident + ".. attribute:: %s\n" % identifier)
|
||||||
|
fw(ident + " :noindex:\n\n")
|
||||||
write_indented_lines(ident + " ", fw, py_prop.__doc__)
|
write_indented_lines(ident + " ", fw, py_prop.__doc__)
|
||||||
if py_prop.fset is None:
|
if py_prop.fset is None:
|
||||||
|
fw("\n")
|
||||||
fw(ident + " (readonly)\n\n")
|
fw(ident + " (readonly)\n\n")
|
||||||
else:
|
else:
|
||||||
fw("\n")
|
fw("\n")
|
||||||
@@ -913,7 +907,8 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
|||||||
elif issubclass(value_type, (bool, int, float, str, tuple)):
|
elif issubclass(value_type, (bool, int, float, str, tuple)):
|
||||||
# constant, not much fun we can do here except to list it.
|
# constant, not much fun we can do here except to list it.
|
||||||
# TODO, figure out some way to document these!
|
# TODO, figure out some way to document these!
|
||||||
fw(".. data:: %s\n\n" % attribute)
|
fw(".. data:: %s\n" % attribute)
|
||||||
|
fw(" :noindex:\n\n")
|
||||||
write_indented_lines(" ", fw, "constant value %s" % repr(value), False)
|
write_indented_lines(" ", fw, "constant value %s" % repr(value), False)
|
||||||
fw("\n")
|
fw("\n")
|
||||||
else:
|
else:
|
||||||
@@ -1121,7 +1116,8 @@ def pycontext2sphinx(basepath):
|
|||||||
|
|
||||||
type_descr = prop.get_type_description(
|
type_descr = prop.get_type_description(
|
||||||
class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID)
|
class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID)
|
||||||
fw(".. data:: %s\n\n" % prop.identifier)
|
fw(".. data:: %s\n" % prop.identifier)
|
||||||
|
fw(" :noindex:\n\n")
|
||||||
if prop.description:
|
if prop.description:
|
||||||
fw(" %s\n\n" % prop.description)
|
fw(" %s\n\n" % prop.description)
|
||||||
|
|
||||||
@@ -1166,7 +1162,8 @@ def pycontext2sphinx(basepath):
|
|||||||
i = 0
|
i = 0
|
||||||
while char_array[i] is not None:
|
while char_array[i] is not None:
|
||||||
member = ctypes.string_at(char_array[i]).decode(encoding="ascii")
|
member = ctypes.string_at(char_array[i]).decode(encoding="ascii")
|
||||||
fw(".. data:: %s\n\n" % member)
|
fw(".. data:: %s\n" % member)
|
||||||
|
fw(" :noindex:\n\n")
|
||||||
member_type, is_seq = context_type_map[member]
|
member_type, is_seq = context_type_map[member]
|
||||||
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
|
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
|
||||||
unique.add(member)
|
unique.add(member)
|
||||||
@@ -1310,7 +1307,7 @@ def pyrna2sphinx(basepath):
|
|||||||
|
|
||||||
fw(title_string(title, "="))
|
fw(title_string(title, "="))
|
||||||
|
|
||||||
fw(".. module:: %s\n\n" % struct_module_name)
|
fw(".. module:: %s.%s\n\n" % (struct_module_name, struct_id))
|
||||||
|
|
||||||
# docs first?, ok
|
# docs first?, ok
|
||||||
write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id))
|
write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id))
|
||||||
@@ -1369,9 +1366,11 @@ def pyrna2sphinx(basepath):
|
|||||||
type_descr = prop.get_type_description(class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID)
|
type_descr = prop.get_type_description(class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID)
|
||||||
# readonly properties use "data" directive, variables properties use "attribute" directive
|
# readonly properties use "data" directive, variables properties use "attribute" directive
|
||||||
if 'readonly' in type_descr:
|
if 'readonly' in type_descr:
|
||||||
fw(" .. data:: %s\n\n" % prop.identifier)
|
fw(" .. data:: %s\n" % prop.identifier)
|
||||||
|
fw(" :noindex:\n\n")
|
||||||
else:
|
else:
|
||||||
fw(" .. attribute:: %s\n\n" % prop.identifier)
|
fw(" .. attribute:: %s\n" % prop.identifier)
|
||||||
|
fw(" :noindex:\n\n")
|
||||||
if prop.description:
|
if prop.description:
|
||||||
fw(" %s\n\n" % prop.description)
|
fw(" %s\n\n" % prop.description)
|
||||||
|
|
||||||
@@ -1541,7 +1540,7 @@ def pyrna2sphinx(basepath):
|
|||||||
|
|
||||||
fw(title_string(class_name, "="))
|
fw(title_string(class_name, "="))
|
||||||
|
|
||||||
fw(".. module:: %s\n" % class_module_name)
|
fw(".. module:: %s.%s\n" % (class_module_name, class_name))
|
||||||
fw("\n")
|
fw("\n")
|
||||||
|
|
||||||
if use_subclasses:
|
if use_subclasses:
|
||||||
|
@@ -36,16 +36,10 @@ fi
|
|||||||
blender_srcdir=$(dirname -- $0)/../..
|
blender_srcdir=$(dirname -- $0)/../..
|
||||||
blender_version_header="$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h"
|
blender_version_header="$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h"
|
||||||
blender_version=$(grep "BLENDER_VERSION\s" "$blender_version_header" | awk '{print $3}')
|
blender_version=$(grep "BLENDER_VERSION\s" "$blender_version_header" | awk '{print $3}')
|
||||||
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_version_header" | awk '{print $3}')
|
|
||||||
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_version_header" | awk '{print $3}')
|
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_version_header" | awk '{print $3}')
|
||||||
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_version_header" | awk '{print $3}')
|
|
||||||
unset blender_version_header
|
unset blender_version_header
|
||||||
|
|
||||||
if [ "$blender_version_cycle" = "release" ] ; then
|
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)
|
||||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
|
|
||||||
else
|
|
||||||
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
|
|
||||||
fi
|
|
||||||
|
|
||||||
SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
|
SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION
|
||||||
|
|
||||||
|
@@ -127,11 +127,10 @@ def main():
|
|||||||
" f.write('%d\\n' % is_release)\n"
|
" f.write('%d\\n' % is_release)\n"
|
||||||
" f.write('%d\\n' % is_beta)\n"
|
" f.write('%d\\n' % is_beta)\n"
|
||||||
" f.write('%s\\n' % branch)\n"
|
" f.write('%s\\n' % branch)\n"
|
||||||
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char))\n"
|
" f.write('%d.%d\\n' % (bpy.app.version[0], bpy.app.version[1]))\n"
|
||||||
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
" f.write('%d.%d\\n' % (bpy.app.version[0], bpy.app.version[1])\n"
|
||||||
" if (is_release or is_beta) else '%s\\n' % branch)\n"
|
" if (is_release or is_beta) else '%s\\n' % branch)\n"
|
||||||
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
|
" f.write('%d_%d' % (bpy.app.version[0], bpy.app.version[1]))\n"
|
||||||
" if is_release else '%d_%d_%d' % bpy.app.version)\n"
|
|
||||||
)
|
)
|
||||||
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
|
||||||
"--python-expr", getver_script, "--", getver_file)
|
"--python-expr", getver_script, "--", getver_file)
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "util/util_args.h"
|
#include "util/util_args.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/util_foreach.h"
|
||||||
#include "util/util_function.h"
|
#include "util/util_function.h"
|
||||||
|
#include "util/util_image.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/util_logging.h"
|
||||||
#include "util/util_path.h"
|
#include "util/util_path.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/util_progress.h"
|
||||||
|
@@ -85,6 +85,7 @@ def update_script_node(node, report):
|
|||||||
# write text datablock contents to temporary file
|
# write text datablock contents to temporary file
|
||||||
osl_file = tempfile.NamedTemporaryFile(mode='w', suffix=".osl", delete=False)
|
osl_file = tempfile.NamedTemporaryFile(mode='w', suffix=".osl", delete=False)
|
||||||
osl_file.write(script.as_string())
|
osl_file.write(script.as_string())
|
||||||
|
osl_file.write("\n")
|
||||||
osl_file.close()
|
osl_file.close()
|
||||||
|
|
||||||
ok, oso_path = osl_compile(osl_file.name, report)
|
ok, oso_path = osl_compile(osl_file.name, report)
|
||||||
|
@@ -1205,6 +1205,13 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
|
|||||||
default=1.0,
|
default=1.0,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
shadow_terminator_offset: FloatProperty(
|
||||||
|
name="Shadow Terminator Offset",
|
||||||
|
description="Push the shadow terminator towards the light to hide artifacts on low poly geometry",
|
||||||
|
min=0.0, max=1.0,
|
||||||
|
default=0.0,
|
||||||
|
)
|
||||||
|
|
||||||
is_shadow_catcher: BoolProperty(
|
is_shadow_catcher: BoolProperty(
|
||||||
name="Shadow Catcher",
|
name="Shadow Catcher",
|
||||||
description="Only render shadows on this object, for compositing renders into real footage",
|
description="Only render shadows on this object, for compositing renders into real footage",
|
||||||
@@ -1528,6 +1535,12 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
|
|
||||||
devices: bpy.props.CollectionProperty(type=CyclesDeviceSettings)
|
devices: bpy.props.CollectionProperty(type=CyclesDeviceSettings)
|
||||||
|
|
||||||
|
peer_memory: BoolProperty(
|
||||||
|
name="Distribute memory across devices",
|
||||||
|
description="Make more room for large scenes to fit by distributing memory across interconnected devices (e.g. via NVLink) rather than duplicating it",
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
|
|
||||||
def find_existing_device_entry(self, device):
|
def find_existing_device_entry(self, device):
|
||||||
for device_entry in self.devices:
|
for device_entry in self.devices:
|
||||||
if device_entry.id == device[2] and device_entry.type == device[1]:
|
if device_entry.id == device[2] and device_entry.type == device[1]:
|
||||||
@@ -1625,14 +1638,21 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(self, "compute_device_type", expand=True)
|
row.prop(self, "compute_device_type", expand=True)
|
||||||
|
|
||||||
devices = self.get_devices_for_type(self.compute_device_type)
|
if self.compute_device_type == 'NONE':
|
||||||
|
return
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
if self.compute_device_type == 'CUDA':
|
devices = self.get_devices_for_type(self.compute_device_type)
|
||||||
self._draw_devices(row, 'CUDA', devices)
|
self._draw_devices(row, self.compute_device_type, devices)
|
||||||
elif self.compute_device_type == 'OPTIX':
|
|
||||||
self._draw_devices(row, 'OPTIX', devices)
|
import _cycles
|
||||||
elif self.compute_device_type == 'OPENCL':
|
has_peer_memory = 0
|
||||||
self._draw_devices(row, 'OPENCL', devices)
|
for device in _cycles.available_devices(self.compute_device_type):
|
||||||
|
if device[3] and self.find_existing_device_entry(device).use:
|
||||||
|
has_peer_memory += 1
|
||||||
|
if has_peer_memory > 1:
|
||||||
|
row = layout.row()
|
||||||
|
row.use_property_split = True
|
||||||
|
row.prop(self, "peer_memory")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.draw_impl(self.layout, context)
|
self.draw_impl(self.layout, context)
|
||||||
|
@@ -1209,6 +1209,27 @@ def has_geometry_visibility(ob):
|
|||||||
return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
|
return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
|
||||||
(ob.instance_type == 'COLLECTION' and ob.instance_collection))
|
(ob.instance_type == 'COLLECTION' and ob.instance_collection))
|
||||||
|
|
||||||
|
class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
|
||||||
|
bl_label = "Shading"
|
||||||
|
bl_context = "object"
|
||||||
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return CyclesButtonsPanel.poll(context) and (context.object)
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
|
||||||
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||||
|
layout = self.layout
|
||||||
|
ob = context.object
|
||||||
|
cob = ob.cycles
|
||||||
|
|
||||||
|
if has_geometry_visibility(ob):
|
||||||
|
col = flow.column()
|
||||||
|
col.prop(cob, "shadow_terminator_offset")
|
||||||
|
|
||||||
class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||||
bl_label = "Visibility"
|
bl_label = "Visibility"
|
||||||
@@ -1367,7 +1388,7 @@ class CYCLES_LIGHT_PT_light(CyclesButtonsPanel, Panel):
|
|||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
if light.type in {'POINT', 'SPOT'}:
|
if light.type in {'POINT', 'SPOT'}:
|
||||||
col.prop(light, "shadow_soft_size", text="Size")
|
col.prop(light, "shadow_soft_size", text="Radius")
|
||||||
elif light.type == 'SUN':
|
elif light.type == 'SUN':
|
||||||
col.prop(light, "angle")
|
col.prop(light, "angle")
|
||||||
elif light.type == 'AREA':
|
elif light.type == 'AREA':
|
||||||
@@ -2268,6 +2289,7 @@ classes = (
|
|||||||
CYCLES_CAMERA_PT_dof_aperture,
|
CYCLES_CAMERA_PT_dof_aperture,
|
||||||
CYCLES_PT_context_material,
|
CYCLES_PT_context_material,
|
||||||
CYCLES_OBJECT_PT_motion_blur,
|
CYCLES_OBJECT_PT_motion_blur,
|
||||||
|
CYCLES_OBJECT_PT_shading,
|
||||||
CYCLES_OBJECT_PT_visibility,
|
CYCLES_OBJECT_PT_visibility,
|
||||||
CYCLES_OBJECT_PT_visibility_ray_visibility,
|
CYCLES_OBJECT_PT_visibility_ray_visibility,
|
||||||
CYCLES_OBJECT_PT_visibility_culling,
|
CYCLES_OBJECT_PT_visibility_culling,
|
||||||
|
@@ -897,7 +897,7 @@ static void ExportCurveTriangleVcol(ParticleCurveData *CData, int resol, uchar4
|
|||||||
|
|
||||||
/* Hair Curve Sync */
|
/* Hair Curve Sync */
|
||||||
|
|
||||||
void BlenderSync::sync_curve_settings()
|
void BlenderSync::sync_curve_settings(BL::Depsgraph &b_depsgraph)
|
||||||
{
|
{
|
||||||
PointerRNA csscene = RNA_pointer_get(&b_scene.ptr, "cycles_curves");
|
PointerRNA csscene = RNA_pointer_get(&b_scene.ptr, "cycles_curves");
|
||||||
|
|
||||||
@@ -949,9 +949,9 @@ void BlenderSync::sync_curve_settings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (curve_system_manager->modified_mesh(prev_curve_system_manager)) {
|
if (curve_system_manager->modified_mesh(prev_curve_system_manager)) {
|
||||||
BL::BlendData::objects_iterator b_ob;
|
BL::Depsgraph::objects_iterator b_ob;
|
||||||
|
|
||||||
for (b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
|
for (b_depsgraph.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
|
||||||
if (object_is_mesh(*b_ob)) {
|
if (object_is_mesh(*b_ob)) {
|
||||||
BL::Object::particle_systems_iterator b_psys;
|
BL::Object::particle_systems_iterator b_psys;
|
||||||
for (b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end();
|
for (b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end();
|
||||||
|
@@ -113,6 +113,10 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scen
|
|||||||
device = Device::get_multi_device(used_devices, threads, background);
|
device = Device::get_multi_device(used_devices, threads, background);
|
||||||
}
|
}
|
||||||
/* Else keep using the CPU device that was set before. */
|
/* Else keep using the CPU device that was set before. */
|
||||||
|
|
||||||
|
if (!get_boolean(cpreferences, "peer_memory")) {
|
||||||
|
device.has_peer_memory = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,12 +141,27 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scen
|
|||||||
device.multi_devices.push_back(device);
|
device.multi_devices.push_back(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Try to use the same physical devices for denoising. */
|
||||||
|
for (const DeviceInfo &cuda_device : device.multi_devices) {
|
||||||
|
if (cuda_device.type == DEVICE_CUDA) {
|
||||||
|
for (const DeviceInfo &optix_device : optix_devices) {
|
||||||
|
if (cuda_device.num == optix_device.num) {
|
||||||
|
device.id += optix_device.id;
|
||||||
|
device.denoising_devices.push_back(optix_device);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (device.denoising_devices.empty()) {
|
||||||
/* Simply use the first available OptiX device. */
|
/* Simply use the first available OptiX device. */
|
||||||
const DeviceInfo optix_device = optix_devices.front();
|
const DeviceInfo optix_device = optix_devices.front();
|
||||||
device.id += optix_device.id; /* Uniquely identify this special multi device. */
|
device.id += optix_device.id; /* Uniquely identify this special multi device. */
|
||||||
device.denoising_devices.push_back(optix_device);
|
device.denoising_devices.push_back(optix_device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
@@ -238,6 +238,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
|||||||
object_updated = true;
|
object_updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float shadow_terminator_offset = get_float(cobject, "shadow_terminator_offset");
|
||||||
|
if (shadow_terminator_offset != object->shadow_terminator_offset) {
|
||||||
|
object->shadow_terminator_offset = shadow_terminator_offset;
|
||||||
|
object_updated = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* sync the asset name for Cryptomatte */
|
/* sync the asset name for Cryptomatte */
|
||||||
BL::Object parent = b_ob.parent();
|
BL::Object parent = b_ob.parent();
|
||||||
ustring parent_name;
|
ustring parent_name;
|
||||||
|
@@ -416,10 +416,11 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject *args)
|
|||||||
for (size_t i = 0; i < devices.size(); i++) {
|
for (size_t i = 0; i < devices.size(); i++) {
|
||||||
DeviceInfo &device = devices[i];
|
DeviceInfo &device = devices[i];
|
||||||
string type_name = Device::string_from_type(device.type);
|
string type_name = Device::string_from_type(device.type);
|
||||||
PyObject *device_tuple = PyTuple_New(3);
|
PyObject *device_tuple = PyTuple_New(4);
|
||||||
PyTuple_SET_ITEM(device_tuple, 0, pyunicode_from_string(device.description.c_str()));
|
PyTuple_SET_ITEM(device_tuple, 0, pyunicode_from_string(device.description.c_str()));
|
||||||
PyTuple_SET_ITEM(device_tuple, 1, pyunicode_from_string(type_name.c_str()));
|
PyTuple_SET_ITEM(device_tuple, 1, pyunicode_from_string(type_name.c_str()));
|
||||||
PyTuple_SET_ITEM(device_tuple, 2, pyunicode_from_string(device.id.c_str()));
|
PyTuple_SET_ITEM(device_tuple, 2, pyunicode_from_string(device.id.c_str()));
|
||||||
|
PyTuple_SET_ITEM(device_tuple, 3, PyBool_FromLong(device.has_peer_memory));
|
||||||
PyTuple_SET_ITEM(ret, i, device_tuple);
|
PyTuple_SET_ITEM(ret, i, device_tuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -168,9 +168,13 @@ void BlenderSession::create_session()
|
|||||||
|
|
||||||
void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
|
void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
|
||||||
{
|
{
|
||||||
|
/* Update data, scene and depsgraph pointers. These can change after undo. */
|
||||||
this->b_data = b_data;
|
this->b_data = b_data;
|
||||||
this->b_depsgraph = b_depsgraph;
|
this->b_depsgraph = b_depsgraph;
|
||||||
this->b_scene = b_depsgraph.scene_eval();
|
this->b_scene = b_depsgraph.scene_eval();
|
||||||
|
if (sync) {
|
||||||
|
sync->reset(this->b_data, this->b_scene);
|
||||||
|
}
|
||||||
|
|
||||||
if (preview_osl) {
|
if (preview_osl) {
|
||||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||||
|
@@ -78,6 +78,14 @@ BlenderSync::~BlenderSync()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
|
||||||
|
{
|
||||||
|
/* Update data and scene pointers in case they change in session reset,
|
||||||
|
* for example after undo. */
|
||||||
|
this->b_data = b_data;
|
||||||
|
this->b_scene = b_scene;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sync */
|
/* Sync */
|
||||||
|
|
||||||
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
|
||||||
@@ -204,7 +212,7 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render,
|
|||||||
sync_film(b_v3d);
|
sync_film(b_v3d);
|
||||||
sync_shaders(b_depsgraph, b_v3d);
|
sync_shaders(b_depsgraph, b_v3d);
|
||||||
sync_images();
|
sync_images();
|
||||||
sync_curve_settings();
|
sync_curve_settings(b_depsgraph);
|
||||||
|
|
||||||
geometry_synced.clear(); /* use for objects and motion sync */
|
geometry_synced.clear(); /* use for objects and motion sync */
|
||||||
|
|
||||||
|
@@ -61,6 +61,8 @@ class BlenderSync {
|
|||||||
Progress &progress);
|
Progress &progress);
|
||||||
~BlenderSync();
|
~BlenderSync();
|
||||||
|
|
||||||
|
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
|
||||||
|
|
||||||
/* sync */
|
/* sync */
|
||||||
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
|
||||||
void sync_data(BL::RenderSettings &b_render,
|
void sync_data(BL::RenderSettings &b_render,
|
||||||
@@ -160,7 +162,7 @@ class BlenderSync {
|
|||||||
void sync_hair(Hair *hair, BL::Object &b_ob, bool motion, int motion_step = 0);
|
void sync_hair(Hair *hair, BL::Object &b_ob, bool motion, int motion_step = 0);
|
||||||
void sync_particle_hair(
|
void sync_particle_hair(
|
||||||
Geometry *geom, BL::Mesh &b_mesh, BL::Object &b_ob, bool motion, int motion_step = 0);
|
Geometry *geom, BL::Mesh &b_mesh, BL::Object &b_ob, bool motion, int motion_step = 0);
|
||||||
void sync_curve_settings();
|
void sync_curve_settings(BL::Depsgraph &b_depsgraph);
|
||||||
bool object_has_particle_hair(BL::Object b_ob);
|
bool object_has_particle_hair(BL::Object b_ob);
|
||||||
|
|
||||||
/* Camera */
|
/* Camera */
|
||||||
|
@@ -229,8 +229,6 @@ void BVH::refit_primitives(int start, int end, BoundBox &bbox, uint &visibility)
|
|||||||
|
|
||||||
curve.bounds_grow(k, &hair->curve_keys[0], &hair->curve_radius[0], bbox);
|
curve.bounds_grow(k, &hair->curve_keys[0], &hair->curve_radius[0], bbox);
|
||||||
|
|
||||||
visibility |= PATH_RAY_CURVE;
|
|
||||||
|
|
||||||
/* Motion curves. */
|
/* Motion curves. */
|
||||||
if (hair->use_motion_blur) {
|
if (hair->use_motion_blur) {
|
||||||
Attribute *attr = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
Attribute *attr = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
@@ -327,9 +325,6 @@ void BVH::pack_primitives()
|
|||||||
pack.prim_tri_index[i] = -1;
|
pack.prim_tri_index[i] = -1;
|
||||||
}
|
}
|
||||||
pack.prim_visibility[i] = ob->visibility_for_tracing();
|
pack.prim_visibility[i] = ob->visibility_for_tracing();
|
||||||
if (pack.prim_type[i] & PRIMITIVE_ALL_CURVE) {
|
|
||||||
pack.prim_visibility[i] |= PATH_RAY_CURVE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pack.prim_tri_index[i] = -1;
|
pack.prim_tri_index[i] = -1;
|
||||||
|
@@ -439,8 +439,6 @@ void BVH8::refit_node(int idx, bool leaf, BoundBox &bbox, uint &visibility)
|
|||||||
|
|
||||||
curve.bounds_grow(k, &hair->curve_keys[0], &hair->curve_radius[0], bbox);
|
curve.bounds_grow(k, &hair->curve_keys[0], &hair->curve_radius[0], bbox);
|
||||||
|
|
||||||
visibility |= PATH_RAY_CURVE;
|
|
||||||
|
|
||||||
/* Motion curves. */
|
/* Motion curves. */
|
||||||
if (hair->use_motion_blur) {
|
if (hair->use_motion_blur) {
|
||||||
Attribute *attr = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
Attribute *attr = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
|
||||||
|
@@ -885,9 +885,6 @@ BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHRefer
|
|||||||
|
|
||||||
bounds[type_index].grow(ref.bounds());
|
bounds[type_index].grow(ref.bounds());
|
||||||
visibility[type_index] |= objects[ref.prim_object()]->visibility_for_tracing();
|
visibility[type_index] |= objects[ref.prim_object()]->visibility_for_tracing();
|
||||||
if (ref.prim_type() & PRIMITIVE_ALL_CURVE) {
|
|
||||||
visibility[type_index] |= PATH_RAY_CURVE;
|
|
||||||
}
|
|
||||||
++num_new_prims;
|
++num_new_prims;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -16,11 +16,6 @@
|
|||||||
|
|
||||||
/* This class implements a ray accelerator for Cycles using Intel's Embree library.
|
/* This class implements a ray accelerator for Cycles using Intel's Embree library.
|
||||||
* It supports triangles, curves, object and deformation blur and instancing.
|
* It supports triangles, curves, object and deformation blur and instancing.
|
||||||
* Not supported are thick line segments, those have no native equivalent in Embree.
|
|
||||||
* They could be implemented using Embree's thick curves, at the expense of wasted memory.
|
|
||||||
* User defined intersections for Embree could also be an option, but since Embree only uses
|
|
||||||
* aligned BVHs for user geometry, this would come with reduced performance and/or higher memory
|
|
||||||
* usage.
|
|
||||||
*
|
*
|
||||||
* Since Embree allows object to be either curves or triangles but not both, Cycles object IDs are
|
* Since Embree allows object to be either curves or triangles but not both, Cycles object IDs are
|
||||||
* mapped to Embree IDs by multiplying by two and adding one for curves.
|
* mapped to Embree IDs by multiplying by two and adding one for curves.
|
||||||
@@ -775,6 +770,21 @@ void BVHEmbree::update_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# if RTC_VERSION >= 30900
|
||||||
|
if (!use_curves) {
|
||||||
|
unsigned char *flags = (unsigned char *)rtcSetNewGeometryBuffer(geom_id,
|
||||||
|
RTC_BUFFER_TYPE_FLAGS,
|
||||||
|
0,
|
||||||
|
RTC_FORMAT_UCHAR,
|
||||||
|
sizeof(unsigned char),
|
||||||
|
num_keys_embree);
|
||||||
|
flags[0] = RTC_CURVE_FLAG_NEIGHBOR_RIGHT;
|
||||||
|
::memset(flags + 1,
|
||||||
|
RTC_CURVE_FLAG_NEIGHBOR_RIGHT | RTC_CURVE_FLAG_NEIGHBOR_RIGHT,
|
||||||
|
num_keys_embree - 2);
|
||||||
|
flags[num_keys_embree - 1] = RTC_CURVE_FLAG_NEIGHBOR_LEFT;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
||||||
@@ -810,10 +820,18 @@ void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
|||||||
size_t prim_tri_index_size = pack.prim_index.size();
|
size_t prim_tri_index_size = pack.prim_index.size();
|
||||||
pack.prim_tri_index.resize(prim_tri_index_size + num_segments);
|
pack.prim_tri_index.resize(prim_tri_index_size + num_segments);
|
||||||
|
|
||||||
|
# if RTC_VERSION >= 30900
|
||||||
|
enum RTCGeometryType type = (!use_curves) ?
|
||||||
|
(use_ribbons ? RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE :
|
||||||
|
RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE) :
|
||||||
|
(use_ribbons ? RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE :
|
||||||
|
RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE);
|
||||||
|
# else
|
||||||
enum RTCGeometryType type = (!use_curves) ?
|
enum RTCGeometryType type = (!use_curves) ?
|
||||||
RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE :
|
RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE :
|
||||||
(use_ribbons ? RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE :
|
(use_ribbons ? RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE :
|
||||||
RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE);
|
RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE);
|
||||||
|
# endif
|
||||||
|
|
||||||
RTCGeometry geom_id = rtcNewGeometry(rtc_shared_device, type);
|
RTCGeometry geom_id = rtcNewGeometry(rtc_shared_device, type);
|
||||||
rtcSetGeometryTessellationRate(geom_id, curve_subdivisions);
|
rtcSetGeometryTessellationRate(geom_id, curve_subdivisions);
|
||||||
|
@@ -51,6 +51,7 @@ class CUDADevice : public Device {
|
|||||||
size_t map_host_used;
|
size_t map_host_used;
|
||||||
size_t map_host_limit;
|
size_t map_host_limit;
|
||||||
int can_map_host;
|
int can_map_host;
|
||||||
|
int pitch_alignment;
|
||||||
int cuDevId;
|
int cuDevId;
|
||||||
int cuDevArchitecture;
|
int cuDevArchitecture;
|
||||||
bool first_error;
|
bool first_error;
|
||||||
@@ -111,6 +112,8 @@ class CUDADevice : public Device {
|
|||||||
|
|
||||||
bool support_device(const DeviceRequestedFeatures & /*requested_features*/);
|
bool support_device(const DeviceRequestedFeatures & /*requested_features*/);
|
||||||
|
|
||||||
|
bool check_peer_access(Device *peer_device);
|
||||||
|
|
||||||
bool use_adaptive_compilation();
|
bool use_adaptive_compilation();
|
||||||
|
|
||||||
bool use_split_kernel();
|
bool use_split_kernel();
|
||||||
|
@@ -207,6 +207,7 @@ CUDADevice::CUDADevice(DeviceInfo &info, Stats &stats, Profiler &profiler, bool
|
|||||||
map_host_limit = 0;
|
map_host_limit = 0;
|
||||||
map_host_used = 0;
|
map_host_used = 0;
|
||||||
can_map_host = 0;
|
can_map_host = 0;
|
||||||
|
pitch_alignment = 0;
|
||||||
|
|
||||||
functions.loaded = false;
|
functions.loaded = false;
|
||||||
|
|
||||||
@@ -224,6 +225,9 @@ CUDADevice::CUDADevice(DeviceInfo &info, Stats &stats, Profiler &profiler, bool
|
|||||||
cuda_assert(
|
cuda_assert(
|
||||||
cuDeviceGetAttribute(&can_map_host, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, cuDevice));
|
cuDeviceGetAttribute(&can_map_host, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, cuDevice));
|
||||||
|
|
||||||
|
cuda_assert(cuDeviceGetAttribute(
|
||||||
|
&pitch_alignment, CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, cuDevice));
|
||||||
|
|
||||||
unsigned int ctx_flags = CU_CTX_LMEM_RESIZE_TO_MAX;
|
unsigned int ctx_flags = CU_CTX_LMEM_RESIZE_TO_MAX;
|
||||||
if (can_map_host) {
|
if (can_map_host) {
|
||||||
ctx_flags |= CU_CTX_MAP_HOST;
|
ctx_flags |= CU_CTX_MAP_HOST;
|
||||||
@@ -286,6 +290,49 @@ bool CUDADevice::support_device(const DeviceRequestedFeatures & /*requested_feat
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CUDADevice::check_peer_access(Device *peer_device)
|
||||||
|
{
|
||||||
|
if (peer_device == this) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (peer_device->info.type != DEVICE_CUDA && peer_device->info.type != DEVICE_OPTIX) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
CUDADevice *const peer_device_cuda = static_cast<CUDADevice *>(peer_device);
|
||||||
|
|
||||||
|
int can_access = 0;
|
||||||
|
cuda_assert(cuDeviceCanAccessPeer(&can_access, cuDevice, peer_device_cuda->cuDevice));
|
||||||
|
if (can_access == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure array access over the link is possible as well (for 3D textures)
|
||||||
|
cuda_assert(cuDeviceGetP2PAttribute(&can_access,
|
||||||
|
CU_DEVICE_P2P_ATTRIBUTE_ARRAY_ACCESS_ACCESS_SUPPORTED,
|
||||||
|
cuDevice,
|
||||||
|
peer_device_cuda->cuDevice));
|
||||||
|
if (can_access == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable peer access in both directions
|
||||||
|
{
|
||||||
|
const CUDAContextScope scope(this);
|
||||||
|
if (cuda_error(cuCtxEnablePeerAccess(peer_device_cuda->cuContext, 0))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
const CUDAContextScope scope(peer_device_cuda);
|
||||||
|
if (cuda_error(cuCtxEnablePeerAccess(cuContext, 0))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool CUDADevice::use_adaptive_compilation()
|
bool CUDADevice::use_adaptive_compilation()
|
||||||
{
|
{
|
||||||
return DebugFlags().cuda.adaptive_compile;
|
return DebugFlags().cuda.adaptive_compile;
|
||||||
@@ -674,6 +721,12 @@ void CUDADevice::load_texture_info()
|
|||||||
|
|
||||||
void CUDADevice::move_textures_to_host(size_t size, bool for_texture)
|
void CUDADevice::move_textures_to_host(size_t size, bool for_texture)
|
||||||
{
|
{
|
||||||
|
/* Break out of recursive call, which can happen when moving memory on a multi device. */
|
||||||
|
static bool any_device_moving_textures_to_host = false;
|
||||||
|
if (any_device_moving_textures_to_host) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Signal to reallocate textures in host memory only. */
|
/* Signal to reallocate textures in host memory only. */
|
||||||
move_texture_to_host = true;
|
move_texture_to_host = true;
|
||||||
|
|
||||||
@@ -687,6 +740,12 @@ void CUDADevice::move_textures_to_host(size_t size, bool for_texture)
|
|||||||
device_memory &mem = *pair.first;
|
device_memory &mem = *pair.first;
|
||||||
CUDAMem *cmem = &pair.second;
|
CUDAMem *cmem = &pair.second;
|
||||||
|
|
||||||
|
/* Can only move textures allocated on this device (and not those from peer devices).
|
||||||
|
* And need to ignore memory that is already on the host. */
|
||||||
|
if (!mem.is_resident(this) || cmem->use_mapped_host) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
bool is_texture = (mem.type == MEM_TEXTURE || mem.type == MEM_GLOBAL) &&
|
bool is_texture = (mem.type == MEM_TEXTURE || mem.type == MEM_GLOBAL) &&
|
||||||
(&mem != &texture_info);
|
(&mem != &texture_info);
|
||||||
bool is_image = is_texture && (mem.data_height > 1);
|
bool is_image = is_texture && (mem.data_height > 1);
|
||||||
@@ -696,11 +755,6 @@ void CUDADevice::move_textures_to_host(size_t size, bool for_texture)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Already in host memory. */
|
|
||||||
if (cmem->use_mapped_host) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* For other textures, only move image textures. */
|
/* For other textures, only move image textures. */
|
||||||
if (for_texture && !is_image) {
|
if (for_texture && !is_image) {
|
||||||
continue;
|
continue;
|
||||||
@@ -723,26 +777,30 @@ void CUDADevice::move_textures_to_host(size_t size, bool for_texture)
|
|||||||
static thread_mutex move_mutex;
|
static thread_mutex move_mutex;
|
||||||
thread_scoped_lock lock(move_mutex);
|
thread_scoped_lock lock(move_mutex);
|
||||||
|
|
||||||
/* Preserve the original device pointer, in case of multi device
|
any_device_moving_textures_to_host = true;
|
||||||
* we can't change it because the pointer mapping would break. */
|
|
||||||
device_ptr prev_pointer = max_mem->device_pointer;
|
|
||||||
size_t prev_size = max_mem->device_size;
|
|
||||||
|
|
||||||
mem_copy_to(*max_mem);
|
/* Potentially need to call back into multi device, so pointer mapping
|
||||||
|
* and peer devices are updated. This is also necessary since the device
|
||||||
|
* pointer may just be a key here, so cannot be accessed and freed directly.
|
||||||
|
* Unfortunately it does mean that memory is reallocated on all other
|
||||||
|
* devices as well, which is potentially dangerous when still in use (since
|
||||||
|
* a thread rendering on another devices would only be caught in this mutex
|
||||||
|
* if it so happens to do an allocation at the same time as well. */
|
||||||
|
max_mem->device_copy_to();
|
||||||
size = (max_size >= size) ? 0 : size - max_size;
|
size = (max_size >= size) ? 0 : size - max_size;
|
||||||
|
|
||||||
max_mem->device_pointer = prev_pointer;
|
any_device_moving_textures_to_host = false;
|
||||||
max_mem->device_size = prev_size;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Unset flag before texture info is reloaded, since it should stay in device memory. */
|
||||||
|
move_texture_to_host = false;
|
||||||
|
|
||||||
/* Update texture info array with new pointers. */
|
/* Update texture info array with new pointers. */
|
||||||
load_texture_info();
|
load_texture_info();
|
||||||
|
|
||||||
move_texture_to_host = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CUDADevice::CUDAMem *CUDADevice::generic_alloc(device_memory &mem, size_t pitch_padding)
|
CUDADevice::CUDAMem *CUDADevice::generic_alloc(device_memory &mem, size_t pitch_padding)
|
||||||
@@ -808,9 +866,6 @@ CUDADevice::CUDAMem *CUDADevice::generic_alloc(device_memory &mem, size_t pitch_
|
|||||||
map_host_used += size;
|
map_host_used += size;
|
||||||
status = " in host memory";
|
status = " in host memory";
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
status = " failed, out of host memory";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mem_alloc_result != CUDA_SUCCESS) {
|
if (mem_alloc_result != CUDA_SUCCESS) {
|
||||||
@@ -906,7 +961,7 @@ void CUDADevice::generic_free(device_memory &mem)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Free device memory. */
|
/* Free device memory. */
|
||||||
cuMemFree(mem.device_pointer);
|
cuda_assert(cuMemFree(mem.device_pointer));
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.mem_free(mem.device_size);
|
stats.mem_free(mem.device_size);
|
||||||
@@ -1032,18 +1087,17 @@ void CUDADevice::const_copy_to(const char *name, void *host, size_t size)
|
|||||||
|
|
||||||
void CUDADevice::global_alloc(device_memory &mem)
|
void CUDADevice::global_alloc(device_memory &mem)
|
||||||
{
|
{
|
||||||
CUDAContextScope scope(this);
|
if (mem.is_resident(this)) {
|
||||||
|
|
||||||
generic_alloc(mem);
|
generic_alloc(mem);
|
||||||
generic_copy_to(mem);
|
generic_copy_to(mem);
|
||||||
|
}
|
||||||
|
|
||||||
const_copy_to(mem.name, &mem.device_pointer, sizeof(mem.device_pointer));
|
const_copy_to(mem.name, &mem.device_pointer, sizeof(mem.device_pointer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUDADevice::global_free(device_memory &mem)
|
void CUDADevice::global_free(device_memory &mem)
|
||||||
{
|
{
|
||||||
if (mem.device_pointer) {
|
if (mem.is_resident(this) && mem.device_pointer) {
|
||||||
CUDAContextScope scope(this);
|
|
||||||
generic_free(mem);
|
generic_free(mem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1112,7 +1166,19 @@ void CUDADevice::tex_alloc(device_texture &mem)
|
|||||||
size_t src_pitch = mem.data_width * dsize * mem.data_elements;
|
size_t src_pitch = mem.data_width * dsize * mem.data_elements;
|
||||||
size_t dst_pitch = src_pitch;
|
size_t dst_pitch = src_pitch;
|
||||||
|
|
||||||
|
if (!mem.is_resident(this)) {
|
||||||
|
cmem = &cuda_mem_map[&mem];
|
||||||
|
cmem->texobject = 0;
|
||||||
|
|
||||||
if (mem.data_depth > 1) {
|
if (mem.data_depth > 1) {
|
||||||
|
array_3d = (CUarray)mem.device_pointer;
|
||||||
|
cmem->array = array_3d;
|
||||||
|
}
|
||||||
|
else if (mem.data_height > 0) {
|
||||||
|
dst_pitch = align_up(src_pitch, pitch_alignment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (mem.data_depth > 1) {
|
||||||
/* 3D texture using array, there is no API for linear memory. */
|
/* 3D texture using array, there is no API for linear memory. */
|
||||||
CUDA_ARRAY3D_DESCRIPTOR desc;
|
CUDA_ARRAY3D_DESCRIPTOR desc;
|
||||||
|
|
||||||
@@ -1156,10 +1222,7 @@ void CUDADevice::tex_alloc(device_texture &mem)
|
|||||||
}
|
}
|
||||||
else if (mem.data_height > 0) {
|
else if (mem.data_height > 0) {
|
||||||
/* 2D texture, using pitch aligned linear memory. */
|
/* 2D texture, using pitch aligned linear memory. */
|
||||||
int alignment = 0;
|
dst_pitch = align_up(src_pitch, pitch_alignment);
|
||||||
cuda_assert(
|
|
||||||
cuDeviceGetAttribute(&alignment, CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, cuDevice));
|
|
||||||
dst_pitch = align_up(src_pitch, alignment);
|
|
||||||
size_t dst_size = dst_pitch * mem.data_height;
|
size_t dst_size = dst_pitch * mem.data_height;
|
||||||
|
|
||||||
cmem = generic_alloc(mem, dst_size - mem.memory_size());
|
cmem = generic_alloc(mem, dst_size - mem.memory_size());
|
||||||
@@ -1251,7 +1314,11 @@ void CUDADevice::tex_free(device_texture &mem)
|
|||||||
cuTexObjectDestroy(cmem.texobject);
|
cuTexObjectDestroy(cmem.texobject);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmem.array) {
|
if (!mem.is_resident(this)) {
|
||||||
|
/* Do not free memory here, since it was allocated on a different device. */
|
||||||
|
cuda_mem_map.erase(cuda_mem_map.find(&mem));
|
||||||
|
}
|
||||||
|
else if (cmem.array) {
|
||||||
/* Free array. */
|
/* Free array. */
|
||||||
cuArrayDestroy(cmem.array);
|
cuArrayDestroy(cmem.array);
|
||||||
stats.mem_free(mem.device_size);
|
stats.mem_free(mem.device_size);
|
||||||
|
@@ -602,6 +602,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices,
|
|||||||
info.has_adaptive_stop_per_sample = true;
|
info.has_adaptive_stop_per_sample = true;
|
||||||
info.has_osl = true;
|
info.has_osl = true;
|
||||||
info.has_profiling = true;
|
info.has_profiling = true;
|
||||||
|
info.has_peer_memory = false;
|
||||||
|
|
||||||
foreach (const DeviceInfo &device, subdevices) {
|
foreach (const DeviceInfo &device, subdevices) {
|
||||||
/* Ensure CPU device does not slow down GPU. */
|
/* Ensure CPU device does not slow down GPU. */
|
||||||
@@ -645,6 +646,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices,
|
|||||||
info.has_adaptive_stop_per_sample &= device.has_adaptive_stop_per_sample;
|
info.has_adaptive_stop_per_sample &= device.has_adaptive_stop_per_sample;
|
||||||
info.has_osl &= device.has_osl;
|
info.has_osl &= device.has_osl;
|
||||||
info.has_profiling &= device.has_profiling;
|
info.has_profiling &= device.has_profiling;
|
||||||
|
info.has_peer_memory |= device.has_peer_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
@@ -82,6 +82,7 @@ class DeviceInfo {
|
|||||||
bool has_osl; /* Support Open Shading Language. */
|
bool has_osl; /* Support Open Shading Language. */
|
||||||
bool use_split_kernel; /* Use split or mega kernel. */
|
bool use_split_kernel; /* Use split or mega kernel. */
|
||||||
bool has_profiling; /* Supports runtime collection of profiling info. */
|
bool has_profiling; /* Supports runtime collection of profiling info. */
|
||||||
|
bool has_peer_memory; /* GPU has P2P access to memory of another GPU. */
|
||||||
int cpu_threads;
|
int cpu_threads;
|
||||||
vector<DeviceInfo> multi_devices;
|
vector<DeviceInfo> multi_devices;
|
||||||
vector<DeviceInfo> denoising_devices;
|
vector<DeviceInfo> denoising_devices;
|
||||||
@@ -99,6 +100,7 @@ class DeviceInfo {
|
|||||||
has_osl = false;
|
has_osl = false;
|
||||||
use_split_kernel = false;
|
use_split_kernel = false;
|
||||||
has_profiling = false;
|
has_profiling = false;
|
||||||
|
has_peer_memory = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const DeviceInfo &info)
|
bool operator==(const DeviceInfo &info)
|
||||||
@@ -435,6 +437,17 @@ class Device {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool is_resident(device_ptr /*key*/, Device *sub_device)
|
||||||
|
{
|
||||||
|
/* Memory is always resident if this is not a multi device, regardless of whether the pointer
|
||||||
|
* is valid or not (since it may not have been allocated yet). */
|
||||||
|
return sub_device == this;
|
||||||
|
}
|
||||||
|
virtual bool check_peer_access(Device * /*peer_device*/)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
static Device *create(DeviceInfo &info,
|
static Device *create(DeviceInfo &info,
|
||||||
Stats &stats,
|
Stats &stats,
|
||||||
|
@@ -131,6 +131,15 @@ void device_cuda_info(vector<DeviceInfo> &devices)
|
|||||||
info.has_volume_decoupled = false;
|
info.has_volume_decoupled = false;
|
||||||
info.has_adaptive_stop_per_sample = false;
|
info.has_adaptive_stop_per_sample = false;
|
||||||
|
|
||||||
|
/* Check if the device has P2P access to any other device in the system. */
|
||||||
|
for (int peer_num = 0; peer_num < count && !info.has_peer_memory; peer_num++) {
|
||||||
|
if (num != peer_num) {
|
||||||
|
int can_access = 0;
|
||||||
|
cuDeviceCanAccessPeer(&can_access, num, peer_num);
|
||||||
|
info.has_peer_memory = (can_access != 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int pci_location[3] = {0, 0, 0};
|
int pci_location[3] = {0, 0, 0};
|
||||||
cuDeviceGetAttribute(&pci_location[0], CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, num);
|
cuDeviceGetAttribute(&pci_location[0], CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, num);
|
||||||
cuDeviceGetAttribute(&pci_location[1], CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, num);
|
cuDeviceGetAttribute(&pci_location[1], CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, num);
|
||||||
|
@@ -125,6 +125,11 @@ void device_memory::restore_device()
|
|||||||
device_pointer = original_device_ptr;
|
device_pointer = original_device_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool device_memory::is_resident(Device *sub_device) const
|
||||||
|
{
|
||||||
|
return device->is_resident(device_pointer, sub_device);
|
||||||
|
}
|
||||||
|
|
||||||
/* Device Sub Ptr */
|
/* Device Sub Ptr */
|
||||||
|
|
||||||
device_sub_ptr::device_sub_ptr(device_memory &mem, int offset, int size) : device(mem.device)
|
device_sub_ptr::device_sub_ptr(device_memory &mem, int offset, int size) : device(mem.device)
|
||||||
|
@@ -230,6 +230,8 @@ class device_memory {
|
|||||||
void swap_device(Device *new_device, size_t new_device_size, device_ptr new_device_ptr);
|
void swap_device(Device *new_device, size_t new_device_size, device_ptr new_device_ptr);
|
||||||
void restore_device();
|
void restore_device();
|
||||||
|
|
||||||
|
bool is_resident(Device *sub_device) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class CUDADevice;
|
friend class CUDADevice;
|
||||||
friend class OptiXDevice;
|
friend class OptiXDevice;
|
||||||
|
@@ -34,37 +34,88 @@ CCL_NAMESPACE_BEGIN
|
|||||||
class MultiDevice : public Device {
|
class MultiDevice : public Device {
|
||||||
public:
|
public:
|
||||||
struct SubDevice {
|
struct SubDevice {
|
||||||
explicit SubDevice(Device *device_) : device(device_)
|
Stats stats;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Device *device;
|
Device *device;
|
||||||
map<device_ptr, device_ptr> ptr_map;
|
map<device_ptr, device_ptr> ptr_map;
|
||||||
|
int peer_island_index = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
list<SubDevice> devices, denoising_devices;
|
list<SubDevice> devices, denoising_devices;
|
||||||
device_ptr unique_key;
|
device_ptr unique_key;
|
||||||
|
vector<vector<SubDevice *>> peer_islands;
|
||||||
|
bool matching_rendering_and_denoising_devices;
|
||||||
|
|
||||||
MultiDevice(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background_)
|
MultiDevice(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background_)
|
||||||
: Device(info, stats, profiler, background_), unique_key(1)
|
: Device(info, stats, profiler, background_), unique_key(1)
|
||||||
{
|
{
|
||||||
foreach (DeviceInfo &subinfo, info.multi_devices) {
|
foreach (DeviceInfo &subinfo, info.multi_devices) {
|
||||||
Device *device = Device::create(subinfo, sub_stats_, profiler, background);
|
|
||||||
|
|
||||||
/* Always add CPU devices at the back since GPU devices can change
|
/* Always add CPU devices at the back since GPU devices can change
|
||||||
* host memory pointers, which CPU uses as device pointer. */
|
* host memory pointers, which CPU uses as device pointer. */
|
||||||
|
SubDevice *sub;
|
||||||
if (subinfo.type == DEVICE_CPU) {
|
if (subinfo.type == DEVICE_CPU) {
|
||||||
devices.push_back(SubDevice(device));
|
devices.emplace_back();
|
||||||
|
sub = &devices.back();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
devices.push_front(SubDevice(device));
|
devices.emplace_front();
|
||||||
|
sub = &devices.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The pointer to 'sub->stats' will stay valid even after new devices
|
||||||
|
* are added, since 'devices' is a linked list. */
|
||||||
|
sub->device = Device::create(subinfo, sub->stats, profiler, background);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (DeviceInfo &subinfo, info.denoising_devices) {
|
foreach (DeviceInfo &subinfo, info.denoising_devices) {
|
||||||
Device *device = Device::create(subinfo, sub_stats_, profiler, background);
|
denoising_devices.emplace_front();
|
||||||
|
SubDevice *sub = &denoising_devices.front();
|
||||||
|
|
||||||
denoising_devices.push_back(SubDevice(device));
|
sub->device = Device::create(subinfo, sub->stats, profiler, background);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build a list of peer islands for the available render devices */
|
||||||
|
foreach (SubDevice &sub, devices) {
|
||||||
|
/* First ensure that every device is in at least once peer island */
|
||||||
|
if (sub.peer_island_index < 0) {
|
||||||
|
peer_islands.emplace_back();
|
||||||
|
sub.peer_island_index = (int)peer_islands.size() - 1;
|
||||||
|
peer_islands[sub.peer_island_index].push_back(&sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!info.has_peer_memory) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Second check peer access between devices and fill up the islands accordingly */
|
||||||
|
foreach (SubDevice &peer_sub, devices) {
|
||||||
|
if (peer_sub.peer_island_index < 0 &&
|
||||||
|
peer_sub.device->info.type == sub.device->info.type &&
|
||||||
|
peer_sub.device->check_peer_access(sub.device)) {
|
||||||
|
peer_sub.peer_island_index = sub.peer_island_index;
|
||||||
|
peer_islands[sub.peer_island_index].push_back(&peer_sub);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Try to re-use memory when denoising and render devices use the same physical devices
|
||||||
|
* (e.g. OptiX denoising and CUDA rendering device pointing to the same GPU).
|
||||||
|
* Ordering has to match as well, so that 'DeviceTask::split' behaves consistent. */
|
||||||
|
matching_rendering_and_denoising_devices = denoising_devices.empty() ||
|
||||||
|
(devices.size() == denoising_devices.size());
|
||||||
|
if (matching_rendering_and_denoising_devices) {
|
||||||
|
for (list<SubDevice>::iterator device_it = devices.begin(),
|
||||||
|
denoising_device_it = denoising_devices.begin();
|
||||||
|
device_it != devices.end() && denoising_device_it != denoising_devices.end();
|
||||||
|
++device_it, ++denoising_device_it) {
|
||||||
|
const DeviceInfo &info = device_it->device->info;
|
||||||
|
const DeviceInfo &denoising_info = denoising_device_it->device->info;
|
||||||
|
if ((info.type != DEVICE_CUDA && info.type != DEVICE_OPTIX) ||
|
||||||
|
(denoising_info.type != DEVICE_CUDA && denoising_info.type != DEVICE_OPTIX) ||
|
||||||
|
info.num != denoising_info.num) {
|
||||||
|
matching_rendering_and_denoising_devices = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_NETWORK
|
#ifdef WITH_NETWORK
|
||||||
@@ -175,11 +226,11 @@ class MultiDevice : public Device {
|
|||||||
|
|
||||||
bool build_optix_bvh(BVH *bvh)
|
bool build_optix_bvh(BVH *bvh)
|
||||||
{
|
{
|
||||||
// Broadcast acceleration structure build to all render devices
|
/* Broadcast acceleration structure build to all render devices */
|
||||||
foreach (SubDevice &sub, devices)
|
foreach (SubDevice &sub, devices) {
|
||||||
if (!sub.device->build_optix_bvh(bvh))
|
if (!sub.device->build_optix_bvh(bvh))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,10 +242,60 @@ class MultiDevice : public Device {
|
|||||||
return devices.front().device->osl_memory();
|
return devices.front().device->osl_memory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_resident(device_ptr key, Device *sub_device)
|
||||||
|
{
|
||||||
|
foreach (SubDevice &sub, devices) {
|
||||||
|
if (sub.device == sub_device) {
|
||||||
|
return find_matching_mem_device(key, sub)->device == sub_device;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
SubDevice *find_matching_mem_device(device_ptr key, SubDevice &sub)
|
||||||
|
{
|
||||||
|
assert(key != 0 && (sub.peer_island_index >= 0 || sub.ptr_map.find(key) != sub.ptr_map.end()));
|
||||||
|
|
||||||
|
/* Get the memory owner of this key (first try current device, then peer devices) */
|
||||||
|
SubDevice *owner_sub = ⊂
|
||||||
|
if (owner_sub->ptr_map.find(key) == owner_sub->ptr_map.end()) {
|
||||||
|
foreach (SubDevice *island_sub, peer_islands[sub.peer_island_index]) {
|
||||||
|
if (island_sub != owner_sub &&
|
||||||
|
island_sub->ptr_map.find(key) != island_sub->ptr_map.end()) {
|
||||||
|
owner_sub = island_sub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return owner_sub;
|
||||||
|
}
|
||||||
|
|
||||||
|
SubDevice *find_suitable_mem_device(device_ptr key, const vector<SubDevice *> &island)
|
||||||
|
{
|
||||||
|
assert(!island.empty());
|
||||||
|
|
||||||
|
/* Get the memory owner of this key or the device with the lowest memory usage when new */
|
||||||
|
SubDevice *owner_sub = island.front();
|
||||||
|
foreach (SubDevice *island_sub, island) {
|
||||||
|
if (key ? (island_sub->ptr_map.find(key) != island_sub->ptr_map.end()) :
|
||||||
|
(island_sub->device->stats.mem_used < owner_sub->device->stats.mem_used)) {
|
||||||
|
owner_sub = island_sub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return owner_sub;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline device_ptr find_matching_mem(device_ptr key, SubDevice &sub)
|
||||||
|
{
|
||||||
|
return find_matching_mem_device(key, sub)->ptr_map[key];
|
||||||
|
}
|
||||||
|
|
||||||
void mem_alloc(device_memory &mem)
|
void mem_alloc(device_memory &mem)
|
||||||
{
|
{
|
||||||
device_ptr key = unique_key++;
|
device_ptr key = unique_key++;
|
||||||
|
|
||||||
|
if (mem.type == MEM_PIXELS) {
|
||||||
|
/* Always allocate pixels memory on all devices
|
||||||
|
* This is necessary to ensure PBOs are registered everywhere, which FILM_CONVERT uses */
|
||||||
foreach (SubDevice &sub, devices) {
|
foreach (SubDevice &sub, devices) {
|
||||||
mem.device = sub.device;
|
mem.device = sub.device;
|
||||||
mem.device_pointer = 0;
|
mem.device_pointer = 0;
|
||||||
@@ -203,6 +304,21 @@ class MultiDevice : public Device {
|
|||||||
sub.device->mem_alloc(mem);
|
sub.device->mem_alloc(mem);
|
||||||
sub.ptr_map[key] = mem.device_pointer;
|
sub.ptr_map[key] = mem.device_pointer;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assert(mem.type == MEM_READ_ONLY || mem.type == MEM_READ_WRITE ||
|
||||||
|
mem.type == MEM_DEVICE_ONLY);
|
||||||
|
/* The remaining memory types can be distributed across devices */
|
||||||
|
foreach (const vector<SubDevice *> &island, peer_islands) {
|
||||||
|
SubDevice *owner_sub = find_suitable_mem_device(key, island);
|
||||||
|
mem.device = owner_sub->device;
|
||||||
|
mem.device_pointer = 0;
|
||||||
|
mem.device_size = 0;
|
||||||
|
|
||||||
|
owner_sub->device->mem_alloc(mem);
|
||||||
|
owner_sub->ptr_map[key] = mem.device_pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mem.device = this;
|
mem.device = this;
|
||||||
mem.device_pointer = key;
|
mem.device_pointer = key;
|
||||||
@@ -215,6 +331,8 @@ class MultiDevice : public Device {
|
|||||||
device_ptr key = (existing_key) ? existing_key : unique_key++;
|
device_ptr key = (existing_key) ? existing_key : unique_key++;
|
||||||
size_t existing_size = mem.device_size;
|
size_t existing_size = mem.device_size;
|
||||||
|
|
||||||
|
/* The tile buffers are allocated on each device (see below), so copy to all of them */
|
||||||
|
if (strcmp(mem.name, "RenderBuffers") == 0) {
|
||||||
foreach (SubDevice &sub, devices) {
|
foreach (SubDevice &sub, devices) {
|
||||||
mem.device = sub.device;
|
mem.device = sub.device;
|
||||||
mem.device_pointer = (existing_key) ? sub.ptr_map[existing_key] : 0;
|
mem.device_pointer = (existing_key) ? sub.ptr_map[existing_key] : 0;
|
||||||
@@ -223,6 +341,27 @@ class MultiDevice : public Device {
|
|||||||
sub.device->mem_copy_to(mem);
|
sub.device->mem_copy_to(mem);
|
||||||
sub.ptr_map[key] = mem.device_pointer;
|
sub.ptr_map[key] = mem.device_pointer;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach (const vector<SubDevice *> &island, peer_islands) {
|
||||||
|
SubDevice *owner_sub = find_suitable_mem_device(existing_key, island);
|
||||||
|
mem.device = owner_sub->device;
|
||||||
|
mem.device_pointer = (existing_key) ? owner_sub->ptr_map[existing_key] : 0;
|
||||||
|
mem.device_size = existing_size;
|
||||||
|
|
||||||
|
owner_sub->device->mem_copy_to(mem);
|
||||||
|
owner_sub->ptr_map[key] = mem.device_pointer;
|
||||||
|
|
||||||
|
if (mem.type == MEM_GLOBAL || mem.type == MEM_TEXTURE) {
|
||||||
|
/* Need to create texture objects and update pointer in kernel globals on all devices */
|
||||||
|
foreach (SubDevice *island_sub, island) {
|
||||||
|
if (island_sub != owner_sub) {
|
||||||
|
island_sub->device->mem_copy_to(mem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mem.device = this;
|
mem.device = this;
|
||||||
mem.device_pointer = key;
|
mem.device_pointer = key;
|
||||||
@@ -238,10 +377,11 @@ class MultiDevice : public Device {
|
|||||||
int sy = y + i * sub_h;
|
int sy = y + i * sub_h;
|
||||||
int sh = (i == (int)devices.size() - 1) ? h - sub_h * i : sub_h;
|
int sh = (i == (int)devices.size() - 1) ? h - sub_h * i : sub_h;
|
||||||
|
|
||||||
mem.device = sub.device;
|
SubDevice *owner_sub = find_matching_mem_device(key, sub);
|
||||||
mem.device_pointer = sub.ptr_map[key];
|
mem.device = owner_sub->device;
|
||||||
|
mem.device_pointer = owner_sub->ptr_map[key];
|
||||||
|
|
||||||
sub.device->mem_copy_from(mem, sy, w, sh, elem);
|
owner_sub->device->mem_copy_from(mem, sy, w, sh, elem);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,6 +395,13 @@ class MultiDevice : public Device {
|
|||||||
device_ptr key = (existing_key) ? existing_key : unique_key++;
|
device_ptr key = (existing_key) ? existing_key : unique_key++;
|
||||||
size_t existing_size = mem.device_size;
|
size_t existing_size = mem.device_size;
|
||||||
|
|
||||||
|
/* This is a hack to only allocate the tile buffers on denoising devices
|
||||||
|
* Similarily the tile buffers also need to be allocated separately on all devices so any
|
||||||
|
* overlap rendered for denoising does not interfer with each other */
|
||||||
|
if (strcmp(mem.name, "RenderBuffers") == 0) {
|
||||||
|
vector<device_ptr> device_pointers;
|
||||||
|
device_pointers.reserve(devices.size());
|
||||||
|
|
||||||
foreach (SubDevice &sub, devices) {
|
foreach (SubDevice &sub, devices) {
|
||||||
mem.device = sub.device;
|
mem.device = sub.device;
|
||||||
mem.device_pointer = (existing_key) ? sub.ptr_map[existing_key] : 0;
|
mem.device_pointer = (existing_key) ? sub.ptr_map[existing_key] : 0;
|
||||||
@@ -262,10 +409,15 @@ class MultiDevice : public Device {
|
|||||||
|
|
||||||
sub.device->mem_zero(mem);
|
sub.device->mem_zero(mem);
|
||||||
sub.ptr_map[key] = mem.device_pointer;
|
sub.ptr_map[key] = mem.device_pointer;
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(mem.name, "RenderBuffers") == 0) {
|
device_pointers.push_back(mem.device_pointer);
|
||||||
|
}
|
||||||
foreach (SubDevice &sub, denoising_devices) {
|
foreach (SubDevice &sub, denoising_devices) {
|
||||||
|
if (matching_rendering_and_denoising_devices) {
|
||||||
|
sub.ptr_map[key] = device_pointers.front();
|
||||||
|
device_pointers.erase(device_pointers.begin());
|
||||||
|
}
|
||||||
|
else {
|
||||||
mem.device = sub.device;
|
mem.device = sub.device;
|
||||||
mem.device_pointer = (existing_key) ? sub.ptr_map[existing_key] : 0;
|
mem.device_pointer = (existing_key) ? sub.ptr_map[existing_key] : 0;
|
||||||
mem.device_size = existing_size;
|
mem.device_size = existing_size;
|
||||||
@@ -274,6 +426,18 @@ class MultiDevice : public Device {
|
|||||||
sub.ptr_map[key] = mem.device_pointer;
|
sub.ptr_map[key] = mem.device_pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach (const vector<SubDevice *> &island, peer_islands) {
|
||||||
|
SubDevice *owner_sub = find_suitable_mem_device(existing_key, island);
|
||||||
|
mem.device = owner_sub->device;
|
||||||
|
mem.device_pointer = (existing_key) ? owner_sub->ptr_map[existing_key] : 0;
|
||||||
|
mem.device_size = existing_size;
|
||||||
|
|
||||||
|
owner_sub->device->mem_zero(mem);
|
||||||
|
owner_sub->ptr_map[key] = mem.device_pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mem.device = this;
|
mem.device = this;
|
||||||
mem.device_pointer = key;
|
mem.device_pointer = key;
|
||||||
@@ -285,6 +449,8 @@ class MultiDevice : public Device {
|
|||||||
device_ptr key = mem.device_pointer;
|
device_ptr key = mem.device_pointer;
|
||||||
size_t existing_size = mem.device_size;
|
size_t existing_size = mem.device_size;
|
||||||
|
|
||||||
|
/* Free memory that was allocated for all devices (see above) on each device */
|
||||||
|
if (strcmp(mem.name, "RenderBuffers") == 0 || mem.type == MEM_PIXELS) {
|
||||||
foreach (SubDevice &sub, devices) {
|
foreach (SubDevice &sub, devices) {
|
||||||
mem.device = sub.device;
|
mem.device = sub.device;
|
||||||
mem.device_pointer = sub.ptr_map[key];
|
mem.device_pointer = sub.ptr_map[key];
|
||||||
@@ -293,9 +459,11 @@ class MultiDevice : public Device {
|
|||||||
sub.device->mem_free(mem);
|
sub.device->mem_free(mem);
|
||||||
sub.ptr_map.erase(sub.ptr_map.find(key));
|
sub.ptr_map.erase(sub.ptr_map.find(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(mem.name, "RenderBuffers") == 0) {
|
|
||||||
foreach (SubDevice &sub, denoising_devices) {
|
foreach (SubDevice &sub, denoising_devices) {
|
||||||
|
if (matching_rendering_and_denoising_devices) {
|
||||||
|
sub.ptr_map.erase(key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
mem.device = sub.device;
|
mem.device = sub.device;
|
||||||
mem.device_pointer = sub.ptr_map[key];
|
mem.device_pointer = sub.ptr_map[key];
|
||||||
mem.device_size = existing_size;
|
mem.device_size = existing_size;
|
||||||
@@ -304,6 +472,27 @@ class MultiDevice : public Device {
|
|||||||
sub.ptr_map.erase(sub.ptr_map.find(key));
|
sub.ptr_map.erase(sub.ptr_map.find(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach (const vector<SubDevice *> &island, peer_islands) {
|
||||||
|
SubDevice *owner_sub = find_matching_mem_device(key, *island.front());
|
||||||
|
mem.device = owner_sub->device;
|
||||||
|
mem.device_pointer = owner_sub->ptr_map[key];
|
||||||
|
mem.device_size = existing_size;
|
||||||
|
|
||||||
|
owner_sub->device->mem_free(mem);
|
||||||
|
owner_sub->ptr_map.erase(owner_sub->ptr_map.find(key));
|
||||||
|
|
||||||
|
if (mem.type == MEM_TEXTURE) {
|
||||||
|
/* Free texture objects on all devices */
|
||||||
|
foreach (SubDevice *island_sub, island) {
|
||||||
|
if (island_sub != owner_sub) {
|
||||||
|
island_sub->device->mem_free(mem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mem.device = this;
|
mem.device = this;
|
||||||
mem.device_pointer = 0;
|
mem.device_pointer = 0;
|
||||||
@@ -330,6 +519,8 @@ class MultiDevice : public Device {
|
|||||||
bool transparent,
|
bool transparent,
|
||||||
const DeviceDrawParams &draw_params)
|
const DeviceDrawParams &draw_params)
|
||||||
{
|
{
|
||||||
|
assert(rgba.type == MEM_PIXELS);
|
||||||
|
|
||||||
device_ptr key = rgba.device_pointer;
|
device_ptr key = rgba.device_pointer;
|
||||||
int i = 0, sub_h = h / devices.size();
|
int i = 0, sub_h = h / devices.size();
|
||||||
int sub_height = height / devices.size();
|
int sub_height = height / devices.size();
|
||||||
@@ -358,7 +549,7 @@ class MultiDevice : public Device {
|
|||||||
|
|
||||||
foreach (SubDevice &sub, devices) {
|
foreach (SubDevice &sub, devices) {
|
||||||
if (sub.device == sub_device) {
|
if (sub.device == sub_device) {
|
||||||
tile.buffer = sub.ptr_map[tile.buffer];
|
tile.buffer = find_matching_mem(tile.buffer, sub);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,7 +591,7 @@ class MultiDevice : public Device {
|
|||||||
device_vector<float> &mem = tiles[i].buffers->buffer;
|
device_vector<float> &mem = tiles[i].buffers->buffer;
|
||||||
tiles[i].buffer = mem.device_pointer;
|
tiles[i].buffer = mem.device_pointer;
|
||||||
|
|
||||||
if (mem.device == this && denoising_devices.empty()) {
|
if (mem.device == this && matching_rendering_and_denoising_devices) {
|
||||||
/* Skip unnecessary copies in viewport mode (buffer covers the
|
/* Skip unnecessary copies in viewport mode (buffer covers the
|
||||||
* whole image), but still need to fix up the tile device pointer. */
|
* whole image), but still need to fix up the tile device pointer. */
|
||||||
map_tile(sub_device, tiles[i]);
|
map_tile(sub_device, tiles[i]);
|
||||||
@@ -444,7 +635,7 @@ class MultiDevice : public Device {
|
|||||||
{
|
{
|
||||||
device_vector<float> &mem = tiles[9].buffers->buffer;
|
device_vector<float> &mem = tiles[9].buffers->buffer;
|
||||||
|
|
||||||
if (mem.device == this && denoising_devices.empty()) {
|
if (mem.device == this && matching_rendering_and_denoising_devices) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,17 +709,22 @@ class MultiDevice : public Device {
|
|||||||
tasks.pop_front();
|
tasks.pop_front();
|
||||||
|
|
||||||
if (task.buffer)
|
if (task.buffer)
|
||||||
subtask.buffer = sub.ptr_map[task.buffer];
|
subtask.buffer = find_matching_mem(task.buffer, sub);
|
||||||
if (task.rgba_byte)
|
if (task.rgba_byte)
|
||||||
subtask.rgba_byte = sub.ptr_map[task.rgba_byte];
|
subtask.rgba_byte = sub.ptr_map[task.rgba_byte];
|
||||||
if (task.rgba_half)
|
if (task.rgba_half)
|
||||||
subtask.rgba_half = sub.ptr_map[task.rgba_half];
|
subtask.rgba_half = sub.ptr_map[task.rgba_half];
|
||||||
if (task.shader_input)
|
if (task.shader_input)
|
||||||
subtask.shader_input = sub.ptr_map[task.shader_input];
|
subtask.shader_input = find_matching_mem(task.shader_input, sub);
|
||||||
if (task.shader_output)
|
if (task.shader_output)
|
||||||
subtask.shader_output = sub.ptr_map[task.shader_output];
|
subtask.shader_output = find_matching_mem(task.shader_output, sub);
|
||||||
|
|
||||||
sub.device->task_add(subtask);
|
sub.device->task_add(subtask);
|
||||||
|
|
||||||
|
if (task.buffers && task.buffers->buffer.device == this) {
|
||||||
|
/* Synchronize access to RenderBuffers, since 'map_neighbor_tiles' is not thread-safe. */
|
||||||
|
sub.device->task_wait();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -548,9 +744,6 @@ class MultiDevice : public Device {
|
|||||||
foreach (SubDevice &sub, denoising_devices)
|
foreach (SubDevice &sub, denoising_devices)
|
||||||
sub.device->task_cancel();
|
sub.device->task_cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
Stats sub_stats_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Device *device_multi_create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background)
|
Device *device_multi_create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background)
|
||||||
|
@@ -924,7 +924,8 @@ class OptiXDevice : public CUDADevice {
|
|||||||
&rtiles[9].h,
|
&rtiles[9].h,
|
||||||
&rtiles[9].offset,
|
&rtiles[9].offset,
|
||||||
&rtiles[9].stride,
|
&rtiles[9].stride,
|
||||||
&task.pass_stride};
|
&task.pass_stride,
|
||||||
|
&rtile.sample};
|
||||||
launch_filter_kernel(
|
launch_filter_kernel(
|
||||||
"kernel_cuda_filter_convert_from_rgb", rtiles[9].w, rtiles[9].h, output_args);
|
"kernel_cuda_filter_convert_from_rgb", rtiles[9].w, rtiles[9].h, output_args);
|
||||||
# endif
|
# endif
|
||||||
@@ -1536,36 +1537,24 @@ bool device_optix_init()
|
|||||||
|
|
||||||
void device_optix_info(const vector<DeviceInfo> &cuda_devices, vector<DeviceInfo> &devices)
|
void device_optix_info(const vector<DeviceInfo> &cuda_devices, vector<DeviceInfo> &devices)
|
||||||
{
|
{
|
||||||
|
devices.reserve(cuda_devices.size());
|
||||||
|
|
||||||
// Simply add all supported CUDA devices as OptiX devices again
|
// Simply add all supported CUDA devices as OptiX devices again
|
||||||
for (const DeviceInfo &cuda_info : cuda_devices) {
|
for (DeviceInfo info : cuda_devices) {
|
||||||
DeviceInfo info = cuda_info;
|
|
||||||
assert(info.type == DEVICE_CUDA);
|
assert(info.type == DEVICE_CUDA);
|
||||||
|
|
||||||
|
int major;
|
||||||
|
cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num);
|
||||||
|
if (major < 5) {
|
||||||
|
continue; // Only Maxwell and up are supported by OptiX
|
||||||
|
}
|
||||||
|
|
||||||
info.type = DEVICE_OPTIX;
|
info.type = DEVICE_OPTIX;
|
||||||
info.id += "_OptiX";
|
info.id += "_OptiX";
|
||||||
|
|
||||||
// Figure out RTX support
|
|
||||||
CUdevice cuda_device = 0;
|
|
||||||
CUcontext cuda_context = NULL;
|
|
||||||
unsigned int rtcore_version = 0;
|
|
||||||
if (cuDeviceGet(&cuda_device, info.num) == CUDA_SUCCESS &&
|
|
||||||
cuDevicePrimaryCtxRetain(&cuda_context, cuda_device) == CUDA_SUCCESS) {
|
|
||||||
OptixDeviceContext optix_context = NULL;
|
|
||||||
if (optixDeviceContextCreate(cuda_context, nullptr, &optix_context) == OPTIX_SUCCESS) {
|
|
||||||
optixDeviceContextGetProperty(optix_context,
|
|
||||||
OPTIX_DEVICE_PROPERTY_RTCORE_VERSION,
|
|
||||||
&rtcore_version,
|
|
||||||
sizeof(rtcore_version));
|
|
||||||
optixDeviceContextDestroy(optix_context);
|
|
||||||
}
|
|
||||||
cuDevicePrimaryCtxRelease(cuda_device);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only add devices with RTX support
|
|
||||||
if (rtcore_version != 0 || getenv("CYCLES_OPTIX_TEST")) {
|
|
||||||
devices.push_back(info);
|
devices.push_back(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Device *device_optix_create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background)
|
Device *device_optix_create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background)
|
||||||
{
|
{
|
||||||
|
@@ -44,7 +44,8 @@ DeviceTask::DeviceTask(Type type_)
|
|||||||
shader_eval_type(0),
|
shader_eval_type(0),
|
||||||
shader_filter(0),
|
shader_filter(0),
|
||||||
shader_x(0),
|
shader_x(0),
|
||||||
shader_w(0)
|
shader_w(0),
|
||||||
|
buffers(nullptr)
|
||||||
{
|
{
|
||||||
last_update_time = time_dt();
|
last_update_time = time_dt();
|
||||||
}
|
}
|
||||||
|
@@ -300,7 +300,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
|
|||||||
// Is set to zero on miss or if ray is aborted, so can be used as return value
|
// Is set to zero on miss or if ray is aborted, so can be used as return value
|
||||||
uint p5 = max_hits;
|
uint p5 = max_hits;
|
||||||
|
|
||||||
|
if (local_isect) {
|
||||||
local_isect->num_hits = 0; // Initialize hit count to zero
|
local_isect->num_hits = 0; // Initialize hit count to zero
|
||||||
|
}
|
||||||
optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0,
|
optixTrace(scene_intersect_valid(ray) ? kernel_data.bvh.scene : 0,
|
||||||
ray->P,
|
ray->P,
|
||||||
ray->D,
|
ray->D,
|
||||||
@@ -323,7 +325,9 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
|
|||||||
return p5;
|
return p5;
|
||||||
# else /* __KERNEL_OPTIX__ */
|
# else /* __KERNEL_OPTIX__ */
|
||||||
if (!scene_intersect_valid(ray)) {
|
if (!scene_intersect_valid(ray)) {
|
||||||
|
if (local_isect) {
|
||||||
local_isect->num_hits = 0;
|
local_isect->num_hits = 0;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -97,6 +97,18 @@ ccl_device_inline float bump_shadowing_term(float3 Ng, float3 N, float3 I)
|
|||||||
return -g2 * g + g2 + g;
|
return -g2 * g + g2 + g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Shadow terminator workaround, taken from Appleseed.
|
||||||
|
* Original code is under the MIT License
|
||||||
|
* Copyright (c) 2019 Francois Beaune, The appleseedhq Organization */
|
||||||
|
ccl_device_inline float shift_cos_in(float cos_in, const float frequency_multiplier)
|
||||||
|
{
|
||||||
|
cos_in = min(cos_in, 1.0f);
|
||||||
|
|
||||||
|
const float angle = fast_acosf(cos_in);
|
||||||
|
const float val = max(cosf(angle * frequency_multiplier), 0.0f) / cos_in;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
||||||
ShaderData *sd,
|
ShaderData *sd,
|
||||||
const ShaderClosure *sc,
|
const ShaderClosure *sc,
|
||||||
@@ -444,11 +456,19 @@ ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (label & LABEL_DIFFUSE) {
|
else {
|
||||||
|
/* Shadow terminator offset. */
|
||||||
|
const float frequency_multiplier =
|
||||||
|
kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
|
||||||
|
if (frequency_multiplier > 1.0f) {
|
||||||
|
*eval *= shift_cos_in(dot(*omega_in, sc->N), frequency_multiplier);
|
||||||
|
}
|
||||||
|
if (label & LABEL_DIFFUSE) {
|
||||||
if (!isequal_float3(sc->N, sd->N)) {
|
if (!isequal_float3(sc->N, sd->N)) {
|
||||||
*eval *= bump_shadowing_term((label & LABEL_TRANSMIT) ? -sd->N : sd->N, sc->N, *omega_in);
|
*eval *= bump_shadowing_term((label & LABEL_TRANSMIT) ? -sd->N : sd->N, sc->N, *omega_in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
@@ -561,6 +581,12 @@ ccl_device_inline
|
|||||||
eval *= bump_shadowing_term(sd->N, sc->N, omega_in);
|
eval *= bump_shadowing_term(sd->N, sc->N, omega_in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* Shadow terminator offset. */
|
||||||
|
const float frequency_multiplier =
|
||||||
|
kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
|
||||||
|
if (frequency_multiplier > 1.0f) {
|
||||||
|
eval *= shift_cos_in(dot(omega_in, sc->N), frequency_multiplier);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (sc->type) {
|
switch (sc->type) {
|
||||||
|
@@ -185,19 +185,19 @@ ccl_device bool kernel_do_adaptive_filter_x(KernelGlobals *kg, int y, ccl_global
|
|||||||
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||||
kernel_data.film.pass_adaptive_aux_buffer);
|
kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
if (aux->w == 0.0f) {
|
if ((*aux).w == 0.0f) {
|
||||||
any = true;
|
any = true;
|
||||||
if (x > tile->x && !prev) {
|
if (x > tile->x && !prev) {
|
||||||
index = index - 1;
|
index = index - 1;
|
||||||
buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||||
aux = (ccl_global float4 *)(buffer + kernel_data.film.pass_adaptive_aux_buffer);
|
aux = (ccl_global float4 *)(buffer + kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
aux->w = 0.0f;
|
(*aux).w = 0.0f;
|
||||||
}
|
}
|
||||||
prev = true;
|
prev = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (prev) {
|
if (prev) {
|
||||||
aux->w = 0.0f;
|
(*aux).w = 0.0f;
|
||||||
}
|
}
|
||||||
prev = false;
|
prev = false;
|
||||||
}
|
}
|
||||||
@@ -214,19 +214,19 @@ ccl_device bool kernel_do_adaptive_filter_y(KernelGlobals *kg, int x, ccl_global
|
|||||||
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||||
kernel_data.film.pass_adaptive_aux_buffer);
|
kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
if (aux->w == 0.0f) {
|
if ((*aux).w == 0.0f) {
|
||||||
any = true;
|
any = true;
|
||||||
if (y > tile->y && !prev) {
|
if (y > tile->y && !prev) {
|
||||||
index = index - tile->stride;
|
index = index - tile->stride;
|
||||||
buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
buffer = tile->buffer + index * kernel_data.film.pass_stride;
|
||||||
aux = (ccl_global float4 *)(buffer + kernel_data.film.pass_adaptive_aux_buffer);
|
aux = (ccl_global float4 *)(buffer + kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
aux->w = 0.0f;
|
(*aux).w = 0.0f;
|
||||||
}
|
}
|
||||||
prev = true;
|
prev = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (prev) {
|
if (prev) {
|
||||||
aux->w = 0.0f;
|
(*aux).w = 0.0f;
|
||||||
}
|
}
|
||||||
prev = false;
|
prev = false;
|
||||||
}
|
}
|
||||||
|
@@ -441,9 +441,23 @@ ccl_device_inline float camera_distance(KernelGlobals *kg, float3 P)
|
|||||||
float3 camD = make_float3(cameratoworld.x.z, cameratoworld.y.z, cameratoworld.z.z);
|
float3 camD = make_float3(cameratoworld.x.z, cameratoworld.y.z, cameratoworld.z.z);
|
||||||
return fabsf(dot((P - camP), camD));
|
return fabsf(dot((P - camP), camD));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
return len(P - camP);
|
return len(P - camP);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ccl_device_inline float camera_z_depth(KernelGlobals *kg, float3 P)
|
||||||
|
{
|
||||||
|
if (kernel_data.cam.type != CAMERA_PANORAMA) {
|
||||||
|
Transform worldtocamera = kernel_data.cam.worldtocamera;
|
||||||
|
return transform_point(&worldtocamera, P).z;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Transform cameratoworld = kernel_data.cam.cameratoworld;
|
||||||
|
float3 camP = make_float3(cameratoworld.x.w, cameratoworld.y.w, cameratoworld.z.w);
|
||||||
|
return len(P - camP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ccl_device_inline float3 camera_direction_from_point(KernelGlobals *kg, float3 P)
|
ccl_device_inline float3 camera_direction_from_point(KernelGlobals *kg, float3 P)
|
||||||
{
|
{
|
||||||
|
@@ -249,13 +249,13 @@ ccl_device float3 background_map_sample(KernelGlobals *kg, float randu, float ra
|
|||||||
float u = (index_u + du) / res_x;
|
float u = (index_u + du) / res_x;
|
||||||
|
|
||||||
/* compute pdf */
|
/* compute pdf */
|
||||||
float denom = cdf_last_u.x * cdf_last_v.x;
|
|
||||||
float sin_theta = sinf(M_PI_F * v);
|
float sin_theta = sinf(M_PI_F * v);
|
||||||
|
float denom = (M_2PI_F * M_PI_F * sin_theta) * cdf_last_u.x * cdf_last_v.x;
|
||||||
|
|
||||||
if (sin_theta == 0.0f || denom == 0.0f)
|
if (sin_theta == 0.0f || denom == 0.0f)
|
||||||
*pdf = 0.0f;
|
*pdf = 0.0f;
|
||||||
else
|
else
|
||||||
*pdf = (cdf_u.x * cdf_v.x) / (M_2PI_F * M_PI_F * sin_theta * denom);
|
*pdf = (cdf_u.x * cdf_v.x) / denom;
|
||||||
|
|
||||||
/* compute direction */
|
/* compute direction */
|
||||||
return equirectangular_to_direction(u, v);
|
return equirectangular_to_direction(u, v);
|
||||||
@@ -284,7 +284,7 @@ ccl_device float background_map_pdf(KernelGlobals *kg, float3 direction)
|
|||||||
index_v * cdf_width + res_x);
|
index_v * cdf_width + res_x);
|
||||||
float2 cdf_last_v = kernel_tex_fetch(__light_background_marginal_cdf, res_y);
|
float2 cdf_last_v = kernel_tex_fetch(__light_background_marginal_cdf, res_y);
|
||||||
|
|
||||||
float denom = cdf_last_u.x * cdf_last_v.x;
|
float denom = (M_2PI_F * M_PI_F * sin_theta) * cdf_last_u.x * cdf_last_v.x;
|
||||||
|
|
||||||
if (denom == 0.0f)
|
if (denom == 0.0f)
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
@@ -294,7 +294,7 @@ ccl_device float background_map_pdf(KernelGlobals *kg, float3 direction)
|
|||||||
index_v * cdf_width + index_u);
|
index_v * cdf_width + index_u);
|
||||||
float2 cdf_v = kernel_tex_fetch(__light_background_marginal_cdf, index_v);
|
float2 cdf_v = kernel_tex_fetch(__light_background_marginal_cdf, index_v);
|
||||||
|
|
||||||
return (cdf_u.x * cdf_v.x) / (M_2PI_F * M_PI_F * sin_theta * denom);
|
return (cdf_u.x * cdf_v.x) / denom;
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device_inline bool background_portal_data_fetch_and_check_side(
|
ccl_device_inline bool background_portal_data_fetch_and_check_side(
|
||||||
|
@@ -85,8 +85,9 @@ ccl_device_inline void sample_uniform_hemisphere(
|
|||||||
ccl_device_inline void sample_uniform_cone(
|
ccl_device_inline void sample_uniform_cone(
|
||||||
const float3 N, float angle, float randu, float randv, float3 *omega_in, float *pdf)
|
const float3 N, float angle, float randu, float randv, float3 *omega_in, float *pdf)
|
||||||
{
|
{
|
||||||
float z = cosf(angle * randu);
|
float zMin = cosf(angle);
|
||||||
float r = sqrtf(max(0.0f, 1.0f - z * z));
|
float z = zMin - zMin * randu + randu;
|
||||||
|
float r = safe_sqrtf(1.0f - sqr(z));
|
||||||
float phi = M_2PI_F * randv;
|
float phi = M_2PI_F * randv;
|
||||||
float x = r * cosf(phi);
|
float x = r * cosf(phi);
|
||||||
float y = r * sinf(phi);
|
float y = r * sinf(phi);
|
||||||
@@ -94,7 +95,7 @@ ccl_device_inline void sample_uniform_cone(
|
|||||||
float3 T, B;
|
float3 T, B;
|
||||||
make_orthonormals(N, &T, &B);
|
make_orthonormals(N, &T, &B);
|
||||||
*omega_in = x * T + y * B + z * N;
|
*omega_in = x * T + y * B + z * N;
|
||||||
*pdf = 0.5f * M_1_PI_F / (1.0f - cosf(angle));
|
*pdf = M_1_2PI_F / (1.0f - zMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sample uniform point on the surface of a sphere */
|
/* sample uniform point on the surface of a sphere */
|
||||||
|
@@ -194,7 +194,7 @@ ccl_device_inline void kernel_write_data_passes(KernelGlobals *kg,
|
|||||||
average(shader_bsdf_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) {
|
average(shader_bsdf_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) {
|
||||||
if (state->sample == 0) {
|
if (state->sample == 0) {
|
||||||
if (flag & PASSMASK(DEPTH)) {
|
if (flag & PASSMASK(DEPTH)) {
|
||||||
float depth = camera_distance(kg, sd->P);
|
float depth = camera_z_depth(kg, sd->P);
|
||||||
kernel_write_pass_float(buffer + kernel_data.film.pass_depth, depth);
|
kernel_write_pass_float(buffer + kernel_data.film.pass_depth, depth);
|
||||||
}
|
}
|
||||||
if (flag & PASSMASK(OBJECT_ID)) {
|
if (flag & PASSMASK(OBJECT_ID)) {
|
||||||
|
@@ -662,7 +662,7 @@ ccl_device void kernel_path_trace(
|
|||||||
if (kernel_data.film.pass_adaptive_aux_buffer) {
|
if (kernel_data.film.pass_adaptive_aux_buffer) {
|
||||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||||
kernel_data.film.pass_adaptive_aux_buffer);
|
kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
if (aux->w > 0.0f) {
|
if ((*aux).w > 0.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -526,7 +526,7 @@ ccl_device void kernel_branched_path_trace(
|
|||||||
if (kernel_data.film.pass_adaptive_aux_buffer) {
|
if (kernel_data.film.pass_adaptive_aux_buffer) {
|
||||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||||
kernel_data.film.pass_adaptive_aux_buffer);
|
kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
if (aux->w > 0.0f) {
|
if ((*aux).w > 0.0f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -273,6 +273,7 @@ enum SamplingPattern {
|
|||||||
/* these flags values correspond to raytypes in osl.cpp, so keep them in sync! */
|
/* these flags values correspond to raytypes in osl.cpp, so keep them in sync! */
|
||||||
|
|
||||||
enum PathRayFlag {
|
enum PathRayFlag {
|
||||||
|
/* Ray visibility. */
|
||||||
PATH_RAY_CAMERA = (1 << 0),
|
PATH_RAY_CAMERA = (1 << 0),
|
||||||
PATH_RAY_REFLECT = (1 << 1),
|
PATH_RAY_REFLECT = (1 << 1),
|
||||||
PATH_RAY_TRANSMIT = (1 << 2),
|
PATH_RAY_TRANSMIT = (1 << 2),
|
||||||
@@ -281,6 +282,7 @@ enum PathRayFlag {
|
|||||||
PATH_RAY_SINGULAR = (1 << 5),
|
PATH_RAY_SINGULAR = (1 << 5),
|
||||||
PATH_RAY_TRANSPARENT = (1 << 6),
|
PATH_RAY_TRANSPARENT = (1 << 6),
|
||||||
|
|
||||||
|
/* Shadow ray visibility. */
|
||||||
PATH_RAY_SHADOW_OPAQUE_NON_CATCHER = (1 << 7),
|
PATH_RAY_SHADOW_OPAQUE_NON_CATCHER = (1 << 7),
|
||||||
PATH_RAY_SHADOW_OPAQUE_CATCHER = (1 << 8),
|
PATH_RAY_SHADOW_OPAQUE_CATCHER = (1 << 8),
|
||||||
PATH_RAY_SHADOW_OPAQUE = (PATH_RAY_SHADOW_OPAQUE_NON_CATCHER | PATH_RAY_SHADOW_OPAQUE_CATCHER),
|
PATH_RAY_SHADOW_OPAQUE = (PATH_RAY_SHADOW_OPAQUE_NON_CATCHER | PATH_RAY_SHADOW_OPAQUE_CATCHER),
|
||||||
@@ -292,8 +294,11 @@ enum PathRayFlag {
|
|||||||
PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER),
|
PATH_RAY_SHADOW_TRANSPARENT_NON_CATCHER),
|
||||||
PATH_RAY_SHADOW = (PATH_RAY_SHADOW_OPAQUE | PATH_RAY_SHADOW_TRANSPARENT),
|
PATH_RAY_SHADOW = (PATH_RAY_SHADOW_OPAQUE | PATH_RAY_SHADOW_TRANSPARENT),
|
||||||
|
|
||||||
PATH_RAY_CURVE = (1 << 11), /* visibility flag to define curve segments */
|
/* Unused, free to reuse. */
|
||||||
PATH_RAY_VOLUME_SCATTER = (1 << 12), /* volume scattering */
|
PATH_RAY_UNUSED = (1 << 11),
|
||||||
|
|
||||||
|
/* Ray visibility for volume scattering. */
|
||||||
|
PATH_RAY_VOLUME_SCATTER = (1 << 12),
|
||||||
|
|
||||||
/* Special flag to tag unaligned BVH nodes. */
|
/* Special flag to tag unaligned BVH nodes. */
|
||||||
PATH_RAY_NODE_UNALIGNED = (1 << 13),
|
PATH_RAY_NODE_UNALIGNED = (1 << 13),
|
||||||
@@ -1480,6 +1485,9 @@ typedef struct KernelObject {
|
|||||||
|
|
||||||
float cryptomatte_object;
|
float cryptomatte_object;
|
||||||
float cryptomatte_asset;
|
float cryptomatte_asset;
|
||||||
|
|
||||||
|
float shadow_terminator_offset;
|
||||||
|
float pad1, pad2, pad3;
|
||||||
} KernelObject;
|
} KernelObject;
|
||||||
static_assert_align(KernelObject, 16);
|
static_assert_align(KernelObject, 16);
|
||||||
|
|
||||||
|
@@ -99,7 +99,7 @@ ccl_device bool get_next_work(KernelGlobals *kg,
|
|||||||
ccl_global float *buffer = kernel_split_params.tile.buffer + buffer_offset;
|
ccl_global float *buffer = kernel_split_params.tile.buffer + buffer_offset;
|
||||||
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
ccl_global float4 *aux = (ccl_global float4 *)(buffer +
|
||||||
kernel_data.film.pass_adaptive_aux_buffer);
|
kernel_data.film.pass_adaptive_aux_buffer);
|
||||||
if (aux->w == 0.0f) {
|
if ((*aux).w == 0.0f) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -57,9 +57,9 @@ kernel_cuda_filter_convert_to_rgb(float *rgb, float *buf, int sw, int sh, int st
|
|||||||
if (num_inputs > 0) {
|
if (num_inputs > 0) {
|
||||||
float *in = buf + x * pass_stride + (y * stride + pass_offset.x) / sizeof(float);
|
float *in = buf + x * pass_stride + (y * stride + pass_offset.x) / sizeof(float);
|
||||||
float *out = rgb + (x + y * sw) * 3;
|
float *out = rgb + (x + y * sw) * 3;
|
||||||
out[0] = clamp(in[0], 0.0f, 10000.0f);
|
out[0] = clamp(in[0] / num_samples, 0.0f, 10000.0f);
|
||||||
out[1] = clamp(in[1], 0.0f, 10000.0f);
|
out[1] = clamp(in[1] / num_samples, 0.0f, 10000.0f);
|
||||||
out[2] = clamp(in[2], 0.0f, 10000.0f);
|
out[2] = clamp(in[2] / num_samples, 0.0f, 10000.0f);
|
||||||
}
|
}
|
||||||
if (num_inputs > 1) {
|
if (num_inputs > 1) {
|
||||||
float *in = buf + x * pass_stride + (y * stride + pass_offset.y) / sizeof(float);
|
float *in = buf + x * pass_stride + (y * stride + pass_offset.y) / sizeof(float);
|
||||||
@@ -80,16 +80,16 @@ kernel_cuda_filter_convert_to_rgb(float *rgb, float *buf, int sw, int sh, int st
|
|||||||
|
|
||||||
extern "C" __global__ void
|
extern "C" __global__ void
|
||||||
CUDA_LAUNCH_BOUNDS(CUDA_THREADS_BLOCK_WIDTH, CUDA_KERNEL_MAX_REGISTERS)
|
CUDA_LAUNCH_BOUNDS(CUDA_THREADS_BLOCK_WIDTH, CUDA_KERNEL_MAX_REGISTERS)
|
||||||
kernel_cuda_filter_convert_from_rgb(float *rgb, float *buf, int ix, int iy, int iw, int ih, int sx, int sy, int sw, int sh, int offset, int stride, int pass_stride)
|
kernel_cuda_filter_convert_from_rgb(float *rgb, float *buf, int ix, int iy, int iw, int ih, int sx, int sy, int sw, int sh, int offset, int stride, int pass_stride, int num_samples)
|
||||||
{
|
{
|
||||||
int x = blockDim.x*blockIdx.x + threadIdx.x;
|
int x = blockDim.x*blockIdx.x + threadIdx.x;
|
||||||
int y = blockDim.y*blockIdx.y + threadIdx.y;
|
int y = blockDim.y*blockIdx.y + threadIdx.y;
|
||||||
if(x < sw && y < sh) {
|
if(x < sw && y < sh) {
|
||||||
float *in = rgb + ((ix + x) + (iy + y) * iw) * 3;
|
float *in = rgb + ((ix + x) + (iy + y) * iw) * 3;
|
||||||
float *out = buf + (offset + (sx + x) + (sy + y) * stride) * pass_stride;
|
float *out = buf + (offset + (sx + x) + (sy + y) * stride) * pass_stride;
|
||||||
out[0] = in[0];
|
out[0] = in[0] * num_samples;
|
||||||
out[1] = in[1];
|
out[1] = in[1] * num_samples;
|
||||||
out[2] = in[2];
|
out[2] = in[2] * num_samples;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -120,6 +120,7 @@ NODE_DEFINE(Light)
|
|||||||
|
|
||||||
SOCKET_VECTOR(dir, "Dir", make_float3(0.0f, 0.0f, 0.0f));
|
SOCKET_VECTOR(dir, "Dir", make_float3(0.0f, 0.0f, 0.0f));
|
||||||
SOCKET_FLOAT(size, "Size", 0.0f);
|
SOCKET_FLOAT(size, "Size", 0.0f);
|
||||||
|
SOCKET_FLOAT(angle, "Angle", 0.0f);
|
||||||
|
|
||||||
SOCKET_VECTOR(axisu, "Axis U", make_float3(0.0f, 0.0f, 0.0f));
|
SOCKET_VECTOR(axisu, "Axis U", make_float3(0.0f, 0.0f, 0.0f));
|
||||||
SOCKET_FLOAT(sizeu, "Size U", 1.0f);
|
SOCKET_FLOAT(sizeu, "Size U", 1.0f);
|
||||||
@@ -183,6 +184,8 @@ LightManager::LightManager()
|
|||||||
need_update = true;
|
need_update = true;
|
||||||
need_update_background = true;
|
need_update_background = true;
|
||||||
use_light_visibility = false;
|
use_light_visibility = false;
|
||||||
|
last_background_enabled = false;
|
||||||
|
last_background_resolution = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LightManager::~LightManager()
|
LightManager::~LightManager()
|
||||||
@@ -202,7 +205,7 @@ bool LightManager::has_background_light(Scene *scene)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightManager::disable_ineffective_light(Scene *scene)
|
void LightManager::test_enabled_lights(Scene *scene)
|
||||||
{
|
{
|
||||||
/* Make all lights enabled by default, and perform some preliminary checks
|
/* Make all lights enabled by default, and perform some preliminary checks
|
||||||
* needed for finer-tuning of settings (for example, check whether we've
|
* needed for finer-tuning of settings (for example, check whether we've
|
||||||
@@ -215,6 +218,9 @@ void LightManager::disable_ineffective_light(Scene *scene)
|
|||||||
has_background |= light->type == LIGHT_BACKGROUND;
|
has_background |= light->type == LIGHT_BACKGROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool background_enabled = false;
|
||||||
|
int background_resolution = 0;
|
||||||
|
|
||||||
if (has_background) {
|
if (has_background) {
|
||||||
/* Ignore background light if:
|
/* Ignore background light if:
|
||||||
* - If unsupported on a device
|
* - If unsupported on a device
|
||||||
@@ -226,9 +232,18 @@ void LightManager::disable_ineffective_light(Scene *scene)
|
|||||||
foreach (Light *light, scene->lights) {
|
foreach (Light *light, scene->lights) {
|
||||||
if (light->type == LIGHT_BACKGROUND) {
|
if (light->type == LIGHT_BACKGROUND) {
|
||||||
light->is_enabled = !disable_mis;
|
light->is_enabled = !disable_mis;
|
||||||
|
background_enabled = !disable_mis;
|
||||||
|
background_resolution = light->map_resolution;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (last_background_enabled != background_enabled ||
|
||||||
|
last_background_resolution != background_resolution) {
|
||||||
|
last_background_enabled = background_enabled;
|
||||||
|
last_background_resolution = background_resolution;
|
||||||
|
need_update_background = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LightManager::object_usable_as_light(Object *object)
|
bool LightManager::object_usable_as_light(Object *object)
|
||||||
@@ -902,12 +917,13 @@ void LightManager::device_update(Device *device,
|
|||||||
|
|
||||||
VLOG(1) << "Total " << scene->lights.size() << " lights.";
|
VLOG(1) << "Total " << scene->lights.size() << " lights.";
|
||||||
|
|
||||||
|
/* Detect which lights are enabled, also determins if we need to update the background. */
|
||||||
|
test_enabled_lights(scene);
|
||||||
|
|
||||||
device_free(device, dscene, need_update_background);
|
device_free(device, dscene, need_update_background);
|
||||||
|
|
||||||
use_light_visibility = false;
|
use_light_visibility = false;
|
||||||
|
|
||||||
disable_ineffective_light(scene);
|
|
||||||
|
|
||||||
device_update_points(device, dscene, scene);
|
device_update_points(device, dscene, scene);
|
||||||
if (progress.get_cancel())
|
if (progress.get_cancel())
|
||||||
return;
|
return;
|
||||||
|
@@ -112,7 +112,7 @@ class LightManager {
|
|||||||
* which doesn't contribute to the scene or which is only used for MIS
|
* which doesn't contribute to the scene or which is only used for MIS
|
||||||
* and scene doesn't need MIS.
|
* and scene doesn't need MIS.
|
||||||
*/
|
*/
|
||||||
void disable_ineffective_light(Scene *scene);
|
void test_enabled_lights(Scene *scene);
|
||||||
|
|
||||||
void device_update_points(Device *device, DeviceScene *dscene, Scene *scene);
|
void device_update_points(Device *device, DeviceScene *dscene, Scene *scene);
|
||||||
void device_update_distribution(Device *device,
|
void device_update_distribution(Device *device,
|
||||||
@@ -136,6 +136,9 @@ class LightManager {
|
|||||||
|
|
||||||
vector<IESSlot *> ies_slots;
|
vector<IESSlot *> ies_slots;
|
||||||
thread_mutex ies_mutex;
|
thread_mutex ies_mutex;
|
||||||
|
|
||||||
|
bool last_background_enabled;
|
||||||
|
int last_background_resolution;
|
||||||
};
|
};
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
@@ -101,6 +101,7 @@ NODE_DEFINE(Object)
|
|||||||
SOCKET_POINT(dupli_generated, "Dupli Generated", make_float3(0.0f, 0.0f, 0.0f));
|
SOCKET_POINT(dupli_generated, "Dupli Generated", make_float3(0.0f, 0.0f, 0.0f));
|
||||||
SOCKET_POINT2(dupli_uv, "Dupli UV", make_float2(0.0f, 0.0f));
|
SOCKET_POINT2(dupli_uv, "Dupli UV", make_float2(0.0f, 0.0f));
|
||||||
SOCKET_TRANSFORM_ARRAY(motion, "Motion", array<Transform>());
|
SOCKET_TRANSFORM_ARRAY(motion, "Motion", array<Transform>());
|
||||||
|
SOCKET_FLOAT(shadow_terminator_offset, "Terminator Offset", 0.0f);
|
||||||
|
|
||||||
SOCKET_BOOLEAN(is_shadow_catcher, "Shadow Catcher", false);
|
SOCKET_BOOLEAN(is_shadow_catcher, "Shadow Catcher", false);
|
||||||
|
|
||||||
@@ -534,6 +535,7 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
|
|||||||
uint32_t hash_asset = util_murmur_hash3(ob->asset_name.c_str(), ob->asset_name.length(), 0);
|
uint32_t hash_asset = util_murmur_hash3(ob->asset_name.c_str(), ob->asset_name.length(), 0);
|
||||||
kobject.cryptomatte_object = util_hash_to_float(hash_name);
|
kobject.cryptomatte_object = util_hash_to_float(hash_name);
|
||||||
kobject.cryptomatte_asset = util_hash_to_float(hash_asset);
|
kobject.cryptomatte_asset = util_hash_to_float(hash_asset);
|
||||||
|
kobject.shadow_terminator_offset = 1.0f / (1.0f - 0.5f * ob->shadow_terminator_offset);
|
||||||
|
|
||||||
/* Object flag. */
|
/* Object flag. */
|
||||||
if (ob->use_holdout) {
|
if (ob->use_holdout) {
|
||||||
|
@@ -59,6 +59,7 @@ class Object : public Node {
|
|||||||
bool hide_on_missing_motion;
|
bool hide_on_missing_motion;
|
||||||
bool use_holdout;
|
bool use_holdout;
|
||||||
bool is_shadow_catcher;
|
bool is_shadow_catcher;
|
||||||
|
float shadow_terminator_offset;
|
||||||
|
|
||||||
float3 dupli_generated;
|
float3 dupli_generated;
|
||||||
float2 dupli_uv;
|
float2 dupli_uv;
|
||||||
|
@@ -436,6 +436,12 @@ bool Session::acquire_tile(RenderTile &rtile, Device *tile_device, uint tile_typ
|
|||||||
/* Reset copy state, since buffer contents change after the tile was acquired */
|
/* Reset copy state, since buffer contents change after the tile was acquired */
|
||||||
buffers->map_neighbor_copied = false;
|
buffers->map_neighbor_copied = false;
|
||||||
|
|
||||||
|
/* This hack ensures that the copy in 'MultiDevice::map_neighbor_tiles' accounts
|
||||||
|
* for the buffer resolution divider. */
|
||||||
|
buffers->buffer.data_width = (buffers->params.width * buffers->params.get_passes_size()) /
|
||||||
|
tile_manager.state.resolution_divider;
|
||||||
|
buffers->buffer.data_height = buffers->params.height / tile_manager.state.resolution_divider;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1125,13 +1131,6 @@ bool Session::render_need_denoise(bool &delayed)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cannot denoise with resolution divider and separate denoising devices.
|
|
||||||
* It breaks the copy in 'MultiDevice::map_neighbor_tiles' (which operates on
|
|
||||||
* the full buffer dimensions and not the scaled ones). */
|
|
||||||
if (!params.device.denoising_devices.empty() && tile_manager.state.resolution_divider > 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Avoid excessive denoising in viewport after reaching a certain amount of samples. */
|
/* Avoid excessive denoising in viewport after reaching a certain amount of samples. */
|
||||||
delayed = (tile_manager.state.sample >= 20 &&
|
delayed = (tile_manager.state.sample >= 20 &&
|
||||||
(time_dt() - last_display_time) < params.progressive_update_timeout);
|
(time_dt() - last_display_time) < params.progressive_update_timeout);
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#define __UTIL_GUARDED_ALLOCATOR_H__
|
#define __UTIL_GUARDED_ALLOCATOR_H__
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cstdlib>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#ifdef WITH_BLENDER_GUARDEDALLOC
|
#ifdef WITH_BLENDER_GUARDEDALLOC
|
||||||
|
@@ -435,7 +435,7 @@ extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
|
|||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of a modifier key (ouside the message queue).
|
* Returns the state of a modifier key (outside the message queue).
|
||||||
* \param systemhandle The handle to the system
|
* \param systemhandle The handle to the system
|
||||||
* \param mask The modifier key state to retrieve.
|
* \param mask The modifier key state to retrieve.
|
||||||
* \param isDown Pointer to return modifier state in.
|
* \param isDown Pointer to return modifier state in.
|
||||||
@@ -446,7 +446,7 @@ extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
|
|||||||
int *isDown);
|
int *isDown);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of a mouse button (ouside the message queue).
|
* Returns the state of a mouse button (outside the message queue).
|
||||||
* \param systemhandle The handle to the system
|
* \param systemhandle The handle to the system
|
||||||
* \param mask The button state to retrieve.
|
* \param mask The button state to retrieve.
|
||||||
* \param isDown Pointer to return button state in.
|
* \param isDown Pointer to return button state in.
|
||||||
|
@@ -382,7 +382,7 @@ class GHOST_ISystem {
|
|||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of a modifier key (ouside the message queue).
|
* Returns the state of a modifier key (outside the message queue).
|
||||||
* \param mask The modifier key state to retrieve.
|
* \param mask The modifier key state to retrieve.
|
||||||
* \param isDown The state of a modifier key (true == pressed).
|
* \param isDown The state of a modifier key (true == pressed).
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
@@ -390,7 +390,7 @@ class GHOST_ISystem {
|
|||||||
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const = 0;
|
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of a mouse button (ouside the message queue).
|
* Returns the state of a mouse button (outside the message queue).
|
||||||
* \param mask The button state to retrieve.
|
* \param mask The button state to retrieve.
|
||||||
* \param isDown Button state.
|
* \param isDown Button state.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
|
@@ -48,14 +48,6 @@ class GHOST_Rect {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy constructor.
|
|
||||||
* \param r rectangle to copy
|
|
||||||
*/
|
|
||||||
GHOST_Rect(const GHOST_Rect &r) : m_l(r.m_l), m_t(r.m_t), m_r(r.m_r), m_b(r.m_b)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
@@ -219,7 +219,7 @@ class GHOST_System : public GHOST_ISystem {
|
|||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of a modifier key (ouside the message queue).
|
* Returns the state of a modifier key (outside the message queue).
|
||||||
* \param mask The modifier key state to retrieve.
|
* \param mask The modifier key state to retrieve.
|
||||||
* \param isDown The state of a modifier key (true == pressed).
|
* \param isDown The state of a modifier key (true == pressed).
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
@@ -227,7 +227,7 @@ class GHOST_System : public GHOST_ISystem {
|
|||||||
GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const;
|
GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of a mouse button (ouside the message queue).
|
* Returns the state of a mouse button (outside the message queue).
|
||||||
* \param mask The button state to retrieve.
|
* \param mask The button state to retrieve.
|
||||||
* \param isDown Button state.
|
* \param isDown Button state.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
@@ -247,8 +247,8 @@ class GHOST_System : public GHOST_ISystem {
|
|||||||
***************************************************************************************/
|
***************************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets 3D mouse deadzone
|
* Sets 3D mouse dead-zone
|
||||||
* \param deadzone: Deadzone of the 3D mouse (both for rotation and pan) relative to full range
|
* \param deadzone: Dead-zone of the 3D mouse (both for rotation and pan) relative to full range.
|
||||||
*/
|
*/
|
||||||
void setNDOFDeadZone(float deadzone);
|
void setNDOFDeadZone(float deadzone);
|
||||||
#endif
|
#endif
|
||||||
@@ -295,7 +295,7 @@ class GHOST_System : public GHOST_ISystem {
|
|||||||
virtual GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const = 0;
|
virtual GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of the mouse buttons (ouside the message queue).
|
* Returns the state of the mouse buttons (outside the message queue).
|
||||||
* \param buttons The state of the buttons.
|
* \param buttons The state of the buttons.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
*/
|
*/
|
||||||
|
@@ -198,7 +198,7 @@ class GHOST_SystemCocoa : public GHOST_System {
|
|||||||
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
|
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of the mouse buttons (ouside the message queue).
|
* Returns the state of the mouse buttons (outside the message queue).
|
||||||
* \param buttons The state of the buttons.
|
* \param buttons The state of the buttons.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
*/
|
*/
|
||||||
|
@@ -1527,7 +1527,7 @@ GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
|
|||||||
GHOST_TDrawingContextType type,
|
GHOST_TDrawingContextType type,
|
||||||
GHOST_GLSettings glSettings,
|
GHOST_GLSettings glSettings,
|
||||||
const bool exclusive,
|
const bool exclusive,
|
||||||
const bool /*is_dialog*/,
|
const bool is_dialog,
|
||||||
const GHOST_IWindow *parentWindow)
|
const GHOST_IWindow *parentWindow)
|
||||||
{
|
{
|
||||||
GHOST_WindowWayland *window = new GHOST_WindowWayland(
|
GHOST_WindowWayland *window = new GHOST_WindowWayland(
|
||||||
@@ -1540,6 +1540,7 @@ GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
|
|||||||
state,
|
state,
|
||||||
parentWindow,
|
parentWindow,
|
||||||
type,
|
type,
|
||||||
|
is_dialog,
|
||||||
((glSettings.flags & GHOST_glStereoVisual) != 0),
|
((glSettings.flags & GHOST_glStereoVisual) != 0),
|
||||||
exclusive);
|
exclusive);
|
||||||
|
|
||||||
|
@@ -212,7 +212,7 @@ class GHOST_SystemWin32 : public GHOST_System {
|
|||||||
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
|
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of the mouse buttons (ouside the message queue).
|
* Returns the state of the mouse buttons (outside the message queue).
|
||||||
* \param buttons The state of the buttons.
|
* \param buttons The state of the buttons.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
*/
|
*/
|
||||||
|
@@ -182,7 +182,7 @@ class GHOST_SystemX11 : public GHOST_System {
|
|||||||
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
|
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of the mouse buttons (ouside the message queue).
|
* Returns the state of the mouse buttons (outside the message queue).
|
||||||
* \param buttons The state of the buttons.
|
* \param buttons The state of the buttons.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
*/
|
*/
|
||||||
@@ -211,7 +211,7 @@ class GHOST_SystemX11 : public GHOST_System {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Helped function for get data from the clipboard. */
|
/** Helped function for get data from the clipboard. */
|
||||||
void getClipboard_xcout(const XEvent *evt,
|
void getClipboard_xcout(const XEvent *evt,
|
||||||
Atom sel,
|
Atom sel,
|
||||||
Atom target,
|
Atom target,
|
||||||
@@ -337,7 +337,7 @@ class GHOST_SystemX11 : public GHOST_System {
|
|||||||
private:
|
private:
|
||||||
Display *m_display;
|
Display *m_display;
|
||||||
|
|
||||||
/* Use for scancode lookups. */
|
/** Use for scan-code look-ups. */
|
||||||
XkbDescRec *m_xkb_descr;
|
XkbDescRec *m_xkb_descr;
|
||||||
|
|
||||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||||
@@ -349,20 +349,22 @@ class GHOST_SystemX11 : public GHOST_System {
|
|||||||
std::vector<GHOST_TabletX11> m_xtablets;
|
std::vector<GHOST_TabletX11> m_xtablets;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// The vector of windows that need to be updated.
|
/** The vector of windows that need to be updated. */
|
||||||
std::vector<GHOST_WindowX11 *> m_dirty_windows;
|
std::vector<GHOST_WindowX11 *> m_dirty_windows;
|
||||||
|
|
||||||
/// Start time at initialization.
|
/** Start time at initialization. */
|
||||||
GHOST_TUns64 m_start_time;
|
GHOST_TUns64 m_start_time;
|
||||||
|
|
||||||
/// A vector of keyboard key masks
|
/** A vector of keyboard key masks. */
|
||||||
char m_keyboard_vector[32];
|
char m_keyboard_vector[32];
|
||||||
|
|
||||||
/* to prevent multiple warp, we store the time of the last warp event
|
/**
|
||||||
* and stop accumulating all events generated before that */
|
* To prevent multiple warp, we store the time of the last warp event
|
||||||
|
* and stop accumulating all events generated before that.
|
||||||
|
*/
|
||||||
Time m_last_warp;
|
Time m_last_warp;
|
||||||
|
|
||||||
/* detect autorepeat glitch */
|
/* Detect auto-repeat glitch. */
|
||||||
unsigned int m_last_release_keycode;
|
unsigned int m_last_release_keycode;
|
||||||
Time m_last_release_time;
|
Time m_last_release_time;
|
||||||
|
|
||||||
|
@@ -411,17 +411,17 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
|
|||||||
NSTIFFPboardType,
|
NSTIFFPboardType,
|
||||||
nil]];
|
nil]];
|
||||||
|
|
||||||
if (state != GHOST_kWindowStateFullScreen) {
|
if (is_dialog && parentWindow) {
|
||||||
|
[parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
|
||||||
|
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
|
||||||
|
}
|
||||||
|
else if (state != GHOST_kWindowStateFullScreen) {
|
||||||
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
[m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == GHOST_kWindowStateFullScreen)
|
if (state == GHOST_kWindowStateFullScreen)
|
||||||
setState(GHOST_kWindowStateFullScreen);
|
setState(GHOST_kWindowStateFullScreen);
|
||||||
|
|
||||||
if (is_dialog && parentWindow) {
|
|
||||||
[parentWindow->getCocoaWindow() addChildWindow:m_window ordered:NSWindowAbove];
|
|
||||||
}
|
|
||||||
|
|
||||||
setNativePixelSize();
|
setNativePixelSize();
|
||||||
|
|
||||||
[pool drain];
|
[pool drain];
|
||||||
|
@@ -39,6 +39,7 @@ struct window_t {
|
|||||||
bool is_maximised;
|
bool is_maximised;
|
||||||
bool is_fullscreen;
|
bool is_fullscreen;
|
||||||
bool is_active;
|
bool is_active;
|
||||||
|
bool is_dialog;
|
||||||
int32_t width, height;
|
int32_t width, height;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -144,6 +145,7 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
|
|||||||
GHOST_TWindowState state,
|
GHOST_TWindowState state,
|
||||||
const GHOST_IWindow *parentWindow,
|
const GHOST_IWindow *parentWindow,
|
||||||
GHOST_TDrawingContextType type,
|
GHOST_TDrawingContextType type,
|
||||||
|
const bool is_dialog,
|
||||||
const bool stereoVisual,
|
const bool stereoVisual,
|
||||||
const bool exclusive)
|
const bool exclusive)
|
||||||
: GHOST_Window(width, height, state, stereoVisual, exclusive),
|
: GHOST_Window(width, height, state, stereoVisual, exclusive),
|
||||||
@@ -155,6 +157,8 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
|
|||||||
w->width = int32_t(width);
|
w->width = int32_t(width);
|
||||||
w->height = int32_t(height);
|
w->height = int32_t(height);
|
||||||
|
|
||||||
|
w->is_dialog = is_dialog;
|
||||||
|
|
||||||
/* Window surfaces. */
|
/* Window surfaces. */
|
||||||
w->surface = wl_compositor_create_surface(m_system->compositor());
|
w->surface = wl_compositor_create_surface(m_system->compositor());
|
||||||
w->egl_window = wl_egl_window_create(w->surface, int(width), int(height));
|
w->egl_window = wl_egl_window_create(w->surface, int(width), int(height));
|
||||||
@@ -376,6 +380,11 @@ GHOST_TSuccess GHOST_WindowWayland::endFullScreen() const
|
|||||||
return GHOST_kSuccess;
|
return GHOST_kSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GHOST_WindowWayland::isDialog() const
|
||||||
|
{
|
||||||
|
return w->is_dialog;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \param type The type of rendering context create.
|
* \param type The type of rendering context create.
|
||||||
* \return Indication of success.
|
* \return Indication of success.
|
||||||
|
@@ -42,6 +42,7 @@ class GHOST_WindowWayland : public GHOST_Window {
|
|||||||
GHOST_TWindowState state,
|
GHOST_TWindowState state,
|
||||||
const GHOST_IWindow *parentWindow,
|
const GHOST_IWindow *parentWindow,
|
||||||
GHOST_TDrawingContextType type,
|
GHOST_TDrawingContextType type,
|
||||||
|
const bool is_dialog,
|
||||||
const bool stereoVisual,
|
const bool stereoVisual,
|
||||||
const bool exclusive);
|
const bool exclusive);
|
||||||
|
|
||||||
@@ -106,6 +107,8 @@ class GHOST_WindowWayland : public GHOST_Window {
|
|||||||
|
|
||||||
GHOST_TSuccess endFullScreen() const override;
|
GHOST_TSuccess endFullScreen() const override;
|
||||||
|
|
||||||
|
bool isDialog() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GHOST_SystemWayland *m_system;
|
GHOST_SystemWayland *m_system;
|
||||||
struct window_t *w;
|
struct window_t *w;
|
||||||
|
@@ -126,6 +126,7 @@ void GHOST_XrContext::storeInstanceProperties()
|
|||||||
const std::map<std::string, GHOST_TXrOpenXRRuntimeID> runtime_map = {
|
const std::map<std::string, GHOST_TXrOpenXRRuntimeID> runtime_map = {
|
||||||
{"Monado(XRT) by Collabora et al", OPENXR_RUNTIME_MONADO},
|
{"Monado(XRT) by Collabora et al", OPENXR_RUNTIME_MONADO},
|
||||||
{"Oculus", OPENXR_RUNTIME_OCULUS},
|
{"Oculus", OPENXR_RUNTIME_OCULUS},
|
||||||
|
{"SteamVR/OpenXR", OPENXR_RUNTIME_STEAMVR},
|
||||||
{"Windows Mixed Reality Runtime", OPENXR_RUNTIME_WMR}};
|
{"Windows Mixed Reality Runtime", OPENXR_RUNTIME_WMR}};
|
||||||
decltype(runtime_map)::const_iterator runtime_map_iter;
|
decltype(runtime_map)::const_iterator runtime_map_iter;
|
||||||
|
|
||||||
|
@@ -49,6 +49,7 @@ struct GHOST_XrCustomFuncs {
|
|||||||
enum GHOST_TXrOpenXRRuntimeID {
|
enum GHOST_TXrOpenXRRuntimeID {
|
||||||
OPENXR_RUNTIME_MONADO,
|
OPENXR_RUNTIME_MONADO,
|
||||||
OPENXR_RUNTIME_OCULUS,
|
OPENXR_RUNTIME_OCULUS,
|
||||||
|
OPENXR_RUNTIME_STEAMVR,
|
||||||
OPENXR_RUNTIME_WMR, /* Windows Mixed Reality */
|
OPENXR_RUNTIME_WMR, /* Windows Mixed Reality */
|
||||||
|
|
||||||
OPENXR_RUNTIME_UNKNOWN
|
OPENXR_RUNTIME_UNKNOWN
|
||||||
|
@@ -181,7 +181,7 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
|
|||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool needsUpsideDownDrawing(GHOST_Context &ghost_ctx) const
|
bool needsUpsideDownDrawing(GHOST_Context &ghost_ctx) const override
|
||||||
{
|
{
|
||||||
return ghost_ctx.isUpsideDown();
|
return ghost_ctx.isUpsideDown();
|
||||||
}
|
}
|
||||||
|
@@ -380,7 +380,8 @@ static bool ghost_xr_draw_view_expects_srgb_buffer(const GHOST_XrContext *contex
|
|||||||
/* Monado seems to be faulty and doesn't do OETF transform correctly. So expect a SRGB buffer to
|
/* Monado seems to be faulty and doesn't do OETF transform correctly. So expect a SRGB buffer to
|
||||||
* compensate. You get way too dark rendering without this, it's pretty obvious (even in the
|
* compensate. You get way too dark rendering without this, it's pretty obvious (even in the
|
||||||
* default startup scene). */
|
* default startup scene). */
|
||||||
return (context->getOpenXRRuntimeID() == OPENXR_RUNTIME_MONADO);
|
GHOST_TXrOpenXRRuntimeID runtime_id = context->getOpenXRRuntimeID();
|
||||||
|
return (runtime_id == OPENXR_RUNTIME_MONADO) || (runtime_id == OPENXR_RUNTIME_STEAMVR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_XrSession::drawView(GHOST_XrSwapchain &swapchain,
|
void GHOST_XrSession::drawView(GHOST_XrSwapchain &swapchain,
|
||||||
|
@@ -858,23 +858,144 @@ void MANTA::initializeRNAMap(FluidModifierData *mmd)
|
|||||||
mRNAMap["GRAVITY_Y"] = to_string(mds->gravity[1]);
|
mRNAMap["GRAVITY_Y"] = to_string(mds->gravity[1]);
|
||||||
mRNAMap["GRAVITY_Z"] = to_string(mds->gravity[2]);
|
mRNAMap["GRAVITY_Z"] = to_string(mds->gravity[2]);
|
||||||
mRNAMap["CACHE_DIR"] = cacheDirectory;
|
mRNAMap["CACHE_DIR"] = cacheDirectory;
|
||||||
mRNAMap["NAME_DENSITY"] = FLUID_GRIDNAME_DENSITY;
|
|
||||||
mRNAMap["NAME_SHADOW"] = FLUID_GRIDNAME_SHADOW;
|
/* Fluid object names. */
|
||||||
mRNAMap["NAME_HEAT"] = FLUID_GRIDNAME_HEAT;
|
mRNAMap["NAME_FLAGS"] = FLUID_NAME_FLAGS;
|
||||||
mRNAMap["NAME_VELOCITY"] = FLUID_GRIDNAME_VELOCITY;
|
mRNAMap["NAME_VELOCITY"] = FLUID_NAME_VELOCITY;
|
||||||
mRNAMap["NAME_COLORR"] = FLUID_GRIDNAME_COLORR;
|
mRNAMap["NAME_VELOCITYTMP"] = FLUID_NAME_VELOCITYTMP;
|
||||||
mRNAMap["NAME_COLORG"] = FLUID_GRIDNAME_COLORG;
|
mRNAMap["NAME_VELOCITY_X"] = FLUID_NAME_VELOCITYX;
|
||||||
mRNAMap["NAME_COLORB"] = FLUID_GRIDNAME_COLORB;
|
mRNAMap["NAME_VELOCITY_Y"] = FLUID_NAME_VELOCITYY;
|
||||||
mRNAMap["NAME_FLAME"] = FLUID_GRIDNAME_FLAME;
|
mRNAMap["NAME_VELOCITY_Z"] = FLUID_NAME_VELOCITYZ;
|
||||||
mRNAMap["NAME_FUEL"] = FLUID_GRIDNAME_FUEL;
|
mRNAMap["NAME_PRESSURE"] = FLUID_NAME_PRESSURE;
|
||||||
mRNAMap["NAME_REACT"] = FLUID_GRIDNAME_REACT;
|
mRNAMap["NAME_PHIOBS"] = FLUID_NAME_PHIOBS;
|
||||||
mRNAMap["NAME_DENSITYNOISE"] = FLUID_GRIDNAME_DENSITYNOISE;
|
mRNAMap["NAME_PHISIN"] = FLUID_NAME_PHISIN;
|
||||||
mRNAMap["NAME_COLORRNOISE"] = FLUID_GRIDNAME_COLORRNOISE;
|
mRNAMap["NAME_PHIIN"] = FLUID_NAME_PHIIN;
|
||||||
mRNAMap["NAME_COLORGNOISE"] = FLUID_GRIDNAME_COLORGNOISE;
|
mRNAMap["NAME_PHIOUT"] = FLUID_NAME_PHIOUT;
|
||||||
mRNAMap["NAME_COLORBNOISE"] = FLUID_GRIDNAME_COLORBNOISE;
|
mRNAMap["NAME_FORCES"] = FLUID_NAME_FORCES;
|
||||||
mRNAMap["NAME_FLAMENOISE"] = FLUID_GRIDNAME_FLAMENOISE;
|
mRNAMap["NAME_FORCES_X"] = FLUID_NAME_FORCE_X;
|
||||||
mRNAMap["NAME_FUELNOISE"] = FLUID_GRIDNAME_FUELNOISE;
|
mRNAMap["NAME_FORCES_Y"] = FLUID_NAME_FORCE_Y;
|
||||||
mRNAMap["NAME_REACTNOISE"] = FLUID_GRIDNAME_REACTNOISE;
|
mRNAMap["NAME_FORCES_Z"] = FLUID_NAME_FORCE_Z;
|
||||||
|
mRNAMap["NAME_NUMOBS"] = FLUID_NAME_NUMOBS;
|
||||||
|
mRNAMap["NAME_PHIOBSSIN"] = FLUID_NAME_PHIOBSSIN;
|
||||||
|
mRNAMap["NAME_PHIOBSIN"] = FLUID_NAME_PHIOBSIN;
|
||||||
|
mRNAMap["NAME_OBVEL"] = FLUID_NAME_OBVEL;
|
||||||
|
mRNAMap["NAME_OBVELC"] = FLUID_NAME_OBVELC;
|
||||||
|
mRNAMap["NAME_OBVEL_X"] = FLUID_NAME_OBVEL_X;
|
||||||
|
mRNAMap["NAME_OBVEL_Y"] = FLUID_NAME_OBVEL_Y;
|
||||||
|
mRNAMap["NAME_OBVEL_Z"] = FLUID_NAME_OBVEL_Z;
|
||||||
|
mRNAMap["NAME_FRACTIONS"] = FLUID_NAME_FRACTIONS;
|
||||||
|
mRNAMap["NAME_INVELC"] = FLUID_NAME_INVELC;
|
||||||
|
mRNAMap["NAME_INVEL"] = FLUID_NAME_INVEL;
|
||||||
|
mRNAMap["NAME_INVEL_X"] = FLUID_NAME_INVEL_X;
|
||||||
|
mRNAMap["NAME_INVEL_Y"] = FLUID_NAME_INVEL_Y;
|
||||||
|
mRNAMap["NAME_INVEL_Z"] = FLUID_NAME_INVEL_Z;
|
||||||
|
mRNAMap["NAME_PHIOUTSIN"] = FLUID_NAME_PHIOUTSIN;
|
||||||
|
mRNAMap["NAME_PHIOUTIN"] = FLUID_NAME_PHIOUTIN;
|
||||||
|
|
||||||
|
/* Smoke object names. */
|
||||||
|
mRNAMap["NAME_SHADOW"] = FLUID_NAME_SHADOW;
|
||||||
|
mRNAMap["NAME_EMISSION"] = FLUID_NAME_EMISSION;
|
||||||
|
mRNAMap["NAME_EMISSIONIN"] = FLUID_NAME_EMISSIONIN;
|
||||||
|
mRNAMap["NAME_DENSITY"] = FLUID_NAME_DENSITY;
|
||||||
|
mRNAMap["NAME_DENSITYIN"] = FLUID_NAME_DENSITYIN;
|
||||||
|
mRNAMap["NAME_HEAT"] = FLUID_NAME_HEAT;
|
||||||
|
mRNAMap["NAME_HEATIN"] = FLUID_NAME_HEATIN;
|
||||||
|
mRNAMap["NAME_COLORR"] = FLUID_NAME_COLORR;
|
||||||
|
mRNAMap["NAME_COLORG"] = FLUID_NAME_COLORG;
|
||||||
|
mRNAMap["NAME_COLORB"] = FLUID_NAME_COLORB;
|
||||||
|
mRNAMap["NAME_COLORRIN"] = FLUID_NAME_COLORRIN;
|
||||||
|
mRNAMap["NAME_COLORGIN"] = FLUID_NAME_COLORGIN;
|
||||||
|
mRNAMap["NAME_COLORBIN"] = FLUID_NAME_COLORBIN;
|
||||||
|
mRNAMap["NAME_FLAME"] = FLUID_NAME_FLAME;
|
||||||
|
mRNAMap["NAME_FUEL"] = FLUID_NAME_FUEL;
|
||||||
|
mRNAMap["NAME_REACT"] = FLUID_NAME_REACT;
|
||||||
|
mRNAMap["NAME_FUELIN"] = FLUID_NAME_FUELIN;
|
||||||
|
mRNAMap["NAME_REACTIN"] = FLUID_NAME_REACTIN;
|
||||||
|
|
||||||
|
/* Liquid object names. */
|
||||||
|
mRNAMap["NAME_PHIPARTS"] = FLUID_NAME_PHIPARTS;
|
||||||
|
mRNAMap["NAME_PHI"] = FLUID_NAME_PHI;
|
||||||
|
mRNAMap["NAME_PHITMP"] = FLUID_NAME_PHITMP;
|
||||||
|
mRNAMap["NAME_VELOLD"] = FLUID_NAME_VELOCITYOLD;
|
||||||
|
mRNAMap["NAME_VELPARTS"] = FLUID_NAME_VELOCITYPARTS;
|
||||||
|
mRNAMap["NAME_MAPWEIGHTS"] = FLUID_NAME_MAPWEIGHTS;
|
||||||
|
mRNAMap["NAME_PP"] = FLUID_NAME_PP;
|
||||||
|
mRNAMap["NAME_PVEL"] = FLUID_NAME_PVEL;
|
||||||
|
mRNAMap["NAME_PINDEX"] = FLUID_NAME_PINDEX;
|
||||||
|
mRNAMap["NAME_GPI"] = FLUID_NAME_GPI;
|
||||||
|
mRNAMap["NAME_CURVATURE"] = FLUID_NAME_CURVATURE;
|
||||||
|
|
||||||
|
/* Noise object names. */
|
||||||
|
mRNAMap["NAME_VELOCITY_NOISE"] = FLUID_NAME_VELOCITY_NOISE;
|
||||||
|
mRNAMap["NAME_DENSITY_NOISE"] = FLUID_NAME_DENSITY_NOISE;
|
||||||
|
mRNAMap["NAME_PHIIN_NOISE"] = FLUID_NAME_PHIIN_NOISE;
|
||||||
|
mRNAMap["NAME_PHIOUT_NOISE"] = FLUID_NAME_PHIOUT_NOISE;
|
||||||
|
mRNAMap["NAME_PHIOBS_NOISE"] = FLUID_NAME_PHIOBS_NOISE;
|
||||||
|
mRNAMap["NAME_FLAGS_NOISE"] = FLUID_NAME_FLAGS_NOISE;
|
||||||
|
mRNAMap["NAME_TMPIN_NOISE"] = FLUID_NAME_TMPIN_NOISE;
|
||||||
|
mRNAMap["NAME_EMISSIONIN_NOISE"] = FLUID_NAME_EMISSIONIN_NOISE;
|
||||||
|
mRNAMap["NAME_ENERGY"] = FLUID_NAME_ENERGY;
|
||||||
|
mRNAMap["NAME_TMPFLAGS"] = FLUID_NAME_TMPFLAGS;
|
||||||
|
mRNAMap["NAME_TEXTURE_U"] = FLUID_NAME_TEXTURE_U;
|
||||||
|
mRNAMap["NAME_TEXTURE_V"] = FLUID_NAME_TEXTURE_V;
|
||||||
|
mRNAMap["NAME_TEXTURE_W"] = FLUID_NAME_TEXTURE_W;
|
||||||
|
mRNAMap["NAME_TEXTURE_U2"] = FLUID_NAME_TEXTURE_U2;
|
||||||
|
mRNAMap["NAME_TEXTURE_V2"] = FLUID_NAME_TEXTURE_V2;
|
||||||
|
mRNAMap["NAME_TEXTURE_W2"] = FLUID_NAME_TEXTURE_W2;
|
||||||
|
mRNAMap["NAME_UV0"] = FLUID_NAME_UV0;
|
||||||
|
mRNAMap["NAME_UV1"] = FLUID_NAME_UV1;
|
||||||
|
mRNAMap["NAME_COLORR_NOISE"] = FLUID_NAME_COLORR_NOISE;
|
||||||
|
mRNAMap["NAME_COLORG_NOISE"] = FLUID_NAME_COLORG_NOISE;
|
||||||
|
mRNAMap["NAME_COLORB_NOISE"] = FLUID_NAME_COLORB_NOISE;
|
||||||
|
mRNAMap["NAME_FLAME_NOISE"] = FLUID_NAME_FLAME_NOISE;
|
||||||
|
mRNAMap["NAME_FUEL_NOISE"] = FLUID_NAME_FUEL_NOISE;
|
||||||
|
mRNAMap["NAME_REACT_NOISE"] = FLUID_NAME_REACT_NOISE;
|
||||||
|
|
||||||
|
/* Mesh object names. */
|
||||||
|
mRNAMap["NAME_PHIPARTS_MESH"] = FLUID_NAME_PHIPARTS_MESH;
|
||||||
|
mRNAMap["NAME_PHI_MESH"] = FLUID_NAME_PHI_MESH;
|
||||||
|
mRNAMap["NAME_PP_MESH"] = FLUID_NAME_PP_MESH;
|
||||||
|
mRNAMap["NAME_FLAGS_MESH"] = FLUID_NAME_FLAGS_MESH;
|
||||||
|
mRNAMap["NAME_LMESH"] = FLUID_NAME_LMESH;
|
||||||
|
mRNAMap["NAME_VELOCITYVEC_MESH"] = FLUID_NAME_VELOCITYVEC_MESH;
|
||||||
|
mRNAMap["NAME_VELOCITY_MESH"] = FLUID_NAME_VELOCITY_MESH;
|
||||||
|
mRNAMap["NAME_PINDEX_MESH"] = FLUID_NAME_PINDEX_MESH;
|
||||||
|
mRNAMap["NAME_GPI_MESH"] = FLUID_NAME_GPI_MESH;
|
||||||
|
|
||||||
|
/* Particles object names. */
|
||||||
|
mRNAMap["NAME_PP_PARTICLES"] = FLUID_NAME_PP_PARTICLES;
|
||||||
|
mRNAMap["NAME_PVEL_PARTICLES"] = FLUID_NAME_PVEL_PARTICLES;
|
||||||
|
mRNAMap["NAME_PFORCE_PARTICLES"] = FLUID_NAME_PFORCE_PARTICLES;
|
||||||
|
mRNAMap["NAME_PLIFE_PARTICLES"] = FLUID_NAME_PLIFE_PARTICLES;
|
||||||
|
mRNAMap["NAME_VELOCITY_PARTICLES"] = FLUID_NAME_VELOCITY_PARTICLES;
|
||||||
|
mRNAMap["NAME_FLAGS_PARTICLES"] = FLUID_NAME_FLAGS_PARTICLES;
|
||||||
|
mRNAMap["NAME_PHI_PARTICLES"] = FLUID_NAME_PHI_PARTICLES;
|
||||||
|
mRNAMap["NAME_PHIOBS_PARTICLES"] = FLUID_NAME_PHIOBS_PARTICLES;
|
||||||
|
mRNAMap["NAME_PHIOUT_PARTICLES"] = FLUID_NAME_PHIOUT_PARTICLES;
|
||||||
|
mRNAMap["NAME_NORMAL_PARTICLES"] = FLUID_NAME_NORMAL_PARTICLES;
|
||||||
|
mRNAMap["NAME_NEIGHBORRATIO_PARTICLES"] = FLUID_NAME_NEIGHBORRATIO_PARTICLES;
|
||||||
|
mRNAMap["NAME_TRAPPEDAIR_PARTICLES"] = FLUID_NAME_TRAPPEDAIR_PARTICLES;
|
||||||
|
mRNAMap["NAME_WAVECREST_PARTICLES"] = FLUID_NAME_WAVECREST_PARTICLES;
|
||||||
|
mRNAMap["NAME_KINETICENERGY_PARTICLES"] = FLUID_NAME_KINETICENERGY_PARTICLES;
|
||||||
|
|
||||||
|
/* Guiding object names. */
|
||||||
|
mRNAMap["NAME_VELT"] = FLUID_NAME_VELT;
|
||||||
|
mRNAMap["NAME_WEIGHTGUIDE"] = FLUID_NAME_WEIGHTGUIDE;
|
||||||
|
mRNAMap["NAME_NUMGUIDES"] = FLUID_NAME_NUMGUIDES;
|
||||||
|
mRNAMap["NAME_PHIGUIDEIN"] = FLUID_NAME_PHIGUIDEIN;
|
||||||
|
mRNAMap["NAME_GUIDEVELC"] = FLUID_NAME_GUIDEVELC;
|
||||||
|
mRNAMap["NAME_GUIDEVEL_X"] = FLUID_NAME_GUIDEVEL_X;
|
||||||
|
mRNAMap["NAME_GUIDEVEL_Y"] = FLUID_NAME_GUIDEVEL_Y;
|
||||||
|
mRNAMap["NAME_GUIDEVEL_Z"] = FLUID_NAME_GUIDEVEL_Z;
|
||||||
|
mRNAMap["NAME_GUIDEVEL"] = FLUID_NAME_GUIDEVEL;
|
||||||
|
|
||||||
|
/* Cache file names. */
|
||||||
|
mRNAMap["NAME_CONFIG"] = FLUID_NAME_CONFIG;
|
||||||
|
mRNAMap["NAME_DATA"] = FLUID_NAME_DATA;
|
||||||
|
mRNAMap["NAME_NOISE"] = FLUID_NAME_NOISE;
|
||||||
|
mRNAMap["NAME_MESH"] = FLUID_NAME_MESH;
|
||||||
|
mRNAMap["NAME_PARTICLES"] = FLUID_NAME_PARTICLES;
|
||||||
|
mRNAMap["NAME_GUIDING"] = FLUID_NAME_GUIDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
string MANTA::getRealValue(const string &varName)
|
string MANTA::getRealValue(const string &varName)
|
||||||
@@ -965,7 +1086,7 @@ bool MANTA::updateFlipStructures(FluidModifierData *mmd, int framenr)
|
|||||||
mFlipParticleVelocity->clear();
|
mFlipParticleVelocity->clear();
|
||||||
|
|
||||||
string pformat = getCacheFileEnding(mds->cache_particle_format);
|
string pformat = getCacheFileEnding(mds->cache_particle_format);
|
||||||
string file = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_PP, pformat, framenr);
|
string file = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_PP, pformat, framenr);
|
||||||
|
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
@@ -973,7 +1094,7 @@ bool MANTA::updateFlipStructures(FluidModifierData *mmd, int framenr)
|
|||||||
assert(result == expected);
|
assert(result == expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
file = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_PVEL, pformat, framenr);
|
file = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_PVEL, pformat, framenr);
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
result += updateParticlesFromFile(file, false, true);
|
result += updateParticlesFromFile(file, false, true);
|
||||||
@@ -1011,7 +1132,7 @@ bool MANTA::updateMeshStructures(FluidModifierData *mmd, int framenr)
|
|||||||
|
|
||||||
string mformat = getCacheFileEnding(mds->cache_mesh_format);
|
string mformat = getCacheFileEnding(mds->cache_mesh_format);
|
||||||
string dformat = getCacheFileEnding(mds->cache_data_format);
|
string dformat = getCacheFileEnding(mds->cache_data_format);
|
||||||
string file = getFile(mmd, FLUID_DOMAIN_DIR_MESH, FLUID_FILENAME_MESH, mformat, framenr);
|
string file = getFile(mmd, FLUID_DOMAIN_DIR_MESH, FLUID_NAME_LMESH, mformat, framenr);
|
||||||
|
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
@@ -1020,7 +1141,7 @@ bool MANTA::updateMeshStructures(FluidModifierData *mmd, int framenr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mUsingMVel) {
|
if (mUsingMVel) {
|
||||||
file = getFile(mmd, FLUID_DOMAIN_DIR_MESH, FLUID_FILENAME_MESHVEL, dformat, framenr);
|
file = getFile(mmd, FLUID_DOMAIN_DIR_MESH, FLUID_NAME_VELOCITYVEC_MESH, dformat, framenr);
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
result += updateMeshFromFile(file);
|
result += updateMeshFromFile(file);
|
||||||
@@ -1056,7 +1177,8 @@ bool MANTA::updateParticleStructures(FluidModifierData *mmd, int framenr)
|
|||||||
mSndParticleLife->clear();
|
mSndParticleLife->clear();
|
||||||
|
|
||||||
string pformat = getCacheFileEnding(mds->cache_particle_format);
|
string pformat = getCacheFileEnding(mds->cache_particle_format);
|
||||||
string file = getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_FILENAME_PPSND, pformat, framenr);
|
string file = getFile(
|
||||||
|
mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_NAME_PP_PARTICLES, pformat, framenr);
|
||||||
|
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
@@ -1064,14 +1186,14 @@ bool MANTA::updateParticleStructures(FluidModifierData *mmd, int framenr)
|
|||||||
assert(result == expected);
|
assert(result == expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
file = getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_FILENAME_PVELSND, pformat, framenr);
|
file = getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_NAME_PVEL_PARTICLES, pformat, framenr);
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
result += updateParticlesFromFile(file, true, true);
|
result += updateParticlesFromFile(file, true, true);
|
||||||
assert(result == expected);
|
assert(result == expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
file = getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_FILENAME_PLIFESND, pformat, framenr);
|
file = getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_NAME_PLIFE_PARTICLES, pformat, framenr);
|
||||||
expected += 1;
|
expected += 1;
|
||||||
if (BLI_exists(file.c_str())) {
|
if (BLI_exists(file.c_str())) {
|
||||||
result += updateParticlesFromFile(file, true, false);
|
result += updateParticlesFromFile(file, true, false);
|
||||||
@@ -1135,29 +1257,29 @@ bool MANTA::updateSmokeStructures(FluidModifierData *mmd, int framenr)
|
|||||||
void *aReact[] = {mReact};
|
void *aReact[] = {mReact};
|
||||||
|
|
||||||
/* File names for grids. */
|
/* File names for grids. */
|
||||||
string fDensity = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_DENSITY, dformat, framenr);
|
string fDensity = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_DENSITY, dformat, framenr);
|
||||||
string fShadow = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_SHADOW, dformat, framenr);
|
string fShadow = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_SHADOW, dformat, framenr);
|
||||||
string fVel = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_VELOCITY, dformat, framenr);
|
string fVel = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_VELOCITY, dformat, framenr);
|
||||||
string fHeat = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_HEAT, dformat, framenr);
|
string fHeat = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_HEAT, dformat, framenr);
|
||||||
string fColorR = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_COLORR, dformat, framenr);
|
string fColorR = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_COLORR, dformat, framenr);
|
||||||
string fColorG = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_COLORG, dformat, framenr);
|
string fColorG = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_COLORG, dformat, framenr);
|
||||||
string fColorB = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_COLORB, dformat, framenr);
|
string fColorB = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_COLORB, dformat, framenr);
|
||||||
string fFlame = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_FLAME, dformat, framenr);
|
string fFlame = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_FLAME, dformat, framenr);
|
||||||
string fFuel = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_FUEL, dformat, framenr);
|
string fFuel = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_FUEL, dformat, framenr);
|
||||||
string fReact = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_REACT, dformat, framenr);
|
string fReact = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_REACT, dformat, framenr);
|
||||||
string fFluid = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_DATA, dformat, framenr);
|
string fFluid = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_DATA, dformat, framenr);
|
||||||
|
|
||||||
/* Prepare grid info containers. */
|
/* Prepare grid info containers. */
|
||||||
GridItem gDensity = {aDensity, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_DENSITY};
|
GridItem gDensity = {aDensity, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_DENSITY};
|
||||||
GridItem gShadow = {aShadow, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_SHADOW};
|
GridItem gShadow = {aShadow, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_SHADOW};
|
||||||
GridItem gVel = {aVelocities, FLUID_DOMAIN_GRID_VEC3F, res, FLUID_GRIDNAME_VELOCITY};
|
GridItem gVel = {aVelocities, FLUID_DOMAIN_GRID_VEC3F, res, FLUID_NAME_VELOCITY};
|
||||||
GridItem gHeat = {aHeat, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_HEAT};
|
GridItem gHeat = {aHeat, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_HEAT};
|
||||||
GridItem gColorR = {aColorR, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_COLORR};
|
GridItem gColorR = {aColorR, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_COLORR};
|
||||||
GridItem gColorG = {aColorG, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_COLORG};
|
GridItem gColorG = {aColorG, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_COLORG};
|
||||||
GridItem gColorB = {aColorB, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_COLORB};
|
GridItem gColorB = {aColorB, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_COLORB};
|
||||||
GridItem gFlame = {aFlame, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_FLAME};
|
GridItem gFlame = {aFlame, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_FLAME};
|
||||||
GridItem gFuel = {aFuel, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_FUEL};
|
GridItem gFuel = {aFuel, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_FUEL};
|
||||||
GridItem gReact = {aReact, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_GRIDNAME_REACT};
|
GridItem gReact = {aReact, FLUID_DOMAIN_GRID_FLOAT, res, FLUID_NAME_REACT};
|
||||||
|
|
||||||
/* TODO (sebbas): For now, only allow single file mode. Combined grid file export is todo. */
|
/* TODO (sebbas): For now, only allow single file mode. Combined grid file export is todo. */
|
||||||
const int fileMode = FLUID_DOMAIN_CACHE_FILES_SINGLE;
|
const int fileMode = FLUID_DOMAIN_CACHE_FILES_SINGLE;
|
||||||
@@ -1252,36 +1374,31 @@ bool MANTA::updateNoiseStructures(FluidModifierData *mmd, int framenr)
|
|||||||
void *aReact[] = {mReactHigh};
|
void *aReact[] = {mReactHigh};
|
||||||
|
|
||||||
/* File names for grids. */
|
/* File names for grids. */
|
||||||
string fShadow = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_SHADOW, dformat, framenr);
|
string fShadow = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_SHADOW, dformat, framenr);
|
||||||
string fVel = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_FILENAME_VELOCITY, dformat, framenr);
|
string fVel = getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_VELOCITY, dformat, framenr);
|
||||||
string fFluid = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_DATA, dformat, framenr);
|
string fFluid = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_DATA, dformat, framenr);
|
||||||
|
|
||||||
string fDensity = getFile(
|
string fDensity = getFile(
|
||||||
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_DENSITYNOISE, nformat, framenr);
|
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_DENSITY_NOISE, nformat, framenr);
|
||||||
string fColorR = getFile(
|
string fColorR = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_COLORR_NOISE, nformat, framenr);
|
||||||
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_COLORRNOISE, nformat, framenr);
|
string fColorG = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_COLORG_NOISE, nformat, framenr);
|
||||||
string fColorG = getFile(
|
string fColorB = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_COLORB_NOISE, nformat, framenr);
|
||||||
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_COLORGNOISE, nformat, framenr);
|
string fFlame = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_FLAME_NOISE, nformat, framenr);
|
||||||
string fColorB = getFile(
|
string fFuel = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_FUEL_NOISE, nformat, framenr);
|
||||||
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_COLORBNOISE, nformat, framenr);
|
string fReact = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_REACT_NOISE, nformat, framenr);
|
||||||
string fFlame = getFile(
|
string fNoise = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_NOISE, nformat, framenr);
|
||||||
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_FLAMENOISE, nformat, framenr);
|
|
||||||
string fFuel = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_FUELNOISE, nformat, framenr);
|
|
||||||
string fReact = getFile(
|
|
||||||
mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_REACTNOISE, nformat, framenr);
|
|
||||||
string fNoise = getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_NOISE, nformat, framenr);
|
|
||||||
|
|
||||||
/* Prepare grid info containers. */
|
/* Prepare grid info containers. */
|
||||||
GridItem gShadow = {aShadow, FLUID_DOMAIN_GRID_FLOAT, resData, FLUID_GRIDNAME_SHADOW};
|
GridItem gShadow = {aShadow, FLUID_DOMAIN_GRID_FLOAT, resData, FLUID_NAME_SHADOW};
|
||||||
GridItem gVel = {aVelocities, FLUID_DOMAIN_GRID_VEC3F, resData, FLUID_GRIDNAME_VELOCITY};
|
GridItem gVel = {aVelocities, FLUID_DOMAIN_GRID_VEC3F, resData, FLUID_NAME_VELOCITY};
|
||||||
|
|
||||||
GridItem gDensity = {aDensity, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_DENSITYNOISE};
|
GridItem gDensity = {aDensity, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_DENSITY_NOISE};
|
||||||
GridItem gColorR = {aColorR, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_COLORRNOISE};
|
GridItem gColorR = {aColorR, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_COLORR_NOISE};
|
||||||
GridItem gColorG = {aColorG, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_COLORGNOISE};
|
GridItem gColorG = {aColorG, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_COLORG_NOISE};
|
||||||
GridItem gColorB = {aColorB, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_COLORBNOISE};
|
GridItem gColorB = {aColorB, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_COLORB_NOISE};
|
||||||
GridItem gFlame = {aFlame, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_FLAMENOISE};
|
GridItem gFlame = {aFlame, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_FLAME_NOISE};
|
||||||
GridItem gFuel = {aFuel, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_FUELNOISE};
|
GridItem gFuel = {aFuel, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_FUEL_NOISE};
|
||||||
GridItem gReact = {aReact, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_GRIDNAME_REACTNOISE};
|
GridItem gReact = {aReact, FLUID_DOMAIN_GRID_FLOAT, resNoise, FLUID_NAME_REACT_NOISE};
|
||||||
|
|
||||||
/* TODO (sebbas): For now, only allow single file mode. Combined grid file export is todo. */
|
/* TODO (sebbas): For now, only allow single file mode. Combined grid file export is todo. */
|
||||||
const int fileMode = FLUID_DOMAIN_CACHE_FILES_SINGLE;
|
const int fileMode = FLUID_DOMAIN_CACHE_FILES_SINGLE;
|
||||||
@@ -1371,7 +1488,7 @@ bool MANTA::writeConfiguration(FluidModifierData *mmd, int framenr)
|
|||||||
|
|
||||||
string directory = getDirectory(mmd, FLUID_DOMAIN_DIR_CONFIG);
|
string directory = getDirectory(mmd, FLUID_DOMAIN_DIR_CONFIG);
|
||||||
string format = FLUID_DOMAIN_EXTENSION_UNI;
|
string format = FLUID_DOMAIN_EXTENSION_UNI;
|
||||||
string file = getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_FILENAME_CONFIG, format, framenr);
|
string file = getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_NAME_CONFIG, format, framenr);
|
||||||
|
|
||||||
/* Create 'config' subdir if it does not exist already. */
|
/* Create 'config' subdir if it does not exist already. */
|
||||||
BLI_dir_create_recursive(directory.c_str());
|
BLI_dir_create_recursive(directory.c_str());
|
||||||
@@ -1471,7 +1588,7 @@ bool MANTA::readConfiguration(FluidModifierData *mmd, int framenr)
|
|||||||
|
|
||||||
string directory = getDirectory(mmd, FLUID_DOMAIN_DIR_CONFIG);
|
string directory = getDirectory(mmd, FLUID_DOMAIN_DIR_CONFIG);
|
||||||
string format = FLUID_DOMAIN_EXTENSION_UNI;
|
string format = FLUID_DOMAIN_EXTENSION_UNI;
|
||||||
string file = getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_FILENAME_CONFIG, format, framenr);
|
string file = getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_NAME_CONFIG, format, framenr);
|
||||||
|
|
||||||
if (!hasConfig(mmd, framenr))
|
if (!hasConfig(mmd, framenr))
|
||||||
return false;
|
return false;
|
||||||
@@ -3356,42 +3473,64 @@ bool MANTA::hasConfig(FluidModifierData *mmd, int framenr)
|
|||||||
{
|
{
|
||||||
string extension = FLUID_DOMAIN_EXTENSION_UNI;
|
string extension = FLUID_DOMAIN_EXTENSION_UNI;
|
||||||
return BLI_exists(
|
return BLI_exists(
|
||||||
getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_FILENAME_CONFIG, extension, framenr).c_str());
|
getFile(mmd, FLUID_DOMAIN_DIR_CONFIG, FLUID_NAME_CONFIG, extension, framenr).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MANTA::hasData(FluidModifierData *mmd, int framenr)
|
bool MANTA::hasData(FluidModifierData *mmd, int framenr)
|
||||||
{
|
{
|
||||||
string filename = (mUsingSmoke) ? FLUID_FILENAME_DENSITY : FLUID_FILENAME_PP;
|
|
||||||
string extension = getCacheFileEnding(mmd->domain->cache_data_format);
|
string extension = getCacheFileEnding(mmd->domain->cache_data_format);
|
||||||
return BLI_exists(getFile(mmd, FLUID_DOMAIN_DIR_DATA, filename, extension, framenr).c_str());
|
bool exists = BLI_exists(
|
||||||
|
getFile(mmd, FLUID_DOMAIN_DIR_DATA, FLUID_NAME_DATA, extension, framenr).c_str());
|
||||||
|
|
||||||
|
/* Check single file naming. */
|
||||||
|
if (!exists) {
|
||||||
|
string filename = (mUsingSmoke) ? FLUID_NAME_DENSITY : FLUID_NAME_PP;
|
||||||
|
exists = BLI_exists(getFile(mmd, FLUID_DOMAIN_DIR_DATA, filename, extension, framenr).c_str());
|
||||||
|
}
|
||||||
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MANTA::hasNoise(FluidModifierData *mmd, int framenr)
|
bool MANTA::hasNoise(FluidModifierData *mmd, int framenr)
|
||||||
{
|
{
|
||||||
string extension = getCacheFileEnding(mmd->domain->cache_noise_format);
|
string extension = getCacheFileEnding(mmd->domain->cache_noise_format);
|
||||||
return BLI_exists(
|
bool exists = BLI_exists(
|
||||||
getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_FILENAME_DENSITYNOISE, extension, framenr)
|
getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_NOISE, extension, framenr).c_str());
|
||||||
|
|
||||||
|
/* Check single file naming. */
|
||||||
|
if (!exists) {
|
||||||
|
exists = BLI_exists(
|
||||||
|
getFile(mmd, FLUID_DOMAIN_DIR_NOISE, FLUID_NAME_DENSITY_NOISE, extension, framenr)
|
||||||
.c_str());
|
.c_str());
|
||||||
}
|
}
|
||||||
|
return exists;
|
||||||
|
}
|
||||||
|
|
||||||
bool MANTA::hasMesh(FluidModifierData *mmd, int framenr)
|
bool MANTA::hasMesh(FluidModifierData *mmd, int framenr)
|
||||||
{
|
{
|
||||||
string extension = getCacheFileEnding(mmd->domain->cache_mesh_format);
|
string extension = getCacheFileEnding(mmd->domain->cache_mesh_format);
|
||||||
return BLI_exists(
|
return BLI_exists(
|
||||||
getFile(mmd, FLUID_DOMAIN_DIR_MESH, FLUID_FILENAME_MESH, extension, framenr).c_str());
|
getFile(mmd, FLUID_DOMAIN_DIR_MESH, FLUID_NAME_LMESH, extension, framenr).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MANTA::hasParticles(FluidModifierData *mmd, int framenr)
|
bool MANTA::hasParticles(FluidModifierData *mmd, int framenr)
|
||||||
{
|
{
|
||||||
string extension = getCacheFileEnding(mmd->domain->cache_particle_format);
|
string extension = getCacheFileEnding(mmd->domain->cache_particle_format);
|
||||||
return BLI_exists(
|
bool exists = BLI_exists(
|
||||||
getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_FILENAME_PPSND, extension, framenr).c_str());
|
getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_NAME_PARTICLES, extension, framenr).c_str());
|
||||||
|
|
||||||
|
/* Check single file naming. */
|
||||||
|
if (!exists) {
|
||||||
|
exists = BLI_exists(
|
||||||
|
getFile(mmd, FLUID_DOMAIN_DIR_PARTICLES, FLUID_NAME_PP_PARTICLES, extension, framenr)
|
||||||
|
.c_str());
|
||||||
|
}
|
||||||
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MANTA::hasGuiding(FluidModifierData *mmd, int framenr, bool sourceDomain)
|
bool MANTA::hasGuiding(FluidModifierData *mmd, int framenr, bool sourceDomain)
|
||||||
{
|
{
|
||||||
string subdirectory = (sourceDomain) ? FLUID_DOMAIN_DIR_DATA : FLUID_DOMAIN_DIR_GUIDE;
|
string subdirectory = (sourceDomain) ? FLUID_DOMAIN_DIR_DATA : FLUID_DOMAIN_DIR_GUIDE;
|
||||||
string filename = (sourceDomain) ? FLUID_FILENAME_VELOCITY : FLUID_FILENAME_GUIDEVEL;
|
string filename = (sourceDomain) ? FLUID_NAME_VELOCITY : FLUID_NAME_GUIDEVEL;
|
||||||
string extension = getCacheFileEnding(mmd->domain->cache_data_format);
|
string extension = getCacheFileEnding(mmd->domain->cache_data_format);
|
||||||
return BLI_exists(getFile(mmd, subdirectory, filename, extension, framenr).c_str());
|
return BLI_exists(getFile(mmd, subdirectory, filename, extension, framenr).c_str());
|
||||||
}
|
}
|
||||||
@@ -3410,7 +3549,7 @@ string MANTA::getFile(
|
|||||||
{
|
{
|
||||||
char targetFile[FILE_MAX];
|
char targetFile[FILE_MAX];
|
||||||
string path = getDirectory(mmd, subdirectory);
|
string path = getDirectory(mmd, subdirectory);
|
||||||
string filename = fname + extension;
|
string filename = fname + "_####" + extension;
|
||||||
BLI_join_dirfile(targetFile, sizeof(targetFile), path.c_str(), filename.c_str());
|
BLI_join_dirfile(targetFile, sizeof(targetFile), path.c_str(), filename.c_str());
|
||||||
BLI_path_frame(targetFile, framenr, 0);
|
BLI_path_frame(targetFile, framenr, 0);
|
||||||
return targetFile;
|
return targetFile;
|
||||||
|
@@ -258,21 +258,21 @@ def fluid_adapt_time_step_$ID$():\n\
|
|||||||
const std::string fluid_alloc =
|
const std::string fluid_alloc =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Fluid alloc data')\n\
|
mantaMsg('Fluid alloc data')\n\
|
||||||
flags_s$ID$ = s$ID$.create(FlagGrid)\n\
|
flags_s$ID$ = s$ID$.create(FlagGrid, name='$NAME_FLAGS$')\n\
|
||||||
vel_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELOCITY$')\n\
|
vel_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELOCITY$')\n\
|
||||||
velTmp_s$ID$ = s$ID$.create(MACGrid)\n\
|
velTmp_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELOCITYTMP$')\n\
|
||||||
x_vel_s$ID$ = s$ID$.create(RealGrid)\n\
|
x_vel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_VELOCITY_X$')\n\
|
||||||
y_vel_s$ID$ = s$ID$.create(RealGrid)\n\
|
y_vel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_VELOCITY_Y$')\n\
|
||||||
z_vel_s$ID$ = s$ID$.create(RealGrid)\n\
|
z_vel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_VELOCITY_Z$')\n\
|
||||||
pressure_s$ID$ = s$ID$.create(RealGrid)\n\
|
pressure_s$ID$ = s$ID$.create(RealGrid, name='$NAME_PRESSURE$')\n\
|
||||||
phiObs_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiObs_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIOBS$')\n\
|
||||||
phiSIn_s$ID$ = s$ID$.create(LevelsetGrid) # helper for static flow objects\n\
|
phiSIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHISIN$') # helper for static flow objects\n\
|
||||||
phiIn_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIIN$')\n\
|
||||||
phiOut_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiOut_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIOUT$')\n\
|
||||||
forces_s$ID$ = s$ID$.create(Vec3Grid)\n\
|
forces_s$ID$ = s$ID$.create(Vec3Grid, name='$NAME_FORCES$')\n\
|
||||||
x_force_s$ID$ = s$ID$.create(RealGrid)\n\
|
x_force_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FORCES_X$')\n\
|
||||||
y_force_s$ID$ = s$ID$.create(RealGrid)\n\
|
y_force_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FORCES_Y$')\n\
|
||||||
z_force_s$ID$ = s$ID$.create(RealGrid)\n\
|
z_force_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FORCES_Z$')\n\
|
||||||
obvel_s$ID$ = None\n\
|
obvel_s$ID$ = None\n\
|
||||||
\n\
|
\n\
|
||||||
# Set some initial values\n\
|
# Set some initial values\n\
|
||||||
@@ -288,14 +288,14 @@ fluid_data_dict_resume_s$ID$ = dict(phiObs=phiObs_s$ID$, phiIn=phiIn_s$ID$, phiO
|
|||||||
const std::string fluid_alloc_obstacle =
|
const std::string fluid_alloc_obstacle =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Allocating obstacle data')\n\
|
mantaMsg('Allocating obstacle data')\n\
|
||||||
numObs_s$ID$ = s$ID$.create(RealGrid)\n\
|
numObs_s$ID$ = s$ID$.create(RealGrid, name='$NAME_NUMOBS$')\n\
|
||||||
phiObsSIn_s$ID$ = s$ID$.create(LevelsetGrid) # helper for static obstacle objects\n\
|
phiObsSIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIOBSSIN$') # helper for static obstacle objects\n\
|
||||||
phiObsIn_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiObsIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIOBSIN$')\n\
|
||||||
obvel_s$ID$ = s$ID$.create(MACGrid)\n\
|
obvel_s$ID$ = s$ID$.create(MACGrid, name='$NAME_OBVEL$')\n\
|
||||||
obvelC_s$ID$ = s$ID$.create(Vec3Grid)\n\
|
obvelC_s$ID$ = s$ID$.create(Vec3Grid, name='$NAME_OBVELC$')\n\
|
||||||
x_obvel_s$ID$ = s$ID$.create(RealGrid)\n\
|
x_obvel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_OBVEL_X$')\n\
|
||||||
y_obvel_s$ID$ = s$ID$.create(RealGrid)\n\
|
y_obvel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_OBVEL_Y$')\n\
|
||||||
z_obvel_s$ID$ = s$ID$.create(RealGrid)\n\
|
z_obvel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_OBVEL_Z$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Set some initial values\n\
|
# Set some initial values\n\
|
||||||
phiObsSIn_s$ID$.setConst(9999)\n\
|
phiObsSIn_s$ID$.setConst(9999)\n\
|
||||||
@@ -307,40 +307,40 @@ if 'fluid_data_dict_resume_s$ID$' in globals():\n\
|
|||||||
const std::string fluid_alloc_guiding =
|
const std::string fluid_alloc_guiding =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Allocating guiding data')\n\
|
mantaMsg('Allocating guiding data')\n\
|
||||||
velT_s$ID$ = s$ID$.create(MACGrid)\n\
|
velT_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELT$')\n\
|
||||||
weightGuide_s$ID$ = s$ID$.create(RealGrid)\n\
|
weightGuide_s$ID$ = s$ID$.create(RealGrid, name='$NAME_WEIGHTGUIDE$')\n\
|
||||||
numGuides_s$ID$ = s$ID$.create(RealGrid)\n\
|
numGuides_s$ID$ = s$ID$.create(RealGrid, name='$NAME_NUMGUIDES$')\n\
|
||||||
phiGuideIn_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiGuideIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIGUIDEIN$')\n\
|
||||||
guidevelC_s$ID$ = s$ID$.create(Vec3Grid)\n\
|
guidevelC_s$ID$ = s$ID$.create(Vec3Grid, name='$NAME_GUIDEVELC$')\n\
|
||||||
x_guidevel_s$ID$ = s$ID$.create(RealGrid)\n\
|
x_guidevel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_GUIDEVEL_X$')\n\
|
||||||
y_guidevel_s$ID$ = s$ID$.create(RealGrid)\n\
|
y_guidevel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_GUIDEVEL_Y$')\n\
|
||||||
z_guidevel_s$ID$ = s$ID$.create(RealGrid)\n\
|
z_guidevel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_GUIDEVEL_Z$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Final guide vel grid needs to have independent size\n\
|
# Final guide vel grid needs to have independent size\n\
|
||||||
guidevel_sg$ID$ = sg$ID$.create(MACGrid)\n\
|
guidevel_sg$ID$ = sg$ID$.create(MACGrid, name='$NAME_GUIDEVEL$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Keep track of important objects in dict to load them later on\n\
|
# Keep track of important objects in dict to load them later on\n\
|
||||||
fluid_guiding_dict_s$ID$ = dict(guidevel=guidevel_sg$ID$)\n";
|
fluid_guiding_dict_s$ID$ = { 'guidevel' : guidevel_sg$ID$ }\n";
|
||||||
|
|
||||||
const std::string fluid_alloc_fractions =
|
const std::string fluid_alloc_fractions =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Allocating fractions data')\n\
|
mantaMsg('Allocating fractions data')\n\
|
||||||
fractions_s$ID$ = s$ID$.create(MACGrid)\n";
|
fractions_s$ID$ = s$ID$.create(MACGrid, name='$NAME_FRACTIONS$')\n";
|
||||||
|
|
||||||
const std::string fluid_alloc_invel =
|
const std::string fluid_alloc_invel =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Allocating initial velocity data')\n\
|
mantaMsg('Allocating initial velocity data')\n\
|
||||||
invelC_s$ID$ = s$ID$.create(VecGrid)\n\
|
invelC_s$ID$ = s$ID$.create(VecGrid, name='$NAME_INVELC$')\n\
|
||||||
invel_s$ID$ = s$ID$.create(MACGrid)\n\
|
invel_s$ID$ = s$ID$.create(MACGrid, name='$NAME_INVEL$')\n\
|
||||||
x_invel_s$ID$ = s$ID$.create(RealGrid)\n\
|
x_invel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_INVEL_X$')\n\
|
||||||
y_invel_s$ID$ = s$ID$.create(RealGrid)\n\
|
y_invel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_INVEL_Y$')\n\
|
||||||
z_invel_s$ID$ = s$ID$.create(RealGrid)\n";
|
z_invel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_INVEL_Z$')\n";
|
||||||
|
|
||||||
const std::string fluid_alloc_outflow =
|
const std::string fluid_alloc_outflow =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Allocating outflow data')\n\
|
mantaMsg('Allocating outflow data')\n\
|
||||||
phiOutSIn_s$ID$ = s$ID$.create(LevelsetGrid) # helper for static outflow objects\n\
|
phiOutSIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIOUTSIN$') # helper for static outflow objects\n\
|
||||||
phiOutIn_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiOutIn_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIOUTIN$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Set some initial values\n\
|
# Set some initial values\n\
|
||||||
phiOutSIn_s$ID$.setConst(9999)\n\
|
phiOutSIn_s$ID$.setConst(9999)\n\
|
||||||
|
@@ -77,21 +77,21 @@ using_snd_pushout_sp$ID$ = $SNDPARTICLE_BOUNDARY_PUSHOUT$\n";
|
|||||||
const std::string liquid_alloc =
|
const std::string liquid_alloc =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Liquid alloc')\n\
|
mantaMsg('Liquid alloc')\n\
|
||||||
phiParts_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiParts_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHIPARTS$')\n\
|
||||||
phi_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phi_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHI$')\n\
|
||||||
phiTmp_s$ID$ = s$ID$.create(LevelsetGrid)\n\
|
phiTmp_s$ID$ = s$ID$.create(LevelsetGrid, name='$NAME_PHITMP$')\n\
|
||||||
velOld_s$ID$ = s$ID$.create(MACGrid)\n\
|
velOld_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELOLD$')\n\
|
||||||
velParts_s$ID$ = s$ID$.create(MACGrid)\n\
|
velParts_s$ID$ = s$ID$.create(MACGrid, name='$NAME_VELPARTS$')\n\
|
||||||
mapWeights_s$ID$ = s$ID$.create(MACGrid)\n\
|
mapWeights_s$ID$ = s$ID$.create(MACGrid, name='$NAME_MAPWEIGHTS$')\n\
|
||||||
fractions_s$ID$ = None # allocated dynamically\n\
|
fractions_s$ID$ = None # allocated dynamically\n\
|
||||||
curvature_s$ID$ = None\n\
|
curvature_s$ID$ = None\n\
|
||||||
\n\
|
\n\
|
||||||
pp_s$ID$ = s$ID$.create(BasicParticleSystem)\n\
|
pp_s$ID$ = s$ID$.create(BasicParticleSystem, name='$NAME_PP$')\n\
|
||||||
pVel_pp$ID$ = pp_s$ID$.create(PdataVec3)\n\
|
pVel_pp$ID$ = pp_s$ID$.create(PdataVec3, name='$NAME_PVEL$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Acceleration data for particle nbs\n\
|
# Acceleration data for particle nbs\n\
|
||||||
pindex_s$ID$ = s$ID$.create(ParticleIndexSystem)\n\
|
pindex_s$ID$ = s$ID$.create(ParticleIndexSystem, name='$NAME_PINDEX$')\n\
|
||||||
gpi_s$ID$ = s$ID$.create(IntGrid)\n\
|
gpi_s$ID$ = s$ID$.create(IntGrid, name='$NAME_GPI$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Keep track of important objects in dict to load them later on\n\
|
# Keep track of important objects in dict to load them later on\n\
|
||||||
liquid_data_dict_final_s$ID$ = dict(pp=pp_s$ID$, pVel=pVel_pp$ID$)\n\
|
liquid_data_dict_final_s$ID$ = dict(pp=pp_s$ID$, pVel=pVel_pp$ID$)\n\
|
||||||
@@ -100,19 +100,19 @@ liquid_data_dict_resume_s$ID$ = dict(phiParts=phiParts_s$ID$, phi=phi_s$ID$, phi
|
|||||||
const std::string liquid_alloc_mesh =
|
const std::string liquid_alloc_mesh =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Liquid alloc mesh')\n\
|
mantaMsg('Liquid alloc mesh')\n\
|
||||||
phiParts_sm$ID$ = sm$ID$.create(LevelsetGrid)\n\
|
phiParts_sm$ID$ = sm$ID$.create(LevelsetGrid, name='$NAME_PHIPARTS_MESH$')\n\
|
||||||
phi_sm$ID$ = sm$ID$.create(LevelsetGrid)\n\
|
phi_sm$ID$ = sm$ID$.create(LevelsetGrid, name='$NAME_PHI_MESH$')\n\
|
||||||
pp_sm$ID$ = sm$ID$.create(BasicParticleSystem)\n\
|
pp_sm$ID$ = sm$ID$.create(BasicParticleSystem, name='$NAME_PP_MESH$')\n\
|
||||||
flags_sm$ID$ = sm$ID$.create(FlagGrid)\n\
|
flags_sm$ID$ = sm$ID$.create(FlagGrid, name='$NAME_FLAGS_MESH$')\n\
|
||||||
mesh_sm$ID$ = sm$ID$.create(Mesh)\n\
|
mesh_sm$ID$ = sm$ID$.create(Mesh, name='$NAME_LMESH$')\n\
|
||||||
\n\
|
\n\
|
||||||
if using_speedvectors_s$ID$:\n\
|
if using_speedvectors_s$ID$:\n\
|
||||||
mVel_mesh$ID$ = mesh_sm$ID$.create(MdataVec3)\n\
|
mVel_mesh$ID$ = mesh_sm$ID$.create(MdataVec3, name='$NAME_VELOCITYVEC_MESH$')\n\
|
||||||
vel_sm$ID$ = sm$ID$.create(MACGrid)\n\
|
vel_sm$ID$ = sm$ID$.create(MACGrid, name='$NAME_VELOCITY_MESH$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Acceleration data for particle nbs\n\
|
# Acceleration data for particle nbs\n\
|
||||||
pindex_sm$ID$ = sm$ID$.create(ParticleIndexSystem)\n\
|
pindex_sm$ID$ = sm$ID$.create(ParticleIndexSystem, name='$NAME_PINDEX_MESH$')\n\
|
||||||
gpi_sm$ID$ = sm$ID$.create(IntGrid)\n\
|
gpi_sm$ID$ = sm$ID$.create(IntGrid, name='$NAME_GPI_MESH$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Set some initial values\n\
|
# Set some initial values\n\
|
||||||
phiParts_sm$ID$.setConst(9999)\n\
|
phiParts_sm$ID$.setConst(9999)\n\
|
||||||
@@ -127,24 +127,24 @@ if using_speedvectors_s$ID$:\n\
|
|||||||
const std::string liquid_alloc_curvature =
|
const std::string liquid_alloc_curvature =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Liquid alloc curvature')\n\
|
mantaMsg('Liquid alloc curvature')\n\
|
||||||
curvature_s$ID$ = s$ID$.create(RealGrid)\n";
|
curvature_s$ID$ = s$ID$.create(RealGrid, name='$NAME_CURVATURE$')\n";
|
||||||
|
|
||||||
const std::string liquid_alloc_particles =
|
const std::string liquid_alloc_particles =
|
||||||
"\n\
|
"\n\
|
||||||
ppSnd_sp$ID$ = sp$ID$.create(BasicParticleSystem)\n\
|
ppSnd_sp$ID$ = sp$ID$.create(BasicParticleSystem, name='$FLUID_NAME_PP_PARTICLES$')\n\
|
||||||
pVelSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataVec3)\n\
|
pVelSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataVec3, name='$FLUID_NAME_PVEL_PARTICLES$')\n\
|
||||||
pForceSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataVec3)\n\
|
pForceSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataVec3, name='$FLUID_NAME_PFORCE_PARTICLES$')\n\
|
||||||
pLifeSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataReal)\n\
|
pLifeSnd_pp$ID$ = ppSnd_sp$ID$.create(PdataReal, name='$FLUID_NAME_PLIFE_PARTICLES$')\n\
|
||||||
vel_sp$ID$ = sp$ID$.create(MACGrid)\n\
|
vel_sp$ID$ = sp$ID$.create(MACGrid, name='$FLUID_NAME_VELOCITY_PARTICLES$')\n\
|
||||||
flags_sp$ID$ = sp$ID$.create(FlagGrid)\n\
|
flags_sp$ID$ = sp$ID$.create(FlagGrid, name='$FLUID_NAME_FLAGS_PARTICLES$')\n\
|
||||||
phi_sp$ID$ = sp$ID$.create(LevelsetGrid)\n\
|
phi_sp$ID$ = sp$ID$.create(LevelsetGrid, name='$FLUID_NAME_PHI_PARTICLES$')\n\
|
||||||
phiObs_sp$ID$ = sp$ID$.create(LevelsetGrid)\n\
|
phiObs_sp$ID$ = sp$ID$.create(LevelsetGrid, name='$FLUID_NAME_PHIOBS_PARTICLES$')\n\
|
||||||
phiOut_sp$ID$ = sp$ID$.create(LevelsetGrid)\n\
|
phiOut_sp$ID$ = sp$ID$.create(LevelsetGrid, name='$FLUID_NAME_PHIOUT_PARTICLES$')\n\
|
||||||
normal_sp$ID$ = sp$ID$.create(VecGrid)\n\
|
normal_sp$ID$ = sp$ID$.create(VecGrid, name='$FLUID_NAME_NORMAL_PARTICLES$')\n\
|
||||||
neighborRatio_sp$ID$ = sp$ID$.create(RealGrid)\n\
|
neighborRatio_sp$ID$ = sp$ID$.create(RealGrid, name='$FLUID_NAME_NEIGHBORRATIO_PARTICLES$')\n\
|
||||||
trappedAir_sp$ID$ = sp$ID$.create(RealGrid)\n\
|
trappedAir_sp$ID$ = sp$ID$.create(RealGrid, name='$FLUID_NAME_TRAPPEDAIR_PARTICLES$')\n\
|
||||||
waveCrest_sp$ID$ = sp$ID$.create(RealGrid)\n\
|
waveCrest_sp$ID$ = sp$ID$.create(RealGrid, name='$FLUID_NAME_WAVECREST_PARTICLES$')\n\
|
||||||
kineticEnergy_sp$ID$ = sp$ID$.create(RealGrid)\n\
|
kineticEnergy_sp$ID$ = sp$ID$.create(RealGrid, name='$FLUID_NAME_KINETICENERGY_PARTICLES$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Set some initial values\n\
|
# Set some initial values\n\
|
||||||
phi_sp$ID$.setConst(9999)\n\
|
phi_sp$ID$.setConst(9999)\n\
|
||||||
|
@@ -82,10 +82,10 @@ const std::string smoke_alloc =
|
|||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Smoke alloc')\n\
|
mantaMsg('Smoke alloc')\n\
|
||||||
shadow_s$ID$ = s$ID$.create(RealGrid, name='$NAME_SHADOW$')\n\
|
shadow_s$ID$ = s$ID$.create(RealGrid, name='$NAME_SHADOW$')\n\
|
||||||
emission_s$ID$ = s$ID$.create(RealGrid)\n\
|
emission_s$ID$ = s$ID$.create(RealGrid, name='$NAME_EMISSION$')\n\
|
||||||
emissionIn_s$ID$ = s$ID$.create(RealGrid)\n\
|
emissionIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_EMISSIONIN$')\n\
|
||||||
density_s$ID$ = s$ID$.create(RealGrid, name='$NAME_DENSITY$')\n\
|
density_s$ID$ = s$ID$.create(RealGrid, name='$NAME_DENSITY$')\n\
|
||||||
densityIn_s$ID$ = s$ID$.create(RealGrid)\n\
|
densityIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_DENSITYIN$')\n\
|
||||||
heat_s$ID$ = None # allocated dynamically\n\
|
heat_s$ID$ = None # allocated dynamically\n\
|
||||||
heatIn_s$ID$ = None\n\
|
heatIn_s$ID$ = None\n\
|
||||||
flame_s$ID$ = None\n\
|
flame_s$ID$ = None\n\
|
||||||
@@ -107,22 +107,22 @@ smoke_data_dict_resume_s$ID$ = dict(densityIn=densityIn_s$ID$, emission=emission
|
|||||||
const std::string smoke_alloc_noise =
|
const std::string smoke_alloc_noise =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Smoke alloc noise')\n\
|
mantaMsg('Smoke alloc noise')\n\
|
||||||
vel_sn$ID$ = sn$ID$.create(MACGrid)\n\
|
vel_sn$ID$ = sn$ID$.create(MACGrid, name='$NAME_VELOCITY_NOISE$')\n\
|
||||||
density_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_DENSITYNOISE$')\n\
|
density_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_DENSITY_NOISE$')\n\
|
||||||
phiIn_sn$ID$ = sn$ID$.create(LevelsetGrid)\n\
|
phiIn_sn$ID$ = sn$ID$.create(LevelsetGrid, name='$NAME_PHIIN_NOISE$')\n\
|
||||||
phiOut_sn$ID$ = sn$ID$.create(LevelsetGrid)\n\
|
phiOut_sn$ID$ = sn$ID$.create(LevelsetGrid, name='$NAME_PHIOUT_NOISE$')\n\
|
||||||
phiObs_sn$ID$ = sn$ID$.create(LevelsetGrid)\n\
|
phiObs_sn$ID$ = sn$ID$.create(LevelsetGrid, name='$NAME_PHIOBS_NOISE$')\n\
|
||||||
flags_sn$ID$ = sn$ID$.create(FlagGrid)\n\
|
flags_sn$ID$ = sn$ID$.create(FlagGrid, name='$NAME_FLAGS_NOISE$')\n\
|
||||||
tmpIn_sn$ID$ = sn$ID$.create(RealGrid)\n\
|
tmpIn_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_TMPIN_NOISE$')\n\
|
||||||
emissionIn_sn$ID$ = sn$ID$.create(RealGrid)\n\
|
emissionIn_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_EMISSIONIN_NOISE$')\n\
|
||||||
energy_s$ID$ = s$ID$.create(RealGrid)\n\
|
energy_s$ID$ = s$ID$.create(RealGrid, name='$NAME_ENERGY$')\n\
|
||||||
tempFlag_s$ID$ = s$ID$.create(FlagGrid)\n\
|
tmpFlags_s$ID$ = s$ID$.create(FlagGrid, name='$NAME_TMPFLAGS$')\n\
|
||||||
texture_u_s$ID$ = s$ID$.create(RealGrid)\n\
|
texture_u_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEXTURE_U$')\n\
|
||||||
texture_v_s$ID$ = s$ID$.create(RealGrid)\n\
|
texture_v_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEXTURE_V$')\n\
|
||||||
texture_w_s$ID$ = s$ID$.create(RealGrid)\n\
|
texture_w_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEXTURE_W$')\n\
|
||||||
texture_u2_s$ID$ = s$ID$.create(RealGrid)\n\
|
texture_u2_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEXTURE_U2$')\n\
|
||||||
texture_v2_s$ID$ = s$ID$.create(RealGrid)\n\
|
texture_v2_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEXTURE_V2$')\n\
|
||||||
texture_w2_s$ID$ = s$ID$.create(RealGrid)\n\
|
texture_w2_s$ID$ = s$ID$.create(RealGrid, name='$NAME_TEXTURE_W2$')\n\
|
||||||
flame_sn$ID$ = None\n\
|
flame_sn$ID$ = None\n\
|
||||||
fuel_sn$ID$ = None\n\
|
fuel_sn$ID$ = None\n\
|
||||||
react_sn$ID$ = None\n\
|
react_sn$ID$ = None\n\
|
||||||
@@ -132,8 +132,8 @@ color_b_sn$ID$ = None\n\
|
|||||||
wltnoise_sn$ID$ = sn$ID$.create(NoiseField, fixedSeed=265, loadFromFile=True)\n\
|
wltnoise_sn$ID$ = sn$ID$.create(NoiseField, fixedSeed=265, loadFromFile=True)\n\
|
||||||
\n\
|
\n\
|
||||||
mantaMsg('Initializing UV Grids')\n\
|
mantaMsg('Initializing UV Grids')\n\
|
||||||
uvGrid0_s$ID$ = s$ID$.create(VecGrid)\n\
|
uvGrid0_s$ID$ = s$ID$.create(VecGrid, name='$NAME_UV0$')\n\
|
||||||
uvGrid1_s$ID$ = s$ID$.create(VecGrid)\n\
|
uvGrid1_s$ID$ = s$ID$.create(VecGrid, name='$NAME_UV1$')\n\
|
||||||
resetUvGrid(target=uvGrid0_s$ID$, offset=uvs_offset_s$ID$)\n\
|
resetUvGrid(target=uvGrid0_s$ID$, offset=uvs_offset_s$ID$)\n\
|
||||||
resetUvGrid(target=uvGrid1_s$ID$, offset=uvs_offset_s$ID$)\n\
|
resetUvGrid(target=uvGrid1_s$ID$, offset=uvs_offset_s$ID$)\n\
|
||||||
\n\
|
\n\
|
||||||
@@ -160,9 +160,9 @@ mantaMsg('Allocating colors')\n\
|
|||||||
color_r_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORR$')\n\
|
color_r_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORR$')\n\
|
||||||
color_g_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORG$')\n\
|
color_g_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORG$')\n\
|
||||||
color_b_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORB$')\n\
|
color_b_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORB$')\n\
|
||||||
color_r_in_s$ID$ = s$ID$.create(RealGrid)\n\
|
color_r_in_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORRIN$')\n\
|
||||||
color_g_in_s$ID$ = s$ID$.create(RealGrid)\n\
|
color_g_in_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORGIN$')\n\
|
||||||
color_b_in_s$ID$ = s$ID$.create(RealGrid)\n\
|
color_b_in_s$ID$ = s$ID$.create(RealGrid, name='$NAME_COLORBIN$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Add objects to dict to load them later on\n\
|
# Add objects to dict to load them later on\n\
|
||||||
if 'smoke_data_dict_final_s$ID$' in globals():\n\
|
if 'smoke_data_dict_final_s$ID$' in globals():\n\
|
||||||
@@ -178,9 +178,9 @@ if 'color_g_sn$ID$' in globals(): del color_g_sn$ID$\n\
|
|||||||
if 'color_b_sn$ID$' in globals(): del color_b_sn$ID$\n\
|
if 'color_b_sn$ID$' in globals(): del color_b_sn$ID$\n\
|
||||||
\n\
|
\n\
|
||||||
mantaMsg('Allocating colors noise')\n\
|
mantaMsg('Allocating colors noise')\n\
|
||||||
color_r_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORRNOISE$')\n\
|
color_r_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORR_NOISE$')\n\
|
||||||
color_g_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORGNOISE$')\n\
|
color_g_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORG_NOISE$')\n\
|
||||||
color_b_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORBNOISE$')\n\
|
color_b_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_COLORB_NOISE$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Add objects to dict to load them later on\n\
|
# Add objects to dict to load them later on\n\
|
||||||
if 'smoke_noise_dict_final_s$ID$' in globals():\n\
|
if 'smoke_noise_dict_final_s$ID$' in globals():\n\
|
||||||
@@ -214,7 +214,7 @@ if 'heatIn_s$ID$' in globals(): del heatIn_s$ID$\n\
|
|||||||
\n\
|
\n\
|
||||||
mantaMsg('Allocating heat')\n\
|
mantaMsg('Allocating heat')\n\
|
||||||
heat_s$ID$ = s$ID$.create(RealGrid, name='$NAME_HEAT$')\n\
|
heat_s$ID$ = s$ID$.create(RealGrid, name='$NAME_HEAT$')\n\
|
||||||
heatIn_s$ID$ = s$ID$.create(RealGrid)\n\
|
heatIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_HEATIN$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Add objects to dict to load them later on\n\
|
# Add objects to dict to load them later on\n\
|
||||||
if 'smoke_data_dict_final_s$ID$' in globals():\n\
|
if 'smoke_data_dict_final_s$ID$' in globals():\n\
|
||||||
@@ -235,8 +235,8 @@ mantaMsg('Allocating fire')\n\
|
|||||||
flame_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FLAME$')\n\
|
flame_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FLAME$')\n\
|
||||||
fuel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FUEL$')\n\
|
fuel_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FUEL$')\n\
|
||||||
react_s$ID$ = s$ID$.create(RealGrid, name='$NAME_REACT$')\n\
|
react_s$ID$ = s$ID$.create(RealGrid, name='$NAME_REACT$')\n\
|
||||||
fuelIn_s$ID$ = s$ID$.create(RealGrid)\n\
|
fuelIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_FUELIN$')\n\
|
||||||
reactIn_s$ID$ = s$ID$.create(RealGrid)\n\
|
reactIn_s$ID$ = s$ID$.create(RealGrid, name='$NAME_REACTIN$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Add objects to dict to load them later on\n\
|
# Add objects to dict to load them later on\n\
|
||||||
if 'smoke_data_dict_final_s$ID$' in globals():\n\
|
if 'smoke_data_dict_final_s$ID$' in globals():\n\
|
||||||
@@ -252,9 +252,9 @@ if 'fuel_sn$ID$' in globals(): del fuel_sn$ID$\n\
|
|||||||
if 'react_sn$ID$' in globals(): del react_sn$ID$\n\
|
if 'react_sn$ID$' in globals(): del react_sn$ID$\n\
|
||||||
\n\
|
\n\
|
||||||
mantaMsg('Allocating fire noise')\n\
|
mantaMsg('Allocating fire noise')\n\
|
||||||
flame_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_FLAMENOISE$')\n\
|
flame_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_FLAME_NOISE$')\n\
|
||||||
fuel_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_FUELNOISE$')\n\
|
fuel_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_FUEL_NOISE$')\n\
|
||||||
react_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_REACTNOISE$')\n\
|
react_sn$ID$ = sn$ID$.create(RealGrid, name='$NAME_REACT_NOISE$')\n\
|
||||||
\n\
|
\n\
|
||||||
# Add objects to dict to load them later on\n\
|
# Add objects to dict to load them later on\n\
|
||||||
if 'smoke_noise_dict_final_s$ID$' in globals():\n\
|
if 'smoke_noise_dict_final_s$ID$' in globals():\n\
|
||||||
@@ -493,9 +493,9 @@ def step_noise_$ID$():\n\
|
|||||||
mantaMsg('Energy')\n\
|
mantaMsg('Energy')\n\
|
||||||
computeEnergy(flags=flags_s$ID$, vel=vel_s$ID$, energy=energy_s$ID$)\n\
|
computeEnergy(flags=flags_s$ID$, vel=vel_s$ID$, energy=energy_s$ID$)\n\
|
||||||
\n\
|
\n\
|
||||||
tempFlag_s$ID$.copyFrom(flags_s$ID$)\n\
|
tmpFlags_s$ID$.copyFrom(flags_s$ID$)\n\
|
||||||
extrapolateSimpleFlags(flags=flags_s$ID$, val=tempFlag_s$ID$, distance=2, flagFrom=FlagObstacle, flagTo=FlagFluid)\n\
|
extrapolateSimpleFlags(flags=flags_s$ID$, val=tmpFlags_s$ID$, distance=2, flagFrom=FlagObstacle, flagTo=FlagFluid)\n\
|
||||||
extrapolateSimpleFlags(flags=tempFlag_s$ID$, val=energy_s$ID$, distance=6, flagFrom=FlagFluid, flagTo=FlagObstacle)\n\
|
extrapolateSimpleFlags(flags=tmpFlags_s$ID$, val=energy_s$ID$, distance=6, flagFrom=FlagFluid, flagTo=FlagObstacle)\n\
|
||||||
computeWaveletCoeffs(energy_s$ID$)\n\
|
computeWaveletCoeffs(energy_s$ID$)\n\
|
||||||
\n\
|
\n\
|
||||||
sStr_s$ID$ = 1.0 * wltStrength_s$ID$\n\
|
sStr_s$ID$ = 1.0 * wltStrength_s$ID$\n\
|
||||||
|
@@ -263,19 +263,20 @@ static void updateGLSLShader(OCIO_GLSLShader *shader,
|
|||||||
shader->curve_mapping_loc = glGetUniformLocation(shader->program, "curve_mapping");
|
shader->curve_mapping_loc = glGetUniformLocation(shader->program, "curve_mapping");
|
||||||
|
|
||||||
glUseProgram(shader->program);
|
glUseProgram(shader->program);
|
||||||
/* Set texture bind point uniform once. This is saved by the shader. */
|
|
||||||
glUniform1i(glGetUniformLocation(shader->program, "image_texture"), 0);
|
/* TODO(fclem) Remove this. Make caller always assume viewport space and
|
||||||
glUniform1i(glGetUniformLocation(shader->program, "lut3d_texture"), 2);
|
* specify texco via vertex attribs. */
|
||||||
glUniform1i(glGetUniformLocation(shader->program, "lut3d_display_texture"), 3);
|
shader->interface = GPU_shaderinterface_create(shader->program);
|
||||||
glUniform1i(glGetUniformLocation(shader->program, "curve_mapping_texture"), 4);
|
|
||||||
|
|
||||||
/* Set UBO binding location. */
|
/* Set UBO binding location. */
|
||||||
GLuint index = glGetUniformBlockIndex(shader->program, "OCIO_GLSLCurveMappingParameters");
|
GLuint index = glGetUniformBlockIndex(shader->program, "OCIO_GLSLCurveMappingParameters");
|
||||||
glUniformBlockBinding(shader->program, index, UBO_BIND_LOC);
|
glUniformBlockBinding(shader->program, index, UBO_BIND_LOC);
|
||||||
|
|
||||||
/* TODO(fclem) Remove this. Make caller always assume viewport space and
|
/* Set texture bind point uniform once. This is saved by the shader. */
|
||||||
* specify texco via vertex attribs. */
|
glUniform1i(glGetUniformLocation(shader->program, "image_texture"), 0);
|
||||||
shader->interface = GPU_shaderinterface_create(shader->program);
|
glUniform1i(glGetUniformLocation(shader->program, "lut3d_texture"), 2);
|
||||||
|
glUniform1i(glGetUniformLocation(shader->program, "lut3d_display_texture"), 3);
|
||||||
|
glUniform1i(glGetUniformLocation(shader->program, "curve_mapping_texture"), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
shader->cacheId = cache_id;
|
shader->cacheId = cache_id;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user