Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80284e3579 | ||
|
|
85af292993 | ||
|
|
101ec57e2a | ||
|
|
f70252b0b7 | ||
|
|
a27184a0fb | ||
|
|
f8f52b5eb7 | ||
|
|
24423d6c71 | ||
|
|
64380b59f7 | ||
|
|
c75f0837d5 | ||
|
|
52ddc68964 | ||
|
|
ac6f16f899 | ||
|
|
f995831810 | ||
|
|
89dbb1930d | ||
|
|
94d5fe82a2 | ||
|
|
5b05343902 | ||
|
|
aa3774ea66 | ||
|
|
c08f6ba981 | ||
|
|
1df508397e | ||
|
|
be552bf968 | ||
|
|
536dca3f7d | ||
|
|
b25063c4b6 | ||
|
|
501f991080 | ||
|
|
f71a2d73e0 | ||
|
|
a04c1a3351 | ||
|
|
347e2a804f | ||
|
|
d3dec43d5c | ||
|
|
069b4d0cb2 | ||
|
|
f6f2deb604 | ||
|
|
4bb2ea57b0 | ||
|
|
da5f5b492e | ||
|
|
9b4f1703e0 | ||
|
|
be954607fb | ||
|
|
98922bb22b | ||
|
|
e7fc1d09bb | ||
|
|
6c01601125 | ||
|
|
932775bd2f | ||
|
|
57a2deea05 | ||
|
|
0d9196bab6 | ||
|
|
1593e9094b | ||
|
|
218c20c3ae | ||
|
|
6ad92f0dee | ||
|
|
04a3802636 | ||
|
|
e12ce01a37 | ||
|
|
2da9e15570 | ||
|
|
9ff9446dd8 | ||
|
|
26de7347fa | ||
|
|
54f060e660 | ||
|
|
30e2aec785 | ||
|
|
c67b8cab8b | ||
|
|
94e37acbae | ||
|
|
3692dd553e | ||
|
|
45a2db8ab2 | ||
|
|
41b72afa62 | ||
|
|
bc1757b895 | ||
|
|
34a2557bde | ||
|
|
42d07e5e84 | ||
|
|
dc9354631d | ||
|
|
ffba3a9e24 | ||
|
|
609308b23d | ||
|
|
c9d546e8e0 | ||
|
|
013160d171 | ||
|
|
faeea0b71a | ||
|
|
f2a61c2eb5 | ||
|
|
ecff444288 | ||
|
|
282d90774a | ||
|
|
2ada835073 | ||
|
|
2258668f3f | ||
|
|
604a122646 | ||
|
|
acd097b268 | ||
|
|
f7d32333a4 | ||
|
|
bdf9ab45dc | ||
|
|
d2e1df0d9c | ||
|
|
fb0edb8372 | ||
|
|
c949a20299 | ||
|
|
b7262948b7 | ||
|
|
63aa19247a | ||
|
|
b069d58221 | ||
|
|
c590d5c94b | ||
|
|
60e00b3165 | ||
|
|
d498dcfde9 | ||
|
|
ce4e1016fc | ||
|
|
33b87d3cfd | ||
|
|
33d249da38 | ||
|
|
456855b558 | ||
|
|
a9030e6406 | ||
|
|
ff3497412f | ||
|
|
652262e3b7 | ||
|
|
c61da0ee70 | ||
|
|
55c6f7f5c5 | ||
|
|
508e9c1921 | ||
|
|
5402ed1c3e | ||
|
|
be232a7a6f | ||
|
|
b1047c5e5b | ||
|
|
9c3aa5e21b | ||
|
|
a5b91e23dc | ||
|
|
16b8b4b38d | ||
|
|
96e96d3943 | ||
|
|
573a76dda1 | ||
|
|
f9d83a54f9 | ||
|
|
0563af0164 | ||
|
|
96dfc47cfb | ||
|
|
40d0e456e9 | ||
|
|
2b8da0ff37 | ||
|
|
945a44ebc9 | ||
|
|
5aa45eda81 | ||
|
|
7af9225b7d | ||
|
|
b29ae3efd1 | ||
|
|
bb1a7a941a | ||
|
|
f04f651121 | ||
|
|
a4e0dffe68 | ||
|
|
28b38132a0 | ||
|
|
8d31a2fd9a | ||
|
|
b7875eb247 | ||
|
|
29ef593a8a | ||
|
|
db0f753023 | ||
|
|
e60ea3d882 | ||
|
|
6c5147ff42 | ||
|
|
c0a748980b | ||
|
|
8b168219e7 | ||
|
|
8671ed3ec6 | ||
|
|
31feb8d422 | ||
|
|
29aa66672e | ||
|
|
66fa810848 | ||
|
|
b54e4f4c2c | ||
|
|
b1ddfb9b02 | ||
|
|
d51e3c22b9 | ||
|
|
935eecd94b | ||
|
|
6af29ba63b | ||
|
|
eee353009c | ||
|
|
3541fff36f | ||
|
|
1fb679d403 | ||
|
|
5b5ac96f9b | ||
|
|
3380600552 | ||
|
|
989bbdd125 | ||
|
|
dc81332922 | ||
|
|
1861af7178 | ||
|
|
84aa9035dc | ||
|
|
a4271d7233 | ||
|
|
e0b6b28718 | ||
|
|
363ad7889d | ||
|
|
074f5d0e07 | ||
|
|
f761988f1d | ||
|
|
4bf4634180 | ||
|
|
b9e8115478 | ||
|
|
b5628f83ba | ||
|
|
df09e6a1e8 | ||
|
|
435ebea437 | ||
|
|
21ff84ae8d | ||
|
|
574d3f4ea7 | ||
|
|
c4355ba6ea | ||
|
|
e66833fa4f | ||
|
|
3ece3320bb | ||
|
|
3d254f8667 | ||
|
|
c69a70387d | ||
|
|
753ef7aa1c | ||
|
|
c2371d82c9 | ||
|
|
0e50b38c1d | ||
|
|
8482e03447 | ||
|
|
492db27471 | ||
|
|
961b066000 | ||
|
|
8b528d65af | ||
|
|
2077df315e | ||
|
|
b8bd0ecaca | ||
|
|
07137676d8 | ||
|
|
c1209fc272 | ||
|
|
1280b39ed0 | ||
|
|
1f263d6d2f | ||
|
|
043a5b4014 | ||
|
|
e7fa3be4bc | ||
|
|
11019acc6d | ||
|
|
7836622738 | ||
|
|
18039c7b51 | ||
|
|
0ef253f46b | ||
|
|
9c8466807e | ||
|
|
ff2f6f6786 | ||
|
|
8efb1aa9e3 | ||
|
|
fbbd14a9d5 | ||
|
|
3b1e98a05d | ||
|
|
00464b26d7 | ||
|
|
148ebdf6cc | ||
|
|
abd9269b9b | ||
|
|
56bcac49cd | ||
|
|
a970728e13 | ||
|
|
9b1d2cb556 | ||
|
|
3be5b5d0ff | ||
|
|
b919f3c7cf | ||
|
|
2bdff09928 | ||
|
|
f5a51ed533 | ||
|
|
0a3a05b316 | ||
|
|
015b1dd79f | ||
|
|
5600cea43c | ||
|
|
5b5c502f49 | ||
|
|
9078482c57 | ||
|
|
c5bf246f25 | ||
|
|
e9ef40a7af | ||
|
|
eb9e981f9d | ||
|
|
3c6ac358cc | ||
|
|
88cc0732a8 | ||
|
|
8e8ce5cf37 | ||
|
|
1db3a4cbcb | ||
|
|
3c8902a8b6 | ||
|
|
2fc5e250a2 | ||
|
|
fef4fb5e30 | ||
|
|
bcf55cb73f | ||
|
|
2bd3b659cd | ||
|
|
27a25a1147 | ||
|
|
0e655fe466 | ||
|
|
d45ef1f7e8 | ||
|
|
c2fdacb00c | ||
|
|
08111292f4 | ||
|
|
aa6534c5e8 | ||
|
|
73cf4204f1 | ||
|
|
a356451a9c | ||
|
|
51719801a4 | ||
|
|
b2517884cb | ||
|
|
e97e0278ce | ||
|
|
21234717b3 | ||
|
|
3656baab16 | ||
|
|
2f013f8921 | ||
|
|
9e9a20249f | ||
|
|
9def6a9e96 | ||
|
|
1e76cb84b8 | ||
|
|
0d8337ef27 | ||
|
|
0102937937 | ||
|
|
8664fd62b1 | ||
|
|
4400168f63 | ||
|
|
14ae46b13f | ||
|
|
9a805990c0 | ||
|
|
8668f18270 | ||
|
|
13527b957f | ||
|
|
432e8c7bbf | ||
|
|
d95b5833f5 | ||
|
|
4106d54864 | ||
|
|
3431d6131a | ||
|
|
ea97897e54 | ||
|
|
039a486510 | ||
|
|
7a924c8172 | ||
|
|
bb3e0d9cdf | ||
|
|
58e0dec8f0 | ||
|
|
2a4b20a801 | ||
|
|
811e261853 | ||
|
|
1481fc4eba | ||
|
|
e75140e73b | ||
|
|
69a19c9680 | ||
|
|
c19c5cef38 | ||
|
|
b767a65965 | ||
|
|
ad263f41d1 | ||
|
|
994576a3a0 | ||
|
|
1c4ce88bcd | ||
|
|
d551358d4e | ||
|
|
2aa442a495 | ||
|
|
f0a726f95d | ||
|
|
7f9bc6d789 | ||
|
|
cdb39c88a2 | ||
|
|
97f993faf0 | ||
|
|
81f9f361ef | ||
|
|
5044b49ec5 | ||
|
|
3732fb5c05 | ||
|
|
7c910f0a1a | ||
|
|
e2ed292835 | ||
|
|
fcf9116535 | ||
|
|
2f06d6631d | ||
|
|
242ff8f496 | ||
|
|
ee7bf906b7 | ||
|
|
9314e7ae78 | ||
|
|
c4abdb510f | ||
|
|
352a583e79 | ||
|
|
caec535bed | ||
|
|
571b7e76e9 | ||
|
|
9c977d0f02 | ||
|
|
d749f3c651 | ||
|
|
f66040f847 | ||
|
|
3d1f98e0fb | ||
|
|
aeb4735cd2 | ||
|
|
11723b39b6 | ||
|
|
fd2f6d8242 | ||
|
|
b0cc2a1eca | ||
|
|
0ed95ec157 | ||
|
|
ba32b4aece | ||
|
|
b72247baa9 | ||
|
|
1228768e41 | ||
|
|
da43b2e5ae | ||
|
|
87e5b85466 | ||
|
|
2f1807568c | ||
|
|
7c5ea41e0f | ||
|
|
059395edbf | ||
|
|
392c2dd916 | ||
|
|
0634cf0017 | ||
|
|
ac0b805778 | ||
|
|
d4738d0487 | ||
|
|
b2d2a8e8a9 | ||
|
|
59ba7919d8 | ||
|
|
8a8c80dc7c | ||
|
|
e1c00d1509 | ||
|
|
d53007c1c0 | ||
|
|
0fb56793a7 | ||
|
|
9d808f67ee | ||
|
|
76af3c2256 | ||
|
|
b84d9f25fa | ||
|
|
0464e73d9f | ||
|
|
e3d6baef71 | ||
|
|
dd70eccda3 | ||
|
|
58be9cca36 | ||
|
|
c46720efeb | ||
|
|
4023bdb539 | ||
|
|
4984b6ccfc | ||
|
|
c704078019 | ||
|
|
d6189c0785 | ||
|
|
a5cbe54f6c | ||
|
|
1c742c5577 | ||
|
|
187c538df6 | ||
|
|
4317408e36 | ||
|
|
dbb3938f83 | ||
|
|
4f29cdc9e3 | ||
|
|
70782a452b | ||
|
|
c642831fa7 | ||
|
|
6ec3b692bd | ||
|
|
0e105e383a | ||
|
|
50bcc0caad | ||
|
|
8eb52901cb | ||
|
|
059879ea52 | ||
|
|
34af6ace0a | ||
|
|
d964f08228 | ||
|
|
eb8c6688df | ||
|
|
3f88f0ce66 | ||
|
|
1afe5f611a | ||
|
|
5f4cb57836 | ||
|
|
0b9e2bb02d | ||
|
|
129df5fb92 | ||
|
|
efd242fd4e | ||
|
|
e0ae5f05e4 | ||
|
|
4898a99719 | ||
|
|
81c172e275 | ||
|
|
00190ef343 | ||
|
|
fae79d9d5e | ||
|
|
04c1c44e66 | ||
|
|
34cbc9c308 | ||
|
|
e1273b0256 | ||
|
|
f655001a96 | ||
|
|
10e9487f77 | ||
|
|
edd9401828 | ||
|
|
69249704b7 | ||
|
|
9a3331665d | ||
|
|
ff0b333c71 | ||
|
|
ef6d9fe0f8 | ||
|
|
077d494b2f | ||
|
|
0a136c95e0 | ||
|
|
bbf3cfc243 | ||
|
|
bd572d3799 | ||
|
|
c856b0b25a | ||
|
|
ba884d5050 | ||
|
|
1a3c29d648 | ||
|
|
a3a466089b | ||
|
|
078c589aaa | ||
|
|
73f4c42d9b | ||
|
|
003b647c75 | ||
|
|
e78ee5f2f8 | ||
|
|
4d86a353f2 | ||
|
|
1122689881 | ||
|
|
b5c714a0b7 | ||
|
|
649a743961 | ||
|
|
d1bed79b3c | ||
|
|
bb10f82450 | ||
|
|
6c9b1489bf | ||
|
|
4e8d2d42a0 | ||
|
|
01abb2e970 | ||
|
|
653b146cd3 | ||
|
|
ae1cba844c | ||
|
|
2a05a9c6c1 | ||
|
|
f9d7785cad | ||
|
|
964a41de26 | ||
|
|
85d816070b | ||
|
|
ec8671a320 | ||
|
|
df49686230 | ||
|
|
bf25836fd5 | ||
|
|
13bdd11b99 | ||
|
|
f3f1416563 | ||
|
|
d7762836ce | ||
|
|
fdda0889f9 | ||
|
|
d3322a74a3 | ||
|
|
ade96f0442 | ||
|
|
86145c6041 | ||
|
|
52836d0c3e | ||
|
|
d660e4ac14 | ||
|
|
58433bf2d4 | ||
|
|
13990355a7 | ||
|
|
cd250ef031 | ||
|
|
b759e340b7 | ||
|
|
7d080b6eb3 | ||
|
|
3f0eb05b78 | ||
|
|
918fe73f70 | ||
|
|
8e78559521 | ||
|
|
71b8700170 | ||
|
|
c16152674a | ||
|
|
a9956f0c35 | ||
|
|
79916120c2 | ||
|
|
9153539635 | ||
|
|
d552f2ecf2 | ||
|
|
80c6a18e69 | ||
|
|
34040261a5 | ||
|
|
8742857bff | ||
|
|
951d4b79d0 | ||
|
|
587de6cf84 | ||
|
|
3d425603c7 | ||
|
|
ce690955b4 | ||
|
|
b699bc55b4 | ||
|
|
df63f1dfa3 | ||
|
|
85ed539e28 | ||
|
|
152d5fc414 | ||
|
|
15d5bd1077 | ||
|
|
01beea16f1 | ||
|
|
384cfade35 | ||
|
|
0fa608232a | ||
|
|
6fe34350f9 | ||
|
|
bc891f413f | ||
|
|
bf877c9e36 | ||
|
|
ce42e06709 | ||
|
|
3efa6f9146 | ||
|
|
28ca5a96f1 | ||
|
|
31264b66eb | ||
|
|
95f7589541 | ||
|
|
765991f40b | ||
|
|
23185f67f6 | ||
|
|
5c4c3f8232 | ||
|
|
1549c1b32c | ||
|
|
e9ed53ec50 | ||
|
|
9d0966919a | ||
|
|
9a8963c0d6 | ||
|
|
0a2ecdfd25 | ||
|
|
1e9400a75a | ||
|
|
250c95a251 | ||
|
|
67dfbc0318 | ||
|
|
06c4001431 | ||
|
|
8838b006d6 | ||
|
|
e18f3d15bd | ||
|
|
3475ae1166 | ||
|
|
e7ab776b76 | ||
|
|
733807c076 | ||
|
|
49cecc70f3 | ||
|
|
7cb98c9310 | ||
|
|
2b90ed0c43 | ||
|
|
80df2e9a92 | ||
|
|
fe4b3806f8 | ||
|
|
f0d485990d | ||
|
|
eeff6a95f6 | ||
|
|
19018de25e | ||
|
|
5559419d21 | ||
|
|
1bdc4e13c7 | ||
|
|
04f7149fd1 | ||
|
|
bd6c657fd6 | ||
|
|
82e3564a57 | ||
|
|
d53a6832c4 | ||
|
|
8c7f62383b | ||
|
|
3bb1f557a9 | ||
|
|
6db0860142 | ||
|
|
bbbfb2ef07 | ||
|
|
3f69d3b3f0 | ||
|
|
dee4cfbbe8 | ||
|
|
68ca7afb62 | ||
|
|
cbf9d26d02 | ||
|
|
a33e486ef3 | ||
|
|
ff80074872 | ||
|
|
c1b27d0b19 | ||
|
|
b81afca8f7 | ||
|
|
a884edc34a | ||
|
|
2703c1493c | ||
|
|
89ad98b14b |
@@ -1 +1,2 @@
|
||||
*.rc text working-tree-encoding=UTF-16LE-BOM eol=CRLF
|
||||
*.patch eol=lf
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Baseline
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-ubuntu2004-gcc:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:20.04
|
||||
cmd: |
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-ubuntu2004-gcc
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
### Benchmarks ###
|
||||
|
||||
generate-ci-baseline-avx2:
|
||||
needs: build-ubuntu2004-gcc
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:20.04
|
||||
runs-on: '"avx2"'
|
||||
cmd: |
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
|
||||
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
|
||||
scripts/tests/generate_baseline.sh
|
||||
artifact-in: build-ubuntu2004-gcc
|
||||
artifact-out: generate-ci-baseline-avx2
|
||||
artifact-path: generated_test_images
|
||||
|
||||
generate-ci-baseline-avx512skx:
|
||||
needs: build-ubuntu2004-gcc
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:20.04
|
||||
cmd: |
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
|
||||
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
|
||||
scripts/tests/generate_baseline.sh
|
||||
artifact-in: build-ubuntu2004-gcc
|
||||
artifact-out: generate-ci-baseline-avx512skx
|
||||
artifact-path: generated_test_images
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Benchmark
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-linux:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8.7
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
module load mpi/mpich-x86_64
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -DBUILD_GPU_SUPPORT=ON
|
||||
artifact-out: build-linux
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
### Benchmarks ###
|
||||
|
||||
benchmark-x8280-1:
|
||||
needs: build-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '"vis-perf-x8280-1"'
|
||||
setup-benny: true
|
||||
cmd: |
|
||||
scripts/tests/run-benchmarks.sh
|
||||
artifact-in: build-linux
|
||||
|
||||
benchmark-x8380-1:
|
||||
needs: build-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '"vis-perf-x8380-1"'
|
||||
setup-benny: true
|
||||
cmd: |
|
||||
scripts/tests/run-benchmarks.sh
|
||||
artifact-in: build-linux
|
||||
|
||||
benchmark-a-1:
|
||||
needs: build-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '"vis-perf-a3970x-1"'
|
||||
setup-benny: true
|
||||
cmd: |
|
||||
scripts/tests/run-benchmarks.sh
|
||||
artifact-in: build-linux
|
||||
|
||||
benchmark-adl-1:
|
||||
needs: build-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '"vis-perf-i9-12900k-1"'
|
||||
setup-benny: true
|
||||
cmd: |
|
||||
scripts/tests/run-benchmarks.sh
|
||||
artifact-in: build-linux
|
||||
|
||||
benchmark-dg2:
|
||||
needs: build-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"vis-perf-dg2-01"'
|
||||
setup-benny: true
|
||||
cmd: |
|
||||
scripts/tests/run-benchmarks.sh GPU
|
||||
artifact-in: build-linux
|
||||
|
||||
benchmark-pvc:
|
||||
needs: build-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"vis-perf-spr-pvc-01"'
|
||||
setup-benny: true
|
||||
cmd: |
|
||||
scripts/tests/run-benchmarks.sh GPU
|
||||
artifact-in: build-linux
|
||||
@@ -0,0 +1,242 @@
|
||||
## Copyright 2022 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: CI Linux GPU
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
ubu22-mpi-dpcpp-build:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-ubuntu2204-mpi-dpcpp
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
|
||||
ubu22-mpi-icx-build:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env # OIDN AOT needs ocloc
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
|
||||
artifact-out: build-ubuntu2204-mpi-icx
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
|
||||
suse-icx-build:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: opensuse/leap:15.3
|
||||
env-from-files: .github/workflows/icx-linux.env
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
scripts/build/linux.sh -DBUILD_GPU_SUPPORT=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON
|
||||
|
||||
rocky8-mpich-dpcpp-build:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
module load mpi/mpich-x86_64
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-rocky8-mpich-dpcpp
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
dpcpp-dg2-ubu22-test:
|
||||
needs: ubu22-mpi-dpcpp-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"dg2"'
|
||||
artifact-in: build-ubuntu2204-mpi-dpcpp
|
||||
artifact-out: test-ubuntu2204-dpcpp-dg2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
|
||||
|
||||
dpcpp-pvc-ubu22-test:
|
||||
needs: ubu22-mpi-dpcpp-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"pvc"'
|
||||
artifact-in: build-ubuntu2204-mpi-dpcpp
|
||||
artifact-out: test-ubuntu2204-dpcpp-pvc
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
|
||||
|
||||
mpi-dpcpp-pvc-ubu22-test:
|
||||
needs: ubu22-mpi-dpcpp-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"pvc"'
|
||||
artifact-in: build-ubuntu2204-mpi-dpcpp
|
||||
artifact-out: test-ubuntu2204-mpi-dpcpp-pvc
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
|
||||
|
||||
multidev-dpcpp-pvc-ubu22-test:
|
||||
needs: ubu22-mpi-dpcpp-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"pvc"'
|
||||
artifact-in: build-ubuntu2204-mpi-dpcpp
|
||||
artifact-out: test-ubuntu2204-multidev-dpcpp-pvc
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MULTIDEVICE
|
||||
|
||||
icx-dg2-ubu22-test:
|
||||
needs: ubu22-mpi-icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"dg2"'
|
||||
artifact-in: build-ubuntu2204-mpi-icx
|
||||
artifact-out: test-ubuntu2204-icx-dg2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
|
||||
|
||||
mpi-icx-dg2-ubu22-test:
|
||||
needs: ubu22-mpi-icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"dg2"'
|
||||
artifact-in: build-ubuntu2204-mpi-icx
|
||||
artifact-out: test-ubuntu2204-mpi-icx-dg2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
|
||||
|
||||
icx-pvc-ubu22-test:
|
||||
needs: ubu22-mpi-icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"pvc"'
|
||||
artifact-in: build-ubuntu2204-mpi-icx
|
||||
artifact-out: test-ubuntu2204-icx-pvc
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
|
||||
|
||||
mpi-icx-pvc-ubu22-test:
|
||||
needs: ubu22-mpi-icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"pvc"'
|
||||
artifact-in: build-ubuntu2204-mpi-icx
|
||||
artifact-out: test-ubuntu2204-mpi-icx-pvc
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
|
||||
|
||||
multidev-icx-pvc-ubu22-test:
|
||||
needs: ubu22-mpi-icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"pvc"'
|
||||
artifact-in: build-ubuntu2204-mpi-icx
|
||||
artifact-out: test-ubuntu2204-multidev-icx-pvc
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MULTIDEVICE
|
||||
|
||||
@@ -0,0 +1,432 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: CI Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-arch-clang:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF
|
||||
|
||||
build-arch-clang-extras:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
|
||||
build-arch-gcc:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF
|
||||
|
||||
build-ubuntu2404-gcc-extras:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:24.04
|
||||
cmd: |
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON
|
||||
|
||||
build-rocky8-gcc:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
|
||||
artifact-out: build-rocky8-gcc
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-rocky8-icx:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake
|
||||
module load intel/2022.1
|
||||
export CC=icx
|
||||
export CXX=icpx
|
||||
export CXXFLAGS="-fhonor-infinities -fhonor-nans"
|
||||
export CFLAGS=$CXXFLAGS
|
||||
export LDFLAGS="-static-intel"
|
||||
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DTBB_VERSION=2021.9.0
|
||||
artifact-out: build-rocky8-icx
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-rocky8-mpi-impi:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake
|
||||
module load impi/2021.6
|
||||
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
|
||||
|
||||
build-rocky8-mpi-mpich:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake
|
||||
module load mpi/mpich-x86_64
|
||||
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
|
||||
artifact-out: build-rocky8-mpi-mpich
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-rocky8-mpi-openmpi:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake
|
||||
module load mpi/openmpi-x86_64
|
||||
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
|
||||
|
||||
build-centos8:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: centos:8
|
||||
cmd: |
|
||||
scripts/build/linux.sh -G Ninja
|
||||
artifact-out: build-centos8
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-centos8-mpi-mpich:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: centos:8
|
||||
cmd: |
|
||||
module load mpi/mpich-x86_64
|
||||
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
|
||||
build-centos8-mpi-openmpi:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: centos:8
|
||||
cmd: |
|
||||
module load mpi/openmpi-x86_64
|
||||
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
|
||||
build-rocky8-oidn-mpi:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake/3.15.2
|
||||
module load mpi/mpich-x86_64
|
||||
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
artifact-out: build-rocky8-oidn-mpi
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-linux-debug:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
export CFLAGS=-fsanitize=address
|
||||
export CXXFLAGS=-fsanitize=address
|
||||
export LDFLAGS=-fsanitize=address
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DCMAKE_BUILD_TYPE=Debug -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
artifact-out: build-linux-debug
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt build/install/embree
|
||||
|
||||
build-ubuntu2404-gcc:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:24.04
|
||||
cmd: |
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF
|
||||
artifact-out: build-ubuntu2404-gcc
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-ubuntu2004-gcc:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:20.04
|
||||
cmd: |
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-ubuntu2004-gcc
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-ubuntu2204-oidn-mpi:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
cmd: |
|
||||
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
artifact-out: build-ubuntu2204-oidn-mpi
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-ubuntu2204-arm:
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
with:
|
||||
runs-on: '[ "Linux", "ARM64" ]'
|
||||
cmd: |
|
||||
scripts/build/linux.sh -DBUILD_GLFW=OFF -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
|
||||
artifact-out: build-ubuntu2204-arm
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
test-rocky8-gcc-avx2:
|
||||
needs: build-rocky8-gcc
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2
|
||||
artifact-in: build-rocky8-gcc
|
||||
artifact-out: test-rocky8-gcc-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-rocky8-gcc-mpi-mpich-avx2:
|
||||
needs: build-rocky8-mpi-mpich
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake
|
||||
module load mpi/mpich-x86_64
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2 TEST_MPI
|
||||
artifact-in: build-rocky8-mpi-mpich
|
||||
artifact-out: test-rocky8-gcc-mpi-mpich-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-rocky8-icx-avx2:
|
||||
needs: build-rocky8-icx
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
runs-on: '"avx2"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2
|
||||
artifact-in: build-rocky8-icx
|
||||
artifact-out: test-rocky8-icx-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-rocky8-icx-avx512skx:
|
||||
needs: build-rocky8-icx
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-rocky8-icx
|
||||
artifact-out: test-rocky8-icx-avx512skx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-centos8-avx512skx:
|
||||
needs: build-centos8
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: centos:8
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-centos8
|
||||
artifact-out: test-centos8-avx512skx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-rocky8-oidn-mpi-avx512skx:
|
||||
needs: build-rocky8-oidn-mpi
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
module load cmake/3.15.2
|
||||
module load mpi/mpich-x86_64
|
||||
export OIDN_DEFAULT_DEVICE=cpu
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX TEST_MPI
|
||||
artifact-in: build-rocky8-oidn-mpi
|
||||
artifact-out: test-rocky8-oidn-mpi-avx512skx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-find-ospray:
|
||||
needs: build-centos8
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: centos:8
|
||||
cmd: |
|
||||
module load cmake
|
||||
mkdir buildtut
|
||||
cd buildtut
|
||||
cmake -D ospray_DIR=`echo $GITHUB_WORKSPACE/build/install/ospray/lib/cmake/ospray-*` ../apps/ospTutorial/ospTutorialFindospray
|
||||
cmake --build .
|
||||
artifact-in: build-centos8
|
||||
|
||||
test-ubuntu2404-gcc-avx512skx:
|
||||
needs: build-ubuntu2404-gcc
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:24.04
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-ubuntu2404-gcc
|
||||
artifact-out: test-ubuntu2404-gcc-avx512skx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-ubuntu2004-gcc-avx2:
|
||||
needs: build-ubuntu2004-gcc
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:20.04
|
||||
runs-on: '"avx2"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2
|
||||
artifact-in: build-ubuntu2004-gcc
|
||||
artifact-out: test-ubuntu2004-gcc-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-ubuntu2004-gcc-avx512skx:
|
||||
needs: build-ubuntu2004-gcc
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:20.04
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX TEST_MULTIDEVICE
|
||||
artifact-in: build-ubuntu2004-gcc
|
||||
artifact-out: test-ubuntu2004-gcc-avx512skx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-ubuntu2204-oidn-mpi-avx2-dg2:
|
||||
needs: build-ubuntu2204-oidn-mpi
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/dpcpp.env .github/workflows/gfx-ubuntu22.env
|
||||
submodules: true
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"dg2"'
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
export OIDN_DEFAULT_DEVICE=sycl
|
||||
export OIDN_VERBOSE=2
|
||||
mkdir build_regression_tests
|
||||
cd build_regression_tests
|
||||
cmake -D OSPRAY_TEST_ISA=AVX2 $GITHUB_WORKSPACE/test_image_data
|
||||
cmake --build . --target ospray_test_data
|
||||
ospTestSuite --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp"
|
||||
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 mpiexec -np 1 ospTestSuite --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp" --osp:load-modules=mpi_offload --osp:device=mpiOffload : -np 2 ospray_mpi_worker
|
||||
artifact-in: build-ubuntu2204-oidn-mpi
|
||||
|
||||
test-ubuntu2204-arm:
|
||||
needs: build-ubuntu2204-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
with:
|
||||
runs-on: '[ "Linux", "ARM64" ]'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-ubuntu2204-arm
|
||||
artifact-out: test-ubuntu2204-arm
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
#artifact-on-failure: true
|
||||
|
||||
test-tutorials:
|
||||
needs: build-centos8
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: centos:8
|
||||
cmd: scripts/tests/run_tutorials.sh
|
||||
artifact-in: build-centos8
|
||||
|
||||
test-mpi-tutorials:
|
||||
needs: build-rocky8-oidn-mpi
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake/3.15.2
|
||||
module load mpi/mpich-x86_64
|
||||
scripts/tests/run_tutorials.sh TEST_MPI
|
||||
artifact-in: build-rocky8-oidn-mpi
|
||||
|
||||
sanitize-cpu:
|
||||
needs: build-linux-debug
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/embree/lib:$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
|
||||
export TBB_ENABLE_SANITIZERS=1
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
|
||||
artifact-in: build-linux-debug
|
||||
|
||||
sanitize-bench:
|
||||
needs: build-linux-debug
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/embree/lib:$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
|
||||
export TBB_ENABLE_SANITIZERS=1
|
||||
build/install/ospray/bin/ospBenchmark --benchmark_min_time=0s
|
||||
artifact-in: build-linux-debug
|
||||
|
||||
sanitize-mpi:
|
||||
needs: build-linux-debug
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/embree/lib:$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
|
||||
export TBB_ENABLE_SANITIZERS=1
|
||||
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
|
||||
artifact-in: build-linux-debug
|
||||
@@ -0,0 +1,89 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: CI MacOS
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-osx-clang:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["x86_64", "build"]'
|
||||
cmd: |
|
||||
scripts/build/macosx.sh -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-osx-clang
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-osx-arm:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["arm", "build"]'
|
||||
cmd: |
|
||||
scripts/build/macosx.sh -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON
|
||||
artifact-out: build-osx-arm
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
build-osx-x64-on-arm:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["arm", "build"]'
|
||||
cmd: |
|
||||
scripts/build/macosx.sh -DCMAKE_TOOLCHAIN_FILE=../scripts/superbuild/toolchains/macos-rosetta.cmake -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_ISA_AVX=OFF -DBUILD_ISA_AVX2=OFF -DBUILD_ISA_AVX512=OFF
|
||||
artifact-out: build-osx-x64
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
test-osx-clang:
|
||||
needs: build-osx-clang
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["x86_64", "avx2", "build"]'
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2 TEST_MULTIDEVICE
|
||||
artifact-in: build-osx-clang
|
||||
artifact-out: test-osx-clang
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-osx-arm:
|
||||
needs: build-osx-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["arm", "build"]'
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-osx-arm
|
||||
artifact-out: test-osx-arm
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-osx-x64-on-arm:
|
||||
needs: build-osx-x64-on-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["arm", "build"]'
|
||||
cmd: |
|
||||
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
|
||||
scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-osx-x64
|
||||
artifact-out: test-osx-x64
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
@@ -0,0 +1,118 @@
|
||||
## Copyright 2023 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: CI Windows GPU
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
dpcpp-build:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["build", "mpi"]'
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
$env:SYCL_BUNDLE_ROOT = $env:DPCPP_ROOT
|
||||
# disable warnings which lead to excessively large log files
|
||||
$env:CXXFLAGS = '-w'
|
||||
$env:CFLAGS = '-w'
|
||||
scripts\build\win.ps1 -G Ninja -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
artifact-out: build-windows-dpcpp
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
|
||||
|
||||
icx-build:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["build", "mpi"]'
|
||||
env-from-files: .github/workflows/icx-windows.env
|
||||
ocloc-version: 77a13ae6-6100-4ddc-b069-0086ff44730c/ocloc_win_101.5082
|
||||
cmd: |
|
||||
# disable warnings which lead to excessively large log files
|
||||
$env:CXXFLAGS = '-w'
|
||||
$env:CFLAGS = '-w'
|
||||
scripts\build\win.ps1 -G Ninja -DCMAKE_CXX_COMPILER=icx -DCMAKE_C_COMPILER=icx -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
|
||||
artifact-out: build-windows-icx
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
|
||||
|
||||
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
dpcpp-test:
|
||||
needs: dpcpp-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '"dg2"'
|
||||
env-from-files: .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE"
|
||||
artifact-in: build-windows-dpcpp
|
||||
artifact-out: test-windows-dpcpp
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
mpi-dpcpp-test:
|
||||
needs: dpcpp-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '["dg2"]' # FIXME, "mpi"
|
||||
env-from-files: .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
|
||||
artifact-in: build-windows-dpcpp
|
||||
artifact-out: test-windows-dpcpp-mpi
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
icx-test:
|
||||
needs: icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '"dg2"'
|
||||
env-from-files: .github/workflows/icx-windows.env .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE"
|
||||
artifact-in: build-windows-icx
|
||||
artifact-out: test-windows-icx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
mpi-icx-test:
|
||||
needs: icx-build
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '["dg2"]' # FIXME, "mpi"
|
||||
env-from-files: .github/workflows/icx-windows.env .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
|
||||
artifact-in: build-windows-icx
|
||||
artifact-out: test-windows-icx-mpi
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
@@ -0,0 +1,114 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: CI Windows
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-windows-msvc15:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
cmd: |
|
||||
scripts\build\win.ps1 -G "Visual Studio 15 2017 Win64"
|
||||
artifact-out: build-windows-msvc15
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
|
||||
|
||||
build-windows-msvc16-mpi_and_md:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["build", "mpi"]'
|
||||
cmd: |
|
||||
scripts\build\win.ps1 -G "Visual Studio 16 2019" -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-windows-msvc16-mpi_and_md
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
|
||||
|
||||
build-windows-msvc17:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
cmd: |
|
||||
scripts\build\win.ps1 -G "Visual Studio 17 2022"
|
||||
artifact-out: build-windows-msvc17
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
test-windows-msvc15-avx2:
|
||||
needs: build-windows-msvc15
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '"avx2"'
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX2
|
||||
artifact-in: build-windows-msvc15
|
||||
artifact-out: test-windows-msvc15-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-windows-msvc15-avx512skx:
|
||||
needs: build-windows-msvc15
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-windows-msvc15
|
||||
artifact-out: test-windows-msvc15-avx512
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-windows-msvc16-avx2:
|
||||
needs: build-windows-msvc16-mpi_and_md
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '["avx2", "mpi"]'
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX2 TEST_MULTIDEVICE TEST_MPI
|
||||
artifact-in: build-windows-msvc16-mpi_and_md
|
||||
artifact-out: test-windows-msvc16-mpi_and_md-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-windows-msvc16-avx512skx:
|
||||
needs: build-windows-msvc16-mpi_and_md
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '["avx512", "mpi"]'
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
echo $env:Path
|
||||
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX512SKX TEST_MULTIDEVICE TEST_MPI
|
||||
artifact-in: build-windows-msvc16-mpi_and_md
|
||||
artifact-out: test-windows-msvc16-mpi_and_md-avx512skx
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
test-windows-msvc17:
|
||||
needs: build-windows-msvc17
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-windows-msvc17
|
||||
artifact-out: test-windows-msvc17-avx512
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
@@ -0,0 +1 @@
|
||||
DPCPP_VERSION=intel-llvm/nightly-2023-10-26-rk
|
||||
@@ -0,0 +1 @@
|
||||
GFX_DRIVER_VERSION=linux-latest
|
||||
@@ -0,0 +1 @@
|
||||
GFX_DRIVER_VERSION=windows-101.5445
|
||||
@@ -0,0 +1 @@
|
||||
DPCPP_VERSION=intel/2024.1.0
|
||||
@@ -0,0 +1 @@
|
||||
DPCPP_VERSION=oneAPI/compiler/2024.1
|
||||
@@ -0,0 +1,162 @@
|
||||
## Copyright 2024 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: public CI Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
generate-baseline-images:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: |
|
||||
echo "Installing build dependencies..."
|
||||
apt update
|
||||
apt upgrade -y
|
||||
apt install -y build-essential cmake ninja-build libglfw3-dev libgl1-mesa-dev libxinerama-dev libxcursor-dev libxi-dev git
|
||||
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate baseline images
|
||||
run: |
|
||||
git config --global --add safe.directory `pwd`
|
||||
mkdir build_regression_tests
|
||||
cd build_regression_tests
|
||||
cmake ../test_image_data
|
||||
cmake --build . --target ospray_test_data --parallel 8
|
||||
|
||||
- name: Upload baseline images
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: baseline-images
|
||||
path: |
|
||||
build_regression_tests/regression_test_baseline/*.png
|
||||
build_regression_tests/regression_test_baseline/*.exr
|
||||
build_regression_tests/regression_test_baseline/*.jpg
|
||||
compression-level: 1
|
||||
|
||||
build-rocky-8:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: rockylinux:8
|
||||
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: |
|
||||
echo "Installing build dependencies..."
|
||||
dnf update -y
|
||||
dnf install -y git cmake mesa-libGL-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel
|
||||
dnf group install -y "Development Tools"
|
||||
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
git config --global --add safe.directory `pwd`
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../scripts/superbuild
|
||||
cmake --build . --parallel 8
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-rocky-8
|
||||
path: build/install/ospray
|
||||
|
||||
|
||||
test-rocky-8:
|
||||
needs: [build-rocky-8, generate-baseline-images]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: rockylinux:8
|
||||
|
||||
steps:
|
||||
- name: Download build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-rocky-8
|
||||
|
||||
- name: Download baseline images
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: baseline-images
|
||||
path: regression_test_baseline
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
chmod +x ./bin/*
|
||||
./bin/ospTutorial
|
||||
./bin/ospTestSuite
|
||||
|
||||
|
||||
build-ubuntu-2204:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: |
|
||||
echo "Installing build dependencies..."
|
||||
apt update
|
||||
apt upgrade -y
|
||||
apt install -y build-essential cmake ninja-build libglfw3-dev libgl1-mesa-dev libxinerama-dev libxcursor-dev libxi-dev git
|
||||
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
git config --global --add safe.directory `pwd`
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../scripts/superbuild
|
||||
cmake --build . --parallel 8
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-ubuntu-2204
|
||||
path: build/install/ospray
|
||||
|
||||
|
||||
test-ubuntu-2204:
|
||||
needs: [build-ubuntu-2204, generate-baseline-images]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
|
||||
steps:
|
||||
- name: Download build
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-ubuntu-2204
|
||||
|
||||
- name: Download baseline images
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: baseline-images
|
||||
path: regression_test_baseline
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
chmod +x ./bin/*
|
||||
./bin/ospTutorial
|
||||
./bin/ospTestSuite
|
||||
@@ -0,0 +1,536 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- devel
|
||||
- '**release**'
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### DOC JOBS ###
|
||||
|
||||
pdf:
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ospray/docker-images:docu
|
||||
submodules: true
|
||||
cmd: |
|
||||
cd doc
|
||||
git clone --depth 1 -b release-2.12.x https://${RENDERKIT_GITHUB_TOKEN}@github.com/intel-innersource/documentation.graphics.renderkit.ospray-website.git ospray-doc
|
||||
make pdf
|
||||
make checklinks
|
||||
artifact-out: pdf
|
||||
artifact-path: readme.pdf
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
release-linux:
|
||||
needs: pdf
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: rockylinux:8
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
module load cmake/3.25.3
|
||||
module load mpi/mpich-x86_64
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/release/linux.sh
|
||||
cp build_release/*.gz $STORAGE_PATH/packages/renderkit/ || true
|
||||
artifact-in: pdf
|
||||
artifact-out: release-linux
|
||||
artifact-path: build_release/*.gz
|
||||
|
||||
release-linux-arm:
|
||||
needs: pdf
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '[ "Linux", "ARM64" ]'
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
scripts/release/linux.sh -DBUILD_GLFW=OFF -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
|
||||
cp build_release/*.gz $STORAGE_PATH/packages/renderkit/ || true
|
||||
artifact-in: pdf
|
||||
artifact-out: release-linux-arm
|
||||
artifact-path: build_release/*.gz
|
||||
|
||||
release-osx:
|
||||
needs: pdf
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["sign", "x86_64"]'
|
||||
cmd: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/release/macosx.sh
|
||||
cp build_release/*.zip $STORAGE_PATH/packages/renderkit/ || true
|
||||
artifact-in: pdf
|
||||
artifact-out: release-osx
|
||||
artifact-path: build_release/*.zip
|
||||
|
||||
release-osx-arm:
|
||||
needs: pdf
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["arm", "build"]'
|
||||
cmd: |
|
||||
scripts/release/macosx.sh -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON
|
||||
cp build_release/*.zip $STORAGE_PATH/packages/renderkit/ || true
|
||||
artifact-in: pdf
|
||||
artifact-out: release-osx-arm
|
||||
artifact-path: build_release/*.zip
|
||||
|
||||
release-windows:
|
||||
needs: pdf
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["build", "mpi"]'
|
||||
env-from-files: .github/workflows/dpcpp.env
|
||||
cmd: |
|
||||
$env:SYCL_BUNDLE_ROOT = $env:DPCPP_ROOT
|
||||
# disable warnings which lead to excessively large log files
|
||||
$env:CXXFLAGS = '-w'
|
||||
$env:CFLAGS = '-w'
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
scripts\release\win.ps1 -G Ninja -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
& $env:SIGN_FILE_WINDOWS ospray*.msi
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
cp (Get-ChildItem *.zip | Select-Object -Expand FullName) $env:STORAGE_PATH/packages/renderkit/
|
||||
cp (Get-ChildItem *.msi | Select-Object -Expand FullName) $env:STORAGE_PATH/packages/renderkit/
|
||||
exit $exitCode
|
||||
artifact-in: pdf
|
||||
artifact-out: release-windows
|
||||
artifact-path: "build_release/ospray*.zip build_release/ospray*.msi"
|
||||
|
||||
|
||||
### SCAN JOBS ###
|
||||
|
||||
static-analysis:
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/static_analysis.yml@main
|
||||
with:
|
||||
coverity: true
|
||||
project: OSPRay
|
||||
prebuild: >
|
||||
module load impi/latest &&
|
||||
echo "Configure dependencies" &&
|
||||
cmake -L -S scripts/superbuild -B build_deps -DBUILD_DEPENDENCIES_ONLY=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DINSTALL_IN_SEPARATE_DIRECTORIES=OFF -DBUILD_ISA_AVX512=OFF &&
|
||||
echo "Build dependencies" &&
|
||||
cmake --build build_deps &&
|
||||
INSTALL_DIR=$(pwd)/build_deps/install &&
|
||||
export CMAKE_PREFIX_PATH=${INSTALL_DIR} &&
|
||||
echo "Configure OSPRay" &&
|
||||
cmake -L -S . -B build -DTBB_ROOT=$INSTALL_DIR -DOSPRAY_MODULE_DENOISER=ON -DOSPRAY_MODULE_BILINEAR_PATCH=ON -DOSPRAY_MODULE_MPI=ON &&
|
||||
echo "Done: Configure OSPRay"
|
||||
build: cmake --build build
|
||||
|
||||
binary-analysis:
|
||||
needs:
|
||||
- release-linux
|
||||
- release-osx
|
||||
- release-windows
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
|
||||
with:
|
||||
project: ospray
|
||||
artifact-in-linux: release-linux
|
||||
artifact-in-macos: release-osx
|
||||
artifact-in-windows: release-windows
|
||||
path: build_release/ospray-*
|
||||
|
||||
binary-analysis-arm:
|
||||
needs:
|
||||
- release-linux-arm
|
||||
- release-osx-arm
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
|
||||
with:
|
||||
project: ospray
|
||||
artifact-in-linux: release-linux-arm
|
||||
artifact-in-macos: release-osx-arm
|
||||
path: build_release/ospray-*
|
||||
artifact-out-name: binary-analysis-arm
|
||||
|
||||
antivirus-scan:
|
||||
needs:
|
||||
- release-linux
|
||||
- release-osx
|
||||
- release-windows
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
|
||||
with:
|
||||
project: ospray
|
||||
artifact-in-linux: release-linux
|
||||
artifact-in-macos: release-osx
|
||||
artifact-in-windows: release-windows
|
||||
path: build_release/ospray-*
|
||||
|
||||
antivirus-scan-arm:
|
||||
needs:
|
||||
- release-linux-arm
|
||||
- release-osx-arm
|
||||
secrets: inherit
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
|
||||
with:
|
||||
project: ospray
|
||||
artifact-in-linux: release-linux-arm
|
||||
artifact-in-macos: release-osx-arm
|
||||
path: build_release/ospray-*
|
||||
artifact-out-name: antivirus-scan-arm
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
test-rocky-cpu:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake/3.15.2
|
||||
tar -xzf build_release/*.gz
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
|
||||
artifact-in: release-linux
|
||||
|
||||
test-rocky-mpi-cpu:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: rockylinux:8
|
||||
cmd: |
|
||||
module load cmake/3.15.2
|
||||
module load mpi/mpich-x86_64
|
||||
tar -xzf build_release/*.gz
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-oidnsycl:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
runs-on: '"dg2"'
|
||||
cmd: |
|
||||
module load cmake/3.15.2
|
||||
tar -xzf build_release/*.gz
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
export OIDN_DEFAULT_DEVICE=sycl
|
||||
export OIDN_VERBOSE=2
|
||||
mkdir build_regression_tests
|
||||
cd build_regression_tests
|
||||
cmake -G Ninja -D OSPRAY_TEST_ISA=AVX2 $GITHUB_WORKSPACE/test_image_data
|
||||
cmake --build . --target ospray_test_data
|
||||
ospTestSuite --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp"
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-cpu:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
export OIDN_VERBOSE=2
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-mpi-cpu:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: ubuntu:22.04
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
|
||||
update-alternatives --set mpirun /usr/bin/mpirun.mpich
|
||||
OSPDIR=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/)
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libmpich.so.12 $OSPDIR/lib/libmpi.so.12 # XXX find better way
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libmpichcxx.so.12 $OSPDIR/lib/libmpicxx.so.12
|
||||
export OIDN_VERBOSE=2
|
||||
export PATH=$OSPDIR/bin:$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-dg2:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
runs-on: '"dg2"'
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-mpi-dg2:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
runs-on: '"dg2"'
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
|
||||
update-alternatives --set mpirun /usr/bin/mpirun.mpich
|
||||
OSPDIR=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/)
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libmpich.so.12 $OSPDIR/lib/libmpi.so.12 # XXX find better way
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libmpichcxx.so.12 $OSPDIR/lib/libmpicxx.so.12
|
||||
export OIDN_VERBOSE=2
|
||||
export PATH=$OSPDIR/bin:$PATH
|
||||
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE SKIP_GPU TEST_MPI
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-pvc:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
runs-on: '"pvc"'
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-mpi-pvc:
|
||||
needs: release-linux
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
image: ubuntu:22.04
|
||||
runs-on: '"pvc"'
|
||||
env-from-files: .github/workflows/gfx-ubuntu22.env
|
||||
options: --device=/dev/dri:/dev/dri
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
|
||||
update-alternatives --set mpirun /usr/bin/mpirun.mpich
|
||||
OSPDIR=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/)
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libmpich.so.12 $OSPDIR/lib/libmpi.so.12 # XXX find better way
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libmpichcxx.so.12 $OSPDIR/lib/libmpicxx.so.12
|
||||
export OIDN_VERBOSE=2
|
||||
export PATH=$OSPDIR/bin:$PATH
|
||||
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE SKIP_GPU TEST_MPI
|
||||
artifact-in: release-linux
|
||||
|
||||
test-ubuntu-cpu-arm:
|
||||
needs: release-linux-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
with:
|
||||
runs-on: '[ "Linux", "ARM64" ]'
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
export OIDN_VERBOSE=2
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
|
||||
artifact-in: release-linux-arm
|
||||
|
||||
test-ubuntu-mpi-cpu-arm:
|
||||
needs: release-linux-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
|
||||
with:
|
||||
runs-on: '[ "Linux", "ARM64" ]'
|
||||
cmd: |
|
||||
tar -xzf build_release/*.gz
|
||||
export OIDN_VERBOSE=2
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
|
||||
artifact-in: release-linux-arm
|
||||
|
||||
test-osx-avx2:
|
||||
needs: release-osx
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["x86_64", "build", "avx2"]'
|
||||
cmd: |
|
||||
unzip build_release/*.zip
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX2
|
||||
artifact-in: release-osx
|
||||
|
||||
test-osx-avx512:
|
||||
needs: release-osx
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["x86_64", "build", "avx512"]'
|
||||
cmd: |
|
||||
unzip build_release/*.zip
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
|
||||
artifact-in: release-osx
|
||||
|
||||
test-osx-arm:
|
||||
needs: release-osx-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
with:
|
||||
runs-on: '["arm", "build"]'
|
||||
cmd: |
|
||||
unzip build_release/*.zip
|
||||
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
|
||||
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
|
||||
artifact-in: release-osx-arm
|
||||
|
||||
test-osx-signing:
|
||||
needs: release-osx
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["sign", "x86_64" ]'
|
||||
cmd: |
|
||||
unzip build_release/*.zip
|
||||
sign-path-verify: ospray-*
|
||||
artifact-in: release-osx
|
||||
|
||||
test-osx-signing-arm:
|
||||
needs: release-osx-arm
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '"arm"'
|
||||
cmd: |
|
||||
unzip build_release/*.zip
|
||||
sign-path-verify: ospray-*
|
||||
artifact-in: release-osx-arm
|
||||
|
||||
test-windows-signing:
|
||||
needs: release-windows
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
cmd: |
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
Expand-Archive build_release/*.zip -DestinationPath .
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
$msiFile = (Get-ChildItem build_release/*.msi | Select-Object -Expand FullName)
|
||||
Start-Process msiexec "/a $msiFile /qn TARGETDIR=$env:GITHUB_WORKSPACE" -Wait
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
& $env:SIGN_FILE_WINDOWS -t build_release\*.msi (Get-ChildItem "Intel\OSPRay*\bin\*" | Select-Object -Expand FullName) (Get-ChildItem "ospray-*\bin\*" | Select-Object -Expand FullName)
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
exit $exitCode
|
||||
artifact-in: release-windows
|
||||
|
||||
test-windows-cpu:
|
||||
needs: release-windows
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
Expand-Archive build_release/*.zip -DestinationPath .
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
|
||||
scripts\tests\run_tests.ps1 $env:GITHUB_WORKSPACE AVX512SKX
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
exit $exitCode
|
||||
artifact-in: release-windows
|
||||
|
||||
test-windows-mpi-cpu:
|
||||
needs: release-windows
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '["avx512", "mpi"]'
|
||||
cmd: |
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
Expand-Archive build_release/*.zip -DestinationPath .
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
|
||||
scripts\tests\run_tests.ps1 $env:GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
exit $exitCode
|
||||
artifact-in: release-windows
|
||||
|
||||
test-windows-oidnsycl:
|
||||
needs: release-windows
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '"dg2"'
|
||||
env-from-files: .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
Expand-Archive build_release/*.zip -DestinationPath .
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
|
||||
$env:OIDN_DEFAULT_DEVICE="sycl"
|
||||
$env:OIDN_VERBOSE="2"
|
||||
md build_regression_tests
|
||||
cd build_regression_tests
|
||||
cmake -G Ninja -D OSPRAY_TEST_ISA=AVX2 $env:GITHUB_WORKSPACE\test_image_data
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
cmake --build . --config Release --target ospray_test_data
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
ospTestSuite.exe --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp"
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
exit $exitCode
|
||||
artifact-in: release-windows
|
||||
|
||||
test-windows-dg2:
|
||||
needs: release-windows
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '"dg2"'
|
||||
env-from-files: .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
|
||||
Expand-Archive build_release/*.zip -DestinationPath .
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
|
||||
scripts\tests\run_gpu_tests.ps1 $env:GITHUB_WORKSPACE
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
exit $exitCode
|
||||
artifact-in: release-windows
|
||||
|
||||
test-windows-mpi-dg2:
|
||||
needs: release-windows
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
timeout-minutes: 100
|
||||
runs-on: '"dg2"' # FIXME: mpi
|
||||
env-from-files: .github/workflows/gfx-windows.env
|
||||
cmd: |
|
||||
$exitCode = 0 # keep job status to properly fail
|
||||
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
|
||||
Expand-Archive build_release/*.zip -DestinationPath .
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
|
||||
scripts\tests\run_gpu_tests.ps1 $env:GITHUB_WORKSPACE SKIP_GPU TEST_MPI
|
||||
if ($LastExitCode) { $exitCode++ }
|
||||
exit $exitCode
|
||||
artifact-in: release-windows
|
||||
@@ -0,0 +1,107 @@
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Scheduled
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-arch-clang-devel:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DEMBREE_VERSION=devel -DBUILD_OIDN_FROM_SOURCE=ON -DOIDN_VERSION=devel -DOPENVKL_VERSION=devel -DRKCOMMON_VERSION=devel
|
||||
|
||||
build-linux-debug-all:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
image: archlinux:latest
|
||||
cmd: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
scripts/build/linux.sh -G Ninja -DCMAKE_BUILD_TYPE=Debug -DDEPENDENCIES_BUILD_TYPE=Debug -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-linux-debug-all
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
|
||||
|
||||
# build-mpi-cluster:
|
||||
# with:
|
||||
# runs-on: '["Cluster", "build"]'
|
||||
# script:
|
||||
# - module load cmake
|
||||
# - module load impi
|
||||
# - module load gnu
|
||||
# - scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON -DOSPRAY_BUILD_GLM=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
# <<: *build_artifacts
|
||||
|
||||
build-windows-debug-all:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
runs-on: '["build", "NAS", "mpi"]'
|
||||
cmd: |
|
||||
scripts\build\win.ps1 -G "Visual Studio 17 2022" -buildType Debug -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_ISA_AVX512=OFF -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
artifact-out: build-windows-debug-all
|
||||
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
|
||||
|
||||
build-windows-no-volume:
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
cmd: |
|
||||
scripts\build\win.ps1 -G "Visual Studio 17 2022" -DBUILD_ISA_AVX=OFF -DOSPRAY_BUILD_ISA=AVX2 -DBUILD_OPENVKL=OFF
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
test-linux-debug-all:
|
||||
needs: build-linux-debug-all
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
|
||||
with:
|
||||
image: archlinux:latest
|
||||
runs-on: '"avx512"'
|
||||
cmd: |
|
||||
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
|
||||
artifact-in: build-linux-debug-all
|
||||
artifact-out: test-linux-debug-all
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
|
||||
# test-mpi-cluster:
|
||||
# <<: *test_job_unix_avx512skx
|
||||
# tags: [cluster]
|
||||
# script:
|
||||
# - module load impi
|
||||
# - module load gnu
|
||||
# - LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MPI TEST_MULTIDEVICE
|
||||
# env:
|
||||
# needs: build-mpi-cluster
|
||||
# needs: ${{ env.needs }}
|
||||
|
||||
test-windows-debug-all:
|
||||
needs: build-windows-debug-all
|
||||
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
|
||||
with:
|
||||
runs-on: '"avx2"'
|
||||
cmd: |
|
||||
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
|
||||
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX2
|
||||
artifact-in: build-windows-debug-all
|
||||
artifact-out: test-windows-debug-all-avx2
|
||||
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
|
||||
artifact-on-failure: true
|
||||
+7
-3
@@ -2,7 +2,7 @@
|
||||
*#
|
||||
bin
|
||||
*.user*
|
||||
build*
|
||||
/build*
|
||||
install*
|
||||
*.sw?
|
||||
tags
|
||||
@@ -23,12 +23,16 @@ ispc
|
||||
readme.pdf
|
||||
!/modules
|
||||
/modules/*
|
||||
!/modules/pluggableGeometryExample
|
||||
!/modules/simdGeometryExample
|
||||
!/modules/cpu
|
||||
!/modules/denoiser
|
||||
!/modules/mpi
|
||||
!/modules/multiDevice
|
||||
!/modules/pluggableGeometryExample
|
||||
!/modules/simdGeometryExample
|
||||
*.vim
|
||||
.idea/
|
||||
premake.local.*
|
||||
cmake-build*/
|
||||
.clangd
|
||||
compile_commands.json
|
||||
.cache/
|
||||
|
||||
-736
@@ -1,736 +0,0 @@
|
||||
## Copyright 2009-2021 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
stages:
|
||||
- build
|
||||
- docu
|
||||
- test
|
||||
- benchmark
|
||||
- scan1
|
||||
- scan2
|
||||
- release
|
||||
- scan3
|
||||
- mirror
|
||||
|
||||
variables:
|
||||
GIT_DEPTH: "15"
|
||||
KW_PROJECT_NAME: ospray
|
||||
ErrorActionPreference: STOP
|
||||
|
||||
.job_template: &build_job_docker
|
||||
stage: build
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:arch # default image
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh
|
||||
|
||||
.job_template: &build_job_docker_modules
|
||||
stage: build
|
||||
tags:
|
||||
- docker
|
||||
- modules
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh
|
||||
|
||||
.job_template: &build_artifacts
|
||||
artifacts:
|
||||
paths:
|
||||
- build/install/ospray
|
||||
- build/CMakeCache.txt
|
||||
- build/*/build/CMakeCache.txt
|
||||
expire_in: 3 day
|
||||
|
||||
.job_template: &build_artifacts_all
|
||||
artifacts:
|
||||
paths:
|
||||
- build/install
|
||||
- build/CMakeCache.txt
|
||||
- build/*/build/CMakeCache.txt
|
||||
expire_in: 3 day
|
||||
|
||||
.job_template: &release_job
|
||||
stage: release
|
||||
needs: [pdf]
|
||||
only:
|
||||
- devel
|
||||
- master
|
||||
- /release/
|
||||
|
||||
.job_template: &test_job
|
||||
stage: test
|
||||
tags: [docker]
|
||||
artifacts:
|
||||
paths:
|
||||
- build_regression_tests/tests*.xml
|
||||
- build_regression_tests/failed*
|
||||
expire_in: 1 week
|
||||
when: always
|
||||
|
||||
.job_template: &test_job_unix_avx2
|
||||
<<: *test_job
|
||||
tags: [docker, avx2]
|
||||
script:
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2
|
||||
|
||||
.job_template: &test_job_unix_avx512skx
|
||||
<<: *test_job
|
||||
tags: [docker, avx512vl]
|
||||
script:
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX
|
||||
|
||||
.job_template: &test_job_unix_mpi_avx2
|
||||
<<: *test_job
|
||||
tags: [docker, avx2, modules]
|
||||
script:
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2 TEST_MPI
|
||||
|
||||
.job_template: &test_job_unix_sanitize
|
||||
<<: *test_job
|
||||
tags: [docker, avx512vl]
|
||||
script:
|
||||
- export LSAN_OPTIONS="suppressions=$CI_PROJECT_DIR/scripts/tests/sanitize_ignore.txt"
|
||||
- export LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH"
|
||||
- PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX
|
||||
- build/install/ospray/bin/ospBenchmark --benchmark_min_time=0
|
||||
|
||||
.job_template: &test_job_windows_avx2
|
||||
<<: *test_job
|
||||
script:
|
||||
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
|
||||
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX2
|
||||
|
||||
.job_template: &test_job_windows_avx512skx
|
||||
<<: *test_job
|
||||
script:
|
||||
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
|
||||
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX
|
||||
|
||||
.job_template: &benchmark_job
|
||||
stage: benchmark
|
||||
when: manual
|
||||
script:
|
||||
- scripts/tests/run-benchmarks.sh
|
||||
|
||||
### BUILD JOBS ###
|
||||
|
||||
build-arch-gcc:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF
|
||||
|
||||
build-arch-clang:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- export CC=clang
|
||||
- export CXX=clang++
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF
|
||||
|
||||
build-arch-gcc-extras:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_OIDN=ON
|
||||
|
||||
build-arch-clang-extras:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- export CC=clang
|
||||
- export CXX=clang++
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_OIDN=ON
|
||||
|
||||
build-arch-clang-devel:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- export CC=clang
|
||||
- export CXX=clang++
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DEMBREE_VERSION=devel -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON -DOIDN_VERSION=devel -DOPENVKL_VERSION=devel -DRKCOMMON_VERSION=devel
|
||||
only: [schedules]
|
||||
|
||||
build-linux-debug-all:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- export CC=clang
|
||||
- export CXX=clang++
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DCMAKE_BUILD_TYPE=Debug -DDEPENDENCIES_BUILD_TYPE=Debug -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
<<: *build_artifacts
|
||||
only: [schedules]
|
||||
|
||||
build-ubuntu1604-gcc:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu16.04
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh -G Ninja
|
||||
<<: *build_artifacts
|
||||
|
||||
build-ubuntu1804-gcc:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu18.04
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF
|
||||
<<: *build_artifacts
|
||||
|
||||
build-ubuntu2004-gcc:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
<<: *build_artifacts
|
||||
|
||||
build-centos8:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
|
||||
script:
|
||||
- scripts/build_gitlab/linux.sh -G Ninja
|
||||
<<: *build_artifacts
|
||||
|
||||
build-centos7-icc:
|
||||
<<: *build_job_docker_modules
|
||||
script:
|
||||
- module load cmake
|
||||
- module load intel
|
||||
- export CC=icc
|
||||
- export CXX=icpc
|
||||
- scripts/build_gitlab/linux.sh
|
||||
|
||||
build-centos7-icc15:
|
||||
<<: *build_job_docker_modules
|
||||
script:
|
||||
- module load cmake
|
||||
- module load intel/2015
|
||||
- export CC=icc
|
||||
- export CXX=icpc
|
||||
- scripts/build_gitlab/linux.sh
|
||||
|
||||
build-centos7-gcc:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
<<: *build_artifacts
|
||||
|
||||
build-centos7-mpi-impi:
|
||||
<<: *build_job_docker_modules
|
||||
script:
|
||||
- module load cmake
|
||||
- module load intel/2021.2
|
||||
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
<<: *build_artifacts
|
||||
|
||||
build-centos7-mpi-openmpi:
|
||||
<<: *build_job_docker_modules
|
||||
script:
|
||||
- module load cmake
|
||||
- module load mpi/openmpi-x86_64
|
||||
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
|
||||
build-centos7-mpi-mpich:
|
||||
<<: *build_job_docker_modules
|
||||
script:
|
||||
- module load cmake
|
||||
- module load mpi/mpich-x86_64
|
||||
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
<<: *build_artifacts
|
||||
|
||||
build-centos8-mpi-openmpi:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
|
||||
script:
|
||||
- module load mpi/openmpi-x86_64
|
||||
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
|
||||
build-centos8-mpi-mpich:
|
||||
<<: *build_job_docker
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
|
||||
script:
|
||||
- module load mpi/mpich-x86_64
|
||||
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
|
||||
|
||||
build-mpi-cluster:
|
||||
stage: build
|
||||
tags: [cluster]
|
||||
script:
|
||||
- module load cmake
|
||||
- module load impi
|
||||
- module load gnu
|
||||
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON -DOSPRAY_BUILD_GLM=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
<<: *build_artifacts
|
||||
only: [schedules]
|
||||
|
||||
build-linux-debug:
|
||||
<<: *build_job_docker
|
||||
script:
|
||||
- export CFLAGS=-fsanitize=address
|
||||
- export CXXFLAGS=-fsanitize=address
|
||||
- export LDFLAGS=-fsanitize=address
|
||||
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DCMAKE_BUILD_TYPE=Debug
|
||||
<<: *build_artifacts
|
||||
|
||||
build-osx-clang:
|
||||
stage: build
|
||||
tags:
|
||||
- osx
|
||||
- clang
|
||||
script:
|
||||
- scripts/build_gitlab/macosx.sh -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
|
||||
<<: *build_artifacts
|
||||
|
||||
build-osx-arm:
|
||||
stage: build
|
||||
tags:
|
||||
- mac-arm
|
||||
script:
|
||||
- scripts/build_gitlab/macosx.sh -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON
|
||||
<<: *build_artifacts_all
|
||||
|
||||
build-windows-msvc15:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
- msvc15
|
||||
script:
|
||||
- scripts\build_gitlab\win.ps1 "Visual Studio 15 2017 Win64" "v141" "Release" "OFF" "OFF"
|
||||
<<: *build_artifacts
|
||||
|
||||
build-windows-debug-all:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
- msvc15
|
||||
- mpi
|
||||
script:
|
||||
- scripts\build_gitlab\win.ps1 "Visual Studio 15 2017 Win64" "v141" "Debug" "ON" "ON"
|
||||
<<: *build_artifacts
|
||||
only: [schedules]
|
||||
|
||||
build-windows-msvc16-mpi_and_md:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
- msvc16
|
||||
- mpi
|
||||
script:
|
||||
- scripts\build_gitlab\win.ps1 "Visual Studio 16 2019" "v142" "Release" "ON" "ON"
|
||||
<<: *build_artifacts
|
||||
|
||||
#build-windows-icc:
|
||||
# stage: build
|
||||
# script:
|
||||
# - scripts\build_gitlab\win.ps1 "Visual Studio 14 2015 Win64" "Intel C++ Compiler 17.0"
|
||||
# tags:
|
||||
# - icc17
|
||||
# - win
|
||||
# <<: *build_artifacts
|
||||
|
||||
|
||||
### TEST JOBS ###
|
||||
|
||||
test-centos7-gcc-avx2:
|
||||
<<: *test_job_unix_avx2
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
needs: [build-centos7-gcc]
|
||||
|
||||
test-centos8-avx512skx:
|
||||
<<: *test_job_unix_avx512skx
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
|
||||
needs: [build-centos8]
|
||||
|
||||
test-ubuntu1604-gcc-avx2:
|
||||
<<: *test_job_unix_avx2
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu16.04
|
||||
needs: [build-ubuntu1604-gcc]
|
||||
|
||||
test-ubuntu1804-gcc-avx512skx:
|
||||
<<: *test_job_unix_avx512skx
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu18.04
|
||||
needs: [build-ubuntu1804-gcc]
|
||||
|
||||
test-ubuntu2004-gcc-avx2:
|
||||
<<: *test_job_unix_avx2
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
|
||||
needs: [build-ubuntu2004-gcc]
|
||||
|
||||
test-ubuntu2004-gcc-avx512skx:
|
||||
<<: *test_job_unix_avx512skx
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
|
||||
needs: [build-ubuntu2004-gcc]
|
||||
script:
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MULTIDEVICE
|
||||
|
||||
test-centos7-gcc-mpi-mpich-avx2:
|
||||
<<: *test_job_unix_mpi_avx2
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
needs: [build-centos7-mpi-mpich]
|
||||
before_script:
|
||||
- module load cmake
|
||||
- module load mpi/mpich-x86_64
|
||||
|
||||
test-centos7-gcc-mpi-impi-avx2:
|
||||
<<: *test_job_unix_mpi_avx2
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
needs: [build-centos7-mpi-impi]
|
||||
before_script:
|
||||
- module load cmake
|
||||
- module load intel/2021.2
|
||||
# Note: no omnipath/infiniband/shm comm access for MPI within
|
||||
# Docker container, just use sockets for running validation test
|
||||
- export FI_PROVIDER=sockets
|
||||
|
||||
test-mpi-cluster:
|
||||
<<: *test_job_unix_avx512skx
|
||||
tags: [cluster]
|
||||
script:
|
||||
- module load impi
|
||||
- module load gnu
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MPI TEST_MULTIDEVICE
|
||||
needs: [build-mpi-cluster]
|
||||
only: [schedules]
|
||||
|
||||
sanitize-linux-debug:
|
||||
<<: *test_job_unix_sanitize
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:arch
|
||||
needs: [build-linux-debug]
|
||||
|
||||
test-linux-debug-all:
|
||||
<<: *test_job_unix_avx512skx
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:arch
|
||||
needs: [build-linux-debug-all]
|
||||
only: [schedules]
|
||||
|
||||
test-osx-clang:
|
||||
<<: *test_job
|
||||
tags: [osx]
|
||||
needs: [build-osx-clang]
|
||||
script:
|
||||
- DYLD_FALLBACK_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$DYLD_FALLBACK_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2 TEST_MULTIDEVICE
|
||||
|
||||
test-osx-arm:
|
||||
<<: *test_job
|
||||
tags: [mac-arm]
|
||||
needs: [build-osx-arm]
|
||||
script:
|
||||
- DYLD_FALLBACK_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$DYLD_FALLBACK_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2
|
||||
|
||||
test-tutorials:
|
||||
stage: test
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
needs: [build-centos7-gcc]
|
||||
script:
|
||||
- scripts/tests/run_tutorials.sh
|
||||
|
||||
test-find-ospray:
|
||||
stage: test
|
||||
tags:
|
||||
- docker
|
||||
- modules
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
needs: [build-centos7-gcc]
|
||||
script:
|
||||
- module load cmake
|
||||
- mkdir buildtut
|
||||
- cd buildtut
|
||||
- cmake -D ospray_DIR=`echo $CI_PROJECT_DIR/build/install/ospray/lib/cmake/ospray-*` ../apps/ospTutorial/ospTutorialFindospray
|
||||
- cmake --build .
|
||||
|
||||
test-windows-msvc15-avx2:
|
||||
<<: *test_job_windows_avx2
|
||||
tags: [win, msvc15, avx2]
|
||||
needs: [build-windows-msvc15]
|
||||
allow_failure: true
|
||||
|
||||
test-windows-msvc15-avx512skx:
|
||||
<<: *test_job_windows_avx512skx
|
||||
tags: [win, msvc15, avx512vl]
|
||||
needs: [build-windows-msvc15]
|
||||
|
||||
test-windows-debug-all:
|
||||
<<: *test_job_windows_avx2
|
||||
tags: [win, msvc15, avx2]
|
||||
needs: [build-windows-debug-all]
|
||||
only: [schedules]
|
||||
|
||||
test-windows-msvc16-avx2:
|
||||
<<: *test_job_windows_avx2
|
||||
tags: [win, msvc16, avx2]
|
||||
needs: [build-windows-msvc16-mpi_and_md]
|
||||
allow_failure: true
|
||||
script:
|
||||
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
|
||||
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX2 TEST_MULTIDEVICE
|
||||
|
||||
test-windows-msvc16-avx512skx:
|
||||
<<: *test_job_windows_avx512skx
|
||||
tags: [win, msvc16, avx512vl]
|
||||
needs: [build-windows-msvc16-mpi_and_md]
|
||||
script:
|
||||
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
|
||||
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX TEST_MULTIDEVICE
|
||||
|
||||
generate-ci-baseline-avx2:
|
||||
<<: *test_job_unix_avx2
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
|
||||
needs: [build-ubuntu2004-gcc]
|
||||
script:
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/generate_baseline.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- generated_test_images
|
||||
expire_in: 3 day
|
||||
when: manual
|
||||
|
||||
generate-ci-baseline-avx512skx:
|
||||
<<: *test_job_unix_avx512skx
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
|
||||
needs: [build-ubuntu2004-gcc]
|
||||
script:
|
||||
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/generate_baseline.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- generated_test_images
|
||||
expire_in: 3 day
|
||||
when: manual
|
||||
|
||||
### Benchmarks ###
|
||||
|
||||
benchmark-x8280-1:
|
||||
<<: *benchmark_job
|
||||
tags: [vis-perf-x8280-1]
|
||||
needs: [build-centos8]
|
||||
|
||||
### Documentation ###
|
||||
|
||||
.job_template: &doc-defaults
|
||||
stage: docu
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:docu
|
||||
needs: []
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
|
||||
pdf:
|
||||
<<: *doc-defaults
|
||||
script:
|
||||
- cd doc
|
||||
- make pdf
|
||||
- make checklinks
|
||||
artifacts:
|
||||
paths:
|
||||
- readme.pdf
|
||||
expire_in: 1 week
|
||||
|
||||
web:
|
||||
<<: *doc-defaults
|
||||
script:
|
||||
- cd doc
|
||||
- make www
|
||||
artifacts:
|
||||
paths:
|
||||
- doc/www/*
|
||||
expire_in: 1 week
|
||||
|
||||
spec:
|
||||
<<: *doc-defaults
|
||||
script:
|
||||
- cd doc
|
||||
- make spec
|
||||
- mv www/images _images
|
||||
artifacts:
|
||||
paths:
|
||||
- doc/ospray-spec.*
|
||||
- doc/_images/*
|
||||
expire_in: 1 week
|
||||
|
||||
|
||||
### RELEASE JOBS ###
|
||||
|
||||
release-linux:
|
||||
<<: *release_job
|
||||
tags: [modules]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
script:
|
||||
- source $SPACK_SETUP_ENV
|
||||
- module load cmake/3.15.2
|
||||
- module load mpich/3.2
|
||||
- scripts/release/linux.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- build_release/*.gz
|
||||
expire_in: 3 day
|
||||
|
||||
release-osx-clang:
|
||||
<<: *release_job
|
||||
tags:
|
||||
- clang
|
||||
- osx
|
||||
- sign
|
||||
script:
|
||||
- export CC=clang
|
||||
- export CXX=clang++
|
||||
- scripts/release/macosx.sh
|
||||
- $SIGN_FILE_MAC -o runtime -e scripts/release/ospray.entitlements build_release/ospray-*pkg
|
||||
- scripts/release/macosx_notarization.sh build_release/ospray-*.pkg
|
||||
artifacts:
|
||||
paths:
|
||||
- build_release/*.zip
|
||||
- build_release/*.pkg
|
||||
expire_in: 3 day
|
||||
|
||||
release-windows:
|
||||
<<: *release_job
|
||||
tags:
|
||||
- msvc15
|
||||
- win
|
||||
- mpi
|
||||
script:
|
||||
- scripts\release\win.ps1 "Visual Studio 15 2017 Win64"
|
||||
- ;& $env:SIGN_FILE_WINDOWS ospray*.msi
|
||||
artifacts:
|
||||
paths:
|
||||
- build_release\ospray*.zip
|
||||
- build_release\ospray*.msi
|
||||
expire_in: 3 day
|
||||
|
||||
|
||||
### SCAN JOBS ###
|
||||
|
||||
kw-build:
|
||||
stage: scan1
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
needs: []
|
||||
script:
|
||||
- module load cmake
|
||||
- module load intel/2021.2
|
||||
- scripts/build_gitlab/kw.sh
|
||||
- test -s $CI_PROJECT_DIR/klocwork/build.log
|
||||
- test -s $CI_PROJECT_DIR/klocwork/build_name
|
||||
artifacts:
|
||||
paths:
|
||||
- ./klocwork/*
|
||||
expire_in: 3 day
|
||||
|
||||
protex:
|
||||
stage: scan1
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
needs: []
|
||||
script:
|
||||
- scripts/scan/protex.sh
|
||||
|
||||
kw-scan:
|
||||
stage: scan2
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
needs: [kw-build]
|
||||
script:
|
||||
- scripts/scan/kw-check-issues.sh
|
||||
|
||||
kw-gen-report:
|
||||
stage: scan2
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
needs: [kw-build]
|
||||
only:
|
||||
- devel
|
||||
- master
|
||||
- /release/
|
||||
script:
|
||||
- scripts/scan/kw-gen-report.sh
|
||||
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID klocwork "klocwork/report.log"
|
||||
artifacts:
|
||||
paths:
|
||||
- ./klocwork/report.log
|
||||
|
||||
bdba:
|
||||
<<: *release_job
|
||||
stage: scan3
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
|
||||
needs:
|
||||
- release-linux
|
||||
- release-osx-clang
|
||||
- release-windows
|
||||
script:
|
||||
- scripts/scan/bdba.sh "build_release/ospray*"
|
||||
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID bdba "ospray-*.pdf"
|
||||
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID bdba "ospray-*.csv"
|
||||
artifacts:
|
||||
paths:
|
||||
- build_release/ospray-*
|
||||
- ospray-*
|
||||
|
||||
av:
|
||||
<<: *release_job
|
||||
stage: scan3
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/clamav:ubuntu20.04
|
||||
needs:
|
||||
- release-linux
|
||||
- release-osx-clang
|
||||
- release-windows
|
||||
script:
|
||||
- freshclam | tee -a /tmp/av_scan.log
|
||||
- clamscan -va --max-filesize=512M --max-scansize=1024M --alert-broken --alert-exceeds-max build_release/ospray-* | tee -a /tmp/av_scan.log
|
||||
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID av /tmp/av_scan.log
|
||||
artifacts:
|
||||
paths:
|
||||
- build_release/ospray-*
|
||||
|
||||
test-release-linux:
|
||||
<<: *test_job_unix_avx512skx
|
||||
<<: *release_job
|
||||
stage: scan3
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
needs: [release-linux]
|
||||
script:
|
||||
- source $SPACK_SETUP_ENV
|
||||
- module load cmake/3.15.2
|
||||
- module load mpich/3.2
|
||||
- tar xzf build_release/*.gz
|
||||
- PATH="$CI_PROJECT_DIR/`ls -d1 ospray-*/bin`:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MPI
|
||||
|
||||
test-release-osx:
|
||||
<<: *test_job
|
||||
<<: *release_job
|
||||
stage: scan3
|
||||
tags: [osx, sign]
|
||||
needs: [release-osx-clang]
|
||||
script:
|
||||
- unzip build_release/*.zip
|
||||
- PATH="$CI_PROJECT_DIR/`ls -d1 ospray-*/bin`:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2
|
||||
- $SIGN_FILE_MAC -t $CI_PROJECT_DIR/ospray-*/bin/* $CI_PROJECT_DIR/ospray-*/lib/*.dylib $CI_PROJECT_DIR/build_release/*.pkg
|
||||
|
||||
test-release-windows-zip:
|
||||
<<: *test_job
|
||||
<<: *release_job
|
||||
stage: scan3
|
||||
tags: [win, mpi, avx512vl]
|
||||
needs: [release-windows]
|
||||
script:
|
||||
- Expand-Archive build_release/*.zip -DestinationPath .
|
||||
- $env:Path += ";" + (Get-ChildItem $CI_PROJECT_DIR\ospray-*\bin | Select-Object -Expand FullName)
|
||||
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX TEST_MPI
|
||||
- ;& $env:SIGN_FILE_WINDOWS -t (Get-ChildItem $CI_PROJECT_DIR\ospray-*\bin\* | Select-Object -Expand FullName)
|
||||
|
||||
test-release-windows-msi:
|
||||
<<: *test_job
|
||||
<<: *release_job
|
||||
stage: scan3
|
||||
tags: [win, mpi, avx512vl]
|
||||
needs: [release-windows]
|
||||
script:
|
||||
- msiexec.exe /a (Get-ChildItem build_release/*.msi | Select-Object -Expand FullName) /qn TARGETDIR=$CI_PROJECT_DIR
|
||||
- $env:Path += ";$CI_PROJECT_DIR\Intel\OSPRay v2\bin"
|
||||
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX TEST_MPI
|
||||
- ;& $env:SIGN_FILE_WINDOWS -t $CI_PROJECT_DIR/build_release/*.msi (Get-ChildItem "$CI_PROJECT_DIR\Intel\OSPRay v2\bin\*" | Select-Object -Expand FullName)
|
||||
|
||||
|
||||
### Mirror ###
|
||||
|
||||
mirror:
|
||||
stage: mirror
|
||||
tags: [docker]
|
||||
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
|
||||
only: [devel]
|
||||
dependencies: []
|
||||
script:
|
||||
- git remote add github https://${GITHUB_TOKEN}github.com/ospray/ospray.git
|
||||
- git push github HEAD:devel
|
||||
@@ -1,4 +0,0 @@
|
||||
[submodule "doc-binaries"]
|
||||
path = doc/ospray-doc
|
||||
url = ../ospray-doc.git
|
||||
branch = .
|
||||
|
||||
+280
-24
@@ -1,33 +1,290 @@
|
||||
Version History
|
||||
---------------
|
||||
|
||||
### Changes in v3.2.0:
|
||||
|
||||
- Sampling improvements:
|
||||
- Better performance (lower rendering time and faster convergence)
|
||||
- More pleasing blue noise enabled when the total number of frames
|
||||
to be accumulated is known in advance and set as the
|
||||
`targetFrames` parameter at the framebuffer
|
||||
- Note a maximum of 64k samples is supported
|
||||
- Improved `denoiser` image operation:
|
||||
- User-controlled quality levels via parameter `quality`
|
||||
- Optionally denoise alpha channel as well, enabled via
|
||||
parameter `denoiseAlpha`
|
||||
- Support half-precision (16\ bit float) texture formats
|
||||
`OSP_TEXTURE_[RGBA16F|RGB16F|RA16F|R16F]` and two-channel 32\ bit
|
||||
float textures `OSP_TEXTURE_RA32F`
|
||||
- New parameter `limitIndirectLightSamples` for the `pathtracer` which
|
||||
limits the number of light samples after the first non-specular
|
||||
(i.e., diffuse and glossy) bounce to at most one
|
||||
- Implement MIP Mapping for better texture filtering. If the
|
||||
additional memory per texture needed cannot be spared, applications
|
||||
can disable the generation of MIP maps with device parameter
|
||||
`disableMipMapGeneration`
|
||||
- The backplate (background texture) is now always sampled at the pixel
|
||||
center and thus not blurred by the pixel filter anymore
|
||||
- Avoid color bleeding across eye-subimages when stereo rendering
|
||||
- Superbuild uses binary packages of Open VKL
|
||||
- Removed Intel ISPCRT dependency (ISPC compiler is still needed):
|
||||
- oneAPI Level Zero Loader is no longer necessary
|
||||
- `zeContext` and `zeDevice`device parameters are no longer supported
|
||||
- `ispcrtContext` and `ispcrtDevice`device parameters are no longer
|
||||
supported
|
||||
- Clarify the size of `OSP_BOOL` to be 1 byte
|
||||
- Fix artifacts occasionally appearing with `gpu` device
|
||||
- The new minimum versions of dependencies:
|
||||
- Embree v4.3.3 (better error reporting)
|
||||
- Open Image Denoise v2.3 (better image quality with `HIGH`
|
||||
quality mode, added `FAST` quality mode)
|
||||
- rkcommon v1.14.0
|
||||
|
||||
### Changes in v3.1.0:
|
||||
|
||||
- Principled and Luminous materials support emissive textures
|
||||
- Add native support for disc and oriented disc geometry
|
||||
- Add support for mirror repeat and clamp to edge texture wrap modes
|
||||
- GPU device now also supports motion blur
|
||||
- Improve noise in reflections of ThinGlass
|
||||
- Improve adaptive accumulation: working with GPU, fix correlations
|
||||
- Fix indirectly seen albedo and normal buffer
|
||||
- Fix artifacts when using specular texture for Principled
|
||||
- Fixes for PixelFilter
|
||||
- Parameter was ignored (always using the default Gaussian)
|
||||
- Avoid a shift/misalignment within the pixel for first sample
|
||||
- Fix empty image on Windows when `focusDistance=0`
|
||||
- Fix missing SDK headers for `ISPCDevice*`
|
||||
- The new minimum versions of dependencies:
|
||||
- Embree v4.3.1
|
||||
- Open VKL v2.0.1
|
||||
- Open Image Denoise v2.2 (better quality with fine details,
|
||||
support AArch64 CPU on Linux)
|
||||
- ISPCRT v1.23.0 (uses environment variable `ISPCRT_GPU_DRIVER`
|
||||
to select GPU to run on when multiple (i)GPUs are present)
|
||||
- rkcommon v1.13.0 (fixes crash using GPU and emissive geometry)
|
||||
|
||||
### Changes in v3.0.0:
|
||||
|
||||
- Beta support for Intel Xe GPUs (Intel Arc™ GPUs a Intel Data Center
|
||||
GPU Flex and Max Series), exploiting ray tracing hardware support.
|
||||
Implementation is based on the [SYCL](https://www.khronos.org/sycl/)
|
||||
cross-platform programming language implemented by [Intel oneAPI
|
||||
Data Parallel C++
|
||||
(DPC++)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/data-parallel-c-plus-plus.html).
|
||||
Note that the following features are not implemented yet or are not
|
||||
working correctly on the new `gpu` device:
|
||||
- Multiple volumes in the scene
|
||||
- Clipping
|
||||
- Motion blur
|
||||
- Subdivision surfaces
|
||||
- Progress reporting via `ospGetProgress` or canceling the frame
|
||||
via `ospCancel`
|
||||
- Picking via `ospPick`
|
||||
- Adaptive accumulation via `OSP_FB_VARIANCE` and
|
||||
`varianceThreshold`
|
||||
- Framebuffer channels `OSP_FB_ID_*` (id buffers)
|
||||
- Experimental support for shared device-only data, works only for
|
||||
`structuredRegular` volume
|
||||
- Further known issues
|
||||
- Some delay on start-up or when changing the scene, because
|
||||
kernel code is JIT compiled and specialized. JIT compilation
|
||||
can be cached by setting environment variable
|
||||
`SYCL_CACHE_PERSISTENT=1`, then consecutive starts or
|
||||
rendering the same scene configuration is without delay
|
||||
- For some combination of compiler, GPU driver and scene the
|
||||
rendered images might show artifacts (e.g., vertical lines
|
||||
or small blocks)
|
||||
- Multidevice does not support `OSPImageOperation`s for
|
||||
denoising or tone mapping
|
||||
- Add implicit indexing for `mesh` geometry
|
||||
- Add support for transferring ownership of temporary buffers:
|
||||
`ospNewSharedData` accepts an optional deleter callback
|
||||
- Optimizations for MPI module, supported by new integrated
|
||||
performance tracing framework
|
||||
- Optimize `scivis` gradient shading
|
||||
- Main thread does not set FTZ/DAZ anymore for denormals handling
|
||||
- Compute intersection epsilon for Mesh to avoid rendering artifacts
|
||||
due to self-intersection
|
||||
- Fix energy conservation of Pricipled material under certain
|
||||
parameter combinations
|
||||
- Fix `denoiser` to not wipe the alpha channel
|
||||
- Fix crash in HDRI light
|
||||
- Fix link order for Debug build on Windows
|
||||
- The new minimum versions of dependencies:
|
||||
- Embree v4.3.0
|
||||
- Open VKL v2.0.0
|
||||
- Open Image Denoise v2.1.0
|
||||
- ISPC v1.21.1
|
||||
- rkcommon v1.12.0
|
||||
- Breaking API changes
|
||||
- Renamed `OSP_TEXTURE_FILTER_BILINEAR` to
|
||||
`OSP_TEXTURE_FILTER_LINEAR ` and
|
||||
`OSP_VOLUME_FILTER_TRI[LINEAR|CUBIC]` to
|
||||
`OSP_VOLUME_FILTER_[LINEAR|CUBIC]`
|
||||
- Most enums now use storage type `uint32`
|
||||
- `gridSpacing` of spherical regular volume defaults to full
|
||||
sphere
|
||||
- Remove deprecated parameters and API calls
|
||||
- error callback signatures without user pointer
|
||||
- first argument of `ospNewMaterial`
|
||||
- module name `ispc`; use `cpu`
|
||||
- `volume` texture and `isosurface` geometry:
|
||||
`volumetricModel`; use `OSPVolume volume`
|
||||
- Transfer function `vec2f valueRange`; use `box1f value`
|
||||
- `hdri` and `sun-sky` lights: `intensityQuantity`
|
||||
`OSP_INTENSITY_QUANTITY_RADIANCE`
|
||||
- `spot` light with `intensityDistribution`:
|
||||
`intensityQuantity` other than
|
||||
`OSP_INTENSITY_QUANTITY_SCALE`
|
||||
|
||||
|
||||
### Changes in v2.12.0:
|
||||
|
||||
- Support denoising on the GPU with OIDN 2.0, which is the new minimum
|
||||
version. The `denoiser` now uses HDR mode
|
||||
- New parameter `maxScatteringEvents` for the `pathtracer` which
|
||||
limits the number of non-specular (i.e., diffuse and glossy) bounces
|
||||
- Optimized dynamic load balancing for MPI devices
|
||||
- Fix crash when using small image resolution and many MPI ranks
|
||||
- Fix crash in `pathtracer` when `lightSamples > 0` but there are
|
||||
lights in the scene
|
||||
- Fix transparent shadows with too high `minContribution` setting
|
||||
- The new minimum version for ISPC is v1.20.0
|
||||
- Release binaries on Linux are built on Rocky 8
|
||||
|
||||
### Changes in v2.11.0:
|
||||
|
||||
- Support single ISPC target on Windows
|
||||
- OSPRay's superbuild can now be provided a CMake toolchain file for
|
||||
cross-compilation
|
||||
- Add support for double pumped NEON instruction on ARM64
|
||||
- Reduce the memory overhead of the `mpiOffload` device and resolve
|
||||
memory and `MPI_Comm` handle leaks
|
||||
- Support for volume rendering (and thus the dependency to Open VKL)
|
||||
can now be compile-time controlled via CMake variable
|
||||
`OSPRAY_ENABLE_VOLUMES`
|
||||
- OSPRay's MPI modules have been split up and renamed, the `mpiOffload`
|
||||
device is now in the `mpi_offload` module, while the `mpiDistributed`
|
||||
device is now in the `mpi_distributed_cpu` module
|
||||
- Add native support for spheres via Embree, which requires the
|
||||
positions and radius of the spheres to be interleaved in memory; if
|
||||
this is not the case, OSPRay will internally create a copy of the
|
||||
data
|
||||
- Fix `dynamicScene` flag on World and Group to influence BVH quality
|
||||
again: default is now "high", which should improve rendering
|
||||
performance, depending on the scene; and "low" when `dynamicScene`
|
||||
is enabled (improving BVH build performance)
|
||||
- Fix a crash in `pathtracer` when there are no lights
|
||||
- Fix a data corruption bug when setting string parameters for objects
|
||||
in the `mpiOffload` device
|
||||
- Various documentation fixes
|
||||
- OSPRay now has a new dependency, which is ISPC Run Time (ISPCRT) in
|
||||
minimum 1.19.0 version
|
||||
- Adapt to Embree v4.0.0 API changes, which is thus the new minimum
|
||||
version; additionally, the new minimum version for Open VKL is
|
||||
v1.3.2 and for ISPC v1.19.0
|
||||
- Removed support of MSVC14.0 (Visual Studio 2015) and the second
|
||||
generation Intel Xeon Phi processor (codename Knights Landing)
|
||||
|
||||
### Changes in v2.10.0:
|
||||
|
||||
- Add support for primitive, object, and instance ID buffers as
|
||||
framebuffer channels
|
||||
- Support face-varying attributes for Mesh and Subdivision geometry
|
||||
- Replace CMake variable `OSPRAY_PIXELS_PER_JOB` by
|
||||
`OSPRAY_RENDER_TASK_SIZE`; variance tracking for adaptive
|
||||
accumulation is now per task instead of per tile, allowing for more
|
||||
granular adaptation
|
||||
- OSPRay now requires minimum Open VKL v1.3.0 to bring the following
|
||||
improvements:
|
||||
- VDB volumes added support for contiguous data layouts, which can
|
||||
provide improved performance (`nodesPackedDense`,
|
||||
`nodesPackedTile` parameters)
|
||||
- Particle volumes are more memory efficiency and improved
|
||||
performance
|
||||
- OSPRay now requires minimum ISPC v1.18.0 for Open VKL and to include
|
||||
a fix for parallel dispatch of uniform function pointers
|
||||
- MPI Offload: resolve object life time tracking issue that would
|
||||
result in framebuffer and data info being release too early, leading
|
||||
to a crash
|
||||
- Fix crash with OpenMPI due to argument handling
|
||||
- Fix clipping when rays are parallel to clipping planes
|
||||
- Fix missing SDK headers from CPU and MPI module
|
||||
- Deprecated the `vec2f valueRange` parameter of the `piecewiseLinear`
|
||||
transfer function, use `box1f value` instead
|
||||
|
||||
### Changes in v2.9.0:
|
||||
|
||||
- Add support for multi-segment deformation motion blur for `mesh`
|
||||
geometry
|
||||
- OSPRay now requires minimum Open VKL v1.2.0 to bring the following
|
||||
improvements:
|
||||
- Structured regular volumes support for cell-centered data via
|
||||
the `cellCentered` parameter (vertex-centered remains the
|
||||
default)
|
||||
- Particle volumes ignore particles with zero radius
|
||||
- Add support for dynamic load balancing in MPI Offload device
|
||||
- Support for photometric lights (e.g., IES or EULUMDAT) also for
|
||||
`sphere` and `quad` lights. When setting `intensityDistribution`,
|
||||
other values for `intensityQuantity` than
|
||||
`OSP_INTENSITY_QUANTITY_SCALE` are deprecated
|
||||
- Changed CMake variables for enabling app categories:
|
||||
- `OSPRAY_ENABLE_APPS_BENCHMARK` replaces `OSPRAY_APPS_BENCHMARK`
|
||||
- `OSPRAY_ENABLE_APPS_EXAMPLES` replaces `OSPRAY_APPS_EXAMPLES`
|
||||
- `OSPRAY_ENABLE_APPS_TUTORIALS` replaces `OSPRAY_APPS_TUTORIALS`
|
||||
- `OSPRAY_ENABLE_APPS_TESTING` replaces `OSPRAY_APPS_TESTING`
|
||||
- Improve sampling of quad lights in the `pathtracer` (solid angle
|
||||
instead of area)
|
||||
- Instances can now have the group object rebound via a parameter
|
||||
- Fix leaking framebuffers in the MPI Offload device
|
||||
- Resolve possible race condition in assigning IDs to distributed
|
||||
objects in the MPI device
|
||||
- Move ISPC module to `modules/` folder and renamed the module to
|
||||
`cpu`
|
||||
- Minimum version of rkcommon is 1.9.0, which brings the following
|
||||
improvements:
|
||||
- Add detection of Intel oneAPI DPC++/C++ compiler
|
||||
- Fix memory leak
|
||||
|
||||
### Changes in v2.8.0:
|
||||
|
||||
- Lights can be now part of `OSPGroup` and thus instanced like
|
||||
geometries and volumes and thus lights also support motion blur
|
||||
(with the path tracer)
|
||||
- Add cylinder light (with solid area sampling)
|
||||
- Add support for rolling shutter of cameras
|
||||
- Add support for quaternion motion blur for instance and camera to
|
||||
allow for smoothly interpolated rotations
|
||||
- Fix illumination from emissive quad meshes
|
||||
|
||||
### Changes in v2.7.1:
|
||||
|
||||
- Use Open VKL v1.0.1 to fix sporadic slowdowns when rendering
|
||||
structured regular and VDB volumes with the SciVis renderer
|
||||
- Fix CMake variables and logic
|
||||
- Fix crash when transferfunction.opacity = 0
|
||||
- Fix crash when `transferfunction.opacity = 0`
|
||||
- Fix bug in MPI data-parallel rendering that caused rendering to hang
|
||||
- Workaround dynamic linking issue on Windows in MPI distributed
|
||||
rendering
|
||||
- Correctly initialize renderFrame progress
|
||||
- Improved performance of data-parallel rendering for scenes with
|
||||
a large number of regions
|
||||
- Correctly initialize `renderFrame` progress
|
||||
- Improved performance of data-parallel rendering for scenes with a
|
||||
large number of regions
|
||||
- Expanded camera model support of the data-parallel renderer,
|
||||
data-parallel rendering can now use all the camera models supported
|
||||
by the scivis renderer
|
||||
by the SciVis renderer
|
||||
- Clarify documentation and error messages
|
||||
|
||||
### Changes in v2.7.0:
|
||||
|
||||
- Add support for transformation and camera Motion Blur (with the path
|
||||
- Add support for transformation and camera motion blur (with the path
|
||||
tracer) via `shutter` parameter of the camera and `motion.transform`
|
||||
array and `time` parameter of the instance and camera
|
||||
- OSPRay can now be built for ARM64 CPUs with NEON (e.g., Apple M1)
|
||||
using the superbuild. Thus, new minimum versions are for ISPC
|
||||
1.16.0, for Embree 3.13.1 and for rkcommon 1.7.0
|
||||
- OSPRay now requires minimum Open VKL v1.0.0 to bring the
|
||||
following improvements:
|
||||
- OSPRay now requires minimum Open VKL v1.0.0 to bring the following
|
||||
improvements:
|
||||
- Configurable `background` values for all volume types (default
|
||||
`NaN`), defining region outside the volume domain
|
||||
- Better default sampling rate for scaled VDB volumes, improved
|
||||
@@ -65,30 +322,30 @@ Version History
|
||||
only supported quantity for these lights, the value
|
||||
`OSP_INTENSITY_QUANTITY_RADIANCE` is deprecated. When
|
||||
`OSP_INTENSITY_QUANTITY_SCALE` is used for `sunSky` the default
|
||||
value of `intensity` is `0.025` to match the old behaviour
|
||||
value of `intensity` is `0.025` to match the old behavior
|
||||
- The MPI module is included in the releases packages. An
|
||||
[MPICH-ABI](https://www.mpich.org/abi/) compatible build is provided
|
||||
for Linux that can be run with the Intel oneAPI HPC Toolki, MPICH,
|
||||
and other MPICH-ABI compatible MPI distributions. The Windows
|
||||
release is built against MPI provided in the Intel oneAPI HPC
|
||||
Toolkit
|
||||
- OSPRay now requires minimum Open VKL v0.13.0 to bring the
|
||||
following improvements:
|
||||
- Support half precision float (fp16) voxel data in strutured
|
||||
- OSPRay now requires minimum Open VKL v0.13.0 to bring the following
|
||||
improvements:
|
||||
- Support half precision float (fp16) voxel data in structured
|
||||
volumes (regular and spherical) and VDB volume
|
||||
- Supporting tricubic filtering via `VKL_FILTER_TRICUBIC` filter
|
||||
for VDB volume
|
||||
- Fixed artifacts for isosurfaces of unstructured volumes
|
||||
- Performance improvements for isosurfaces when multiple
|
||||
isovalues are selected
|
||||
- Performance improvements for isosurfaces when multiple isovalues
|
||||
are selected
|
||||
- Better, adaptive sampling of AMR volumes
|
||||
- The `mpiOffload` and `mpiDistributed` devices now support picking.
|
||||
Picking in the distributed device will return the globally closest
|
||||
object on the rank that owns that object. Other ranks will report
|
||||
no hit
|
||||
- Messages issued from ISPC code use the same reporting path as the C++
|
||||
code, thus now the whole OSPRay console output can be consistently
|
||||
filtered with log levels
|
||||
object on the rank that owns that object. Other ranks will report no
|
||||
hit
|
||||
- Messages issued from ISPC code use the same reporting path as the
|
||||
C++ code, thus now the whole OSPRay console output can be
|
||||
consistently filtered with log levels
|
||||
- Open VKL and Embree internal errors are now correctly mapped to
|
||||
their corresponding OSPRay errors
|
||||
- Fix behavior of committing the framebuffer in distributed rendering
|
||||
@@ -133,7 +390,7 @@ Version History
|
||||
|
||||
### Changes in v2.4.0:
|
||||
|
||||
- The pathtracer optionally allows for alpha blending even if the
|
||||
- The `pathtracer` optionally allows for alpha blending even if the
|
||||
background is seen through refractive objects like glass, by
|
||||
enabling `backgroundRefraction`
|
||||
- OSPRay now requires minimum Open VKL v0.11.0 to bring the following
|
||||
@@ -146,7 +403,7 @@ Version History
|
||||
and spherical)
|
||||
- Expose parameter `horizonExtension` of Sun-sky light, which extends
|
||||
the sky dome by stretching the horizon over the lower hemisphere
|
||||
- Optimize handling of geometry lights by the pathtracer
|
||||
- Optimize handling of geometry lights by the `pathtracer`
|
||||
- The optional `denoiser` image operation now respects frame
|
||||
cancellation, requiring Intel® Open Image Denoise with minimum
|
||||
version 1.2.3
|
||||
@@ -373,9 +630,9 @@ Version History
|
||||
is required to build OSPRay
|
||||
- The MPI module is now a separate repository, which also contains all
|
||||
MPI distributed rendering documentation
|
||||
- Log levels are now controled with enums and named strings (where
|
||||
- Log levels are now controlled with enums and named strings (where
|
||||
applicable)
|
||||
- A new flag was also introduced which turns all OSP_LOG_WARNING
|
||||
- A new flag was also introduced which turns all `OSP_LOG_WARNING`
|
||||
messages into errors, which are submitted to the error callback
|
||||
instead of the message callback
|
||||
- Any unused parameters an object ignores now emit a warning
|
||||
@@ -1118,4 +1375,3 @@ changes.
|
||||
- Corrected memory management for shared data buffers
|
||||
- Updated to ISPC 1.8.1
|
||||
- Resolved issue in XML parser
|
||||
|
||||
|
||||
+7
-6
@@ -1,7 +1,7 @@
|
||||
## Copyright 2009-2020 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
##############################################################
|
||||
# Language setup
|
||||
@@ -20,6 +20,7 @@ set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_INSTALL_MESSAGE LAZY)
|
||||
|
||||
##############################################################
|
||||
# Establish project
|
||||
@@ -38,10 +39,10 @@ list(APPEND CMAKE_MODULE_PATH
|
||||
${PROJECT_SOURCE_DIR}/cmake/compiler
|
||||
)
|
||||
|
||||
include(ispc)
|
||||
include(ospray_macros)
|
||||
include(ospray_options)
|
||||
include(package)
|
||||
include(ispc)
|
||||
|
||||
if (OSPRAY_INSTALL_DEPENDENCIES)
|
||||
include(ospray_redistribute_deps)
|
||||
@@ -54,12 +55,12 @@ endif()
|
||||
## Main OSPRay library ##
|
||||
add_subdirectory(ospray)
|
||||
|
||||
## OSPRay sample apps ##
|
||||
add_subdirectory(apps)
|
||||
|
||||
## Modules ##
|
||||
add_subdirectory(modules)
|
||||
|
||||
## OSPRay sample apps ##
|
||||
add_subdirectory(apps)
|
||||
|
||||
## Regression test images target ##
|
||||
add_subdirectory(test_image_data)
|
||||
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ be overly strict. However, deviations from this document should be
|
||||
supported with technical reasoning.
|
||||
|
||||
This document is relatively simple and meant as a "quick overview" of
|
||||
expecations for OSPRay. A more complete set of guidelines for all of C++
|
||||
expectations for OSPRay. A more complete set of guidelines for all of C++
|
||||
can be found in the [ISO C++ Core
|
||||
Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md).
|
||||
|
||||
@@ -157,7 +157,7 @@ The following are concerns specific to ISPC:
|
||||
```
|
||||
|
||||
- Prefer omitting `uniform`/`varying` qualifiers for structs. Only
|
||||
apply them if they need to be consistenly the same for both
|
||||
apply them if they need to be consistently the same for both
|
||||
`uniform` and `varying` instances of the struct.
|
||||
|
||||
### OSPRay ISPCDevice Specific Design Choices
|
||||
|
||||
+9
-34
@@ -1,43 +1,11 @@
|
||||
## Copyright 2009-2020 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_dependent_option(
|
||||
OSPRAY_APPS_BENCHMARK
|
||||
"Enable building, installing, and packaging of benchmark tools."
|
||||
ON
|
||||
OSPRAY_ENABLE_APPS
|
||||
OFF
|
||||
)
|
||||
|
||||
cmake_dependent_option(
|
||||
OSPRAY_APPS_EXAMPLES
|
||||
"Enable building, installing, and packaging of ospExamples."
|
||||
ON
|
||||
OSPRAY_ENABLE_APPS
|
||||
OFF
|
||||
)
|
||||
|
||||
cmake_dependent_option(
|
||||
OSPRAY_APPS_TUTORIALS
|
||||
"Enable building, installing, and packaging of tutorial apps."
|
||||
ON
|
||||
OSPRAY_ENABLE_APPS
|
||||
OFF
|
||||
)
|
||||
|
||||
cmake_dependent_option(
|
||||
OSPRAY_APPS_TESTING
|
||||
"Enable building, installing, and packaging of test tools."
|
||||
ON
|
||||
OSPRAY_ENABLE_APPS
|
||||
OFF
|
||||
)
|
||||
|
||||
cmake_dependent_option(
|
||||
OSPRAY_APPS_ENABLE_GLM
|
||||
"Build ospray_cpp glm tests/tutorial"
|
||||
OFF
|
||||
"OSPRAY_APPS_TESTING OR OSPRAY_APPS_TUTORIALS"
|
||||
"OSPRAY_ENABLE_APPS_TESTING OR OSPRAY_ENABLE_APPS_TUTORIALS"
|
||||
OFF
|
||||
)
|
||||
|
||||
@@ -51,4 +19,11 @@ if (OSPRAY_APPS_ENABLE_GLM)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (OSPRAY_ENABLE_APPS_EXAMPLES)
|
||||
# prefer libGL over libOpenGl for better compatibility with SWR
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
find_package(OpenGL 3 REQUIRED)
|
||||
find_package(glfw3 REQUIRED)
|
||||
endif()
|
||||
|
||||
add_all_subdirectories()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
## Copyright 2009-2021 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if (NOT OSPRAY_APPS_BENCHMARK AND
|
||||
NOT OSPRAY_APPS_EXAMPLES AND
|
||||
NOT OSPRAY_APPS_TESTING)
|
||||
if (NOT OSPRAY_ENABLE_APPS_BENCHMARK AND
|
||||
NOT OSPRAY_ENABLE_APPS_EXAMPLES AND
|
||||
NOT OSPRAY_ENABLE_APPS_TESTING)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2021 Intel Corporation
|
||||
// Copyright 2017 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "ArcballCamera.h"
|
||||
@@ -84,7 +84,7 @@ void ArcballCamera::updateCamera()
|
||||
invCamera = rcp(camera);
|
||||
}
|
||||
|
||||
void ArcballCamera::setRotation(rkcommon::math::quaternionf q)
|
||||
void ArcballCamera::setRotation(rkcommon::math::quatf q)
|
||||
{
|
||||
rotation = q;
|
||||
updateCamera();
|
||||
@@ -95,16 +95,16 @@ void ArcballCamera::updateWindowSize(const rkcommon::math::vec2i &windowSize)
|
||||
invWindowSize = rkcommon::math::vec2f(1) / rkcommon::math::vec2f(windowSize);
|
||||
}
|
||||
|
||||
rkcommon::math::quaternionf ArcballCamera::screenToArcball(
|
||||
rkcommon::math::quatf ArcballCamera::screenToArcball(
|
||||
const rkcommon::math::vec2f &p)
|
||||
{
|
||||
const float dist = dot(p, p);
|
||||
// If we're on/in the sphere return the point on it
|
||||
if (dist <= 1.f) {
|
||||
return rkcommon::math::quaternionf(0, p.x, p.y, std::sqrt(1.f - dist));
|
||||
return rkcommon::math::quatf(0, p.x, p.y, std::sqrt(1.f - dist));
|
||||
} else {
|
||||
// otherwise we project the point onto the sphere
|
||||
const rkcommon::math::vec2f unitDir = normalize(p);
|
||||
return rkcommon::math::quaternionf(0, unitDir.x, unitDir.y, 0);
|
||||
return rkcommon::math::quatf(0, unitDir.x, unitDir.y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2021 Intel Corporation
|
||||
// Copyright 2017 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
@@ -23,7 +23,7 @@ class ArcballCamera
|
||||
rkcommon::math::vec3f upDir() const;
|
||||
rkcommon::math::AffineSpace3f transform() const;
|
||||
|
||||
void setRotation(rkcommon::math::quaternionf);
|
||||
void setRotation(rkcommon::math::quatf);
|
||||
|
||||
void updateWindowSize(const rkcommon::math::vec2i &windowSize);
|
||||
|
||||
@@ -31,10 +31,10 @@ class ArcballCamera
|
||||
void updateCamera();
|
||||
|
||||
// Project the point in [-1, 1] screen space onto the arcball sphere
|
||||
rkcommon::math::quaternionf screenToArcball(const rkcommon::math::vec2f &p);
|
||||
rkcommon::math::quatf screenToArcball(const rkcommon::math::vec2f &p);
|
||||
|
||||
float zoomSpeed;
|
||||
rkcommon::math::vec2f invWindowSize;
|
||||
rkcommon::math::AffineSpace3f centerTranslation, translation, invCamera;
|
||||
rkcommon::math::quaternionf rotation;
|
||||
rkcommon::math::quatf rotation;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright 2009-2020 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(arcball_camera STATIC ArcballCamera.cpp)
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
## Copyright 2009-2021 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
ospray_disable_compiler_warnings()
|
||||
|
||||
if (OSPRAY_APPS_EXAMPLES)
|
||||
if (OSPRAY_ENABLE_APPS_EXAMPLES)
|
||||
add_subdirectory(imgui)
|
||||
endif()
|
||||
|
||||
|
||||
+37
-8
@@ -1,19 +1,47 @@
|
||||
## Copyright 2009-2021 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
include(FetchContent)
|
||||
set(FETCHCONTENT_QUIET ON)
|
||||
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
|
||||
|
||||
FetchContent_Declare(
|
||||
imgui
|
||||
GIT_REPOSITORY https://github.com/ocornut/imgui
|
||||
GIT_TAG ${OSPRAY_IMGUI_GIT_TAG}
|
||||
# `patch` is not available on all systems, so use `git apply` instead.
|
||||
# The patch command first resets the repository to a clean state. That
|
||||
# is because CMake wants to apply the patch again when CMake needs to
|
||||
# reconfigure, which fails.
|
||||
PATCH_COMMAND git reset --hard && git apply -v -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/imgui.patch
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(imgui)
|
||||
|
||||
mark_as_advanced(FETCHCONTENT_BASE_DIR)
|
||||
mark_as_advanced(FETCHCONTENT_FULLY_DISCONNECTED)
|
||||
mark_as_advanced(FETCHCONTENT_QUIET)
|
||||
mark_as_advanced(FETCHCONTENT_SOURCE_DIR_IMGUI)
|
||||
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED)
|
||||
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_IMGUI)
|
||||
|
||||
ospray_disable_compiler_warnings()
|
||||
|
||||
add_library(ospray_imgui SHARED
|
||||
imgui.cpp
|
||||
imgui_draw.cpp
|
||||
imgui_tables.cpp
|
||||
imgui_widgets.cpp
|
||||
${imgui_SOURCE_DIR}/imgui.cpp
|
||||
${imgui_SOURCE_DIR}/imgui_draw.cpp
|
||||
${imgui_SOURCE_DIR}/imgui_tables.cpp
|
||||
${imgui_SOURCE_DIR}/imgui_widgets.cpp
|
||||
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
|
||||
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ospray_imgui
|
||||
PUBLIC
|
||||
glfw
|
||||
${OPENGL_LIBRARIES}
|
||||
rkcommon::rkcommon
|
||||
)
|
||||
|
||||
ospray_install_library(ospray_imgui apps)
|
||||
@@ -21,7 +49,8 @@ ospray_install_library(ospray_imgui apps)
|
||||
target_include_directories(
|
||||
ospray_imgui
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
|
||||
$<BUILD_INTERFACE:${imgui_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${imgui_SOURCE_DIR}/backends>
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${imgui_SOURCE_DIR}
|
||||
)
|
||||
|
||||
-116
@@ -1,116 +0,0 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
|
||||
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
|
||||
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
|
||||
//-----------------------------------------------------------------------------
|
||||
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
|
||||
// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
|
||||
//-----------------------------------------------------------------------------
|
||||
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
|
||||
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
|
||||
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
|
||||
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
//---- Define assertion handler. Defaults to calling assert().
|
||||
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
|
||||
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
|
||||
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
|
||||
|
||||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||
// Using dear imgui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||
#ifdef _WIN32
|
||||
# ifdef ospray_imgui_EXPORTS
|
||||
# define IMGUI_API __declspec(dllexport)
|
||||
# else
|
||||
# define IMGUI_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define IMGUI_API
|
||||
#endif
|
||||
|
||||
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
|
||||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
|
||||
//---- Disable all of Dear ImGui or don't implement standard windows.
|
||||
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
|
||||
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
|
||||
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
|
||||
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger window: ShowMetricsWindow() will be empty.
|
||||
|
||||
//---- Don't implement some functions to reduce linkage requirements.
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
|
||||
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
|
||||
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
||||
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
||||
|
||||
//---- Include imgui_user.h at the end of imgui.h as a convenience
|
||||
//#define IMGUI_INCLUDE_IMGUI_USER_H
|
||||
|
||||
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
|
||||
//#define IMGUI_USE_BGRA_PACKED_COLOR
|
||||
|
||||
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
|
||||
//#define IMGUI_USE_WCHAR32
|
||||
|
||||
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
|
||||
// By default the embedded implementations are declared static and not available outside of imgui cpp files.
|
||||
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
|
||||
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
|
||||
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
|
||||
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
|
||||
|
||||
//---- Use stb_printf's faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
|
||||
// Requires 'stb_sprintf.h' to be available in the include path. Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf.
|
||||
// #define IMGUI_USE_STB_SPRINTF
|
||||
|
||||
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
|
||||
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
|
||||
/*
|
||||
#define IM_VEC2_CLASS_EXTRA \
|
||||
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
|
||||
operator MyVec2() const { return MyVec2(x,y); }
|
||||
|
||||
#define IM_VEC4_CLASS_EXTRA \
|
||||
ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \
|
||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||
*/
|
||||
|
||||
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
||||
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
||||
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
|
||||
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
|
||||
//#define ImDrawIdx unsigned int
|
||||
|
||||
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
|
||||
//struct ImDrawList;
|
||||
//struct ImDrawCmd;
|
||||
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
|
||||
//#define ImDrawCallback MyImDrawCallback
|
||||
|
||||
//---- Debug Tools: Macro to break in Debugger
|
||||
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
|
||||
//#define IM_DEBUG_BREAK IM_ASSERT(0)
|
||||
//#define IM_DEBUG_BREAK __debugbreak()
|
||||
|
||||
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
|
||||
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
|
||||
// This adds a small runtime cost which is why it is not enabled by default.
|
||||
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
|
||||
|
||||
//---- Debug Tools: Enable slower asserts
|
||||
//#define IMGUI_DEBUG_PARANOID
|
||||
|
||||
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
||||
/*
|
||||
namespace ImGui
|
||||
{
|
||||
void MyFunction(const char* name, const MyMatrix44& v);
|
||||
}
|
||||
*/
|
||||
Vendored
-11153
File diff suppressed because it is too large
Load Diff
Vendored
-2725
File diff suppressed because it is too large
Load Diff
+44
@@ -0,0 +1,44 @@
|
||||
--- a/imconfig.h
|
||||
+++ b/imconfig.h
|
||||
@@ -21,20 +21,29 @@
|
||||
|
||||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||
+#ifdef _WIN32
|
||||
+# ifdef ospray_imgui_EXPORTS
|
||||
+# define IMGUI_API __declspec(dllexport)
|
||||
+# else
|
||||
+# define IMGUI_API __declspec(dllimport)
|
||||
+# endif
|
||||
+#else
|
||||
+# define IMGUI_API
|
||||
+#endif
|
||||
// DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
|
||||
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
|
||||
//#define IMGUI_API __declspec( dllexport )
|
||||
//#define IMGUI_API __declspec( dllimport )
|
||||
|
||||
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
|
||||
-//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
+#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
|
||||
|
||||
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
|
||||
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
|
||||
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
|
||||
-//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
|
||||
-//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
|
||||
+#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
|
||||
+#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
|
||||
|
||||
//---- Don't implement some functions to reduce linkage requirements.
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
|
||||
@@ -44,7 +53,7 @@
|
||||
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
||||
-//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
|
||||
+#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
|
||||
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
||||
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
|
||||
-3899
File diff suppressed because it is too large
Load Diff
-2528
File diff suppressed because it is too large
Load Diff
-3923
File diff suppressed because it is too large
Load Diff
-7918
File diff suppressed because it is too large
Load Diff
-639
@@ -1,639 +0,0 @@
|
||||
// [DEAR IMGUI]
|
||||
// This is a slightly modified version of stb_rect_pack.h 1.00.
|
||||
// Those changes would need to be pushed into nothings/stb:
|
||||
// - Added STBRP__CDECL
|
||||
// Grep for [DEAR IMGUI] to find the changes.
|
||||
|
||||
// stb_rect_pack.h - v1.00 - public domain - rectangle packing
|
||||
// Sean Barrett 2014
|
||||
//
|
||||
// Useful for e.g. packing rectangular textures into an atlas.
|
||||
// Does not do rotation.
|
||||
//
|
||||
// Not necessarily the awesomest packing method, but better than
|
||||
// the totally naive one in stb_truetype (which is primarily what
|
||||
// this is meant to replace).
|
||||
//
|
||||
// Has only had a few tests run, may have issues.
|
||||
//
|
||||
// More docs to come.
|
||||
//
|
||||
// No memory allocations; uses qsort() and assert() from stdlib.
|
||||
// Can override those by defining STBRP_SORT and STBRP_ASSERT.
|
||||
//
|
||||
// This library currently uses the Skyline Bottom-Left algorithm.
|
||||
//
|
||||
// Please note: better rectangle packers are welcome! Please
|
||||
// implement them to the same API, but with a different init
|
||||
// function.
|
||||
//
|
||||
// Credits
|
||||
//
|
||||
// Library
|
||||
// Sean Barrett
|
||||
// Minor features
|
||||
// Martins Mozeiko
|
||||
// github:IntellectualKitty
|
||||
//
|
||||
// Bugfixes / warning fixes
|
||||
// Jeremy Jaussaud
|
||||
// Fabian Giesen
|
||||
//
|
||||
// Version history:
|
||||
//
|
||||
// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
|
||||
// 0.99 (2019-02-07) warning fixes
|
||||
// 0.11 (2017-03-03) return packing success/fail result
|
||||
// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
|
||||
// 0.09 (2016-08-27) fix compiler warnings
|
||||
// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
|
||||
// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
|
||||
// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
|
||||
// 0.05: added STBRP_ASSERT to allow replacing assert
|
||||
// 0.04: fixed minor bug in STBRP_LARGE_RECTS support
|
||||
// 0.01: initial release
|
||||
//
|
||||
// LICENSE
|
||||
//
|
||||
// See end of file for license information.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// INCLUDE SECTION
|
||||
//
|
||||
|
||||
#ifndef STB_INCLUDE_STB_RECT_PACK_H
|
||||
#define STB_INCLUDE_STB_RECT_PACK_H
|
||||
|
||||
#define STB_RECT_PACK_VERSION 1
|
||||
|
||||
#ifdef STBRP_STATIC
|
||||
#define STBRP_DEF static
|
||||
#else
|
||||
#define STBRP_DEF extern
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct stbrp_context stbrp_context;
|
||||
typedef struct stbrp_node stbrp_node;
|
||||
typedef struct stbrp_rect stbrp_rect;
|
||||
|
||||
#ifdef STBRP_LARGE_RECTS
|
||||
typedef int stbrp_coord;
|
||||
#else
|
||||
typedef unsigned short stbrp_coord;
|
||||
#endif
|
||||
|
||||
STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
|
||||
// Assign packed locations to rectangles. The rectangles are of type
|
||||
// 'stbrp_rect' defined below, stored in the array 'rects', and there
|
||||
// are 'num_rects' many of them.
|
||||
//
|
||||
// Rectangles which are successfully packed have the 'was_packed' flag
|
||||
// set to a non-zero value and 'x' and 'y' store the minimum location
|
||||
// on each axis (i.e. bottom-left in cartesian coordinates, top-left
|
||||
// if you imagine y increasing downwards). Rectangles which do not fit
|
||||
// have the 'was_packed' flag set to 0.
|
||||
//
|
||||
// You should not try to access the 'rects' array from another thread
|
||||
// while this function is running, as the function temporarily reorders
|
||||
// the array while it executes.
|
||||
//
|
||||
// To pack into another rectangle, you need to call stbrp_init_target
|
||||
// again. To continue packing into the same rectangle, you can call
|
||||
// this function again. Calling this multiple times with multiple rect
|
||||
// arrays will probably produce worse packing results than calling it
|
||||
// a single time with the full rectangle array, but the option is
|
||||
// available.
|
||||
//
|
||||
// The function returns 1 if all of the rectangles were successfully
|
||||
// packed and 0 otherwise.
|
||||
|
||||
struct stbrp_rect
|
||||
{
|
||||
// reserved for your use:
|
||||
int id;
|
||||
|
||||
// input:
|
||||
stbrp_coord w, h;
|
||||
|
||||
// output:
|
||||
stbrp_coord x, y;
|
||||
int was_packed; // non-zero if valid packing
|
||||
|
||||
}; // 16 bytes, nominally
|
||||
|
||||
|
||||
STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
|
||||
// Initialize a rectangle packer to:
|
||||
// pack a rectangle that is 'width' by 'height' in dimensions
|
||||
// using temporary storage provided by the array 'nodes', which is 'num_nodes' long
|
||||
//
|
||||
// You must call this function every time you start packing into a new target.
|
||||
//
|
||||
// There is no "shutdown" function. The 'nodes' memory must stay valid for
|
||||
// the following stbrp_pack_rects() call (or calls), but can be freed after
|
||||
// the call (or calls) finish.
|
||||
//
|
||||
// Note: to guarantee best results, either:
|
||||
// 1. make sure 'num_nodes' >= 'width'
|
||||
// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1'
|
||||
//
|
||||
// If you don't do either of the above things, widths will be quantized to multiples
|
||||
// of small integers to guarantee the algorithm doesn't run out of temporary storage.
|
||||
//
|
||||
// If you do #2, then the non-quantized algorithm will be used, but the algorithm
|
||||
// may run out of temporary storage and be unable to pack some rectangles.
|
||||
|
||||
STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
|
||||
// Optionally call this function after init but before doing any packing to
|
||||
// change the handling of the out-of-temp-memory scenario, described above.
|
||||
// If you call init again, this will be reset to the default (false).
|
||||
|
||||
|
||||
STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
|
||||
// Optionally select which packing heuristic the library should use. Different
|
||||
// heuristics will produce better/worse results for different data sets.
|
||||
// If you call init again, this will be reset to the default.
|
||||
|
||||
enum
|
||||
{
|
||||
STBRP_HEURISTIC_Skyline_default=0,
|
||||
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
|
||||
STBRP_HEURISTIC_Skyline_BF_sortHeight
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// the details of the following structures don't matter to you, but they must
|
||||
// be visible so you can handle the memory allocations for them
|
||||
|
||||
struct stbrp_node
|
||||
{
|
||||
stbrp_coord x,y;
|
||||
stbrp_node *next;
|
||||
};
|
||||
|
||||
struct stbrp_context
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
int align;
|
||||
int init_mode;
|
||||
int heuristic;
|
||||
int num_nodes;
|
||||
stbrp_node *active_head;
|
||||
stbrp_node *free_head;
|
||||
stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPLEMENTATION SECTION
|
||||
//
|
||||
|
||||
#ifdef STB_RECT_PACK_IMPLEMENTATION
|
||||
#ifndef STBRP_SORT
|
||||
#include <stdlib.h>
|
||||
#define STBRP_SORT qsort
|
||||
#endif
|
||||
|
||||
#ifndef STBRP_ASSERT
|
||||
#include <assert.h>
|
||||
#define STBRP_ASSERT assert
|
||||
#endif
|
||||
|
||||
// [DEAR IMGUI] Added STBRP__CDECL
|
||||
#ifdef _MSC_VER
|
||||
#define STBRP__NOTUSED(v) (void)(v)
|
||||
#define STBRP__CDECL __cdecl
|
||||
#else
|
||||
#define STBRP__NOTUSED(v) (void)sizeof(v)
|
||||
#define STBRP__CDECL
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
STBRP__INIT_skyline = 1
|
||||
};
|
||||
|
||||
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
|
||||
{
|
||||
switch (context->init_mode) {
|
||||
case STBRP__INIT_skyline:
|
||||
STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
|
||||
context->heuristic = heuristic;
|
||||
break;
|
||||
default:
|
||||
STBRP_ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
|
||||
{
|
||||
if (allow_out_of_mem)
|
||||
// if it's ok to run out of memory, then don't bother aligning them;
|
||||
// this gives better packing, but may fail due to OOM (even though
|
||||
// the rectangles easily fit). @TODO a smarter approach would be to only
|
||||
// quantize once we've hit OOM, then we could get rid of this parameter.
|
||||
context->align = 1;
|
||||
else {
|
||||
// if it's not ok to run out of memory, then quantize the widths
|
||||
// so that num_nodes is always enough nodes.
|
||||
//
|
||||
// I.e. num_nodes * align >= width
|
||||
// align >= width / num_nodes
|
||||
// align = ceil(width/num_nodes)
|
||||
|
||||
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
|
||||
}
|
||||
}
|
||||
|
||||
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
|
||||
{
|
||||
int i;
|
||||
#ifndef STBRP_LARGE_RECTS
|
||||
STBRP_ASSERT(width <= 0xffff && height <= 0xffff);
|
||||
#endif
|
||||
|
||||
for (i=0; i < num_nodes-1; ++i)
|
||||
nodes[i].next = &nodes[i+1];
|
||||
nodes[i].next = NULL;
|
||||
context->init_mode = STBRP__INIT_skyline;
|
||||
context->heuristic = STBRP_HEURISTIC_Skyline_default;
|
||||
context->free_head = &nodes[0];
|
||||
context->active_head = &context->extra[0];
|
||||
context->width = width;
|
||||
context->height = height;
|
||||
context->num_nodes = num_nodes;
|
||||
stbrp_setup_allow_out_of_mem(context, 0);
|
||||
|
||||
// node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
|
||||
context->extra[0].x = 0;
|
||||
context->extra[0].y = 0;
|
||||
context->extra[0].next = &context->extra[1];
|
||||
context->extra[1].x = (stbrp_coord) width;
|
||||
#ifdef STBRP_LARGE_RECTS
|
||||
context->extra[1].y = (1<<30);
|
||||
#else
|
||||
context->extra[1].y = 65535;
|
||||
#endif
|
||||
context->extra[1].next = NULL;
|
||||
}
|
||||
|
||||
// find minimum y position if it starts at x1
|
||||
static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
|
||||
{
|
||||
stbrp_node *node = first;
|
||||
int x1 = x0 + width;
|
||||
int min_y, visited_width, waste_area;
|
||||
|
||||
STBRP__NOTUSED(c);
|
||||
|
||||
STBRP_ASSERT(first->x <= x0);
|
||||
|
||||
#if 0
|
||||
// skip in case we're past the node
|
||||
while (node->next->x <= x0)
|
||||
++node;
|
||||
#else
|
||||
STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
|
||||
#endif
|
||||
|
||||
STBRP_ASSERT(node->x <= x0);
|
||||
|
||||
min_y = 0;
|
||||
waste_area = 0;
|
||||
visited_width = 0;
|
||||
while (node->x < x1) {
|
||||
if (node->y > min_y) {
|
||||
// raise min_y higher.
|
||||
// we've accounted for all waste up to min_y,
|
||||
// but we'll now add more waste for everything we've visted
|
||||
waste_area += visited_width * (node->y - min_y);
|
||||
min_y = node->y;
|
||||
// the first time through, visited_width might be reduced
|
||||
if (node->x < x0)
|
||||
visited_width += node->next->x - x0;
|
||||
else
|
||||
visited_width += node->next->x - node->x;
|
||||
} else {
|
||||
// add waste area
|
||||
int under_width = node->next->x - node->x;
|
||||
if (under_width + visited_width > width)
|
||||
under_width = width - visited_width;
|
||||
waste_area += under_width * (min_y - node->y);
|
||||
visited_width += under_width;
|
||||
}
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
*pwaste = waste_area;
|
||||
return min_y;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x,y;
|
||||
stbrp_node **prev_link;
|
||||
} stbrp__findresult;
|
||||
|
||||
static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
|
||||
{
|
||||
int best_waste = (1<<30), best_x, best_y = (1 << 30);
|
||||
stbrp__findresult fr;
|
||||
stbrp_node **prev, *node, *tail, **best = NULL;
|
||||
|
||||
// align to multiple of c->align
|
||||
width = (width + c->align - 1);
|
||||
width -= width % c->align;
|
||||
STBRP_ASSERT(width % c->align == 0);
|
||||
|
||||
// if it can't possibly fit, bail immediately
|
||||
if (width > c->width || height > c->height) {
|
||||
fr.prev_link = NULL;
|
||||
fr.x = fr.y = 0;
|
||||
return fr;
|
||||
}
|
||||
|
||||
node = c->active_head;
|
||||
prev = &c->active_head;
|
||||
while (node->x + width <= c->width) {
|
||||
int y,waste;
|
||||
y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
|
||||
if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL
|
||||
// bottom left
|
||||
if (y < best_y) {
|
||||
best_y = y;
|
||||
best = prev;
|
||||
}
|
||||
} else {
|
||||
// best-fit
|
||||
if (y + height <= c->height) {
|
||||
// can only use it if it first vertically
|
||||
if (y < best_y || (y == best_y && waste < best_waste)) {
|
||||
best_y = y;
|
||||
best_waste = waste;
|
||||
best = prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
prev = &node->next;
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
best_x = (best == NULL) ? 0 : (*best)->x;
|
||||
|
||||
// if doing best-fit (BF), we also have to try aligning right edge to each node position
|
||||
//
|
||||
// e.g, if fitting
|
||||
//
|
||||
// ____________________
|
||||
// |____________________|
|
||||
//
|
||||
// into
|
||||
//
|
||||
// | |
|
||||
// | ____________|
|
||||
// |____________|
|
||||
//
|
||||
// then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned
|
||||
//
|
||||
// This makes BF take about 2x the time
|
||||
|
||||
if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
|
||||
tail = c->active_head;
|
||||
node = c->active_head;
|
||||
prev = &c->active_head;
|
||||
// find first node that's admissible
|
||||
while (tail->x < width)
|
||||
tail = tail->next;
|
||||
while (tail) {
|
||||
int xpos = tail->x - width;
|
||||
int y,waste;
|
||||
STBRP_ASSERT(xpos >= 0);
|
||||
// find the left position that matches this
|
||||
while (node->next->x <= xpos) {
|
||||
prev = &node->next;
|
||||
node = node->next;
|
||||
}
|
||||
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
|
||||
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
|
||||
if (y + height <= c->height) {
|
||||
if (y <= best_y) {
|
||||
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
|
||||
best_x = xpos;
|
||||
STBRP_ASSERT(y <= best_y);
|
||||
best_y = y;
|
||||
best_waste = waste;
|
||||
best = prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
tail = tail->next;
|
||||
}
|
||||
}
|
||||
|
||||
fr.prev_link = best;
|
||||
fr.x = best_x;
|
||||
fr.y = best_y;
|
||||
return fr;
|
||||
}
|
||||
|
||||
static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
|
||||
{
|
||||
// find best position according to heuristic
|
||||
stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
|
||||
stbrp_node *node, *cur;
|
||||
|
||||
// bail if:
|
||||
// 1. it failed
|
||||
// 2. the best node doesn't fit (we don't always check this)
|
||||
// 3. we're out of memory
|
||||
if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
|
||||
res.prev_link = NULL;
|
||||
return res;
|
||||
}
|
||||
|
||||
// on success, create new node
|
||||
node = context->free_head;
|
||||
node->x = (stbrp_coord) res.x;
|
||||
node->y = (stbrp_coord) (res.y + height);
|
||||
|
||||
context->free_head = node->next;
|
||||
|
||||
// insert the new node into the right starting point, and
|
||||
// let 'cur' point to the remaining nodes needing to be
|
||||
// stiched back in
|
||||
|
||||
cur = *res.prev_link;
|
||||
if (cur->x < res.x) {
|
||||
// preserve the existing one, so start testing with the next one
|
||||
stbrp_node *next = cur->next;
|
||||
cur->next = node;
|
||||
cur = next;
|
||||
} else {
|
||||
*res.prev_link = node;
|
||||
}
|
||||
|
||||
// from here, traverse cur and free the nodes, until we get to one
|
||||
// that shouldn't be freed
|
||||
while (cur->next && cur->next->x <= res.x + width) {
|
||||
stbrp_node *next = cur->next;
|
||||
// move the current node to the free list
|
||||
cur->next = context->free_head;
|
||||
context->free_head = cur;
|
||||
cur = next;
|
||||
}
|
||||
|
||||
// stitch the list back in
|
||||
node->next = cur;
|
||||
|
||||
if (cur->x < res.x + width)
|
||||
cur->x = (stbrp_coord) (res.x + width);
|
||||
|
||||
#ifdef _DEBUG
|
||||
cur = context->active_head;
|
||||
while (cur->x < context->width) {
|
||||
STBRP_ASSERT(cur->x < cur->next->x);
|
||||
cur = cur->next;
|
||||
}
|
||||
STBRP_ASSERT(cur->next == NULL);
|
||||
|
||||
{
|
||||
int count=0;
|
||||
cur = context->active_head;
|
||||
while (cur) {
|
||||
cur = cur->next;
|
||||
++count;
|
||||
}
|
||||
cur = context->free_head;
|
||||
while (cur) {
|
||||
cur = cur->next;
|
||||
++count;
|
||||
}
|
||||
STBRP_ASSERT(count == context->num_nodes+2);
|
||||
}
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// [DEAR IMGUI] Added STBRP__CDECL
|
||||
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
|
||||
{
|
||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||
if (p->h > q->h)
|
||||
return -1;
|
||||
if (p->h < q->h)
|
||||
return 1;
|
||||
return (p->w > q->w) ? -1 : (p->w < q->w);
|
||||
}
|
||||
|
||||
// [DEAR IMGUI] Added STBRP__CDECL
|
||||
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
|
||||
{
|
||||
const stbrp_rect *p = (const stbrp_rect *) a;
|
||||
const stbrp_rect *q = (const stbrp_rect *) b;
|
||||
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
|
||||
}
|
||||
|
||||
#ifdef STBRP_LARGE_RECTS
|
||||
#define STBRP__MAXVAL 0xffffffff
|
||||
#else
|
||||
#define STBRP__MAXVAL 0xffff
|
||||
#endif
|
||||
|
||||
STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
|
||||
{
|
||||
int i, all_rects_packed = 1;
|
||||
|
||||
// we use the 'was_packed' field internally to allow sorting/unsorting
|
||||
for (i=0; i < num_rects; ++i) {
|
||||
rects[i].was_packed = i;
|
||||
}
|
||||
|
||||
// sort according to heuristic
|
||||
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);
|
||||
|
||||
for (i=0; i < num_rects; ++i) {
|
||||
if (rects[i].w == 0 || rects[i].h == 0) {
|
||||
rects[i].x = rects[i].y = 0; // empty rect needs no space
|
||||
} else {
|
||||
stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
|
||||
if (fr.prev_link) {
|
||||
rects[i].x = (stbrp_coord) fr.x;
|
||||
rects[i].y = (stbrp_coord) fr.y;
|
||||
} else {
|
||||
rects[i].x = rects[i].y = STBRP__MAXVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// unsort
|
||||
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);
|
||||
|
||||
// set was_packed flags and all_rects_packed status
|
||||
for (i=0; i < num_rects; ++i) {
|
||||
rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
|
||||
if (!rects[i].was_packed)
|
||||
all_rects_packed = 0;
|
||||
}
|
||||
|
||||
// return the all_rects_packed status
|
||||
return all_rects_packed;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------
|
||||
This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
*/
|
||||
-1447
File diff suppressed because it is too large
Load Diff
-4903
File diff suppressed because it is too large
Load Diff
+23
-2
@@ -1,8 +1,29 @@
|
||||
## Copyright 2009-2019 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
include(FetchContent)
|
||||
set(FETCHCONTENT_QUIET ON)
|
||||
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
|
||||
|
||||
FetchContent_Declare(
|
||||
stb
|
||||
GIT_REPOSITORY https://github.com/nothings/stb
|
||||
GIT_TAG ${OSPRAY_STB_GIT_TAG}
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(stb)
|
||||
|
||||
mark_as_advanced(FETCHCONTENT_BASE_DIR)
|
||||
mark_as_advanced(FETCHCONTENT_FULLY_DISCONNECTED)
|
||||
mark_as_advanced(FETCHCONTENT_QUIET)
|
||||
mark_as_advanced(FETCHCONTENT_SOURCE_DIR_STB)
|
||||
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED)
|
||||
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_STB)
|
||||
|
||||
add_library(stb_image INTERFACE)
|
||||
target_include_directories(stb_image
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
|
||||
$<BUILD_INTERFACE:${stb_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
-7762
File diff suppressed because it is too large
Load Diff
-1690
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
## Copyright 2009-2020 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
include(GenerateExportHeader)
|
||||
@@ -7,32 +7,44 @@ add_library(ospray_testing SHARED
|
||||
${OSPRAY_RESOURCE}
|
||||
|
||||
ospray_testing.cpp
|
||||
builders/Builder.cpp
|
||||
|
||||
builders/Boxes.cpp
|
||||
builders/Builder.cpp
|
||||
builders/ClippingGeometries.cpp
|
||||
builders/CornellBox.cpp
|
||||
builders/Curves.cpp
|
||||
builders/Empty.cpp
|
||||
builders/GravitySpheresVolume.cpp
|
||||
builders/Instancing.cpp
|
||||
builders/Interpolation.cpp
|
||||
builders/MipMapTextures.cpp
|
||||
builders/Noise.cpp
|
||||
builders/ParticleVolume.cpp
|
||||
builders/PerlinNoiseVolumes.cpp
|
||||
builders/Planes.cpp
|
||||
builders/RandomSpheres.cpp
|
||||
builders/Streamlines.cpp
|
||||
builders/SubdivisionCube.cpp
|
||||
builders/UnstructuredVolumeSimple.cpp
|
||||
builders/UnstructuredVolumeGen.cpp
|
||||
builders/Planes.cpp
|
||||
builders/ClippingGeometries.cpp
|
||||
builders/ParticleVolume.cpp
|
||||
builders/VdbVolume.cpp
|
||||
builders/Transparency.cpp
|
||||
builders/UnstructuredVolumeGen.cpp
|
||||
builders/UnstructuredVolumeSimple.cpp
|
||||
builders/VdbVolume.cpp
|
||||
|
||||
# regression test scenes
|
||||
builders/test_pt_alloy_roughness.cpp
|
||||
builders/test_pt_carpaint.cpp
|
||||
builders/test_pt_glass.cpp
|
||||
builders/test_pt_luminous.cpp
|
||||
builders/test_pt_material_tex.cpp
|
||||
builders/test_pt_metal_roughness.cpp
|
||||
builders/test_pt_metallic_flakes.cpp
|
||||
builders/test_pt_mix_tex.cpp
|
||||
builders/test_pt_obj.cpp
|
||||
builders/test_pt_plastic.cpp
|
||||
builders/test_pt_principled.cpp
|
||||
builders/test_pt_principled_tex.cpp
|
||||
builders/test_pt_thinglass.cpp
|
||||
builders/test_pt_velvet.cpp
|
||||
)
|
||||
|
||||
generate_export_header(ospray_testing)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -66,16 +66,11 @@ cpp::Group Boxes::buildGroup() const
|
||||
|
||||
model.setParam("color", cpp::CopiedData(color));
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material material(rendererType, "obj");
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis") {
|
||||
material.setParam("ks", vec3f(0.3f));
|
||||
material.setParam("ns", 10.f);
|
||||
}
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
}
|
||||
cpp::Material material("obj");
|
||||
material.setParam("ks", vec3f(0.3f));
|
||||
material.setParam("ns", 10.f);
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
|
||||
model.commit();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -50,7 +50,7 @@ cpp::World Builder::buildWorld(
|
||||
}
|
||||
|
||||
cpp::TransferFunction Builder::makeTransferFunction(
|
||||
const vec2f &valueRange) const
|
||||
const range1f &valueRange) const
|
||||
{
|
||||
cpp::TransferFunction transferFunction("piecewiseLinear");
|
||||
|
||||
@@ -86,13 +86,15 @@ cpp::TransferFunction Builder::makeTransferFunction(
|
||||
|
||||
transferFunction.setParam("color", cpp::CopiedData(colors));
|
||||
transferFunction.setParam("opacity", cpp::CopiedData(opacities));
|
||||
transferFunction.setParam("valueRange", valueRange);
|
||||
transferFunction.setParam("value", valueRange);
|
||||
transferFunction.commit();
|
||||
|
||||
return transferFunction;
|
||||
}
|
||||
|
||||
cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
|
||||
cpp::Instance Builder::makeGroundPlane(const box3f &bounds,
|
||||
const vec4f &planeColor,
|
||||
const vec4f &stripeColor) const
|
||||
{
|
||||
auto planeExtent = 0.8f * length(bounds.center() - bounds.lower);
|
||||
|
||||
@@ -106,7 +108,6 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
|
||||
unsigned int startingIndex = 0;
|
||||
|
||||
const vec3f up = vec3f{0.f, 1.f, 0.f};
|
||||
const vec4f gray = vec4f{0.9f, 0.9f, 0.9f, 0.75f};
|
||||
|
||||
v_position.emplace_back(-planeExtent, -1.f, -planeExtent);
|
||||
v_position.emplace_back(planeExtent, -1.f, -planeExtent);
|
||||
@@ -118,10 +119,10 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
|
||||
v_normal.push_back(up);
|
||||
v_normal.push_back(up);
|
||||
|
||||
v_color.push_back(gray);
|
||||
v_color.push_back(gray);
|
||||
v_color.push_back(gray);
|
||||
v_color.push_back(gray);
|
||||
v_color.push_back(planeColor);
|
||||
v_color.push_back(planeColor);
|
||||
v_color.push_back(planeColor);
|
||||
v_color.push_back(planeColor);
|
||||
|
||||
indices.emplace_back(
|
||||
startingIndex, startingIndex + 1, startingIndex + 2, startingIndex + 3);
|
||||
@@ -131,8 +132,6 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
|
||||
const float paddedExtent = planeExtent + stripeWidth;
|
||||
const size_t numStripes = 10;
|
||||
|
||||
const vec4f stripeColor = vec4f{1.0f, 0.1f, 0.1f, 1.f};
|
||||
|
||||
for (size_t i = 0; i < numStripes; i++) {
|
||||
// the center coordinate of the stripe, either in the x or z
|
||||
// direction
|
||||
@@ -166,10 +165,13 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
|
||||
// z-direction stripes
|
||||
startingIndex = v_position.size();
|
||||
|
||||
v_position.emplace_back(coord - stripeWidth, yLevel, -paddedExtent);
|
||||
v_position.emplace_back(coord + stripeWidth, yLevel, -paddedExtent);
|
||||
v_position.emplace_back(coord + stripeWidth, yLevel, paddedExtent);
|
||||
v_position.emplace_back(coord - stripeWidth, yLevel, paddedExtent);
|
||||
// offset another epsilon to avoid z-figthing for primID AOV
|
||||
const float yLevel2 = yLevel + 1e-4f;
|
||||
|
||||
v_position.emplace_back(coord - stripeWidth, yLevel2, -paddedExtent);
|
||||
v_position.emplace_back(coord + stripeWidth, yLevel2, -paddedExtent);
|
||||
v_position.emplace_back(coord + stripeWidth, yLevel2, paddedExtent);
|
||||
v_position.emplace_back(coord - stripeWidth, yLevel2, paddedExtent);
|
||||
|
||||
v_normal.push_back(up);
|
||||
v_normal.push_back(up);
|
||||
@@ -194,12 +196,9 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
|
||||
|
||||
cpp::GeometricModel plane(planeGeometry);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material material(rendererType, "obj");
|
||||
material.commit();
|
||||
plane.setParam("material", material);
|
||||
}
|
||||
cpp::Material material("obj");
|
||||
material.commit();
|
||||
plane.setParam("material", material);
|
||||
|
||||
plane.commit();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
@@ -40,9 +40,11 @@ struct Builder : public memory::RefCountedObject,
|
||||
static Builder *createBuilder(const std::string &name);
|
||||
|
||||
protected:
|
||||
cpp::TransferFunction makeTransferFunction(const vec2f &valueRange) const;
|
||||
cpp::TransferFunction makeTransferFunction(const range1f &valueRange) const;
|
||||
|
||||
cpp::Instance makeGroundPlane(const box3f &bounds) const;
|
||||
cpp::Instance makeGroundPlane(const box3f &bounds,
|
||||
const vec4f &planeColor = vec4f{0.9f, 0.9f, 0.9f, 0.75f},
|
||||
const vec4f &stripeColor = vec4f{1.0f, 0.1f, 0.1f, 1.f}) const;
|
||||
|
||||
// Data //
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2021 Intel Corporation
|
||||
// Copyright 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -63,13 +63,10 @@ cpp::Group ClippingGeometries::buildGroup() const
|
||||
spheresGeometry.commit();
|
||||
|
||||
cpp::GeometricModel model(spheresGeometry);
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material material(rendererType, "obj");
|
||||
material.setParam("kd", vec3f(.1f, .4f, .8f));
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
}
|
||||
cpp::Material material("obj");
|
||||
material.setParam("kd", vec3f(.1f, .4f, .8f));
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -110,26 +110,6 @@ static std::vector<vec3f> vertices = {
|
||||
{0.14f, -1.00f, 0.67f},
|
||||
{0.71f, -1.00f, 0.49f}};
|
||||
|
||||
static std::vector<vec4ui> indices = {
|
||||
{0, 1, 2, 3}, // Floor
|
||||
{4, 5, 6, 7}, // Ceiling
|
||||
{8, 9, 10, 11}, // Backwall
|
||||
{12, 13, 14, 15}, // RightWall
|
||||
{16, 17, 18, 19}, // LeftWall
|
||||
{20, 21, 22, 23}, // ShortBox Top Face
|
||||
{24, 25, 26, 27}, // ShortBox Left Face
|
||||
{28, 29, 30, 31}, // ShortBox Front Face
|
||||
{32, 33, 34, 35}, // ShortBox Right Face
|
||||
{36, 37, 38, 39}, // ShortBox Back Face
|
||||
{40, 41, 42, 43}, // ShortBox Bottom Face
|
||||
{44, 45, 46, 47}, // TallBox Top Face
|
||||
{48, 49, 50, 51}, // TallBox Left Face
|
||||
{52, 53, 54, 55}, // TallBox Front Face
|
||||
{56, 57, 58, 59}, // TallBox Right Face
|
||||
{60, 61, 62, 63}, // TallBox Back Face
|
||||
{64, 65, 66, 67} // TallBox Bottom Face
|
||||
};
|
||||
|
||||
static std::vector<vec4f> colors = {
|
||||
// Floor
|
||||
{0.725f, 0.710f, 0.68f, 1.0f},
|
||||
@@ -231,18 +211,14 @@ cpp::Group CornellBox::buildGroup() const
|
||||
|
||||
quadMesh.setParam("vertex.position", cpp::CopiedData(vertices));
|
||||
quadMesh.setParam("vertex.color", cpp::CopiedData(colors));
|
||||
quadMesh.setParam("index", cpp::CopiedData(indices));
|
||||
quadMesh.setParam("quadSoup", true);
|
||||
quadMesh.commit();
|
||||
|
||||
cpp::GeometricModel model(quadMesh);
|
||||
|
||||
// create and setup a material
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material quadMeshMaterial(rendererType, "obj");
|
||||
quadMeshMaterial.commit();
|
||||
model.setParam("material", quadMeshMaterial);
|
||||
}
|
||||
cpp::Material quadMeshMaterial("obj");
|
||||
quadMeshMaterial.commit();
|
||||
model.setParam("material", quadMeshMaterial);
|
||||
|
||||
// Put the mesh and material into a model
|
||||
model.commit();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include <iostream>
|
||||
@@ -75,6 +75,8 @@ cpp::Group Curves::buildGroup() const
|
||||
cpp::CopiedData((vec3f *)points.data(), points.size(), sizeof(vec4f)));
|
||||
} else if (curveVariant == "bspline") {
|
||||
geom.setParam("basis", OSP_BSPLINE);
|
||||
} else if (curveVariant == "bezier") {
|
||||
geom.setParam("basis", OSP_BEZIER);
|
||||
}
|
||||
|
||||
for (auto &c : s_colors) {
|
||||
@@ -93,12 +95,12 @@ cpp::Group Curves::buildGroup() const
|
||||
|
||||
if (rendererType == "pathtracer") {
|
||||
// create glass material and assign to geometry
|
||||
cpp::Material glassMaterial(rendererType.c_str(), "thinGlass");
|
||||
cpp::Material glassMaterial("thinGlass");
|
||||
glassMaterial.setParam("attenuationDistance", 1.f);
|
||||
glassMaterial.commit();
|
||||
model.setParam("material", glassMaterial);
|
||||
} else if (rendererType == "scivis" || rendererType == "ao") {
|
||||
cpp::Material glassMaterial(rendererType.c_str(), "obj");
|
||||
} else {
|
||||
cpp::Material glassMaterial("obj");
|
||||
glassMaterial.commit();
|
||||
model.setParam("material", glassMaterial);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -11,12 +11,17 @@ namespace testing {
|
||||
|
||||
struct Empty : public detail::Builder
|
||||
{
|
||||
Empty() = default;
|
||||
Empty(bool plane = false)
|
||||
{
|
||||
addPlane = plane;
|
||||
}
|
||||
~Empty() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
|
||||
cpp::World buildWorld() const override;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
@@ -24,7 +29,6 @@ struct Empty : public detail::Builder
|
||||
void Empty::commit()
|
||||
{
|
||||
Builder::commit();
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group Empty::buildGroup() const
|
||||
@@ -34,7 +38,21 @@ cpp::Group Empty::buildGroup() const
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::World Empty::buildWorld() const
|
||||
{
|
||||
cpp::World world;
|
||||
|
||||
if (addPlane) {
|
||||
std::vector<cpp::Instance> inst;
|
||||
inst.push_back(makeGroundPlane(box3f(zero, one)));
|
||||
world.setParam("instance", cpp::CopiedData(inst));
|
||||
}
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(Empty, empty);
|
||||
OSP_REGISTER_TESTING_BUILDER(Empty(true), nolight);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -83,7 +83,7 @@ void GravitySpheres::commit()
|
||||
cpp::Group GravitySpheres::buildGroup() const
|
||||
{
|
||||
auto voxels = generateVoxels();
|
||||
auto voxelRange = vec2f(0.f, 10.f);
|
||||
auto voxelRange = range1f(0.f, 10.f);
|
||||
|
||||
cpp::Volume volume =
|
||||
createAsAMR ? createAMRVolume(voxels) : createStructuredVolume(voxels);
|
||||
@@ -110,22 +110,18 @@ cpp::Group GravitySpheres::buildGroup() const
|
||||
|
||||
cpp::GeometricModel isoModel(isoGeom);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material mat(rendererType, "obj");
|
||||
mat.setParam("kd", vec3f(1.f));
|
||||
mat.setParam("d", 0.5f);
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis")
|
||||
mat.setParam("ks", vec3f(0.2f));
|
||||
mat.commit();
|
||||
cpp::Material mat("obj");
|
||||
mat.setParam("kd", vec3f(1.f));
|
||||
mat.setParam("d", 0.5f);
|
||||
mat.setParam("ks", vec3f(0.2f));
|
||||
mat.commit();
|
||||
|
||||
if (multipleIsosurfaces) {
|
||||
std::vector<vec4f> colors = {
|
||||
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
|
||||
isoModel.setParam("color", cpp::CopiedData(colors));
|
||||
}
|
||||
isoModel.setParam("material", mat);
|
||||
if (multipleIsosurfaces) {
|
||||
std::vector<vec4f> colors = {
|
||||
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
|
||||
isoModel.setParam("color", cpp::CopiedData(colors));
|
||||
}
|
||||
isoModel.setParam("material", mat);
|
||||
|
||||
isoModel.commit();
|
||||
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
#include "rkcommon/utility/random.h"
|
||||
// stl
|
||||
#include <random>
|
||||
|
||||
using namespace rkcommon::math;
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct Instancing : public detail::Builder
|
||||
{
|
||||
Instancing() = default;
|
||||
~Instancing() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override
|
||||
{
|
||||
return cpp::Group();
|
||||
}
|
||||
cpp::Group buildGroupA() const;
|
||||
cpp::Group buildGroupB() const;
|
||||
cpp::Group buildGroupC() const;
|
||||
cpp::World buildWorld() const override;
|
||||
|
||||
private:
|
||||
vec2ui numInstances{10, 10};
|
||||
bool useIDs{false};
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
// Helper functions //
|
||||
namespace {
|
||||
|
||||
cpp::Geometry makeBoxGeometry(const box3f &box)
|
||||
{
|
||||
cpp::Geometry ospGeometry("box");
|
||||
ospGeometry.setParam("box", cpp::CopiedData(box));
|
||||
ospGeometry.commit();
|
||||
return ospGeometry;
|
||||
}
|
||||
|
||||
cpp::GeometricModel makeGeometricModel(
|
||||
cpp::Geometry geo, const vec3f &kd, bool useIDs)
|
||||
{
|
||||
cpp::GeometricModel geometricModel(geo);
|
||||
|
||||
cpp::Material objMaterial("obj");
|
||||
objMaterial.setParam("kd", kd);
|
||||
objMaterial.commit();
|
||||
geometricModel.setParam("material", objMaterial);
|
||||
if (useIDs)
|
||||
geometricModel.setParam("id", 44u);
|
||||
geometricModel.commit();
|
||||
|
||||
return geometricModel;
|
||||
}
|
||||
|
||||
cpp::Volume makeVolume(const vec3f ¢er)
|
||||
{
|
||||
cpp::Volume volume("structuredRegular");
|
||||
{
|
||||
const vec3i volumeCells{10, 10, 10};
|
||||
const vec3f spacing{.25f};
|
||||
volume.setParam("gridOrigin", center - volumeCells * spacing / 2.f);
|
||||
volume.setParam("gridSpacing", spacing);
|
||||
std::vector<float> voxels(volumeCells.long_product());
|
||||
index_sequence_3D numCell(volumeCells);
|
||||
for (const vec3i i : numCell)
|
||||
voxels[numCell.flatten(i)] = length(volumeCells - i / 2.f);
|
||||
volume.setParam("data", cpp::CopiedData(voxels.data(), volumeCells));
|
||||
volume.commit();
|
||||
}
|
||||
return volume;
|
||||
}
|
||||
|
||||
cpp::VolumetricModel makeVolumetricModel(cpp::Volume volume, bool useIDs)
|
||||
{
|
||||
cpp::VolumetricModel vModel(volume);
|
||||
{
|
||||
// Create transfer function
|
||||
cpp::TransferFunction transferFunction("piecewiseLinear");
|
||||
{
|
||||
std::vector<vec3f> colors = {{.1f, .4f, .8f}};
|
||||
std::vector<float> opacities = {1.f};
|
||||
transferFunction.setParam("color", cpp::CopiedData(colors));
|
||||
transferFunction.setParam("opacity", cpp::CopiedData(opacities));
|
||||
transferFunction.setParam("value", range1f(0.f, 10.f));
|
||||
transferFunction.commit();
|
||||
}
|
||||
|
||||
vModel.setParam("transferFunction", transferFunction);
|
||||
vModel.setParam("densityScale", .5f);
|
||||
vModel.setParam("gradientShadingScale", 1.f);
|
||||
if (useIDs)
|
||||
vModel.setParam("id", 3u);
|
||||
vModel.commit();
|
||||
}
|
||||
return vModel;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// Instancing definitions //
|
||||
|
||||
void Instancing::commit()
|
||||
{
|
||||
Builder::commit();
|
||||
|
||||
numInstances = getParam<vec2ui>("numInstances", numInstances);
|
||||
useIDs = getParam<bool>("useIDs", useIDs);
|
||||
}
|
||||
|
||||
cpp::Group Instancing::buildGroupA() const
|
||||
{
|
||||
cpp::Group group;
|
||||
|
||||
cpp::Geometry box = makeBoxGeometry(box3f(vec3f(-1.f), vec3f(1.f)));
|
||||
cpp::GeometricModel geometricModel =
|
||||
makeGeometricModel(box, vec3f(.1f, .4f, .8f), useIDs);
|
||||
group.setParam("geometry", cpp::CopiedData(geometricModel));
|
||||
|
||||
cpp::Light light("quad");
|
||||
light.setParam("position", vec3f(0.f, 6.f, 0.f));
|
||||
light.setParam("edge1", vec3f(0.f, 0.f, -1.f));
|
||||
light.setParam("edge2", vec3f(1.f, 0.f, 0.f));
|
||||
light.setParam("intensity", 2.0f);
|
||||
light.setParam("color", vec3f(2.6f, 2.5f, 2.3f));
|
||||
light.commit();
|
||||
group.setParam("light", cpp::CopiedData(light));
|
||||
|
||||
group.commit();
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::Group Instancing::buildGroupB() const
|
||||
{
|
||||
cpp::Group group;
|
||||
std::vector<cpp::GeometricModel> models;
|
||||
|
||||
cpp::Geometry box = makeBoxGeometry(box3f(vec3f(-1.f), vec3f(0.f, 1.f, 1.f)));
|
||||
models.emplace_back(makeGeometricModel(box, vec3f(.1f, .4f, .8f), useIDs));
|
||||
box = makeBoxGeometry(box3f(vec3f(0.f, -1.f, -1.f), vec3f(1.f)));
|
||||
models.emplace_back(makeGeometricModel(box, vec3f(.1f, .4f, .8f), useIDs));
|
||||
group.setParam("geometry", cpp::CopiedData(models));
|
||||
|
||||
cpp::Light light("spot");
|
||||
light.setParam("position", vec3f(0.f, 6.f, 0.f));
|
||||
light.setParam("direction", vec3f(0.f, -1.f, 0.f));
|
||||
light.setParam("openingAngle", 180.f);
|
||||
light.setParam("penumbraAngle", 0.f);
|
||||
light.setParam("radius", 0.3f);
|
||||
light.setParam("intensity", 2.0f);
|
||||
float lid1d[] = {0.f, 2.4f, 0.2f, 0.1f, 0.03f, 0.01f, 0.01f};
|
||||
light.setParam("intensityDistribution", cpp::CopiedData(lid1d, 7));
|
||||
light.setParam("color", vec3f(2.6f, 2.5f, 2.3f));
|
||||
light.commit();
|
||||
group.setParam("light", cpp::CopiedData(light));
|
||||
|
||||
group.commit();
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::Group Instancing::buildGroupC() const
|
||||
{
|
||||
cpp::Group group;
|
||||
|
||||
// Create volumetric model
|
||||
group.setParam("volume",
|
||||
cpp::CopiedData(makeVolumetricModel(makeVolume(vec3f(0.f)), useIDs)));
|
||||
|
||||
cpp::Light light("sphere");
|
||||
light.setParam("position", vec3f(0.f, 2.f, 0.f));
|
||||
light.setParam("radius", .25f);
|
||||
light.setParam("intensity", 2.0f);
|
||||
light.setParam("color", vec3f(2.6f, 2.5f, 2.3f));
|
||||
light.commit();
|
||||
group.setParam("light", cpp::CopiedData(light));
|
||||
|
||||
group.commit();
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::World Instancing::buildWorld() const
|
||||
{
|
||||
// Create all groups
|
||||
std::vector<cpp::Group> groups;
|
||||
groups.push_back(buildGroupA());
|
||||
groups.push_back(buildGroupB());
|
||||
groups.push_back(buildGroupC());
|
||||
|
||||
// Create instances
|
||||
std::vector<cpp::Instance> instances;
|
||||
{
|
||||
const float spacing = 2.5f;
|
||||
const vec2f totalSize = spacing * (numInstances - 1);
|
||||
box3f sceneBounds;
|
||||
index_sequence_2D indexInstances(numInstances);
|
||||
for (const vec2ui i : indexInstances) {
|
||||
const float h = .3f * (sin(.7f * i.x) + sin(.7f * i.y));
|
||||
const vec3f position = spacing * vec3f(i.x, h, i.y)
|
||||
- 0.5f * vec3f(totalSize.x, 0.0f, totalSize.y);
|
||||
const float d = length(vec2f(position.x, position.z));
|
||||
const int gId = int(.18f * d) % groups.size();
|
||||
cpp::Instance instance(groups[gId]);
|
||||
if (useIDs)
|
||||
instance.setParam("id", i.y + 1);
|
||||
const affine3f xfm = affine3f::translate(position)
|
||||
* affine3f::rotate(vec3f(0.f, 1.f, 0.f), .03f * (15.f - d));
|
||||
instance.setParam("transform",
|
||||
affine3f::rotate(vec3f(-1.f, 0.f, 0.f), .3f * float(pi)) * xfm);
|
||||
instance.commit();
|
||||
instances.push_back(instance);
|
||||
}
|
||||
}
|
||||
|
||||
// Create world
|
||||
cpp::World world;
|
||||
world.setParam("instance", cpp::CopiedData(instances));
|
||||
|
||||
// Done
|
||||
return world;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(Instancing, instancing);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,188 @@
|
||||
// Copyright 2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
// stl
|
||||
#include <random>
|
||||
|
||||
using namespace rkcommon::math;
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct Interpolation : public detail::Builder
|
||||
{
|
||||
Interpolation(
|
||||
bool subd = false, unsigned int attrib = 0, unsigned int interp = 0)
|
||||
: useSubd(subd), attribute(attrib), interpolation(interp)
|
||||
{}
|
||||
~Interpolation() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
cpp::World buildWorld() const override;
|
||||
|
||||
// TODO: support triangles
|
||||
bool useSubd{false}; // otherwise Mesh
|
||||
unsigned int attribute; // color, texcoord, normal
|
||||
unsigned int interpolation; // face varying, vertex varying, uniform, constant
|
||||
};
|
||||
|
||||
// quad mesh data
|
||||
static std::vector<vec3f> vertices = {
|
||||
// Left
|
||||
{0.f, 0.f, 0.f},
|
||||
{1.f, 0.f, 0.f},
|
||||
{1.f, 1.f, 0.f},
|
||||
{0.f, 1.f, 0.f},
|
||||
// Right
|
||||
{2.f, 0.f, 0.f},
|
||||
{2.f, 1.f, 0.f}};
|
||||
|
||||
static std::vector<vec4ui> quad_indices = {
|
||||
{0, 1, 2, 3}, // Left
|
||||
{1, 4, 5, 2} // Right
|
||||
};
|
||||
|
||||
static std::vector<unsigned int> subd_indices = {0, 1, 2, 3, 1, 4, 5, 2};
|
||||
|
||||
static std::vector<vec2f> texcoords = {{0.0f, 0.0f},
|
||||
{0.1f, 0.0f},
|
||||
{0.2f, 0.0f},
|
||||
{0.3f, 0.0f},
|
||||
{0.4f, 0.0f},
|
||||
{0.5f, 0.0f},
|
||||
{0.6f, 0.0f},
|
||||
{0.7f, 0.0f}};
|
||||
|
||||
static std::vector<vec4f> colors = {{1.f, 0.f, 0.f, 1.f},
|
||||
{0.f, 1.f, 0.f, 1.f},
|
||||
{0.f, 0.f, 1.f, 1.f},
|
||||
{1.f, 1.f, 0.f, 1.f},
|
||||
{1.f, 0.f, 1.f, 1.f},
|
||||
{1.f, 0.f, 1.f, 1.f}};
|
||||
|
||||
static std::vector<vec4f> colors_fv = {{1.f, 0.f, 0.f, 1.f},
|
||||
{0.f, 1.f, 0.f, 1.f},
|
||||
{0.f, 0.f, 1.f, 1.f},
|
||||
{1.f, 1.f, 0.f, 1.f},
|
||||
{1.f, 0.f, 1.f, 1.f},
|
||||
{1.f, 0.f, 1.f, 1.f},
|
||||
{1.f, 0.f, 1.f, 1.f},
|
||||
{1.f, 0.f, 1.f, 1.f}};
|
||||
|
||||
static std::vector<vec3f> normals = {{1.f, 0.f, 0.f},
|
||||
{0.f, 1.f, 0.f},
|
||||
{0.f, 0.f, 1.f},
|
||||
{1.f, 1.f, 0.f},
|
||||
{1.f, 0.f, 1.f},
|
||||
{1.f, 0.f, 1.f},
|
||||
{1.f, 0.f, 1.f},
|
||||
{1.f, 0.f, 1.f}};
|
||||
|
||||
// number of vertex indices per face
|
||||
static std::vector<unsigned int> faces = {4, 4};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
void Interpolation::commit()
|
||||
{
|
||||
Builder::commit();
|
||||
useSubd = getParam<bool>("useSubd", useSubd);
|
||||
attribute = getParam<unsigned int>("attribute", attribute);
|
||||
interpolation = getParam<unsigned int>("interpolation", interpolation);
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group Interpolation::buildGroup() const
|
||||
{
|
||||
cpp::Geometry mesh;
|
||||
std::vector<vec4f> colors_mod = colors;
|
||||
if (interpolation == 0)
|
||||
colors_mod = colors_fv;
|
||||
else if (interpolation == 2)
|
||||
colors_mod.resize(2);
|
||||
else if (interpolation == 3)
|
||||
colors_mod.resize(1);
|
||||
|
||||
cpp::Texture tex("texture2d");
|
||||
tex.setParam("format", OSP_TEXTURE_RGBA32F);
|
||||
tex.setParam(
|
||||
"data", cpp::CopiedData(colors_mod.data(), vec2ul(colors_mod.size(), 1)));
|
||||
tex.commit();
|
||||
cpp::Material mat("obj");
|
||||
if (attribute == 1) // texture
|
||||
mat.setParam("map_kd", tex);
|
||||
mat.commit();
|
||||
if (useSubd) {
|
||||
mesh = cpp::Geometry("subdivision");
|
||||
mesh.setParam("vertex.position", cpp::CopiedData(vertices));
|
||||
mesh.setParam("face", cpp::CopiedData(faces));
|
||||
mesh.setParam("level", 1.0f); // global level
|
||||
mesh.setParam("index", cpp::CopiedData(subd_indices));
|
||||
mesh.setParam("mode", OSP_SUBDIVISION_PIN_CORNERS);
|
||||
} else {
|
||||
mesh = cpp::Geometry("mesh");
|
||||
mesh.setParam("vertex.position", cpp::CopiedData(vertices));
|
||||
mesh.setParam("index", cpp::CopiedData(quad_indices));
|
||||
}
|
||||
if (interpolation == 0) {
|
||||
if (attribute == 1)
|
||||
mesh.setParam("texcoord", cpp::CopiedData(texcoords));
|
||||
else if (attribute == 2)
|
||||
mesh.setParam("normal", cpp::CopiedData(normals));
|
||||
else
|
||||
mesh.setParam("color", cpp::CopiedData(colors_mod));
|
||||
} else if (interpolation == 1) {
|
||||
if (attribute == 1)
|
||||
mesh.setParam("vertex.texcoord", cpp::CopiedData(texcoords));
|
||||
else if (attribute == 2)
|
||||
mesh.setParam("vertex.normal", cpp::CopiedData(normals));
|
||||
else
|
||||
mesh.setParam("vertex.color", cpp::CopiedData(colors_mod));
|
||||
}
|
||||
mesh.commit();
|
||||
|
||||
cpp::GeometricModel model(mesh);
|
||||
model.setParam("material", mat);
|
||||
|
||||
if ((attribute == 0) && interpolation == 2)
|
||||
model.setParam("color", cpp::CopiedData(colors_mod));
|
||||
else if ((attribute == 0) && interpolation == 3)
|
||||
model.setParam("color", colors_mod[0]);
|
||||
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::World Interpolation::buildWorld() const
|
||||
{
|
||||
auto world = Builder::buildWorld();
|
||||
|
||||
cpp::Light light("distant");
|
||||
light.setParam("color", vec3f(0.78f, 0.551f, 0.183f));
|
||||
light.setParam("intensity", 3.14f);
|
||||
light.setParam("direction", vec3f(-0.8f, -0.6f, 0.3f));
|
||||
light.commit();
|
||||
cpp::Light ambient("ambient");
|
||||
ambient.setParam("intensity", 0.35f);
|
||||
ambient.setParam("visible", false);
|
||||
ambient.commit();
|
||||
std::vector<cpp::Light> lights{light, ambient};
|
||||
world.setParam("light", cpp::CopiedData(lights));
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(Interpolation, interpolation);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,104 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct MipMapTextures : public detail::Builder
|
||||
{
|
||||
MipMapTextures() = default;
|
||||
~MipMapTextures() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
|
||||
private:
|
||||
float scale{1.0f};
|
||||
OSPTextureFilter filter{OSP_TEXTURE_FILTER_LINEAR};
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
void MipMapTextures::commit()
|
||||
{
|
||||
Builder::commit();
|
||||
|
||||
scale = getParam<float>("tcScale", 1.0f);
|
||||
filter = static_cast<OSPTextureFilter>(
|
||||
getParam<uint32_t>("filter", OSP_TEXTURE_FILTER_LINEAR));
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group MipMapTextures::buildGroup() const
|
||||
{
|
||||
std::vector<vec3f> v_position = {{-2.5f, -1.5f, -4.f},
|
||||
{2.5f, -1.5f, -4.f},
|
||||
{2.5f, 1.5f, 0.f},
|
||||
{-2.5f, 1.5f, 0.f},
|
||||
{-1.25f, 1.5f, -2.f},
|
||||
{1.25f, 1.5f, -2.f},
|
||||
{1.25f, 3.5f, -0.5f},
|
||||
{-1.25f, 3.5f, -0.5f}};
|
||||
std::vector<vec2f> v_texcoord = {{0.f, 0.f},
|
||||
{scale, 0.f},
|
||||
{scale, scale},
|
||||
{0.f, scale},
|
||||
{0.f, 0.f},
|
||||
{scale, 0.f},
|
||||
{scale, scale},
|
||||
{0.f, scale}};
|
||||
|
||||
cpp::Geometry planeGeometry("mesh");
|
||||
planeGeometry.setParam("vertex.position", cpp::CopiedData(v_position));
|
||||
planeGeometry.setParam("vertex.texcoord", cpp::CopiedData(v_texcoord));
|
||||
planeGeometry.setParam("quadSoup", true);
|
||||
planeGeometry.commit();
|
||||
|
||||
vec2ul texSize(500, 500);
|
||||
std::vector<uint8_t> texData(texSize.product());
|
||||
uint8_t grayTexel{50};
|
||||
uint8_t lightTexel{200};
|
||||
for (size_t i = 0; i < texSize.x; i++) {
|
||||
const int sz = 1 + i * 4 / texSize.x;
|
||||
for (size_t j = 0; j < texSize.y; j++) {
|
||||
texData[j * texSize.x + i] =
|
||||
(i / sz + j / sz) % 2 ? lightTexel : grayTexel;
|
||||
}
|
||||
}
|
||||
|
||||
cpp::Texture procTex("texture2d");
|
||||
procTex.setParam("format", OSP_TEXTURE_L8);
|
||||
procTex.setParam("filter", filter);
|
||||
procTex.setParam("data", cpp::CopiedData(texData.data(), texSize));
|
||||
procTex.commit();
|
||||
|
||||
cpp::GeometricModel plane(planeGeometry);
|
||||
|
||||
cpp::Material material("obj");
|
||||
material.setParam("map_kd", procTex);
|
||||
material.setParam("map_kd.scale", vec2f(scale));
|
||||
material.setParam("map_kd.translation", vec2f(0.5f - 0.5f / scale));
|
||||
material.commit();
|
||||
|
||||
plane.setParam("material", material);
|
||||
plane.commit();
|
||||
|
||||
cpp::Group planeGroup;
|
||||
planeGroup.setParam("geometry", cpp::CopiedData(plane));
|
||||
planeGroup.commit();
|
||||
|
||||
return planeGroup;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(MipMapTextures, mip_map_textures);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Noise.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "ospray_testing.h"
|
||||
|
||||
@@ -87,7 +87,7 @@ void ParticleVolume::commit()
|
||||
{
|
||||
Builder::commit();
|
||||
|
||||
numParticles = getParam<int>("numParticles", 1000);
|
||||
numParticles = getParam<int>("numParticles", numParticles);
|
||||
withVolume = getParam<bool>("withVolume", withVolume);
|
||||
withIsosurface = getParam<bool>("withIsosurface", withIsosurface);
|
||||
isovalue = getParam<float>("isovalue", 0.5f);
|
||||
@@ -153,8 +153,8 @@ cpp::Group ParticleVolume::buildGroup() const
|
||||
|
||||
// AMK: VKL will set the correct valueRange, but we don't have a good way to
|
||||
// get that to OSPRay yet. Use the weightRange instead.
|
||||
model.setParam(
|
||||
"transferFunction", makeTransferFunction(vec2f(0.f, weightRange.upper)));
|
||||
model.setParam("transferFunction",
|
||||
makeTransferFunction(range1f(0.f, weightRange.upper)));
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
@@ -175,22 +175,18 @@ cpp::Group ParticleVolume::buildGroup() const
|
||||
|
||||
cpp::GeometricModel isoModel(isoGeom);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material mat(rendererType, "obj");
|
||||
mat.setParam("kd", vec3f(1.f));
|
||||
mat.setParam("d", 0.5f);
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis")
|
||||
mat.setParam("ks", vec3f(0.2f));
|
||||
mat.commit();
|
||||
cpp::Material mat("obj");
|
||||
mat.setParam("kd", vec3f(1.f));
|
||||
mat.setParam("d", 0.5f);
|
||||
mat.setParam("ks", vec3f(0.2f));
|
||||
mat.commit();
|
||||
|
||||
if (multipleIsosurfaces) {
|
||||
std::vector<vec4f> colors = {
|
||||
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
|
||||
isoModel.setParam("color", cpp::CopiedData(colors));
|
||||
}
|
||||
isoModel.setParam("material", mat);
|
||||
if (multipleIsosurfaces) {
|
||||
std::vector<vec4f> colors = {
|
||||
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
|
||||
isoModel.setParam("color", cpp::CopiedData(colors));
|
||||
}
|
||||
isoModel.setParam("material", mat);
|
||||
|
||||
isoModel.commit();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2021 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -98,7 +98,7 @@ cpp::VolumetricModel createProceduralVolumetricModel(
|
||||
volume.commit();
|
||||
|
||||
cpp::TransferFunction tfn("piecewiseLinear");
|
||||
tfn.setParam("valueRange", voxelRange.toVec2());
|
||||
tfn.setParam("value", voxelRange);
|
||||
tfn.setParam("color", cpp::CopiedData(colors));
|
||||
tfn.setParam("opacity", cpp::CopiedData(opacities));
|
||||
tfn.commit();
|
||||
@@ -113,18 +113,14 @@ cpp::VolumetricModel createProceduralVolumetricModel(
|
||||
return volumeModel;
|
||||
}
|
||||
|
||||
cpp::GeometricModel createGeometricModel(
|
||||
cpp::Geometry geo, const std::string &rendererType, const vec3f &kd)
|
||||
cpp::GeometricModel createGeometricModel(cpp::Geometry geo, const vec3f &kd)
|
||||
{
|
||||
cpp::GeometricModel geometricModel(geo);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material objMaterial(rendererType, "obj");
|
||||
objMaterial.setParam("kd", kd);
|
||||
objMaterial.commit();
|
||||
geometricModel.setParam("material", objMaterial);
|
||||
}
|
||||
cpp::Material objMaterial("obj");
|
||||
objMaterial.setParam("kd", kd);
|
||||
objMaterial.commit();
|
||||
geometricModel.setParam("material", objMaterial);
|
||||
|
||||
return geometricModel;
|
||||
}
|
||||
@@ -199,7 +195,7 @@ cpp::Group PerlinNoiseVolumes::buildGroup() const
|
||||
gradientShadingScale));
|
||||
}
|
||||
|
||||
for (auto volumetricModel : volumetricModels)
|
||||
for (auto &volumetricModel : volumetricModels)
|
||||
volumetricModel.commit();
|
||||
|
||||
std::vector<cpp::GeometricModel> geometricModels;
|
||||
@@ -211,12 +207,12 @@ cpp::Group PerlinNoiseVolumes::buildGroup() const
|
||||
makeBoxGeometry(box3f(vec3f(0.0f, -1.5f, 0.f), vec3f(2.f, 1.5f, 2.f)));
|
||||
|
||||
geometricModels.emplace_back(
|
||||
createGeometricModel(box1, rendererType, vec3f(0.2f, 0.2f, 0.2f)));
|
||||
createGeometricModel(box1, vec3f(0.2f, 0.2f, 0.2f)));
|
||||
geometricModels.emplace_back(
|
||||
createGeometricModel(box2, rendererType, vec3f(0.2f, 0.2f, 0.2f)));
|
||||
createGeometricModel(box2, vec3f(0.2f, 0.2f, 0.2f)));
|
||||
}
|
||||
|
||||
for (auto geometricModel : geometricModels)
|
||||
for (auto &geometricModel : geometricModels)
|
||||
geometricModel.commit();
|
||||
|
||||
if (!volumetricModels.empty())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -49,13 +49,10 @@ cpp::Group Planes::buildGroup() const
|
||||
|
||||
// Create geometric model
|
||||
cpp::GeometricModel model(planeGeometry);
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material material(rendererType, "obj");
|
||||
material.setParam("kd", vec3f(.1f, .4f, .8f));
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
}
|
||||
cpp::Material material("obj");
|
||||
material.setParam("kd", vec3f(.1f, .4f, .8f));
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
model.commit();
|
||||
|
||||
// Create group
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -14,7 +14,7 @@ namespace testing {
|
||||
|
||||
struct Spheres : public detail::Builder
|
||||
{
|
||||
Spheres() = default;
|
||||
Spheres(OSPSphereType type);
|
||||
~Spheres() override = default;
|
||||
|
||||
void commit() override;
|
||||
@@ -24,11 +24,14 @@ struct Spheres : public detail::Builder
|
||||
private:
|
||||
// Data //
|
||||
|
||||
OSPSphereType sphereType;
|
||||
int numSpheres{100};
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
Spheres::Spheres(OSPSphereType type) : sphereType(type) {}
|
||||
|
||||
void Spheres::commit()
|
||||
{
|
||||
Builder::commit();
|
||||
@@ -70,7 +73,12 @@ cpp::Group Spheres::buildGroup() const
|
||||
// create the sphere geometry, and assign attributes
|
||||
cpp::Geometry spheresGeometry("sphere");
|
||||
|
||||
spheresGeometry.setParam("type", sphereType);
|
||||
spheresGeometry.setParam("sphere.position", cpp::CopiedData(s_center));
|
||||
if (sphereType == OSP_ORIENTED_DISC) {
|
||||
spheresGeometry.setParam("sphere.normal", cpp::CopiedData(s_center));
|
||||
}
|
||||
|
||||
spheresGeometry.setParam("sphere.radius", cpp::CopiedData(s_radius));
|
||||
spheresGeometry.commit();
|
||||
|
||||
@@ -80,12 +88,12 @@ cpp::Group Spheres::buildGroup() const
|
||||
|
||||
if (rendererType == "pathtracer") {
|
||||
// create glass material and assign to geometry
|
||||
cpp::Material glassMaterial(rendererType.c_str(), "thinGlass");
|
||||
cpp::Material glassMaterial("thinGlass");
|
||||
glassMaterial.setParam("attenuationDistance", 0.2f);
|
||||
glassMaterial.commit();
|
||||
model.setParam("material", glassMaterial);
|
||||
} else if (rendererType == "scivis" || rendererType == "ao") {
|
||||
cpp::Material glassMaterial(rendererType.c_str(), "obj");
|
||||
} else {
|
||||
cpp::Material glassMaterial("obj");
|
||||
glassMaterial.commit();
|
||||
model.setParam("material", glassMaterial);
|
||||
}
|
||||
@@ -100,7 +108,9 @@ cpp::Group Spheres::buildGroup() const
|
||||
return group;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(Spheres, random_spheres);
|
||||
OSP_REGISTER_TESTING_BUILDER(Spheres(OSP_SPHERE), random_spheres);
|
||||
OSP_REGISTER_TESTING_BUILDER(Spheres(OSP_DISC), random_discs);
|
||||
OSP_REGISTER_TESTING_BUILDER(Spheres(OSP_ORIENTED_DISC), random_oriented_discs);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -114,12 +114,9 @@ cpp::Group Streamlines::buildGroup() const
|
||||
|
||||
cpp::GeometricModel model(slGeom);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material slMat(rendererType, "obj");
|
||||
slMat.commit();
|
||||
model.setParam("material", slMat);
|
||||
}
|
||||
cpp::Material slMat("obj");
|
||||
slMat.commit();
|
||||
model.setParam("material", slMat);
|
||||
|
||||
model.commit();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -29,7 +29,8 @@ cpp::Group SubdivisionCube::buildGroup() const
|
||||
{-1.0f, 1.0f, -1.0f},
|
||||
{1.0f, 1.0f, -1.0f},
|
||||
{1.0f, 1.0f, 1.0f},
|
||||
{-1.0f, 1.0f, 1.0f}};
|
||||
{-1.0f, 1.0f, 1.0f},
|
||||
/*WA: pad for Embree*/ {0.0f}};
|
||||
|
||||
// color per vertex
|
||||
std::vector<vec4f> colors = {{0.0f, 0.0f, 0.0f, 1.f},
|
||||
@@ -114,12 +115,9 @@ cpp::Group SubdivisionCube::buildGroup() const
|
||||
|
||||
cpp::GeometricModel model(geometry);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material material(rendererType, "obj");
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
}
|
||||
cpp::Material material("obj");
|
||||
material.commit();
|
||||
model.setParam("material", material);
|
||||
|
||||
model.commit();
|
||||
|
||||
|
||||
@@ -57,33 +57,29 @@ cpp::Group Transparency::buildGroup() const
|
||||
// Create geometric model
|
||||
cpp::GeometricModel gModel(planeGeometry);
|
||||
{
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
std::vector<vec3f> colors = {{.8f, 0.f, 0.f},
|
||||
{0.f, .8f, 0.f},
|
||||
{0.f, 0.f, .8f},
|
||||
{.8f, .8f, .8f},
|
||||
{.5f, 0.f, 0.f},
|
||||
{0.f, .5f, 0.f},
|
||||
{0.f, 0.f, .5f}};
|
||||
std::vector<vec3f> transmissions = {{0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f},
|
||||
{.8f, 0.f, 0.f},
|
||||
{0.f, .8f, 0.f},
|
||||
{0.f, 0.f, .8f}};
|
||||
std::vector<cpp::Material> materials;
|
||||
for (uint32_t i = 0; i < std::min(colors.size(), transmissions.size());
|
||||
i++) {
|
||||
materials.emplace_back(cpp::Material(rendererType, "obj"));
|
||||
materials[i].setParam("kd", colors[i]);
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis")
|
||||
materials[i].setParam("tf", transmissions[i]);
|
||||
materials[i].commit();
|
||||
}
|
||||
gModel.setParam("material", cpp::CopiedData(materials));
|
||||
std::vector<vec3f> colors = {{.8f, 0.f, 0.f},
|
||||
{0.f, .8f, 0.f},
|
||||
{0.f, 0.f, .8f},
|
||||
{.8f, .8f, .8f},
|
||||
{.5f, 0.f, 0.f},
|
||||
{0.f, .5f, 0.f},
|
||||
{0.f, 0.f, .5f}};
|
||||
std::vector<vec3f> transmissions = {{0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f},
|
||||
{0.f, 0.f, 0.f},
|
||||
{.8f, 0.f, 0.f},
|
||||
{0.f, .8f, 0.f},
|
||||
{0.f, 0.f, .8f}};
|
||||
std::vector<cpp::Material> materials;
|
||||
for (uint32_t i = 0; i < std::min(colors.size(), transmissions.size());
|
||||
i++) {
|
||||
materials.emplace_back(cpp::Material("obj"));
|
||||
materials[i].setParam("kd", colors[i]);
|
||||
materials[i].setParam("tf", transmissions[i]);
|
||||
materials[i].commit();
|
||||
}
|
||||
gModel.setParam("material", cpp::CopiedData(materials));
|
||||
gModel.commit();
|
||||
}
|
||||
|
||||
@@ -116,7 +112,7 @@ cpp::Group Transparency::buildGroup() const
|
||||
std::vector<float> opacities = {1.f};
|
||||
transferFunction.setParam("color", cpp::CopiedData(colors));
|
||||
transferFunction.setParam("opacity", cpp::CopiedData(opacities));
|
||||
transferFunction.setParam("valueRange", vec2f(0.f, 10.f));
|
||||
transferFunction.setParam("value", range1f(0.f, 10.f));
|
||||
transferFunction.commit();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2021 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -85,7 +85,7 @@ std::array<bool, 256> primsNotAllowed;
|
||||
|
||||
void initializeFromArray(const std::vector<std::vector<uint32_t>> &array)
|
||||
{
|
||||
for (auto order : array) {
|
||||
for (auto &order : array) {
|
||||
uint32_t mask = 0;
|
||||
for (uint32_t i : order)
|
||||
mask |= (1 << i);
|
||||
@@ -98,7 +98,7 @@ void initializeFromArray(const std::vector<std::vector<uint32_t>> &array)
|
||||
void initializePrims()
|
||||
{
|
||||
// Initialize degenerate tetrahedrons
|
||||
for (auto order : tetraNotAllowed) {
|
||||
for (auto &order : tetraNotAllowed) {
|
||||
uint32_t mask = 0;
|
||||
for (uint32_t i : order)
|
||||
mask |= (1 << i);
|
||||
@@ -313,16 +313,12 @@ cpp::Group UnstructuredVolumeGen::buildGroup() const
|
||||
|
||||
cpp::GeometricModel isoModel(isoGeom);
|
||||
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis"
|
||||
|| rendererType == "ao") {
|
||||
cpp::Material mat(rendererType, "obj");
|
||||
mat.setParam("kd", vec3f(0.8f));
|
||||
if (rendererType == "pathtracer" || rendererType == "scivis")
|
||||
mat.setParam("ks", vec3f(0.2f));
|
||||
mat.commit();
|
||||
cpp::Material mat("obj");
|
||||
mat.setParam("kd", vec3f(0.8f));
|
||||
mat.setParam("ks", vec3f(0.2f));
|
||||
mat.commit();
|
||||
|
||||
isoModel.setParam("material", mat);
|
||||
}
|
||||
isoModel.setParam("material", mat);
|
||||
|
||||
isoModel.commit();
|
||||
|
||||
@@ -330,7 +326,8 @@ cpp::Group UnstructuredVolumeGen::buildGroup() const
|
||||
} else {
|
||||
cpp::VolumetricModel model(volume);
|
||||
model.setParam("transferFunction",
|
||||
makeTransferFunction(showCells ? vec2f{0.f, 1.f} : vec2f{-.4f, -.05f}));
|
||||
makeTransferFunction(
|
||||
showCells ? range1f{0.f, 1.f} : range1f{-.4f, -.05f}));
|
||||
model.setParam("densityScale", densityScale);
|
||||
model.commit();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2021 Intel Corporation
|
||||
// Copyright 2020 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
@@ -14,7 +14,7 @@ namespace testing {
|
||||
|
||||
struct VdbVolume : public detail::Builder
|
||||
{
|
||||
VdbVolume() = default;
|
||||
VdbVolume(bool packed = false) : packed(packed) {}
|
||||
~VdbVolume() override = default;
|
||||
|
||||
void commit() override;
|
||||
@@ -25,6 +25,7 @@ struct VdbVolume : public detail::Builder
|
||||
private:
|
||||
float densityScale{1.f};
|
||||
float anisotropy{0.f};
|
||||
bool packed{false};
|
||||
static constexpr uint32_t domainRes = 128;
|
||||
};
|
||||
|
||||
@@ -42,17 +43,17 @@ cpp::Group VdbVolume::buildGroup() const
|
||||
{
|
||||
cpp::Volume volume("vdb");
|
||||
|
||||
std::vector<uint32_t> level;
|
||||
std::vector<vec3i> origin;
|
||||
std::vector<cpp::CopiedData> data;
|
||||
std::vector<float> dataPacked;
|
||||
|
||||
constexpr uint32_t leafRes = 8;
|
||||
constexpr uint32_t N = domainRes / leafRes;
|
||||
constexpr size_t numLeaves = N * static_cast<size_t>(N) * N;
|
||||
|
||||
level.reserve(numLeaves);
|
||||
origin.reserve(numLeaves);
|
||||
data.reserve(numLeaves);
|
||||
if (!packed)
|
||||
data.reserve(numLeaves);
|
||||
|
||||
std::vector<float> leaf(leafRes * (size_t)leafRes * leafRes, 0.f);
|
||||
for (uint32_t z = 0; z < N; ++z)
|
||||
@@ -80,21 +81,30 @@ cpp::Group VdbVolume::buildGroup() const
|
||||
leafValueRange[0].extend(vr);
|
||||
|
||||
if (leafValueRange[0].lower != 0.f || leafValueRange[0].upper != 0.f) {
|
||||
level.push_back(3);
|
||||
origin.push_back(vec3i(x * leafRes, y * leafRes, z * leafRes));
|
||||
data.emplace_back(
|
||||
cpp::CopiedData(leaf.data(), vec3ul(leafRes, leafRes, leafRes)));
|
||||
if (packed)
|
||||
std::copy(leaf.begin(), leaf.end(), std::back_inserter(dataPacked));
|
||||
else
|
||||
data.emplace_back(cpp::CopiedData(
|
||||
leaf.data(), vec3ul(leafRes, leafRes, leafRes)));
|
||||
}
|
||||
}
|
||||
|
||||
if (level.empty())
|
||||
if (origin.empty())
|
||||
throw std::runtime_error("vdb volume is empty.");
|
||||
|
||||
volume.setParam("filter", (int)OSP_VOLUME_FILTER_TRILINEAR);
|
||||
volume.setParam("gradientFilter", (int)OSP_VOLUME_FILTER_TRILINEAR);
|
||||
volume.setParam("node.level", cpp::CopiedData(level));
|
||||
volume.setParam("filter", OSP_VOLUME_FILTER_LINEAR);
|
||||
volume.setParam("gradientFilter", OSP_VOLUME_FILTER_LINEAR);
|
||||
volume.setParam(
|
||||
"node.level", cpp::CopiedData(std::vector<uint32_t>(origin.size(), 3)));
|
||||
volume.setParam("node.origin", cpp::CopiedData(origin));
|
||||
volume.setParam("node.data", cpp::CopiedData(data));
|
||||
if (packed) {
|
||||
volume.setParam("nodesPackedDense", cpp::CopiedData(dataPacked));
|
||||
volume.setParam("node.format",
|
||||
cpp::CopiedData(std::vector<OSPVolumeFormat>(
|
||||
origin.size(), OSP_VOLUME_FORMAT_DENSE_ZYX)));
|
||||
} else
|
||||
volume.setParam("node.data", cpp::CopiedData(data));
|
||||
volume.commit();
|
||||
|
||||
cpp::VolumetricModel model(volume);
|
||||
@@ -145,6 +155,7 @@ cpp::World VdbVolume::buildWorld() const
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(VdbVolume, vdb_volume);
|
||||
OSP_REGISTER_TESTING_BUILDER(VdbVolume(true), vdb_volume_packed);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtAlloyRoughness : public PtMaterial
|
||||
{
|
||||
PtAlloyRoughness() = default;
|
||||
~PtAlloyRoughness() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeAlloyMaterial(
|
||||
vec3f color, vec3f edgeColor, float roughness)
|
||||
{
|
||||
cpp::Material mat("alloy");
|
||||
mat.setParam("color", color);
|
||||
mat.setParam("edgeColor", edgeColor);
|
||||
mat.setParam("roughness", roughness);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtAlloyRoughness::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
// Silver
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeAlloyMaterial(vec3f(.66f, .66f, .67f),
|
||||
vec3f(1.f, 1.f, 1.f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Aluminium
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeAlloyMaterial(vec3f(.52f, .52f, .5f),
|
||||
vec3f(1.f, 1.f, 1.f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Gold
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeAlloyMaterial(vec3f(.83f, .68f, .21f),
|
||||
vec3f(1.f, 1.f, 1.f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Chromium
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeAlloyMaterial(vec3f(.65f, .66f, .67f),
|
||||
vec3f(1.f, 1.f, 1.f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Copper
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeAlloyMaterial(vec3f(.72f, .45f, .2f),
|
||||
vec3f(1.f, 1.f, 1.f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtAlloyRoughness, test_pt_alloy_roughness);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,74 @@
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtCarPaint : public PtMaterial
|
||||
{
|
||||
PtCarPaint() = default;
|
||||
~PtCarPaint() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeCarPaintMaterial(
|
||||
std::initializer_list<std::pair<std::string, float>> params)
|
||||
{
|
||||
cpp::Material mat("carPaint");
|
||||
|
||||
mat.setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
mat.setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
|
||||
mat.setParam("flipflopColor", vec3f(0.252f, 0.0385f, 0.550f));
|
||||
|
||||
for (auto ¶m : params)
|
||||
mat.setParam(param.first, param.second);
|
||||
|
||||
mat.commit();
|
||||
return mat;
|
||||
}
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtCarPaint::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
// flakeDensity
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeCarPaintMaterial(
|
||||
{{"flakeDensity", float(i) / (dimSize - 1)}, {"flakeScale", 1000.f}}));
|
||||
|
||||
// flipflopFalloff
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeCarPaintMaterial({{"flakeDensity", 1.f},
|
||||
{"flakeScale", 1000.f},
|
||||
{"flipflopFalloff", 1.f - float(i) / (dimSize - 1)}}));
|
||||
|
||||
// flakeScale
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeCarPaintMaterial({{"flakeDensity", 1.f},
|
||||
{"flakeScale", lerp(float(i) / (dimSize - 1), 1000.f, 100.f)}}));
|
||||
|
||||
// flakeRoughness
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeCarPaintMaterial({{"flakeDensity", 1.f},
|
||||
{"flakeScale", 1000.f},
|
||||
{"flakeRoughness", float(i) / (dimSize - 1)}}));
|
||||
|
||||
// coat
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(
|
||||
makeCarPaintMaterial({{"coat", float(i) / (dimSize - 1)}}));
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtCarPaint, test_pt_carpaint);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -1,31 +1,23 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtGlass : public detail::Builder
|
||||
struct PtGlass : public PtMaterial
|
||||
{
|
||||
PtGlass() = default;
|
||||
~PtGlass() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeGlassMaterial(const std::string &rendererType,
|
||||
float eta,
|
||||
vec3f color,
|
||||
float attenuationDistance)
|
||||
static cpp::Material makeGlassMaterial(
|
||||
float eta, vec3f color, float attenuationDistance)
|
||||
{
|
||||
cpp::Material mat(rendererType, "glass");
|
||||
cpp::Material mat("glass");
|
||||
mat.setParam("eta", eta);
|
||||
mat.setParam("attenuationColor", color);
|
||||
mat.setParam("attenuationDistance", attenuationDistance);
|
||||
@@ -36,50 +28,20 @@ static cpp::Material makeGlassMaterial(const std::string &rendererType,
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
void PtGlass::commit()
|
||||
std::vector<cpp::Material> PtGlass::buildMaterials() const
|
||||
{
|
||||
Builder::commit();
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group PtGlass::buildGroup() const
|
||||
{
|
||||
cpp::Geometry sphereGeometry("sphere");
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
std::vector<vec3f> spheres;
|
||||
std::vector<uint8_t> index;
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
spheres.emplace_back(i_f.x, i_f.y, 0.f);
|
||||
materials.push_back(makeGlassMaterial(rendererType,
|
||||
lerp(i_f.x / (dimSize - 1), 1.f, 5.f),
|
||||
vec3f(1.f, 0.25f, 0.f),
|
||||
lerp(i_f.y / (dimSize - 1), 0.5f, 5.f)));
|
||||
index.push_back(numSpheres.flatten(i));
|
||||
materials.push_back(makeGlassMaterial(lerp(i_f.x / (dimSize - 1), 1.f, 2.f),
|
||||
vec3f(.1f, .5f, 1.f),
|
||||
lerp(1.f - i_f.y / (dimSize - 1), 0.5f, 5.f)));
|
||||
}
|
||||
|
||||
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
|
||||
sphereGeometry.setParam("radius", 0.4f);
|
||||
sphereGeometry.commit();
|
||||
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
|
||||
model.setParam("material", cpp::CopiedData(materials));
|
||||
model.setParam("index", cpp::CopiedData(index));
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtGlass, test_pt_glass);
|
||||
|
||||
@@ -1,55 +1,39 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "test_pt_material.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtLuminous : public detail::Builder
|
||||
struct PtLuminous : public PtMaterial
|
||||
{
|
||||
PtLuminous() = default;
|
||||
~PtLuminous() override = default;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
cpp::World buildWorld() const override;
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
cpp::Group PtLuminous::buildGroup() const
|
||||
std::vector<cpp::Material> PtLuminous::buildMaterials() const
|
||||
{
|
||||
cpp::Geometry sphereGeometry("sphere");
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
sphereGeometry.setParam("sphere.position", cpp::CopiedData(vec3f(0.f)));
|
||||
sphereGeometry.setParam("radius", 1.f);
|
||||
sphereGeometry.commit();
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
materials.push_back(cpp::Material("luminous"));
|
||||
materials.back().setParam("color", vec3f(0.7f, 0.7f, 1.f));
|
||||
materials.back().setParam("intensity", i_f.x / (dimSize - 1));
|
||||
materials.back().setParam("transparency", 1.f - i_f.y / (dimSize - 1));
|
||||
materials.back().commit();
|
||||
}
|
||||
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
|
||||
cpp::Material material(rendererType, "luminous");
|
||||
material.setParam("color", vec3f(0.7f, 0.7f, 1.f));
|
||||
material.commit();
|
||||
|
||||
model.setParam("material", material);
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::World PtLuminous::buildWorld() const
|
||||
{
|
||||
auto world = Builder::buildWorld();
|
||||
world.removeParam("light");
|
||||
return world;
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtLuminous, test_pt_luminous);
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtMaterial : public detail::Builder
|
||||
{
|
||||
PtMaterial() = default;
|
||||
~PtMaterial() override = default;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
cpp::World buildWorld() const override;
|
||||
|
||||
virtual std::vector<cpp::Material> buildMaterials() const = 0;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
inline cpp::Group PtMaterial::buildGroup() const
|
||||
{
|
||||
cpp::Geometry sphereGeometry("sphere");
|
||||
|
||||
std::vector<cpp::Material> materials = buildMaterials();
|
||||
const int dimCount = sqrtf(materials.size());
|
||||
const int dimSize = dimCount - 1;
|
||||
|
||||
index_sequence_2D numSpheres(dimCount);
|
||||
|
||||
std::vector<vec3f> spheres;
|
||||
std::vector<uint8_t> index;
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
spheres.emplace_back(dimSize / 2.f - i_f.x, dimSize / 2.f - i_f.y, .6f);
|
||||
index.push_back(numSpheres.flatten(i));
|
||||
}
|
||||
|
||||
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
|
||||
sphereGeometry.setParam("radius", 0.4f);
|
||||
sphereGeometry.commit();
|
||||
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
|
||||
model.setParam("material", cpp::CopiedData(materials));
|
||||
model.setParam("index", cpp::CopiedData(index));
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
inline cpp::World PtMaterial::buildWorld() const
|
||||
{
|
||||
cpp::World world;
|
||||
|
||||
cpp::Group group = buildGroup();
|
||||
cpp::Instance groupInstance(group);
|
||||
groupInstance.commit();
|
||||
|
||||
box3f bbox = group.getBounds<box3f>();
|
||||
bbox.lower -= .4f;
|
||||
bbox.upper += .4f;
|
||||
|
||||
cpp::Instance planeInstance = makeGroundPlane(
|
||||
bbox, vec4f(.9f, .9f, .9f, 1.f), vec4f(.2f, .2f, .2f, 1.f));
|
||||
planeInstance.setParam(
|
||||
"xfm", affine3f::rotate(vec3f(-1.f, 0.f, 0.f), half_pi));
|
||||
planeInstance.commit();
|
||||
|
||||
std::vector<cpp::Instance> instances;
|
||||
instances.push_back(groupInstance);
|
||||
instances.push_back(planeInstance);
|
||||
|
||||
world.setParam("instance", cpp::CopiedData(instances));
|
||||
|
||||
// Lights
|
||||
{
|
||||
std::vector<cpp::Light> lightHandles;
|
||||
|
||||
cpp::Light sphereLight("sphere");
|
||||
sphereLight.setParam("intensity", 500.f);
|
||||
sphereLight.setParam("position", vec3f(-15.f, 15.f, -20.f));
|
||||
sphereLight.setParam("radius", 5.f);
|
||||
sphereLight.commit();
|
||||
|
||||
cpp::Light ambientLight("ambient");
|
||||
ambientLight.setParam("intensity", 0.4f);
|
||||
ambientLight.setParam("color", vec3f(1.f));
|
||||
ambientLight.commit();
|
||||
|
||||
lightHandles.push_back(sphereLight);
|
||||
lightHandles.push_back(ambientLight);
|
||||
|
||||
world.setParam("light", cpp::CopiedData(lightHandles));
|
||||
}
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,128 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_tex.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtMaterialTex : public PtTex
|
||||
{
|
||||
PtMaterialTex() = default;
|
||||
~PtMaterialTex() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const override;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtMaterialTex::buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
// carPaint
|
||||
{
|
||||
// roughness
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// flakeColor
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
materials.back().setParam("flakeScale", 2000.f);
|
||||
materials.back().setParam("flakeDensity", 1.f);
|
||||
setTexture<vec3f>(materials.back(), "flakeColor", texRGBA);
|
||||
|
||||
// flakeDensity
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
materials.back().setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
|
||||
materials.back().setParam("flakeScale", 2000.f);
|
||||
setTexture<float>(materials.back(), "flakeDensity", texR);
|
||||
|
||||
// flakeRoughness
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
materials.back().setParam("flakeDensity", 1.f);
|
||||
materials.back().setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
|
||||
materials.back().setParam("flakeScale", 2000.f);
|
||||
setTexture<float>(materials.back(), "flakeRoughness", texR);
|
||||
|
||||
// flipflopFalloff
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
materials.back().setParam("flakeDensity", 1.f);
|
||||
materials.back().setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
|
||||
materials.back().setParam("flakeScale", 1000.f);
|
||||
materials.back().setParam("flipflopColor", vec3f(0.252f, 0.0385f, 0.550f));
|
||||
setTexture<float>(materials.back(), "flipflopFalloff", texR);
|
||||
|
||||
// coat
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
setTexture<float>(materials.back(), "coat", texR);
|
||||
|
||||
// coatColor
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
setTexture<vec3f>(materials.back(), "coatColor", texRGBA);
|
||||
|
||||
// coatRoughness
|
||||
materials.push_back(cpp::Material("carPaint"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
setTexture<float>(materials.back(), "coatRoughness", texR);
|
||||
}
|
||||
|
||||
// obj
|
||||
{
|
||||
// d
|
||||
materials.push_back(cpp::Material("obj"));
|
||||
setTexture<float>(materials.back(), "d", texR);
|
||||
|
||||
// Kd
|
||||
materials.push_back(cpp::Material("obj"));
|
||||
setTexture<vec3f>(materials.back(), "kd", texRGBA);
|
||||
|
||||
// Ks
|
||||
materials.push_back(cpp::Material("obj"));
|
||||
setTexture<vec3f>(materials.back(), "ks", texRGBA);
|
||||
|
||||
// Ns
|
||||
materials.push_back(cpp::Material("obj"));
|
||||
materials.back().setParam("ks", vec3f(1.f));
|
||||
setTexture<float>(materials.back(), "ns", texR);
|
||||
}
|
||||
|
||||
// other
|
||||
{
|
||||
// metal roughness
|
||||
materials.push_back(cpp::Material("metal"));
|
||||
materials.back().setParam("eta", vec3f(0.051, 0.043, 0.041));
|
||||
materials.back().setParam("k", vec3f(5.3f, 3.6f, 2.3f));
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// luminous emissive
|
||||
materials.push_back(cpp::Material("luminous"));
|
||||
setTexture(materials.back(), "color", texRGBA, vec3f(1.f, 0.8f, 0.7f));
|
||||
|
||||
// alloy roughness
|
||||
materials.push_back(cpp::Material("alloy"));
|
||||
materials.back().setParam("color", vec3f(.72f, .45f, .2f));
|
||||
materials.back().setParam("edgeColor", vec3f(1.f, 1.f, 1.f));
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// thinglass attenuationColor
|
||||
materials.push_back(cpp::Material("thinGlass"));
|
||||
setTexture<vec3f>(materials.back(), "attenuationColor", texRGBA);
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtMaterialTex, test_pt_material_tex);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -1,29 +1,22 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtMetalRoughness : public detail::Builder
|
||||
struct PtMetalRoughness : public PtMaterial
|
||||
{
|
||||
PtMetalRoughness() = default;
|
||||
~PtMetalRoughness() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeMetalMaterial(
|
||||
const std::string &rendererType, vec3f eta, vec3f k, float roughness)
|
||||
static cpp::Material makeMetalMaterial(vec3f eta, vec3f k, float roughness)
|
||||
{
|
||||
cpp::Material mat(rendererType, "metal");
|
||||
cpp::Material mat("metal");
|
||||
mat.setParam("eta", eta);
|
||||
mat.setParam("k", k);
|
||||
mat.setParam("roughness", roughness);
|
||||
@@ -34,87 +27,48 @@ static cpp::Material makeMetalMaterial(
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
void PtMetalRoughness::commit()
|
||||
std::vector<cpp::Material> PtMetalRoughness::buildMaterials() const
|
||||
{
|
||||
Builder::commit();
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group PtMetalRoughness::buildGroup() const
|
||||
{
|
||||
cpp::Geometry sphereGeometry("sphere");
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
std::vector<vec3f> spheres;
|
||||
std::vector<uint8_t> index;
|
||||
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
spheres.emplace_back(i_f.x, i_f.y, 0.f);
|
||||
index.push_back(numSpheres.flatten(i));
|
||||
}
|
||||
|
||||
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
|
||||
sphereGeometry.setParam("radius", 0.4f);
|
||||
sphereGeometry.commit();
|
||||
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
// Silver
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeMetalMaterial(rendererType,
|
||||
vec3f(0.051, 0.043, 0.041),
|
||||
vec3f(5.3, 3.6, 2.3),
|
||||
float(i) / 4));
|
||||
materials.push_back(makeMetalMaterial(vec3f(0.051f, 0.043f, 0.041f),
|
||||
vec3f(5.3f, 3.6f, 2.3f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Aluminium
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeMetalMaterial(rendererType,
|
||||
vec3f(1.5, 0.98, 0.6),
|
||||
vec3f(7.6, 6.6, 5.4),
|
||||
float(i) / 4));
|
||||
materials.push_back(makeMetalMaterial(vec3f(1.5f, 0.98f, 0.6f),
|
||||
vec3f(7.6f, 6.6f, 5.4f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Gold
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeMetalMaterial(rendererType,
|
||||
vec3f(0.07, 0.37, 1.5),
|
||||
vec3f(3.7, 2.3, 1.7),
|
||||
float(i) / 4));
|
||||
materials.push_back(makeMetalMaterial(vec3f(0.07f, 0.37f, 1.5f),
|
||||
vec3f(3.7f, 2.3f, 1.7f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Chromium
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeMetalMaterial(rendererType,
|
||||
vec3f(3.2, 3.1, 2.3),
|
||||
vec3f(3.3, 3.3, 3.1),
|
||||
float(i) / 4));
|
||||
materials.push_back(makeMetalMaterial(vec3f(3.2f, 3.1f, 2.3f),
|
||||
vec3f(3.3f, 3.3f, 3.1f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
// Copper
|
||||
for (int i = 0; i < dimSize; ++i) {
|
||||
materials.push_back(makeMetalMaterial(rendererType,
|
||||
vec3f(0.1, 0.8, 1.1),
|
||||
vec3f(3.5, 2.5, 2.4),
|
||||
float(i) / 4));
|
||||
materials.push_back(makeMetalMaterial(vec3f(0.1f, 0.8f, 1.1f),
|
||||
vec3f(3.5f, 2.5f, 2.4f),
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
model.setParam("material", cpp::CopiedData(materials));
|
||||
model.setParam("index", cpp::CopiedData(index));
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtMetalRoughness, test_pt_metal_roughness);
|
||||
|
||||
@@ -1,29 +1,23 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtMetallicFlakes : public detail::Builder
|
||||
struct PtMetallicFlakes : public PtMaterial
|
||||
{
|
||||
PtMetallicFlakes() = default;
|
||||
~PtMetallicFlakes() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeMetallicFlakesMaterial(
|
||||
const std::string &rendererType, float flakeAmount, float flakeSpread)
|
||||
float flakeAmount, float flakeSpread)
|
||||
{
|
||||
cpp::Material mat(rendererType, "metallicPaint");
|
||||
cpp::Material mat("metallicPaint");
|
||||
mat.setParam("baseColor", vec3f(1.f, 0.f, 0.f));
|
||||
mat.setParam("flakeAmount", flakeAmount);
|
||||
mat.setParam("flakeSpread", flakeSpread);
|
||||
@@ -34,49 +28,20 @@ static cpp::Material makeMetallicFlakesMaterial(
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
void PtMetallicFlakes::commit()
|
||||
std::vector<cpp::Material> PtMetallicFlakes::buildMaterials() const
|
||||
{
|
||||
Builder::commit();
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group PtMetallicFlakes::buildGroup() const
|
||||
{
|
||||
cpp::Geometry sphereGeometry("sphere");
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
std::vector<vec3f> spheres;
|
||||
std::vector<uint8_t> index;
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
spheres.emplace_back(i_f.x, i_f.y, 0.f);
|
||||
materials.push_back(makeMetallicFlakesMaterial(rendererType,
|
||||
lerp(i_f.x / (dimSize - 1), 1.f, 0.f),
|
||||
lerp(i_f.y / (dimSize - 1), 1.f, 0.f)));
|
||||
index.push_back(numSpheres.flatten(i));
|
||||
materials.push_back(
|
||||
makeMetallicFlakesMaterial(lerp(i_f.x / (dimSize - 1), 1.f, 0.f),
|
||||
lerp(i_f.y / (dimSize - 1), 0.f, 1.f)));
|
||||
}
|
||||
|
||||
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
|
||||
sphereGeometry.setParam("radius", 0.4f);
|
||||
sphereGeometry.commit();
|
||||
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
|
||||
model.setParam("material", cpp::CopiedData(materials));
|
||||
model.setParam("index", cpp::CopiedData(index));
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtMetallicFlakes, test_pt_metallic_flakes);
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_tex.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtMixTex : public PtTex
|
||||
{
|
||||
PtMixTex() = default;
|
||||
~PtMixTex() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const override;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtMixTex::buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
// obj & thinGlass
|
||||
{
|
||||
cpp::Material obj("obj");
|
||||
obj.commit();
|
||||
cpp::Material thinGlass("thinGlass");
|
||||
thinGlass.commit();
|
||||
cpp::Material mix("mix");
|
||||
mix.setParam("material1", obj);
|
||||
mix.setParam("material2", thinGlass);
|
||||
materials.push_back(mix);
|
||||
setTexture<float>(materials.back(), "factor", texR);
|
||||
}
|
||||
|
||||
// plastic & metal
|
||||
{
|
||||
cpp::Material plastic("plastic");
|
||||
plastic.setParam("pigmentColor", vec3f(.8f, 0.f, 0.f));
|
||||
plastic.commit();
|
||||
cpp::Material metal("metal");
|
||||
metal.commit();
|
||||
cpp::Material mix("mix");
|
||||
mix.setParam("material1", plastic);
|
||||
mix.setParam("material2", metal);
|
||||
materials.push_back(mix);
|
||||
setTexture<float>(materials.back(), "factor", texR);
|
||||
}
|
||||
|
||||
// velvet & metallicPaint
|
||||
{
|
||||
cpp::Material velvet("velvet");
|
||||
cpp::Material metallicPaint("metallicPaint");
|
||||
cpp::Material mix("mix");
|
||||
velvet.commit();
|
||||
metallicPaint.commit();
|
||||
mix.setParam("material1", velvet);
|
||||
mix.setParam("material2", metallicPaint);
|
||||
materials.push_back(mix);
|
||||
setTexture<float>(materials.back(), "factor", texR);
|
||||
}
|
||||
|
||||
// carPaint & principled
|
||||
{
|
||||
cpp::Material carPaint("carPaint");
|
||||
carPaint.setParam("baseColor", vec3f(.5f));
|
||||
carPaint.setParam("flakeColor", vec3f(.8f));
|
||||
carPaint.setParam("flakeDensity", 1.f);
|
||||
carPaint.setParam("flakeScale", 1000.f);
|
||||
carPaint.commit();
|
||||
cpp::Material principled("principled");
|
||||
principled.setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
|
||||
principled.commit();
|
||||
cpp::Material mix("mix");
|
||||
mix.setParam("material1", carPaint);
|
||||
mix.setParam("material2", principled);
|
||||
materials.push_back(mix);
|
||||
setTexture<float>(materials.back(), "factor", texR);
|
||||
}
|
||||
|
||||
// emission: principled & luminous
|
||||
{
|
||||
cpp::Material principled("principled");
|
||||
setTexture<vec3f>(principled, "emissiveColor", texRGBA, vec3f(4.6f, 0.1f, 0.1f));
|
||||
principled.setParam("map_emissiveColor.scale", vec2f(0.7f, 0.3f));
|
||||
principled.commit();
|
||||
cpp::Material luminous("luminous");
|
||||
luminous.setParam("color", vec3f(0.1f, 0.6f, 0.1f));
|
||||
luminous.setParam("intensity", 5.0f);
|
||||
luminous.commit();
|
||||
cpp::Material mix("mix");
|
||||
mix.setParam("material1", principled);
|
||||
mix.setParam("material2", luminous);
|
||||
materials.push_back(mix);
|
||||
setTexture<float>(materials.back(), "factor", texR);
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtMixTex, test_pt_mix_tex);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -1,32 +1,28 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtObj : public detail::Builder
|
||||
struct PtObj : public PtMaterial
|
||||
{
|
||||
PtObj() = default;
|
||||
~PtObj() override = default;
|
||||
|
||||
void commit() override;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
cpp::World buildWorld() const override;
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeObjMaterial(
|
||||
const std::string &rendererType, vec3f Kd, vec3f Ks)
|
||||
float d, vec3f Kd, vec3f Ks, float Ns, vec3f Tf)
|
||||
{
|
||||
cpp::Material mat(rendererType, "obj");
|
||||
cpp::Material mat("obj");
|
||||
mat.setParam("d", d);
|
||||
mat.setParam("kd", Kd);
|
||||
mat.setParam("ks", Ks);
|
||||
mat.setParam("ns", Ns);
|
||||
mat.setParam("tf", Tf);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
@@ -34,75 +30,53 @@ static cpp::Material makeObjMaterial(
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
void PtObj::commit()
|
||||
std::vector<cpp::Material> PtObj::buildMaterials() const
|
||||
{
|
||||
Builder::commit();
|
||||
addPlane = false;
|
||||
}
|
||||
|
||||
cpp::Group PtObj::buildGroup() const
|
||||
{
|
||||
cpp::Geometry sphereGeometry("sphere");
|
||||
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
std::vector<vec3f> spheres;
|
||||
std::vector<uint8_t> index;
|
||||
std::vector<cpp::Material> materials;
|
||||
// d
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeObjMaterial(1.f - float(i) / (dimSize - 1),
|
||||
vec3f(.8f, 0.f, 0.f),
|
||||
vec3f(0.f),
|
||||
10.f,
|
||||
vec3f(0.f)));
|
||||
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
spheres.emplace_back(i_f.x, i_f.y, 0.f);
|
||||
// Kd
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeObjMaterial(1.f,
|
||||
vec3f(1.f - float(i) / (dimSize - 1), 0.f, 0.f),
|
||||
vec3f(0.f),
|
||||
10.f,
|
||||
vec3f(0.f)));
|
||||
|
||||
auto l = i_f / (dimSize - 1);
|
||||
materials.push_back(makeObjMaterial(rendererType,
|
||||
lerp(l.x, vec3f(0.1f), vec3f(1.f, 0.f, 0.f)),
|
||||
lerp(l.y, vec3f(0.f), vec3f(1.f))));
|
||||
// Ks
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeObjMaterial(1.f,
|
||||
vec3f(.8f, 0.f, 0.f),
|
||||
vec3f(float(i) / (dimSize - 1)),
|
||||
1000.f,
|
||||
vec3f(0.f)));
|
||||
|
||||
index.push_back(numSpheres.flatten(i));
|
||||
}
|
||||
// Ns
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeObjMaterial(1.f,
|
||||
vec3f(.8f, 0.f, 0.f),
|
||||
vec3f(1.f),
|
||||
lerp(float(i) / (dimSize - 1), 10.f, 1000.f),
|
||||
vec3f(0.f)));
|
||||
|
||||
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
|
||||
sphereGeometry.setParam("radius", 0.4f);
|
||||
sphereGeometry.commit();
|
||||
// Tf
|
||||
for (int i = 0; i < dimSize; i++)
|
||||
materials.push_back(makeObjMaterial(1.f,
|
||||
vec3f(.2f, 0.f, 0.f),
|
||||
vec3f(.2f, 0.f, 0.f),
|
||||
1000.f,
|
||||
(float(i) / (dimSize - 1)) * vec3f(1.f, .5f, .5f)));
|
||||
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
|
||||
model.setParam("material", cpp::CopiedData(materials));
|
||||
model.setParam("index", cpp::CopiedData(index));
|
||||
model.commit();
|
||||
|
||||
cpp::Group group;
|
||||
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
cpp::World PtObj::buildWorld() const
|
||||
{
|
||||
auto world = Builder::buildWorld();
|
||||
|
||||
std::vector<cpp::Light> lightHandles;
|
||||
|
||||
cpp::Light dirLight("distant");
|
||||
dirLight.setParam("direction", vec3f(1.f, -1.f, 1.f));
|
||||
dirLight.commit();
|
||||
|
||||
cpp::Light ambientLight("ambient");
|
||||
ambientLight.setParam("intensity", 0.4f);
|
||||
ambientLight.setParam("color", vec3f(1.f));
|
||||
ambientLight.commit();
|
||||
|
||||
lightHandles.push_back(dirLight);
|
||||
lightHandles.push_back(ambientLight);
|
||||
|
||||
world.setParam("light", cpp::CopiedData(lightHandles));
|
||||
|
||||
return world;
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtObj, test_pt_obj);
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtPlastic : public PtMaterial
|
||||
{
|
||||
PtPlastic() = default;
|
||||
~PtPlastic() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makePlasticMaterial(
|
||||
vec3f color, float eta, float roughness)
|
||||
{
|
||||
cpp::Material mat("plastic");
|
||||
mat.setParam("pigmentColor", color);
|
||||
mat.setParam("eta", eta);
|
||||
mat.setParam("roughness", roughness);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtPlastic::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
materials.push_back(makePlasticMaterial(vec3f(.8f, 0.f, 0.f),
|
||||
lerp(i_f.y / (dimSize - 1), 1.f, 2.f),
|
||||
i_f.x / (dimSize - 1)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtPlastic, test_pt_plastic);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,310 @@
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtPrincipledMetal : public PtMaterial
|
||||
{
|
||||
PtPrincipledMetal() = default;
|
||||
~PtPrincipledMetal() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
struct PtPrincipledPlastic : public PtMaterial
|
||||
{
|
||||
PtPrincipledPlastic() = default;
|
||||
~PtPrincipledPlastic() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
struct PtPrincipledGlass : public PtMaterial
|
||||
{
|
||||
PtPrincipledGlass() = default;
|
||||
~PtPrincipledGlass() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makePrincipledMetalMaterial(vec3f baseColor,
|
||||
float metallic,
|
||||
float roughness,
|
||||
float anisotropy,
|
||||
float coat,
|
||||
float coatRoughness)
|
||||
{
|
||||
cpp::Material mat("principled");
|
||||
mat.setParam("baseColor", baseColor);
|
||||
mat.setParam("metallic", metallic);
|
||||
mat.setParam("roughness", roughness);
|
||||
mat.setParam("anisotropy", anisotropy);
|
||||
mat.setParam("coat", coat);
|
||||
mat.setParam("coatRoughness", coatRoughness);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
static cpp::Material makePrincipledPlasticMaterial(vec3f baseColor,
|
||||
float ior,
|
||||
float specular,
|
||||
float sheen,
|
||||
float sheenTint,
|
||||
float sheenRoughness,
|
||||
float opacity)
|
||||
{
|
||||
cpp::Material mat("principled");
|
||||
mat.setParam("baseColor", baseColor);
|
||||
mat.setParam("ior", ior);
|
||||
mat.setParam("specular", specular);
|
||||
mat.setParam("sheen", sheen);
|
||||
mat.setParam("sheenTint", sheenTint);
|
||||
mat.setParam("sheenRoughness", sheenRoughness);
|
||||
mat.setParam("opacity", opacity);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
static cpp::Material makePrincipledGlassMaterial(vec3f baseColor,
|
||||
float transmission,
|
||||
float roughness,
|
||||
float ior,
|
||||
float transmissionDepth,
|
||||
bool thin,
|
||||
float thickness,
|
||||
float backlight)
|
||||
{
|
||||
cpp::Material mat("principled");
|
||||
mat.setParam("baseColor", baseColor);
|
||||
mat.setParam("transmissionColor", baseColor);
|
||||
mat.setParam("transmission", transmission);
|
||||
mat.setParam("roughness", roughness);
|
||||
mat.setParam("ior", ior);
|
||||
mat.setParam("transmissionDepth", transmissionDepth);
|
||||
mat.setParam("thin", thin);
|
||||
mat.setParam("thickness", thickness);
|
||||
mat.setParam("backlight", backlight);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtPrincipledMetal::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
// metallic
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledMetalMaterial(vec3f(0.0261f, 0.195f, 0.870f),
|
||||
float(i) / (dimSize - 1),
|
||||
0.f,
|
||||
0.f,
|
||||
0.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// roughness
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledMetalMaterial(vec3f(0.0261f, 0.195f, 0.870f),
|
||||
1.f,
|
||||
float(i) / (dimSize - 1),
|
||||
0.f,
|
||||
0.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// anisotropy
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledMetalMaterial(vec3f(0.0261f, 0.195f, 0.870f),
|
||||
1.f,
|
||||
.5f,
|
||||
float(i) / (dimSize - 1),
|
||||
0.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// coat
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledMetalMaterial(vec3f(0.860f, 0.0258f, 0.0536f),
|
||||
1.f,
|
||||
.5f,
|
||||
0.f,
|
||||
float(i) / (dimSize - 1),
|
||||
0.f));
|
||||
}
|
||||
|
||||
// coatRoughness
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledMetalMaterial(vec3f(0.860f, 0.0258f, 0.0536f),
|
||||
1.f,
|
||||
.5f,
|
||||
0.f,
|
||||
1.f,
|
||||
float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
std::vector<cpp::Material> PtPrincipledPlastic::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
// specular
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(makePrincipledPlasticMaterial(vec3f(0.770, 0.00, 0.00),
|
||||
1.45f,
|
||||
float(i) / (dimSize - 1),
|
||||
0.f,
|
||||
0.f,
|
||||
0.f,
|
||||
1.f));
|
||||
}
|
||||
|
||||
// sheen
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledPlasticMaterial(vec3f(0.950f, 0.494f, 0.0380f),
|
||||
1.f,
|
||||
0.f,
|
||||
float(i) / (dimSize - 1),
|
||||
0.f,
|
||||
.5f,
|
||||
1.f));
|
||||
}
|
||||
|
||||
// sheenTint
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledPlasticMaterial(vec3f(0.950f, 0.494f, 0.0380f),
|
||||
1.f,
|
||||
0.f,
|
||||
1.f,
|
||||
float(i) / (dimSize - 1),
|
||||
.5f,
|
||||
1.f));
|
||||
}
|
||||
|
||||
// sheenRoughness
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledPlasticMaterial(vec3f(0.950f, 0.494f, 0.0380f),
|
||||
1.f,
|
||||
0.f,
|
||||
1.f,
|
||||
0.f,
|
||||
float(i) / (dimSize - 1),
|
||||
1.f));
|
||||
}
|
||||
|
||||
// opacity
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledPlasticMaterial(vec3f(0.930f, 0.884f, 0.0186f),
|
||||
1.45f,
|
||||
1.f,
|
||||
0.f,
|
||||
0.f,
|
||||
0.f,
|
||||
1.f - float(i) / (dimSize - 1)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
std::vector<cpp::Material> PtPrincipledGlass::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
|
||||
// transmission
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
|
||||
float(i) / (dimSize - 1),
|
||||
0.f,
|
||||
1.1f,
|
||||
1.f,
|
||||
false,
|
||||
1.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// roughness
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
|
||||
1.f,
|
||||
float(i) / (dimSize - 1),
|
||||
1.5f,
|
||||
1.f,
|
||||
false,
|
||||
1.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// ior
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
|
||||
1.f,
|
||||
0.f,
|
||||
lerp(float(i) / (dimSize - 1), 1.f, 2.f),
|
||||
1.f,
|
||||
false,
|
||||
1.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// transmissionDepth
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
|
||||
1.f,
|
||||
0.f,
|
||||
1.5f,
|
||||
lerp(float(i) / (dimSize - 1), 2.f, 0.f),
|
||||
false,
|
||||
1.f,
|
||||
0.f));
|
||||
}
|
||||
|
||||
// backlight
|
||||
for (int i = 0; i < dimSize; i++) {
|
||||
materials.push_back(
|
||||
makePrincipledGlassMaterial(vec3f(0.0400f, 0.200f, 1.00f),
|
||||
.3f,
|
||||
0.f,
|
||||
1.5f,
|
||||
1.f,
|
||||
true,
|
||||
1.f,
|
||||
lerp(float(i) / (dimSize - 1), 0.f, 2.f)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtPrincipledMetal, test_pt_principled_metal);
|
||||
OSP_REGISTER_TESTING_BUILDER(PtPrincipledPlastic, test_pt_principled_plastic);
|
||||
OSP_REGISTER_TESTING_BUILDER(PtPrincipledGlass, test_pt_principled_glass);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,167 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_tex.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtPrincipledTex : public PtTex
|
||||
{
|
||||
PtPrincipledTex() = default;
|
||||
~PtPrincipledTex() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const override;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtPrincipledTex::buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
// principled metal
|
||||
{
|
||||
// metallic
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0261f, 0.195f, 0.870f));
|
||||
setTexture<float>(materials.back(), "metallic", texR);
|
||||
|
||||
// roughness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0261f, 0.195f, 0.870f));
|
||||
materials.back().setParam("metallic", 1.f);
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// anisotropy
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0261f, 0.195f, 0.870f));
|
||||
materials.back().setParam("metallic", 1.f);
|
||||
materials.back().setParam("roughness", .5f);
|
||||
setTexture<float>(materials.back(), "anisotropy", texR);
|
||||
|
||||
// coat
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
|
||||
materials.back().setParam("metallic", 1.f);
|
||||
materials.back().setParam("roughness", .5f);
|
||||
setTexture<float>(materials.back(), "coat", texR);
|
||||
|
||||
// coatRoughness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
|
||||
materials.back().setParam("metallic", 1.f);
|
||||
materials.back().setParam("roughness", .5f);
|
||||
materials.back().setParam("coat", 1.f);
|
||||
setTexture<float>(materials.back(), "coatRoughness", texR);
|
||||
}
|
||||
|
||||
// principled plastic
|
||||
{
|
||||
// roughness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.770f, 0.00f, 0.00f));
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// specular
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.770f, 0.00f, 0.00f));
|
||||
materials.back().setParam("ior", 1.45f);
|
||||
setTexture<float>(materials.back(), "specular", texR);
|
||||
|
||||
// sheen
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.950f, 0.494f, 0.0380f));
|
||||
materials.back().setParam("sheenRoughness", .5f);
|
||||
setTexture<float>(materials.back(), "sheen", texR);
|
||||
|
||||
// sheenTint
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.950f, 0.494f, 0.0380f));
|
||||
materials.back().setParam("sheen", 1.f);
|
||||
materials.back().setParam("sheenRoughness", .5f);
|
||||
setTexture<float>(materials.back(), "sheenTint", texR);
|
||||
|
||||
// sheenRoughness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.950f, 0.494f, 0.0380f));
|
||||
materials.back().setParam("sheen", 1.f);
|
||||
setTexture<float>(materials.back(), "sheenRoughness", texR);
|
||||
}
|
||||
|
||||
// principled glass
|
||||
{
|
||||
// transmission
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam(
|
||||
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam("ior", 1.1f);
|
||||
setTexture<float>(materials.back(), "transmission", texR);
|
||||
|
||||
// roughness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam(
|
||||
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam("transmission", 1.f);
|
||||
materials.back().setParam("ior", 1.5f);
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// thickness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam(
|
||||
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam("transmission", 1.f);
|
||||
materials.back().setParam("ior", 1.5f);
|
||||
materials.back().setParam("thin", true);
|
||||
setTexture<float>(materials.back(), "thickness", texR);
|
||||
|
||||
// thin roughness
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam(
|
||||
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam("transmission", 1.f);
|
||||
materials.back().setParam("ior", 1.5f);
|
||||
materials.back().setParam("thin", true);
|
||||
setTexture<float>(materials.back(), "roughness", texR);
|
||||
|
||||
// thin backlight
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam(
|
||||
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
|
||||
materials.back().setParam("transmission", .3f);
|
||||
materials.back().setParam("ior", 1.5f);
|
||||
materials.back().setParam("thin", true);
|
||||
setTexture<float>(materials.back(), "backlight", texR, 2.f);
|
||||
}
|
||||
|
||||
{
|
||||
// emissive
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(1.f, 0.8f, 0.7f));
|
||||
setTexture<vec3f>(materials.back(), "emissiveColor", texRGBA);
|
||||
|
||||
// transparency
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
|
||||
setTexture<vec3f>(materials.back(), "baseColor", texRGBA);
|
||||
|
||||
// opacity
|
||||
materials.push_back(cpp::Material("principled"));
|
||||
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
|
||||
setTexture<float>(materials.back(), "opacity", texR);
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtPrincipledTex, test_pt_principled_tex);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,278 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "Builder.h"
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/multidim_index_sequence.h"
|
||||
|
||||
using namespace rkcommon::math;
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtTex : public detail::Builder
|
||||
{
|
||||
PtTex() = default;
|
||||
~PtTex() override = default;
|
||||
|
||||
cpp::Group buildGroup() const override;
|
||||
cpp::World buildWorld() const override;
|
||||
|
||||
virtual std::vector<cpp::Material> buildMaterials(
|
||||
const cpp::Texture &texR, const cpp::Texture &texRGBA) const = 0;
|
||||
};
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
static cpp::Texture makeCheckerboardTextureR8()
|
||||
{
|
||||
// Prepare pixel data
|
||||
constexpr uint32_t width = 16;
|
||||
constexpr uint32_t height = 16;
|
||||
std::array<uint8_t, width * height> dbyte;
|
||||
index_sequence_2D idx(vec2i(width, height));
|
||||
for (auto i : idx)
|
||||
dbyte[idx.flatten(i)] = ((i.x & 2) ^ (i.y & 2)) * 255;
|
||||
|
||||
// Create texture object
|
||||
cpp::Texture tex("texture2d");
|
||||
tex.setParam("format", OSP_TEXTURE_R8);
|
||||
tex.setParam("filter", OSP_TEXTURE_FILTER_NEAREST);
|
||||
tex.setParam("data", cpp::CopiedData(dbyte.data(), vec2ul(width, height)));
|
||||
tex.commit();
|
||||
|
||||
// Ready
|
||||
return tex;
|
||||
}
|
||||
|
||||
static cpp::Texture makeCheckerboardTextureRGBA8()
|
||||
{
|
||||
// Prepare pixel data
|
||||
constexpr uint32_t width = 16;
|
||||
constexpr uint32_t height = 16;
|
||||
std::array<vec4uc, width * height> dbyte;
|
||||
index_sequence_2D idx(vec2i(width, height));
|
||||
for (auto i : idx) {
|
||||
uint8_t v = ((i.x & 2) ^ (i.y & 2)) * 255;
|
||||
dbyte[idx.flatten(i)] = vec4uc(v, v, v, 128 + v / 2);
|
||||
}
|
||||
|
||||
// Create texture object
|
||||
cpp::Texture tex("texture2d");
|
||||
tex.setParam("format", OSP_TEXTURE_RGBA8);
|
||||
tex.setParam("filter", OSP_TEXTURE_FILTER_NEAREST);
|
||||
tex.setParam("data", cpp::CopiedData(dbyte.data(), vec2ul(width, height)));
|
||||
tex.commit();
|
||||
|
||||
// Ready
|
||||
return tex;
|
||||
}
|
||||
|
||||
static std::vector<vec3f> makeSphereVertices(
|
||||
uint32_t latitudeCount, uint32_t longitudeCount, float radius)
|
||||
{
|
||||
// Calculate latitude and longitude angular steps (in radians)
|
||||
std::vector<vec3f> vPos;
|
||||
const float latAngleStep = float(pi) / float(latitudeCount);
|
||||
const float longAngleStep = (2.0f * float(pi)) / float(longitudeCount);
|
||||
|
||||
// Iterate through latitude segments
|
||||
for (uint32_t latitudeId = 0; latitudeId <= latitudeCount; latitudeId++) {
|
||||
// Calculate longitude radius at current latitude
|
||||
float longRadius = radius * sin(latAngleStep * latitudeId);
|
||||
|
||||
// Determine segment level
|
||||
float y = radius * cos(latAngleStep * latitudeId);
|
||||
|
||||
// Iterate through longitude segments
|
||||
for (uint32_t longitudeId = 0; longitudeId <= longitudeCount;
|
||||
longitudeId++) {
|
||||
// Calculate vertex position
|
||||
float x = longRadius * cos(longAngleStep * longitudeId);
|
||||
float z = longRadius * sin(longAngleStep * longitudeId);
|
||||
vPos.push_back(vec3f(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
// Ready
|
||||
return vPos;
|
||||
}
|
||||
|
||||
static std::vector<vec2f> makeSphereTexCoords(uint32_t latitudeCount,
|
||||
uint32_t longitudeCount,
|
||||
float tileLat,
|
||||
float tileLong)
|
||||
{
|
||||
// Iterate through latitude segments
|
||||
std::vector<vec2f> vTexCoord;
|
||||
for (uint32_t latitudeId = 0; latitudeId <= latitudeCount; latitudeId++) {
|
||||
// Iterate through longitude segments
|
||||
for (uint32_t longitudeId = 0; longitudeId <= longitudeCount;
|
||||
longitudeId++) {
|
||||
// Calculate texture coordinates
|
||||
vTexCoord.push_back(vec2f(tileLong * longitudeId / float(longitudeCount),
|
||||
tileLat * (latitudeId - 1) / float(latitudeCount)));
|
||||
}
|
||||
}
|
||||
|
||||
// Ready
|
||||
return vTexCoord;
|
||||
}
|
||||
|
||||
static std::vector<vec3ui> makeSphereIndices(
|
||||
uint32_t latitudeCount, uint32_t longitudeCount, bool outside)
|
||||
{
|
||||
// Iterate through latitude segments
|
||||
std::vector<vec3ui> indices;
|
||||
for (uint32_t latitudeId = 0; latitudeId < latitudeCount; latitudeId++) {
|
||||
// Calculate indices of segment left-most vertices
|
||||
uint32_t firstVertex1 = latitudeId * (longitudeCount + 1);
|
||||
uint32_t firstVertex2 = (latitudeId + 1) * (longitudeCount + 1);
|
||||
|
||||
// Iterate through longitude segments
|
||||
for (uint32_t longitudeId = 0; longitudeId < longitudeCount;
|
||||
longitudeId++) {
|
||||
// Setup first triangle indices
|
||||
uint32_t i2 = firstVertex2 + longitudeId + 1;
|
||||
uint32_t i3 = firstVertex2 + longitudeId;
|
||||
indices.push_back(vec3ui(firstVertex1 + longitudeId,
|
||||
(outside) ? i2 : i3,
|
||||
(outside) ? i3 : i2));
|
||||
|
||||
// Setup second triangle indices
|
||||
i2 = firstVertex1 + longitudeId + 1;
|
||||
i3 = firstVertex2 + longitudeId + 1;
|
||||
indices.push_back(vec3ui(firstVertex1 + longitudeId,
|
||||
(outside) ? i2 : i3,
|
||||
(outside) ? i3 : i2));
|
||||
}
|
||||
}
|
||||
|
||||
// Ready
|
||||
return indices;
|
||||
}
|
||||
|
||||
static cpp::Geometry makeSphereMesh(
|
||||
uint32_t latitudeCount, uint32_t longitudeCount)
|
||||
{
|
||||
cpp::Geometry sphereMesh("mesh");
|
||||
|
||||
// Prepare mesh buffers
|
||||
std::vector<vec3f> vertices =
|
||||
makeSphereVertices(latitudeCount, longitudeCount, 1.f);
|
||||
std::vector<vec2f> texCoords =
|
||||
makeSphereTexCoords(latitudeCount, longitudeCount, 1.f, 2.f);
|
||||
std::vector<vec3ui> indices =
|
||||
makeSphereIndices(latitudeCount, longitudeCount, false);
|
||||
|
||||
// Set mesh parameters
|
||||
sphereMesh.setParam("vertex.position", cpp::CopiedData(vertices));
|
||||
sphereMesh.setParam("vertex.normal", cpp::CopiedData(vertices));
|
||||
sphereMesh.setParam("vertex.texcoord", cpp::CopiedData(texCoords));
|
||||
sphereMesh.setParam("index", cpp::CopiedData(indices));
|
||||
sphereMesh.commit();
|
||||
|
||||
// Ready
|
||||
return sphereMesh;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void setTexture(cpp::Material &mat,
|
||||
const std::string &name,
|
||||
const cpp::Texture &tex,
|
||||
const T mul = T(1.f))
|
||||
{
|
||||
mat.setParam(name, mul);
|
||||
mat.setParam("map_" + name, tex);
|
||||
mat.commit();
|
||||
}
|
||||
|
||||
inline cpp::Group PtTex::buildGroup() const
|
||||
{
|
||||
// Do nothing, needs per-instance materials feature to have single group
|
||||
return cpp::Group();
|
||||
}
|
||||
|
||||
inline cpp::World PtTex::buildWorld() const
|
||||
{
|
||||
cpp::World world;
|
||||
std::vector<cpp::Instance> instances;
|
||||
|
||||
cpp::Texture texR = makeCheckerboardTextureR8();
|
||||
cpp::Texture texRGBA = makeCheckerboardTextureRGBA8();
|
||||
|
||||
std::vector<cpp::Material> materials = buildMaterials(texR, texRGBA);
|
||||
size_t dimCount = sqrtf(materials.size());
|
||||
if (dimCount * dimCount < materials.size())
|
||||
dimCount++;
|
||||
const size_t dimSize = dimCount - 1;
|
||||
|
||||
cpp::Geometry sphereGeometry = makeSphereMesh(25, 50);
|
||||
|
||||
// Note: this is a temporary implementation, per-instance materials feature
|
||||
// should be used here
|
||||
box3f bbox(empty);
|
||||
index_sequence_2D numSpheres(dimCount);
|
||||
for (auto i : numSpheres) {
|
||||
const auto idx = numSpheres.flatten(i);
|
||||
if (idx >= materials.size())
|
||||
break;
|
||||
// Construct GeometricModel for each instance
|
||||
cpp::GeometricModel model(sphereGeometry);
|
||||
model.setParam("material", cpp::CopiedData(materials[idx]));
|
||||
model.commit();
|
||||
|
||||
// Construct Group for each instance
|
||||
cpp::Group group;
|
||||
group.setParam("geometry", cpp::CopiedData(model));
|
||||
group.commit();
|
||||
|
||||
// Construct instance
|
||||
cpp::Instance instance(group);
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
instance.setParam("xfm",
|
||||
affine3f::translate(
|
||||
vec3f(dimSize / 2.f - i_f.x, dimSize / 2.f - i_f.y, .6f))
|
||||
* affine3f::scale(.4f));
|
||||
instance.commit();
|
||||
instances.push_back(instance);
|
||||
bbox.extend(instance.getBounds<box3f>());
|
||||
}
|
||||
|
||||
bbox.lower -= .4f;
|
||||
bbox.upper += .4f;
|
||||
cpp::Instance planeInstance = makeGroundPlane(
|
||||
bbox, vec4f(.9f, .9f, .9f, 1.f), vec4f(.2f, .2f, .2f, 1.f));
|
||||
planeInstance.setParam(
|
||||
"xfm", affine3f::rotate(vec3f(-1.f, 0.f, 0.f), half_pi));
|
||||
planeInstance.commit();
|
||||
instances.push_back(planeInstance);
|
||||
|
||||
world.setParam("instance", cpp::CopiedData(instances));
|
||||
|
||||
// Lights
|
||||
{
|
||||
std::vector<cpp::Light> lightHandles;
|
||||
|
||||
cpp::Light sphereLight("sphere");
|
||||
sphereLight.setParam("intensity", 500.f);
|
||||
sphereLight.setParam("position", vec3f(-15.f, 15.f, -20.f));
|
||||
sphereLight.setParam("radius", 5.f);
|
||||
sphereLight.commit();
|
||||
|
||||
cpp::Light ambientLight("ambient");
|
||||
ambientLight.setParam("intensity", 0.4f);
|
||||
ambientLight.setParam("color", vec3f(1.f));
|
||||
ambientLight.commit();
|
||||
|
||||
lightHandles.push_back(sphereLight);
|
||||
lightHandles.push_back(ambientLight);
|
||||
|
||||
world.setParam("light", cpp::CopiedData(lightHandles));
|
||||
}
|
||||
|
||||
return world;
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtThinGlass : public PtMaterial
|
||||
{
|
||||
PtThinGlass() = default;
|
||||
~PtThinGlass() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeThinGlassMaterial(
|
||||
float eta, vec3f color, float attenuationDistance)
|
||||
{
|
||||
cpp::Material mat("thinGlass");
|
||||
mat.setParam("eta", eta);
|
||||
mat.setParam("attenuationColor", color);
|
||||
mat.setParam("attenuationDistance", attenuationDistance);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtThinGlass::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
materials.push_back(
|
||||
makeThinGlassMaterial(lerp(i_f.x / (dimSize - 1), 1.f, 2.f),
|
||||
vec3f(.1f, .5f, 1.f),
|
||||
lerp(1.f - i_f.y / (dimSize - 1), 0.5f, 5.f)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtThinGlass, test_pt_thinglass);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright 2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "test_pt_material.h"
|
||||
|
||||
namespace ospray {
|
||||
namespace testing {
|
||||
|
||||
struct PtVelvet : public PtMaterial
|
||||
{
|
||||
PtVelvet() = default;
|
||||
~PtVelvet() override = default;
|
||||
|
||||
std::vector<cpp::Material> buildMaterials() const override;
|
||||
};
|
||||
|
||||
static cpp::Material makeVelvetMaterial(
|
||||
float backScattering, float horizonScatteringFallOff)
|
||||
{
|
||||
cpp::Material mat("velvet");
|
||||
mat.setParam("backScattering", backScattering);
|
||||
mat.setParam("horizonScatteringFallOff", horizonScatteringFallOff);
|
||||
mat.commit();
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
// Inlined definitions ////////////////////////////////////////////////////
|
||||
|
||||
std::vector<cpp::Material> PtVelvet::buildMaterials() const
|
||||
{
|
||||
std::vector<cpp::Material> materials;
|
||||
|
||||
constexpr int dimSize = 5;
|
||||
index_sequence_2D numSpheres(dimSize);
|
||||
for (auto i : numSpheres) {
|
||||
auto i_f = static_cast<vec2f>(i);
|
||||
materials.push_back(makeVelvetMaterial(
|
||||
i_f.x / (dimSize - 1), lerp(i_f.y / (dimSize - 1), 0.f, 20.f)));
|
||||
}
|
||||
|
||||
return materials;
|
||||
}
|
||||
|
||||
OSP_REGISTER_TESTING_BUILDER(PtVelvet, test_pt_velvet);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace ospray
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2019 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "../builders/Builder.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// ospray_testing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Copyright 2009-2020 Intel Corporation
|
||||
## Copyright 2009 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(raw_to_amr STATIC rawToAMR.cpp)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma clang diagnostic push
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "rkcommon/math/box.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2020 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "BaseFixture.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2020 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## Copyright 2018-2021 Intel Corporation
|
||||
## Copyright 2018 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if (NOT OSPRAY_APPS_BENCHMARK)
|
||||
if (NOT OSPRAY_ENABLE_APPS_BENCHMARK)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2020 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "../BaseFixture.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2020 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "../BaseFixture.h"
|
||||
@@ -35,4 +35,4 @@ OSPRAY_DEFINE_BENCHMARK(
|
||||
OSPRAY_DEFINE_BENCHMARK(
|
||||
GravitySpheres, "gravity_spheres_volume", 512, "pathtracer");
|
||||
OSPRAY_DEFINE_SETUP_BENCHMARK(
|
||||
GravitySpheres, "gravity_spheres_volume", 128, "pathtracer");
|
||||
GravitySpheres, "gravity_spheres_volume", 128, "pathtracer");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2020 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "../BaseFixture.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2021 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "BaseFixture.h"
|
||||
@@ -103,6 +103,7 @@ int main(int argc, char **argv)
|
||||
cmdArg.push_back(argv[i]);
|
||||
|
||||
ospInit(&argc, (const char **)argv);
|
||||
std::atexit(ospShutdown);
|
||||
|
||||
auto DIR = utility::getEnvVar<std::string>("OSPRAY_BENCHMARK_IMG_DIR");
|
||||
BaseFixture::dumpFinalImageDir = DIR.value_or("");
|
||||
@@ -112,8 +113,6 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
::benchmark::RunSpecifiedBenchmarks();
|
||||
|
||||
ospShutdown();
|
||||
|
||||
#ifdef _WIN32
|
||||
if (waitForKey) {
|
||||
printf("\n\tpress any key to exit");
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
## Copyright 2018-2020 Intel Corporation
|
||||
## Copyright 2018 Intel Corporation
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if (NOT OSPRAY_APPS_EXAMPLES)
|
||||
if (NOT OSPRAY_ENABLE_APPS_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# prefer libGL over libOpenGl for better compatibility with SWR
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
find_package(OpenGL 2 REQUIRED)
|
||||
find_package(glfw3 REQUIRED)
|
||||
|
||||
add_executable(ospExamples
|
||||
${OSPRAY_RESOURCE}
|
||||
GLFWOSPRayWindow.cpp
|
||||
imgui_impl_glfw_gl3.cpp
|
||||
ospExample.cpp
|
||||
)
|
||||
|
||||
@@ -22,7 +16,6 @@ PRIVATE
|
||||
arcball_camera
|
||||
ospray_testing
|
||||
ospray_imgui
|
||||
glfw
|
||||
${OPENGL_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
// Copyright 2018-2021 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "GLFWOSPRayWindow.h"
|
||||
#include "imgui_impl_glfw_gl3.h"
|
||||
// ospray_testing
|
||||
#include "ospray_testing.h"
|
||||
#include "rkcommon/utility/random.h"
|
||||
// imgui
|
||||
#include "imgui.h"
|
||||
#include "imgui_impl_glfw.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
// std
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
@@ -38,6 +41,8 @@ static const std::vector<std::string> g_scenes = {"boxes_lit",
|
||||
"gravity_spheres_isosurface",
|
||||
"perlin_noise_volumes",
|
||||
"random_spheres",
|
||||
"random_discs",
|
||||
"random_oriented_discs",
|
||||
"streamlines",
|
||||
"subdivision_cube",
|
||||
"unstructured_volume",
|
||||
@@ -50,10 +55,28 @@ static const std::vector<std::string> g_scenes = {"boxes_lit",
|
||||
"clip_particle_volume",
|
||||
"particle_volume",
|
||||
"particle_volume_isosurface",
|
||||
"vdb_volume"};
|
||||
"vdb_volume",
|
||||
"vdb_volume_packed",
|
||||
"instancing",
|
||||
"test_pt_alloy_roughness",
|
||||
"test_pt_carpaint",
|
||||
"test_pt_glass",
|
||||
"test_pt_thinglass",
|
||||
"test_pt_luminous",
|
||||
"test_pt_material_tex",
|
||||
"test_pt_metal_roughness",
|
||||
"test_pt_metallic_flakes",
|
||||
"test_pt_mix_tex",
|
||||
"test_pt_obj",
|
||||
"test_pt_plastic",
|
||||
"test_pt_principled_metal",
|
||||
"test_pt_principled_plastic",
|
||||
"test_pt_principled_glass",
|
||||
"test_pt_principled_tex",
|
||||
"test_pt_velvet"};
|
||||
|
||||
static const std::vector<std::string> g_curveVariant = {
|
||||
"bspline", "hermite", "catmull-rom", "linear", "cones"};
|
||||
"bspline", "bezier", "hermite", "catmull-rom", "linear", "cones"};
|
||||
|
||||
static const std::vector<std::string> g_renderers = {
|
||||
"scivis", "pathtracer", "ao", "debug"};
|
||||
@@ -66,6 +89,7 @@ static const std::vector<std::string> g_debugRendererTypes = {"eyeLight",
|
||||
"Ns",
|
||||
"backfacing_Ng",
|
||||
"backfacing_Ns",
|
||||
"texCoord",
|
||||
"dPds",
|
||||
"dPdt",
|
||||
"volume"};
|
||||
@@ -73,85 +97,75 @@ static const std::vector<std::string> g_debugRendererTypes = {"eyeLight",
|
||||
static const std::vector<std::string> g_pixelFilterTypes = {
|
||||
"point", "box", "gaussian", "mitchell", "blackmanHarris"};
|
||||
|
||||
bool sceneUI_callback(void *, int index, const char **out_text)
|
||||
{
|
||||
*out_text = g_scenes[index].c_str();
|
||||
return true;
|
||||
}
|
||||
static const std::vector<std::string> g_AOVs = {
|
||||
"color", "depth", "albedo", "normal", "primID", "objID", "instID"};
|
||||
|
||||
bool curveVariantUI_callback(void *, int index, const char **out_text)
|
||||
{
|
||||
*out_text = g_curveVariant[index].c_str();
|
||||
return true;
|
||||
}
|
||||
static const std::vector<std::string> g_denoiserQuality = {
|
||||
"low", "medium", "high"};
|
||||
|
||||
bool rendererUI_callback(void *, int index, const char **out_text)
|
||||
const char *vec_string_getter(void *vec_, int index)
|
||||
{
|
||||
*out_text = g_renderers[index].c_str();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool debugTypeUI_callback(void *, int index, const char **out_text)
|
||||
{
|
||||
*out_text = g_debugRendererTypes[index].c_str();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pixelFilterTypeUI_callback(void *, int index, const char **out_text)
|
||||
{
|
||||
*out_text = g_pixelFilterTypes[index].c_str();
|
||||
return true;
|
||||
auto v = (std::vector<std::string> *)vec_;
|
||||
return v->at(index).c_str();
|
||||
}
|
||||
|
||||
// GLFWOSPRayWindow definitions ///////////////////////////////////////////////
|
||||
|
||||
void error_callback(int error, const char *desc)
|
||||
{
|
||||
std::cerr << "error " << error << ": " << desc << std::endl;
|
||||
std::cerr << "GLFW error " << error << ": " << desc << std::endl;
|
||||
}
|
||||
|
||||
GLFWOSPRayWindow *GLFWOSPRayWindow::activeWindow = nullptr;
|
||||
|
||||
GLFWOSPRayWindow::GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser)
|
||||
: denoiserAvailable(denoiser)
|
||||
GLFWOSPRayWindow::GLFWOSPRayWindow(
|
||||
const vec2i &windowSize, bool denoiserAvail, bool denoiserGPUAvail)
|
||||
: denoiserAvailable(denoiserAvail)
|
||||
{
|
||||
if (activeWindow != nullptr) {
|
||||
throw std::runtime_error("Cannot create more than one GLFWOSPRayWindow!");
|
||||
}
|
||||
|
||||
if (denoiserAvailable) {
|
||||
denoiser = cpp::ImageOperation("denoiser");
|
||||
denoiserEnabled = denoiserGPUAvail;
|
||||
updateFrameOpsNextFrame = denoiserEnabled;
|
||||
}
|
||||
|
||||
activeWindow = this;
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
// initialize GLFW
|
||||
if (!glfwInit()) {
|
||||
throw std::runtime_error("Failed to initialize GLFW!");
|
||||
}
|
||||
|
||||
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
|
||||
// create GLFW window
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
#ifdef __APPLE_
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
const char *glslVersion = "#version 150";
|
||||
#else
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
const char *glslVersion = "#version 130";
|
||||
#endif
|
||||
|
||||
glfwWindow = glfwCreateWindow(
|
||||
windowSize.x, windowSize.y, "OSPRay Tutorial", nullptr, nullptr);
|
||||
windowSize.x, windowSize.y, "OSPRay Examples", nullptr, nullptr);
|
||||
|
||||
if (!glfwWindow) {
|
||||
glfwTerminate();
|
||||
throw std::runtime_error("Failed to create GLFW window!");
|
||||
}
|
||||
|
||||
// make the window's context current
|
||||
glfwMakeContextCurrent(glfwWindow);
|
||||
|
||||
ImGui_ImplGlfwGL3_Init(glfwWindow, true);
|
||||
// Setup Dear ImGui context
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO &io = ImGui::GetIO();
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
|
||||
// set initial OpenGL state
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
// create OpenGL frame buffer texture
|
||||
glGenTextures(1, &framebufferTexture);
|
||||
glBindTexture(GL_TEXTURE_2D, framebufferTexture);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
ImGui_ImplGlfw_InitForOpenGL(glfwWindow, false);
|
||||
|
||||
// set GLFW callbacks
|
||||
glfwSetFramebufferSizeCallback(
|
||||
@@ -200,19 +214,33 @@ GLFWOSPRayWindow::GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser)
|
||||
}
|
||||
});
|
||||
|
||||
// will chain our callbacks above
|
||||
ImGui_ImplGlfw_InstallCallbacks(glfwWindow);
|
||||
|
||||
ImGui_ImplOpenGL3_Init(glslVersion);
|
||||
|
||||
// set initial OpenGL state
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
// create OpenGL frame buffer texture
|
||||
glGenTextures(1, &framebufferTexture);
|
||||
glBindTexture(GL_TEXTURE_2D, framebufferTexture);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
// OSPRay setup //
|
||||
|
||||
// set up backplate texture
|
||||
std::vector<vec4f> backplate;
|
||||
backplate.push_back(vec4f(0.8f, 0.2f, 0.2f, 1.0f));
|
||||
backplate.push_back(vec4f(0.2f, 0.8f, 0.2f, 1.0f));
|
||||
backplate.push_back(vec4f(0.2f, 0.2f, 0.8f, 1.0f));
|
||||
backplate.push_back(vec4f(0.4f, 0.2f, 0.4f, 1.0f));
|
||||
backplate.push_back(vec4f(0.05f, 0.05f, 0.05f, 1.0f));
|
||||
backplate.push_back(vec4f(0.05f, 0.05f, 0.05f, 1.0f));
|
||||
backplate.push_back(vec4f(0.01f, 0.01f, 0.01f, 1.0f));
|
||||
backplate.push_back(vec4f(0.01f, 0.01f, 0.01f, 1.0f));
|
||||
|
||||
OSPTextureFormat texFmt = OSP_TEXTURE_RGBA32F;
|
||||
backplateTex.setParam(
|
||||
"data", cpp::CopiedData(backplate.data(), vec2ul(2, 2)));
|
||||
backplateTex.setParam("format", OSP_INT, &texFmt);
|
||||
backplateTex.setParam("format", OSP_TEXTURE_RGBA32F);
|
||||
addObjectToCommit(backplateTex.handle());
|
||||
|
||||
refreshScene(true);
|
||||
@@ -226,8 +254,10 @@ GLFWOSPRayWindow::GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser)
|
||||
|
||||
GLFWOSPRayWindow::~GLFWOSPRayWindow()
|
||||
{
|
||||
ImGui_ImplGlfwGL3_Shutdown();
|
||||
// cleanly terminate GLFW
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
glfwDestroyWindow(glfwWindow);
|
||||
glfwTerminate();
|
||||
}
|
||||
|
||||
@@ -242,12 +272,25 @@ void GLFWOSPRayWindow::mainLoop()
|
||||
startNewOSPRayFrame();
|
||||
|
||||
while (!glfwWindowShouldClose(glfwWindow) && !g_quitNextFrame) {
|
||||
ImGui_ImplGlfwGL3_NewFrame();
|
||||
glfwPollEvents();
|
||||
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
if (displayCallback)
|
||||
displayCallback(this);
|
||||
|
||||
display();
|
||||
|
||||
// poll and process events
|
||||
glfwPollEvents();
|
||||
if (showUi)
|
||||
buildUI();
|
||||
|
||||
glDisable(GL_FRAMEBUFFER_SRGB); // Disable SRGB conversion for UI
|
||||
ImGui::Render();
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
glfwSwapBuffers(glfwWindow);
|
||||
}
|
||||
|
||||
waitOnOSPRayFrame();
|
||||
@@ -258,11 +301,13 @@ void GLFWOSPRayWindow::reshape(const vec2i &newWindowSize)
|
||||
windowSize = newWindowSize;
|
||||
|
||||
// create new frame buffer
|
||||
auto buffers = OSP_FB_COLOR | OSP_FB_DEPTH | OSP_FB_ACCUM | OSP_FB_ALBEDO
|
||||
| OSP_FB_NORMAL;
|
||||
auto buffers = OSP_FB_COLOR | OSP_FB_DEPTH | OSP_FB_ACCUM | OSP_FB_VARIANCE
|
||||
| OSP_FB_ALBEDO | OSP_FB_NORMAL | OSP_FB_ID_PRIMITIVE | OSP_FB_ID_OBJECT
|
||||
| OSP_FB_ID_INSTANCE;
|
||||
framebuffer =
|
||||
cpp::FrameBuffer(windowSize.x, windowSize.y, OSP_FB_RGBA32F, buffers);
|
||||
|
||||
updateTargetFrames(false);
|
||||
refreshFrameOperations();
|
||||
|
||||
// reset OpenGL viewport and orthographic projection
|
||||
@@ -276,12 +321,13 @@ void GLFWOSPRayWindow::reshape(const vec2i &newWindowSize)
|
||||
arcballCamera->updateWindowSize(windowSize);
|
||||
|
||||
camera.setParam("aspect", windowSize.x / float(windowSize.y));
|
||||
camera.commit();
|
||||
addObjectToCommit(camera.handle());
|
||||
}
|
||||
|
||||
void GLFWOSPRayWindow::updateCamera()
|
||||
{
|
||||
camera.setParam("aspect", windowSize.x / float(windowSize.y));
|
||||
camera.setParam("stereoMode", cameraStereoMode);
|
||||
const auto xfm = arcballCamera->transform();
|
||||
if (rendererType == OSPRayRendererType::PATHTRACER && cameraMotionBlur) {
|
||||
camera.removeParam("transform");
|
||||
@@ -290,12 +336,15 @@ void GLFWOSPRayWindow::updateCamera()
|
||||
xfms.push_back(xfm);
|
||||
camera.setParam("motion.transform", cpp::CopiedData(xfms));
|
||||
camera.setParam("shutter", range1f(1.0f - cameraMotionBlur, 1.0f));
|
||||
camera.setParam("shutterType", cameraShutterType);
|
||||
camera.setParam("rollingShutterDuration", cameraRollingShutter);
|
||||
renderCameraMotionBlur = true;
|
||||
} else {
|
||||
camera.removeParam("motion.transform");
|
||||
camera.setParam("transform", xfm);
|
||||
camera.setParam("shutter", range1f(0.5f));
|
||||
}
|
||||
addObjectToCommit(camera.handle());
|
||||
}
|
||||
|
||||
void GLFWOSPRayWindow::motion(const vec2f &position)
|
||||
@@ -330,7 +379,6 @@ void GLFWOSPRayWindow::motion(const vec2f &position)
|
||||
waitOnOSPRayFrame();
|
||||
}
|
||||
updateCamera();
|
||||
addObjectToCommit(camera.handle());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,24 +387,49 @@ void GLFWOSPRayWindow::motion(const vec2f &position)
|
||||
|
||||
void GLFWOSPRayWindow::display()
|
||||
{
|
||||
if (showUi)
|
||||
buildUI();
|
||||
|
||||
if (displayCallback)
|
||||
displayCallback(this);
|
||||
|
||||
updateTitleBar();
|
||||
|
||||
glEnable(GL_FRAMEBUFFER_SRGB); // Turn on sRGB conversion for OSPRay frame
|
||||
static float totalRenderTime = 0.f;
|
||||
static auto displayStart = std::chrono::steady_clock::now();
|
||||
|
||||
static bool firstFrame = true;
|
||||
if (firstFrame || currentFrame.isReady()) {
|
||||
// display frame rate in window title
|
||||
const auto displayEnd = std::chrono::steady_clock::now();
|
||||
const auto displayMilliseconds =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
displayEnd - displayStart);
|
||||
const auto renderTime = currentFrame.duration();
|
||||
totalRenderTime += renderTime;
|
||||
|
||||
// update fps every 10 frames or every second
|
||||
framesCounter++;
|
||||
if (framesCounter > 9 || totalRenderTime > 1.f
|
||||
|| displayMilliseconds > std::chrono::seconds(1)) {
|
||||
displayFPS = 1000.f * float(framesCounter) / displayMilliseconds.count();
|
||||
latestFPS = float(framesCounter) / totalRenderTime;
|
||||
|
||||
displayStart = displayEnd;
|
||||
totalRenderTime = 0.f;
|
||||
framesCounter = 0;
|
||||
|
||||
updateTitleBar();
|
||||
}
|
||||
|
||||
waitOnOSPRayFrame();
|
||||
|
||||
latestFPS = 1.f / currentFrame.duration();
|
||||
|
||||
auto *fb = framebuffer.map(
|
||||
showDepth ? OSP_FB_DEPTH : (showAlbedo ? OSP_FB_ALBEDO : OSP_FB_COLOR));
|
||||
auto fbChannel = OSP_FB_COLOR;
|
||||
if (showDepth)
|
||||
fbChannel = OSP_FB_DEPTH;
|
||||
if (showAlbedo)
|
||||
fbChannel = OSP_FB_ALBEDO;
|
||||
if (showNormal)
|
||||
fbChannel = OSP_FB_NORMAL;
|
||||
if (showPrimID)
|
||||
fbChannel = OSP_FB_ID_PRIMITIVE;
|
||||
if (showGeomID)
|
||||
fbChannel = OSP_FB_ID_OBJECT;
|
||||
if (showInstID)
|
||||
fbChannel = OSP_FB_ID_INSTANCE;
|
||||
auto *fb = framebuffer.map(fbChannel);
|
||||
|
||||
// Copy and normalize depth layer if showDepth is on
|
||||
float *depthFb = static_cast<float *>(fb);
|
||||
@@ -380,17 +453,44 @@ void GLFWOSPRayWindow::display()
|
||||
depthFb[i] = (depthFb[i] - minDepth) * rcpDepthRange;
|
||||
}
|
||||
}
|
||||
unsigned int *ids = static_cast<unsigned int *>(fb);
|
||||
std::vector<vec3f> idFbArray(windowSize.x * windowSize.y);
|
||||
float *idFb = reinterpret_cast<float *>(idFbArray.data());
|
||||
if (showPrimID || showGeomID || showInstID) {
|
||||
for (int i = 0; i < windowSize.x * windowSize.y; i++) {
|
||||
const unsigned int id = ids[i];
|
||||
idFbArray[i] =
|
||||
id == -1u ? vec3f(0.f) : rkcommon::utility::makeRandomColor(id);
|
||||
}
|
||||
}
|
||||
if (showNormal) {
|
||||
float *nFb = static_cast<float *>(fb);
|
||||
float *iFb = reinterpret_cast<float *>(idFbArray.data());
|
||||
for (int i = 0; i < windowSize.x * windowSize.y * 3; i++)
|
||||
iFb[i] = std::abs(nFb[i]);
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, framebufferTexture);
|
||||
glTexImage2D(GL_TEXTURE_2D,
|
||||
0,
|
||||
showDepth ? GL_DEPTH_COMPONENT : (showAlbedo ? GL_RGB32F : GL_RGBA32F),
|
||||
showDepth ? GL_DEPTH_COMPONENT
|
||||
: ((showAlbedo || showNormal || showPrimID || showGeomID
|
||||
|| showInstID)
|
||||
? GL_RGB32F
|
||||
: GL_RGBA32F),
|
||||
windowSize.x,
|
||||
windowSize.y,
|
||||
0,
|
||||
showDepth ? GL_DEPTH_COMPONENT : (showAlbedo ? GL_RGB : GL_RGBA),
|
||||
showDepth ? GL_DEPTH_COMPONENT
|
||||
: ((showAlbedo || showNormal || showPrimID || showGeomID
|
||||
|| showInstID)
|
||||
? GL_RGB
|
||||
: GL_RGBA),
|
||||
GL_FLOAT,
|
||||
showDepth ? depthFb : fb);
|
||||
showDepth
|
||||
? depthFb
|
||||
: ((showNormal || showPrimID || showGeomID || showInstID) ? idFb
|
||||
: fb));
|
||||
|
||||
framebuffer.unmap(fb);
|
||||
|
||||
@@ -400,7 +500,7 @@ void GLFWOSPRayWindow::display()
|
||||
firstFrame = false;
|
||||
}
|
||||
|
||||
// clear current OpenGL color buffer
|
||||
glEnable(GL_FRAMEBUFFER_SRGB); // Turn on sRGB conversion for OSPRay frame
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// render textured quad with OSPRay frame buffer contents
|
||||
@@ -419,26 +519,24 @@ void GLFWOSPRayWindow::display()
|
||||
glVertex2f(windowSize.x, 0.f);
|
||||
|
||||
glEnd();
|
||||
|
||||
if (showUi) {
|
||||
glDisable(GL_FRAMEBUFFER_SRGB); // Disable SRGB conversion for UI
|
||||
|
||||
ImGui::Render();
|
||||
ImGui_ImplGlfwGL3_Render();
|
||||
}
|
||||
|
||||
// swap buffers
|
||||
glfwSwapBuffers(glfwWindow);
|
||||
}
|
||||
|
||||
void GLFWOSPRayWindow::startNewOSPRayFrame()
|
||||
{
|
||||
if (updateFrameOpsNextFrame) {
|
||||
if (updateFrameOpsNextFrame)
|
||||
refreshFrameOperations();
|
||||
updateFrameOpsNextFrame = false;
|
||||
}
|
||||
lastXfm = arcballCamera->transform();
|
||||
currentFrame = framebuffer.renderFrame(*renderer, camera, world);
|
||||
if (updateFrameOpsNextFrame || accumLimit == 0 || frame < accumLimit) {
|
||||
currentFrame = framebuffer.renderFrame(*renderer, camera, world);
|
||||
|
||||
// correctly count rendered frames: to run the PP (e.g. toggling the
|
||||
// denoiser) we need to start a renderFrame and cannot skip rendering via
|
||||
// targetFrames in case PT should *not* use blue noise
|
||||
if (accumLimit == 0 || frame < accumLimit
|
||||
|| (rendererType == OSPRayRendererType::PATHTRACER && !blueNoise))
|
||||
frame++;
|
||||
}
|
||||
updateFrameOpsNextFrame = false;
|
||||
if (renderCameraMotionBlur) {
|
||||
camera.removeParam("motion.transform");
|
||||
camera.setParam("transform", lastXfm);
|
||||
@@ -460,8 +558,13 @@ void GLFWOSPRayWindow::addObjectToCommit(OSPObject obj)
|
||||
void GLFWOSPRayWindow::updateTitleBar()
|
||||
{
|
||||
std::stringstream windowTitle;
|
||||
windowTitle << "OSPRay: " << std::setprecision(3) << latestFPS << " fps";
|
||||
if (latestFPS < 2.f) {
|
||||
windowTitle << "OSPRay frame: " << frame
|
||||
<< (accumLimit && frame >= accumLimit ? " (limit reached), last"
|
||||
: ", ")
|
||||
<< " render:" << std::fixed << std::setprecision(2)
|
||||
<< std::setw(7) << latestFPS << " fps, app:" << std::setw(7)
|
||||
<< displayFPS << " fps";
|
||||
if (latestFPS > 0.f && latestFPS < 2.f) {
|
||||
float progress = currentFrame.progress();
|
||||
windowTitle << " | ";
|
||||
int barWidth = 20;
|
||||
@@ -485,11 +588,11 @@ void GLFWOSPRayWindow::buildUI()
|
||||
ImGuiWindowFlags flags = ImGuiWindowFlags_AlwaysAutoResize;
|
||||
ImGui::Begin("press 'g' to hide/show UI", nullptr, flags);
|
||||
|
||||
static int whichScene = 0;
|
||||
static int whichScene = 2;
|
||||
if (ImGui::Combo("scene##whichScene",
|
||||
&whichScene,
|
||||
sceneUI_callback,
|
||||
nullptr,
|
||||
vec_string_getter,
|
||||
(void *)&g_scenes,
|
||||
g_scenes.size())) {
|
||||
scene = g_scenes[whichScene];
|
||||
refreshScene(true);
|
||||
@@ -499,8 +602,8 @@ void GLFWOSPRayWindow::buildUI()
|
||||
static int whichCurveVariant = 0;
|
||||
if (ImGui::Combo("curveVariant##whichCurveVariant",
|
||||
&whichCurveVariant,
|
||||
curveVariantUI_callback,
|
||||
nullptr,
|
||||
vec_string_getter,
|
||||
(void *)&g_curveVariant,
|
||||
g_curveVariant.size())) {
|
||||
curveVariant = g_curveVariant[whichCurveVariant];
|
||||
refreshScene(true);
|
||||
@@ -512,12 +615,12 @@ void GLFWOSPRayWindow::buildUI()
|
||||
refreshScene(true);
|
||||
}
|
||||
|
||||
static int whichRenderer = 0;
|
||||
static int whichRenderer = 1;
|
||||
static int whichDebuggerType = 0;
|
||||
if (ImGui::Combo("renderer##whichRenderer",
|
||||
&whichRenderer,
|
||||
rendererUI_callback,
|
||||
nullptr,
|
||||
vec_string_getter,
|
||||
(void *)&g_renderers,
|
||||
g_renderers.size())) {
|
||||
rendererTypeStr = g_renderers[whichRenderer];
|
||||
|
||||
@@ -536,54 +639,89 @@ void GLFWOSPRayWindow::buildUI()
|
||||
rendererType = OSPRayRendererType::OTHER;
|
||||
|
||||
refreshScene();
|
||||
updateTargetFrames();
|
||||
}
|
||||
|
||||
if (rendererType == OSPRayRendererType::DEBUGGER) {
|
||||
if (ImGui::Combo("debug type##whichDebugType",
|
||||
&whichDebuggerType,
|
||||
debugTypeUI_callback,
|
||||
nullptr,
|
||||
vec_string_getter,
|
||||
(void *)&g_debugRendererTypes,
|
||||
g_debugRendererTypes.size())) {
|
||||
renderer->setParam("method", g_debugRendererTypes[whichDebuggerType]);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::SliderInt("accumulation limit", &accumLimit, 0, 64))
|
||||
updateTargetFrames();
|
||||
ImGui::Checkbox("cancel frame on interaction", &cancelFrameOnInteraction);
|
||||
ImGui::Checkbox("show depth", &showDepth);
|
||||
if (showDepth)
|
||||
showAlbedo = false;
|
||||
else
|
||||
ImGui::Checkbox("show albedo", &showAlbedo);
|
||||
|
||||
static int whichAOV = 0;
|
||||
if (ImGui::Combo("AOV Display##whichAOV",
|
||||
&whichAOV,
|
||||
vec_string_getter,
|
||||
(void *)&g_AOVs,
|
||||
g_AOVs.size())) {
|
||||
const auto &aovStr = g_AOVs[whichAOV];
|
||||
showDepth = showAlbedo = showNormal = showPrimID = showGeomID = showInstID =
|
||||
false;
|
||||
if (aovStr == "depth")
|
||||
showDepth = true;
|
||||
if (aovStr == "albedo")
|
||||
showAlbedo = true;
|
||||
if (aovStr == "normal")
|
||||
showNormal = true;
|
||||
if (aovStr == "primID")
|
||||
showPrimID = true;
|
||||
if (aovStr == "objID")
|
||||
showGeomID = true;
|
||||
if (aovStr == "instID")
|
||||
showInstID = true;
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
if (denoiserAvailable) {
|
||||
if (ImGui::Checkbox("denoiser", &denoiserEnabled))
|
||||
updateFrameOpsNextFrame = true;
|
||||
|
||||
static int whichQuality = 1; // medium
|
||||
if (denoiserEnabled
|
||||
&& ImGui::Combo("quality##whichQuality",
|
||||
&whichQuality,
|
||||
vec_string_getter,
|
||||
(void *)&g_denoiserQuality,
|
||||
g_denoiserQuality.size())) {
|
||||
denoiser.setParam("quality",
|
||||
OSPDenoiserQuality::OSP_DENOISER_QUALITY_LOW + whichQuality);
|
||||
addObjectToCommit(denoiser.handle());
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
// the gaussian pixel fiter is the default,
|
||||
// the gaussian pixel filter is the default,
|
||||
// which is at position 2 in the list
|
||||
static int whichPixelFilter = 2;
|
||||
if (ImGui::Combo("pixelfilter##whichPixelFilter",
|
||||
&whichPixelFilter,
|
||||
pixelFilterTypeUI_callback,
|
||||
nullptr,
|
||||
vec_string_getter,
|
||||
(void *)&g_pixelFilterTypes,
|
||||
g_pixelFilterTypes.size())) {
|
||||
pixelFilterTypeStr = g_pixelFilterTypes[whichPixelFilter];
|
||||
|
||||
OSPPixelFilterTypes pixelFilterType =
|
||||
OSPPixelFilterTypes::OSP_PIXELFILTER_GAUSS;
|
||||
OSPPixelFilterType pixelFilterType =
|
||||
OSPPixelFilterType::OSP_PIXELFILTER_GAUSS;
|
||||
if (pixelFilterTypeStr == "point")
|
||||
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_POINT;
|
||||
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_POINT;
|
||||
else if (pixelFilterTypeStr == "box")
|
||||
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_BOX;
|
||||
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_BOX;
|
||||
else if (pixelFilterTypeStr == "gaussian")
|
||||
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_GAUSS;
|
||||
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_GAUSS;
|
||||
else if (pixelFilterTypeStr == "mitchell")
|
||||
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_MITCHELL;
|
||||
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_MITCHELL;
|
||||
else if (pixelFilterTypeStr == "blackmanHarris")
|
||||
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_BLACKMAN_HARRIS;
|
||||
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_BLACKMAN_HARRIS;
|
||||
|
||||
rendererPT.setParam("pixelFilter", pixelFilterType);
|
||||
rendererSV.setParam("pixelFilter", pixelFilterType);
|
||||
@@ -603,7 +741,24 @@ void GLFWOSPRayWindow::buildUI()
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
static vec3f bgColorSRGB{0.0f}; // imGUI's widget implicitely uses sRGB
|
||||
if (scene == "mip_map_textures") {
|
||||
static float mipBias = 0.0f;
|
||||
if (ImGui::SliderFloat("mipMapBias", &mipBias, -5.0f, 10.0f)) {
|
||||
rendererPT.setParam("mipMapBias", mipBias);
|
||||
rendererSV.setParam("mipMapBias", mipBias);
|
||||
rendererAO.setParam("mipMapBias", mipBias);
|
||||
rendererDBG.setParam("mipMapBias", mipBias);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
}
|
||||
|
||||
static float varianceThreshold = 0.0f;
|
||||
if (ImGui::SliderFloat("varianceThreshold", &varianceThreshold, 0.f, 5.f)) {
|
||||
renderer->setParam("varianceThreshold", varianceThreshold);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
static vec3f bgColorSRGB{0.0f}; // imGUI's widget implicitly uses sRGB
|
||||
if (ImGui::ColorEdit3("backgroundColor", bgColorSRGB)) {
|
||||
bgColor = vec3f(std::pow(bgColorSRGB.x, 2.2f),
|
||||
std::pow(bgColorSRGB.y, 2.2f),
|
||||
@@ -615,8 +770,10 @@ void GLFWOSPRayWindow::buildUI()
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
static bool useTestTex = false;
|
||||
if (ImGui::Checkbox("backplate texture", &useTestTex)) {
|
||||
static bool useTestTex = true;
|
||||
static bool init = true;
|
||||
if (init || ImGui::Checkbox("backplate texture", &useTestTex)) {
|
||||
init = false;
|
||||
if (useTestTex) {
|
||||
rendererPT.setParam("map_backplate", backplateTex);
|
||||
rendererSV.setParam("map_backplate", backplateTex);
|
||||
@@ -631,7 +788,75 @@ void GLFWOSPRayWindow::buildUI()
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
if (rendererType == OSPRayRendererType::SCIVIS
|
||||
|| rendererType == OSPRayRendererType::PATHTRACER) {
|
||||
if (ImGui::Checkbox("sun-sky illumination", &renderSunSky)) {
|
||||
if (renderSunSky) {
|
||||
sunSky.setParam("direction", sunDirection);
|
||||
sunSky.setParam("horizonExtension", horizonExtension);
|
||||
sunSky.setParam("turbidity", turbidity);
|
||||
world.setParam("light", cpp::CopiedData(sunSky));
|
||||
addObjectToCommit(sunSky.handle());
|
||||
// turn-off background
|
||||
bgColorSRGB = bgColor = vec3f(0.f);
|
||||
renderer->setParam("backgroundColor", bgColor);
|
||||
useTestTex = false;
|
||||
rendererPT.removeParam("map_backplate");
|
||||
rendererSV.removeParam("map_backplate");
|
||||
rendererAO.removeParam("map_backplate");
|
||||
rendererDBG.removeParam("map_backplate");
|
||||
addObjectToCommit(renderer->handle());
|
||||
} else {
|
||||
cpp::Light light("ambient");
|
||||
light.setParam("visible", false);
|
||||
light.commit();
|
||||
world.setParam("light", cpp::CopiedData(light));
|
||||
}
|
||||
addObjectToCommit(world.handle());
|
||||
}
|
||||
if (renderSunSky) {
|
||||
if (ImGui::DragFloat3("sunDirection", sunDirection, 0.01f, -1.f, 1.f)) {
|
||||
sunSky.setParam("direction", sunDirection);
|
||||
addObjectToCommit(sunSky.handle());
|
||||
addObjectToCommit(world.handle());
|
||||
}
|
||||
if (ImGui::DragFloat("turbidity", &turbidity, 0.1f, 1.f, 10.f)) {
|
||||
sunSky.setParam("turbidity", turbidity);
|
||||
addObjectToCommit(sunSky.handle());
|
||||
addObjectToCommit(world.handle());
|
||||
}
|
||||
if (ImGui::DragFloat(
|
||||
"horizonExtension", &horizonExtension, 0.01f, 0.f, 1.f)) {
|
||||
sunSky.setParam("horizonExtension", horizonExtension);
|
||||
addObjectToCommit(sunSky.handle());
|
||||
addObjectToCommit(world.handle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rendererType == OSPRayRendererType::PATHTRACER) {
|
||||
static int lightSamples = -1;
|
||||
if (ImGui::SliderInt("lightSamples", &lightSamples, -1, 32)) {
|
||||
renderer->setParam("lightSamples", lightSamples);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
static bool limitIndirectLightSamples = true;
|
||||
if (ImGui::Checkbox("limitIndirectLightSamples", &limitIndirectLightSamples)) {
|
||||
renderer->setParam("limitIndirectLightSamples", limitIndirectLightSamples);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
if (accumLimit) {
|
||||
if (ImGui::Checkbox("blue noise", &blueNoise))
|
||||
updateTargetFrames();
|
||||
} else {
|
||||
ImGui::BeginDisabled();
|
||||
bool f = false;
|
||||
ImGui::Checkbox("blue noise (needs accumulation limit)", &f);
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
static int maxDepth = 20;
|
||||
if (ImGui::SliderInt("maxPathLength", &maxDepth, 1, 64)) {
|
||||
renderer->setParam("maxPathLength", maxDepth);
|
||||
@@ -650,48 +875,57 @@ void GLFWOSPRayWindow::buildUI()
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
if (ImGui::SliderFloat("camera motion blur", &cameraMotionBlur, 0.f, 1.f)) {
|
||||
updateCamera();
|
||||
addObjectToCommit(camera.handle());
|
||||
static float maxContribution = 10000.f;
|
||||
if (ImGui::SliderFloat("maxContribution", &maxContribution, 0.f, 10000.f)) {
|
||||
renderer->setParam("maxContribution", maxContribution);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
if (ImGui::Checkbox("renderSunSky", &renderSunSky)) {
|
||||
if (renderSunSky) {
|
||||
sunSky.setParam("direction", sunDirection);
|
||||
world.setParam("light", cpp::CopiedData(sunSky));
|
||||
addObjectToCommit(sunSky.handle());
|
||||
} else {
|
||||
cpp::Light light("ambient");
|
||||
light.setParam("visible", false);
|
||||
light.commit();
|
||||
world.setParam("light", cpp::CopiedData(light));
|
||||
}
|
||||
addObjectToCommit(world.handle());
|
||||
if (ImGui::SliderFloat("camera motion blur", &cameraMotionBlur, 0.f, 1.f)) {
|
||||
updateCamera();
|
||||
}
|
||||
if (renderSunSky) {
|
||||
if (ImGui::DragFloat3("sunDirection", sunDirection, 0.01f, -1.f, 1.f)) {
|
||||
sunSky.setParam("direction", sunDirection);
|
||||
addObjectToCommit(sunSky.handle());
|
||||
}
|
||||
if (ImGui::DragFloat("turbidity", &turbidity, 0.1f, 1.f, 10.f)) {
|
||||
sunSky.setParam("turbidity", turbidity);
|
||||
addObjectToCommit(sunSky.handle());
|
||||
}
|
||||
if (ImGui::DragFloat(
|
||||
"horizonExtension", &horizonExtension, 0.01f, 0.f, 1.f)) {
|
||||
sunSky.setParam("horizonExtension", horizonExtension);
|
||||
addObjectToCommit(sunSky.handle());
|
||||
|
||||
if (cameraMotionBlur > 0.0f) {
|
||||
static const char *cameraShutterTypes[] = {"global",
|
||||
"rolling right",
|
||||
"rolling left",
|
||||
"rolling down",
|
||||
"rolling up"};
|
||||
if (ImGui::BeginCombo("shutterType##cameraShutterType",
|
||||
cameraShutterTypes[cameraShutterType])) {
|
||||
for (uint32_t n = 0; n < 5; n++) {
|
||||
bool is_selected = (cameraShutterType == n);
|
||||
if (ImGui::Selectable(cameraShutterTypes[n], is_selected))
|
||||
cameraShutterType = (OSPShutterType)n;
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
updateCamera();
|
||||
}
|
||||
}
|
||||
|
||||
if (cameraShutterType != OSP_SHUTTER_GLOBAL
|
||||
&& ImGui::SliderFloat(
|
||||
"rollingShutterDuration", &cameraRollingShutter, 0.f, 1.0f)) {
|
||||
updateCamera();
|
||||
}
|
||||
} else if (rendererType == OSPRayRendererType::SCIVIS) {
|
||||
static bool shadowsEnabled = false;
|
||||
if (ImGui::Checkbox("shadows", &shadowsEnabled)) {
|
||||
static bool init = true;
|
||||
static bool shadowsEnabled = true;
|
||||
if (init || ImGui::Checkbox("shadows", &shadowsEnabled)) {
|
||||
renderer->setParam("shadows", shadowsEnabled);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
static int aoSamples = 0;
|
||||
if (ImGui::SliderInt("aoSamples", &aoSamples, 0, 64)) {
|
||||
static bool visibleLights = true;
|
||||
if (init || ImGui::Checkbox("visibleLights", &visibleLights)) {
|
||||
renderer->setParam("visibleLights", visibleLights);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
|
||||
static int aoSamples = 1;
|
||||
if (init || ImGui::SliderInt("aoSamples", &aoSamples, 0, 64)) {
|
||||
renderer->setParam("aoSamples", aoSamples);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
@@ -701,6 +935,7 @@ void GLFWOSPRayWindow::buildUI()
|
||||
renderer->setParam("volumeSamplingRate", samplingRate);
|
||||
addObjectToCommit(renderer->handle());
|
||||
}
|
||||
init = false;
|
||||
} else if (rendererType == OSPRayRendererType::AO) {
|
||||
static int aoSamples = 1;
|
||||
if (ImGui::SliderInt("aoSamples", &aoSamples, 0, 64)) {
|
||||
@@ -721,6 +956,22 @@ void GLFWOSPRayWindow::buildUI()
|
||||
}
|
||||
}
|
||||
|
||||
static const char *cameraStereoModes[] = {
|
||||
"none", "left", "right", "side-by-side", "top/bottom"};
|
||||
if (ImGui::BeginCombo("camera stereoMode##cameraStereoMode",
|
||||
cameraStereoModes[cameraStereoMode])) {
|
||||
for (uint32_t n = 0; n < 5; n++) {
|
||||
bool is_selected = (cameraStereoMode == n);
|
||||
if (ImGui::Selectable(cameraStereoModes[n], is_selected))
|
||||
cameraStereoMode = (OSPStereoMode)n;
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
|
||||
updateCamera();
|
||||
}
|
||||
|
||||
if (uiCallback) {
|
||||
ImGui::Separator();
|
||||
uiCallback();
|
||||
@@ -735,6 +986,7 @@ void GLFWOSPRayWindow::commitOutstandingHandles()
|
||||
if (!handles.empty()) {
|
||||
for (auto &h : handles)
|
||||
ospCommit(h);
|
||||
frame = 0;
|
||||
framebuffer.resetAccumulation();
|
||||
}
|
||||
}
|
||||
@@ -754,12 +1006,9 @@ void GLFWOSPRayWindow::refreshScene(bool resetCamera)
|
||||
testing::release(builder);
|
||||
|
||||
switch (rendererType) {
|
||||
case OSPRayRendererType::PATHTRACER: {
|
||||
case OSPRayRendererType::PATHTRACER:
|
||||
renderer = &rendererPT;
|
||||
if (renderSunSky)
|
||||
world.setParam("light", cpp::CopiedData(sunSky));
|
||||
break;
|
||||
}
|
||||
case OSPRayRendererType::SCIVIS:
|
||||
renderer = &rendererSV;
|
||||
break;
|
||||
@@ -772,6 +1021,12 @@ void GLFWOSPRayWindow::refreshScene(bool resetCamera)
|
||||
default:
|
||||
throw std::runtime_error("invalid renderer chosen!");
|
||||
}
|
||||
if (rendererType == OSPRayRendererType::SCIVIS
|
||||
|| rendererType == OSPRayRendererType::PATHTRACER) {
|
||||
if (renderSunSky)
|
||||
world.setParam("light", cpp::CopiedData(sunSky));
|
||||
} else
|
||||
renderSunSky = false;
|
||||
// retains a set background color on renderer change
|
||||
renderer->setParam("backgroundColor", bgColor);
|
||||
addObjectToCommit(renderer->handle());
|
||||
@@ -787,18 +1042,25 @@ void GLFWOSPRayWindow::refreshScene(bool resetCamera)
|
||||
// init camera
|
||||
camera.setParam("position", vec3f(0.0f, 0.0f, 1.0f));
|
||||
updateCamera();
|
||||
camera.commit();
|
||||
}
|
||||
}
|
||||
|
||||
void GLFWOSPRayWindow::refreshFrameOperations()
|
||||
{
|
||||
if (denoiserEnabled) {
|
||||
cpp::ImageOperation d("denoiser");
|
||||
framebuffer.setParam("imageOperation", cpp::CopiedData(d));
|
||||
framebuffer.setParam("imageOperation", cpp::CopiedData(denoiser));
|
||||
} else {
|
||||
framebuffer.removeParam("imageOperation");
|
||||
}
|
||||
|
||||
framebuffer.commit();
|
||||
}
|
||||
|
||||
void GLFWOSPRayWindow::updateTargetFrames(const bool commit)
|
||||
{
|
||||
framebuffer.setParam("targetFrames",
|
||||
rendererType != OSPRayRendererType::PATHTRACER || blueNoise ? accumLimit
|
||||
: 0);
|
||||
if (commit)
|
||||
addObjectToCommit(framebuffer.handle());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018-2021 Intel Corporation
|
||||
// Copyright 2018 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
@@ -27,7 +27,9 @@ enum class OSPRayRendererType
|
||||
class GLFWOSPRayWindow
|
||||
{
|
||||
public:
|
||||
GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser = false);
|
||||
GLFWOSPRayWindow(const vec2i &windowSize,
|
||||
bool denoiserAvail = false,
|
||||
bool denoiserGPUAvail = false);
|
||||
|
||||
~GLFWOSPRayWindow();
|
||||
|
||||
@@ -50,6 +52,7 @@ class GLFWOSPRayWindow
|
||||
void commitOutstandingHandles();
|
||||
void refreshScene(bool resetCamera = false);
|
||||
void refreshFrameOperations();
|
||||
void updateTargetFrames(const bool commit = true);
|
||||
|
||||
static GLFWOSPRayWindow *activeWindow;
|
||||
|
||||
@@ -60,7 +63,11 @@ class GLFWOSPRayWindow
|
||||
bool updateFrameOpsNextFrame{false};
|
||||
bool denoiserEnabled{false};
|
||||
bool showAlbedo{false};
|
||||
bool showNormal{false};
|
||||
bool showDepth{false};
|
||||
bool showPrimID{false};
|
||||
bool showGeomID{false};
|
||||
bool showInstID{false};
|
||||
bool renderSunSky{false};
|
||||
bool cancelFrameOnInteraction{false};
|
||||
bool showUnstructuredCells{false};
|
||||
@@ -71,7 +78,10 @@ class GLFWOSPRayWindow
|
||||
// Arcball camera instance
|
||||
std::unique_ptr<ArcballCamera> arcballCamera;
|
||||
affine3f lastXfm{one};
|
||||
OSPStereoMode cameraStereoMode{OSP_STEREO_NONE};
|
||||
float cameraMotionBlur{0.0f};
|
||||
float cameraRollingShutter{0.0f};
|
||||
OSPShutterType cameraShutterType{OSP_SHUTTER_GLOBAL};
|
||||
// only one frame during movement is rendered with MB,
|
||||
// during accumulation the camera is static and thus no MB
|
||||
bool renderCameraMotionBlur{false};
|
||||
@@ -88,18 +98,23 @@ class GLFWOSPRayWindow
|
||||
cpp::FrameBuffer framebuffer;
|
||||
cpp::Future currentFrame;
|
||||
cpp::Texture backplateTex{"texture2d"};
|
||||
cpp::ImageOperation denoiser;
|
||||
|
||||
int frame{0};
|
||||
bool blueNoise{true};
|
||||
int accumLimit{0};
|
||||
|
||||
vec3f bgColor{0.f};
|
||||
vec3f sunDirection{-0.25f, -1.0f, 0.0f};
|
||||
vec3f sunDirection{-0.25f, -1.0f, 1.0f};
|
||||
float turbidity{3.f};
|
||||
float horizonExtension{0.1f};
|
||||
float horizonExtension{0.25f};
|
||||
|
||||
std::string scene{"boxes_lit"};
|
||||
std::string scene{"cornell_box"};
|
||||
|
||||
std::string curveVariant{"bspline"};
|
||||
|
||||
OSPRayRendererType rendererType{OSPRayRendererType::SCIVIS};
|
||||
std::string rendererTypeStr{"scivis"};
|
||||
OSPRayRendererType rendererType{OSPRayRendererType::PATHTRACER};
|
||||
std::string rendererTypeStr{"pathtracer"};
|
||||
|
||||
std::string pixelFilterTypeStr{"gaussian"};
|
||||
|
||||
@@ -119,5 +134,7 @@ class GLFWOSPRayWindow
|
||||
std::function<void()> uiCallback;
|
||||
|
||||
// FPS measurement of last frame
|
||||
uint32_t framesCounter{0};
|
||||
float latestFPS{0.f};
|
||||
float displayFPS{0.f};
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user