Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d064e2ed78 | ||
|
|
a22873bb2e | ||
|
|
b2801d0a5c | ||
|
|
1a5f1cc6ab | ||
|
|
9f5001d347 | ||
|
|
9042f628d4 | ||
|
|
83d71d0f57 | ||
|
|
cb8b1bfefa | ||
|
|
8824f59051 | ||
|
|
d8af04f08f | ||
|
|
559bc4eb96 | ||
|
|
c16cab239d | ||
|
|
68719f913a | ||
|
|
038ed69a92 | ||
|
|
69822a91cf | ||
|
|
24ff10b5db | ||
|
|
ec2f5b8078 | ||
|
|
538aa39127 | ||
|
|
8de56a2bbc | ||
|
|
ea5d7d4f47 | ||
|
|
05cdeccc27 | ||
|
|
ad4f349f00 | ||
|
|
06a2def85f | ||
|
|
a04019937e | ||
|
|
fff7bd2b28 | ||
|
|
3c4591df17 | ||
|
|
4fe852e88a | ||
|
|
864529254e | ||
|
|
93fa55bd29 | ||
|
|
fb9518e915 | ||
|
|
b780cb36d0 | ||
|
|
62cd8f1d35 | ||
|
|
793f2b4eb7 | ||
|
|
9a2ca8ddbb | ||
|
|
67710723d7 | ||
|
|
40851f4b51 | ||
|
|
87bdf96449 | ||
|
|
f1c1aa155b | ||
|
|
41f7dc384b | ||
|
|
4465e6c7f6 | ||
|
|
48a2c6483b | ||
|
|
5b3343fcc2 | ||
|
|
68b3d9ba54 | ||
|
|
5fd84db447 | ||
|
|
1dae41c607 | ||
|
|
6f673753bd | ||
|
|
6dc79a319e | ||
|
|
3b7cbd6bdb | ||
|
|
ea21b740b2 | ||
|
|
2d867a9dd6 | ||
|
|
3f1e32c404 | ||
|
|
ada5791daf | ||
|
|
db6ded4eec | ||
|
|
bfaf3fb87b | ||
|
|
bba254ba6d | ||
|
|
85e2cc0844 | ||
|
|
bef849b0e3 | ||
|
|
1747ae8f5a | ||
|
|
4c3a3241ca | ||
|
|
c49d72e7d3 | ||
|
|
7c6463d01a | ||
|
|
e6b15a90e9 | ||
|
|
e1024123c1 | ||
|
|
24ae0b20f3 | ||
|
|
288e81fb31 | ||
|
|
c435fc74c4 | ||
|
|
eac99e5796 | ||
|
|
97e7058037 | ||
|
|
ac0aea98c9 | ||
|
|
026b985c07 | ||
|
|
65c30f3199 | ||
|
|
da99a0385c | ||
|
|
37fd83af66 | ||
|
|
3abf131066 | ||
|
|
2b0077eea2 | ||
|
|
90a4c88a0c | ||
|
|
d524bca73d | ||
|
|
29d2d819e3 | ||
|
|
863b1346e1 | ||
|
|
f0b9a30bc1 | ||
|
|
a003d3721d | ||
|
|
ef6ef784c9 | ||
|
|
7d271cea1d | ||
|
|
7d0b652663 | ||
|
|
8c1e028b46 | ||
|
|
757e3c57d8 | ||
|
|
aa09d86b5a | ||
|
|
1f1389e668 | ||
|
|
32abd9ea90 | ||
|
|
8724995042 | ||
|
|
e75bf2f40f | ||
|
|
45b0164c84 | ||
|
|
8ddc4d3060 | ||
|
|
377a1106aa | ||
|
|
6a547639d1 | ||
|
|
d2e85290fe | ||
|
|
49d89298f8 | ||
|
|
6a772bf715 | ||
|
|
23847c4314 | ||
|
|
96278f7999 | ||
|
|
ba6bee10f7 | ||
|
|
93790cd06c | ||
|
|
94c1657ca0 | ||
|
|
776a748e05 | ||
|
|
03fdadf417 | ||
|
|
6b7080e8b6 | ||
|
|
6bb7f890ef | ||
|
|
4ea3f7476d | ||
|
|
b48a1556b6 | ||
|
|
8088db6282 | ||
|
|
5817ddf248 | ||
|
|
04de23aaa1 | ||
|
|
e1c7a643ed | ||
|
|
2381551ab9 | ||
|
|
16bab2479a | ||
|
|
64eb27af8a | ||
|
|
98585bdc30 | ||
|
|
0803987df3 | ||
|
|
ffd32e9309 | ||
|
|
b587028aa5 | ||
|
|
43b9c06f79 | ||
|
|
05ffc76032 | ||
|
|
8e5ba51718 | ||
|
|
8aa9c4d004 | ||
|
|
d075a877f2 | ||
|
|
5dfd285105 | ||
|
|
51392c77aa | ||
|
|
e78691b12b | ||
|
|
bc65135c51 | ||
|
|
0108d66aa1 | ||
|
|
96443fa1fd | ||
|
|
61c4df9503 | ||
|
|
b990652702 | ||
|
|
7f7d4d89ea | ||
|
|
2b7f325cc7 | ||
|
|
b9768394a1 | ||
|
|
3e02d5016e | ||
|
|
483ef2f125 | ||
|
|
46dc9e7772 | ||
|
|
b8551e50e1 | ||
|
|
b64df46522 | ||
|
|
7f92dfd06c | ||
|
|
3304a0c8b6 | ||
|
|
0c2d23e55c | ||
|
|
59d1ed6a94 | ||
|
|
33c299d3ba | ||
|
|
1cc87aa9af | ||
|
|
eb1b30c7b1 | ||
|
|
ecedbad5ba | ||
|
|
d1998c1b67 | ||
|
|
c2177ab86a | ||
|
|
f4d87ad526 | ||
|
|
f2f9c547b0 | ||
|
|
ea1c5d8f24 | ||
|
|
42d39834df | ||
|
|
7ea7fa18eb | ||
|
|
a6b4c9fae1 | ||
|
|
8d02cd0383 | ||
|
|
016882336a | ||
|
|
3f150e03bf | ||
|
|
99308c98ba | ||
|
|
6eee4520c7 | ||
|
|
fa3a5d9eb4 | ||
|
|
17e4d2b92e | ||
|
|
13310e4ba0 | ||
|
|
eab8490d14 | ||
|
|
edece8f3dc | ||
|
|
2456299337 | ||
|
|
6e9afff7ba | ||
|
|
4425338559 | ||
|
|
a494f9ff6a | ||
|
|
ba680cf11a | ||
|
|
fc095413b3 | ||
|
|
d80526528c | ||
|
|
38e59fbd6b | ||
|
|
a5e6df1ad3 | ||
|
|
23d1329f37 | ||
|
|
25b37d36ad | ||
|
|
68265ae793 | ||
|
|
e8f3fc5a46 | ||
|
|
22db1be939 | ||
|
|
a3290d7656 | ||
|
|
4ee33cd591 | ||
|
|
fd2f9555f1 | ||
|
|
ccdb58e93c | ||
|
|
1eb1df2cf2 | ||
|
|
d784ce311f | ||
|
|
875b295967 | ||
|
|
b1b2d7072d | ||
|
|
014e6bcbde | ||
|
|
614dbb44d5 | ||
|
|
40c0d59464 | ||
|
|
1b0ff3aadb | ||
|
|
164a25cac4 | ||
|
|
2bbcb6de4c | ||
|
|
58aa74b4ae | ||
|
|
26b42a7685 | ||
|
|
99b55cb888 | ||
|
|
4375ffb3e8 | ||
|
|
e9aeb9312b | ||
|
|
4be172050d | ||
|
|
3b9fc8f751 | ||
|
|
3bd4c45d6e | ||
|
|
1809aa7b11 | ||
|
|
739d4007e2 | ||
|
|
3ed9e8f2c0 | ||
|
|
e77ae6ec2c | ||
|
|
4f5369cefa | ||
|
|
93d28bc16a | ||
|
|
e85c22c6f5 | ||
|
|
2cade209b5 | ||
|
|
3d4fc7852b | ||
|
|
7dc17980a3 | ||
|
|
7da09a7f45 | ||
|
|
b97221b8de | ||
|
|
3f37efe4c9 | ||
|
|
9d57ced452 | ||
|
|
fe15a3047e | ||
|
|
67f37d4c15 | ||
|
|
c5fe185834 | ||
|
|
4c5261106a | ||
|
|
2147a7a640 | ||
|
|
dd7106bfcf | ||
|
|
b26c5ef0dc | ||
|
|
d16fc01cfe | ||
|
|
0fd2436cd1 | ||
|
|
374fc6b519 | ||
|
|
d4bb6b82df | ||
|
|
351d77f87b | ||
|
|
72ba2eee6d | ||
|
|
5974065798 | ||
|
|
e9e7abe287 | ||
|
|
684d441ba7 | ||
|
|
37c615e249 | ||
|
|
8999b21187 | ||
|
|
78aa1c4b10 | ||
|
|
c2b3632725 | ||
|
|
8c91b1baf5 | ||
|
|
1b4afbab51 | ||
|
|
c677607353 | ||
|
|
cdb539b3cf | ||
|
|
16bed4de00 | ||
|
|
2b620e65fd | ||
|
|
2aa51db614 | ||
|
|
2bbbb7f4d1 | ||
|
|
339e8da976 | ||
|
|
c36dd955f4 | ||
|
|
950be941eb | ||
|
|
3857e3789c | ||
|
|
2202b5ab8c | ||
|
|
639b933fd6 | ||
|
|
6653c6c08b | ||
|
|
777f664b1b | ||
|
|
283d240409 | ||
|
|
0e0f3a5518 | ||
|
|
ba5413622f | ||
|
|
ba8d429fcb | ||
|
|
f11e5cb081 | ||
|
|
c84f5d2a7f | ||
|
|
a7317e7a99 | ||
|
|
be4391950d | ||
|
|
6f20cf4b02 | ||
|
|
9674a5ae3c | ||
|
|
485c05789b | ||
|
|
b058794dd1 | ||
|
|
be22e9305d | ||
|
|
4ae7aa6a1b | ||
|
|
5e7106b521 | ||
|
|
30387af61c | ||
|
|
1c2ffc9ed4 | ||
|
|
574518ea74 | ||
|
|
d5a274fa25 | ||
|
|
3351db1178 | ||
|
|
b70aa43727 | ||
|
|
1f9a11802d | ||
|
|
89835a7a67 | ||
|
|
28ef805e5d | ||
|
|
6c0bd360b3 | ||
|
|
063affb612 | ||
|
|
9c857f64ae | ||
|
|
5966b5dd8f | ||
|
|
1795c40591 | ||
|
|
26f4239d8c | ||
|
|
ad29b9c70a | ||
|
|
1c817026f2 | ||
|
|
44a954b559 | ||
|
|
cdd0147a17 | ||
|
|
9de29a475e | ||
|
|
7f97363d9c | ||
|
|
d88b4c1bc3 | ||
|
|
3badf9db18 | ||
|
|
929f793cf3 | ||
|
|
06bffaa650 | ||
|
|
2e2f111435 | ||
|
|
06f9626429 | ||
|
|
fa0e20a699 | ||
|
|
59593830e5 | ||
|
|
112f9d742c | ||
|
|
8ba20eb03c | ||
|
|
1c0370d5d7 | ||
|
|
56f714633d | ||
|
|
f0bc338c80 | ||
|
|
9750ddb9db | ||
|
|
ec2ee9db7a | ||
|
|
1ce1e335a0 | ||
|
|
5fe356e446 | ||
|
|
14ddadd2f6 | ||
|
|
a2f5b635d1 | ||
|
|
324dcd3c86 | ||
|
|
4125802644 | ||
|
|
2d21fcbe55 | ||
|
|
3f4dac6248 | ||
|
|
40ae416715 | ||
|
|
b54a2046cb | ||
|
|
8add6ae1ac | ||
|
|
e7c96cd124 | ||
|
|
730bc99025 | ||
|
|
7441e878bb | ||
|
|
ef4c4a76fc | ||
|
|
be4f287b07 | ||
|
|
d3a35de386 | ||
|
|
9057c47a56 | ||
|
|
4a5081388d | ||
|
|
a60fe41681 | ||
|
|
a8ace2891d | ||
|
|
669ffc85c0 | ||
|
|
d957dd8082 | ||
|
|
8eda62c957 | ||
|
|
90f079ac2c | ||
|
|
3728f06603 | ||
|
|
39cfce641c | ||
|
|
3fbf3f7111 | ||
|
|
ef9bbece2a | ||
|
|
eb8fa9ecdf | ||
|
|
e1bfe7ca81 | ||
|
|
ca4c7ac739 | ||
|
|
9676bc94e8 | ||
|
|
f7a5111106 | ||
|
|
56ac7ab902 | ||
|
|
44b4de904e | ||
|
|
a2fe9f745c | ||
|
|
659b8b6e03 | ||
|
|
c73f4e64d5 | ||
|
|
fe743523bf | ||
|
|
2c1044e812 | ||
|
|
db9183a105 | ||
|
|
e4a0bb8fa0 | ||
|
|
d15c53e530 | ||
|
|
cc8a3ed96b | ||
|
|
213eb6af9e | ||
|
|
e04c6d406f | ||
|
|
cab799f531 | ||
|
|
e95edef9d7 | ||
|
|
9cfef925bb | ||
|
|
3900fc6c37 | ||
|
|
b8ec1658f3 | ||
|
|
371bd1f01f | ||
|
|
df34f92f8f | ||
|
|
43331d04e5 | ||
|
|
9917d4b7d9 | ||
|
|
682150ceec | ||
|
|
af2ecf201f | ||
|
|
020668733a | ||
|
|
4c6d653d60 | ||
|
|
d1022527ac | ||
|
|
68c7a6c7b6 | ||
|
|
f077fff012 | ||
|
|
bea02427ed | ||
|
|
b5d7de06bc | ||
|
|
749b063af3 | ||
|
|
7aefa99e06 | ||
|
|
3c46788e06 | ||
|
|
51d749f451 | ||
|
|
343be60eb3 | ||
|
|
783c35e85b | ||
|
|
278e706d20 | ||
|
|
cf91e42847 | ||
|
|
3ec2249b2a | ||
|
|
a52ae3a7ef | ||
|
|
b4b702b977 | ||
|
|
75158847f7 | ||
|
|
ddf1d422bc | ||
|
|
bbb2e1a454 | ||
|
|
c7202c575a | ||
|
|
8cfdab0c28 | ||
|
|
180c326bb7 | ||
|
|
7d80975c3c | ||
|
|
813e6f805b | ||
|
|
450644ccd5 | ||
|
|
979421c019 | ||
|
|
18ccf0cd8d | ||
|
|
5b80407f6c | ||
|
|
a9f3971989 | ||
|
|
ab12984912 | ||
|
|
1d4f1fe71f | ||
|
|
c93aa4c90d | ||
|
|
499939ed3c | ||
|
|
6be97ee01d | ||
|
|
7267696cbf | ||
|
|
85eb724a90 | ||
|
|
6dd6db89d5 | ||
|
|
c76f67c139 | ||
|
|
6fc16bdcda | ||
|
|
4f021583f1 | ||
|
|
ef15a29c0c | ||
|
|
a0472d3c9f | ||
|
|
54a800a25d | ||
|
|
7f8fbe586c | ||
|
|
6f2c45c76d | ||
|
|
ad60008b6a | ||
|
|
d87f9b621b | ||
|
|
1b38cda0d5 | ||
|
|
a1dea7b1fa | ||
|
|
744708b5ca | ||
|
|
e901837317 | ||
|
|
17f71c9b81 | ||
|
|
b056c126fe | ||
|
|
6ac36d1aab | ||
|
|
a1752b363c | ||
|
|
e855f4aafb | ||
|
|
1c693e24cf | ||
|
|
af92a1f21b | ||
|
|
10ff1ee3e4 | ||
|
|
5449f46350 | ||
|
|
2967888d26 | ||
|
|
afe81d6889 | ||
|
|
95134883d6 | ||
|
|
600c122761 | ||
|
|
1cf5335964 | ||
|
|
4ac4ffd8d6 | ||
|
|
6c40721695 | ||
|
|
56fa078376 | ||
|
|
883507a26f | ||
|
|
d697d42c4a | ||
|
|
e7feee7d5b | ||
|
|
4c75e6e9a2 | ||
|
|
8ab8525359 | ||
|
|
65c794881f | ||
|
|
08d6d57ad0 | ||
|
|
254cf15f0e | ||
|
|
22d99bac3d | ||
|
|
420f06bef3 | ||
|
|
bf8bcef35c | ||
|
|
bfab9f9c32 | ||
|
|
c8335fade7 | ||
|
|
99eac62b4e | ||
|
|
6146d071ba | ||
|
|
d26c972f5b | ||
|
|
93dc218b83 | ||
|
|
b56379dc0f | ||
|
|
e4442a5eb2 | ||
|
|
490e8cf0d0 | ||
|
|
0d25f79421 | ||
|
|
d0586743f6 | ||
|
|
14a99cbc63 | ||
|
|
808b51c1cf | ||
|
|
315726678e | ||
|
|
bac8e58ee7 | ||
|
|
ec31a516f7 | ||
|
|
7a3b762b53 | ||
|
|
67268cb76d | ||
|
|
0b34dc6608 | ||
|
|
afe292986e | ||
|
|
83acf0f9de | ||
|
|
69d9c8b72c | ||
|
|
3bffd90357 | ||
|
|
b21dfd5ea2 | ||
|
|
8af2d7512d | ||
|
|
785592293c | ||
|
|
613b1fc246 | ||
|
|
c8098a4c15 | ||
|
|
d8eee061e8 | ||
|
|
0ebe888344 | ||
|
|
c20496a461 | ||
|
|
8955a61df3 | ||
|
|
9e0e3262c3 | ||
|
|
d3d5281488 | ||
|
|
075f3d0869 | ||
|
|
3ca9b9cd0f | ||
|
|
eb33ce35ef | ||
|
|
cddd22da28 | ||
|
|
05ce5ead8d | ||
|
|
4bed88289f | ||
|
|
7a6138597e | ||
|
|
28da328815 | ||
|
|
de3c4b6d56 | ||
|
|
5d27240e0c | ||
|
|
94fc37b8c2 | ||
|
|
532cb28ce9 | ||
|
|
b30d12aca5 | ||
|
|
d891a6927f | ||
|
|
22b5715837 | ||
|
|
7eb08f11ea | ||
|
|
588a05f77c | ||
|
|
3ec2b47df7 | ||
|
|
1c55ad49ee | ||
|
|
348e61fd76 | ||
|
|
8ce6d54930 | ||
|
|
8db5e700d7 | ||
|
|
0ec3596440 | ||
|
|
ee4c03d0f1 |
@@ -0,0 +1,17 @@
|
|||||||
|
name: 'Android Continuous'
|
||||||
|
inputs:
|
||||||
|
build-abi:
|
||||||
|
description: 'The target platform ABI'
|
||||||
|
required: true
|
||||||
|
default: 'armeabi-v7a'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Run build script
|
||||||
|
run: |
|
||||||
|
cd build/android && printf "y" | ./build.sh continuous ${{ inputs.build-abi }}
|
||||||
|
shell: bash
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
name: 'ubuntu apt add deb-src'
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: "ubuntu apt add deb-src"
|
||||||
|
run: |
|
||||||
|
echo "deb-src http://archive.ubuntu.com/ubuntu jammy main restricted universe" | sudo tee /etc/apt/sources.list.d/my.list
|
||||||
|
sudo apt-get update
|
||||||
|
shell: bash
|
||||||
@@ -10,30 +10,13 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-android:
|
build-android:
|
||||||
name: build-android
|
name: build-android
|
||||||
runs-on: macos-14
|
# We intentially use a larger runner here to enable larger disk space
|
||||||
|
# (standard linux runner will fail on disk space and faster build time).
|
||||||
|
runs-on: ubuntu-22.04-32core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- uses: actions/setup-java@v3
|
- name: Run Android Continuous
|
||||||
|
uses: ./.github/actions/android-continuous
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
build-abi: armeabi-v7a,arm64-v8a,x86_64
|
||||||
java-version: '17'
|
|
||||||
- name: Run build script
|
|
||||||
run: |
|
|
||||||
cd build/android && printf "y" | ./build.sh continuous
|
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
|
||||||
with:
|
|
||||||
name: filament-android
|
|
||||||
path: out/filament-android-release.aar
|
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
|
||||||
with:
|
|
||||||
name: filamat-android-full
|
|
||||||
path: out/filamat-android-release.aar
|
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
|
||||||
with:
|
|
||||||
name: gltfio-android-release
|
|
||||||
path: out/gltfio-android-release.aar
|
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
|
||||||
with:
|
|
||||||
name: filament-utils-android-release
|
|
||||||
path: out/filament-utils-android-release.aar
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-ios:
|
build-ios:
|
||||||
name: build-ios
|
name: build-ios
|
||||||
runs-on: macos-14
|
runs-on: macos-14-xlarge
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
cd build/ios && printf "y" | ./build.sh continuous
|
cd build/ios && printf "y" | ./build.sh continuous
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: filament-ios
|
name: filament-ios
|
||||||
path: out/filament-release-ios.tgz
|
path: out/filament-release-ios.tgz
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
name: build-linux
|
name: build-linux
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04-16core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
cd build/linux && printf "y" | ./build.sh continuous
|
cd build/linux && printf "y" | ./build.sh continuous
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: filament-linux
|
name: filament-linux
|
||||||
path: out/filament-release-linux.tgz
|
path: out/filament-release-linux.tgz
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-mac:
|
build-mac:
|
||||||
name: build-mac
|
name: build-mac
|
||||||
runs-on: macos-14
|
runs-on: macos-14-xlarge
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
cd build/mac && printf "y" | ./build.sh continuous
|
cd build/mac && printf "y" | ./build.sh continuous
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: filament-mac
|
name: filament-mac
|
||||||
path: out/filament-release-darwin.tgz
|
path: out/filament-release-darwin.tgz
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
name: npm-deploy
|
name: npm-deploy
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.inputs.release_tag }}
|
ref: ${{ github.event.inputs.release_tag }}
|
||||||
# Setup .npmrc file to publish to npm
|
# Setup .npmrc file to publish to npm
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-14, ubuntu-22.04]
|
os: [macos-14-xlarge, ubuntu-22.04-16core]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
WORKFLOW_OS=`echo \`uname\` | sed "s/Darwin/mac/" | tr [:upper:] [:lower:]`
|
WORKFLOW_OS=`echo \`uname\` | sed "s/Darwin/mac/" | tr [:upper:] [:lower:]`
|
||||||
@@ -29,10 +29,10 @@ jobs:
|
|||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
name: build-windows
|
name: build-windows
|
||||||
runs-on: windows-2019
|
runs-on: win-2019-16core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
build\windows\build-github.bat presubmit
|
build\windows\build-github.bat presubmit
|
||||||
@@ -40,24 +40,26 @@ jobs:
|
|||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
name: build-android
|
name: build-android
|
||||||
runs-on: macos-14
|
runs-on: ubuntu-22.04-16core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
|
# Only build 1 64 bit target during presubmit to cut down build times during presubmit
|
||||||
|
# Continuous builds will build everything
|
||||||
run: |
|
run: |
|
||||||
cd build/android && printf "y" | ./build.sh presubmit
|
cd build/android && printf "y" | ./build.sh presubmit arm64-v8a
|
||||||
|
|
||||||
build-ios:
|
build-ios:
|
||||||
name: build-iOS
|
name: build-iOS
|
||||||
runs-on: macos-14
|
runs-on: macos-14-xlarge
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
cd build/ios && printf "y" | ./build.sh presubmit
|
cd build/ios && printf "y" | ./build.sh presubmit
|
||||||
@@ -67,10 +69,38 @@ jobs:
|
|||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
name: build-web
|
name: build-web
|
||||||
runs-on: macos-14
|
runs-on: ubuntu-22.04-16core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
cd build/web && printf "y" | ./build.sh presubmit
|
cd build/web && printf "y" | ./build.sh presubmit
|
||||||
|
|
||||||
|
validate-docs:
|
||||||
|
name: validate-docs
|
||||||
|
runs-on: ubuntu-22.04-4core
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.1.6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Check for manual edits to /docs
|
||||||
|
run: |
|
||||||
|
echo "${{ github.event.pull_request.head.sha }} -- ${{ github.event.pull_request.head.sha }}"
|
||||||
|
# disable for now
|
||||||
|
# bash docs_src/build/presubmit_check.sh ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
test-renderdiff:
|
||||||
|
name: test-renderdiff
|
||||||
|
runs-on: ubuntu-22.04-16core
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.1.6
|
||||||
|
- uses: ./.github/actions/ubuntu-apt-add-src
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
source ./build/linux/ci-common.sh && bash test/renderdiff/test.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: presubmit-renderdiff-result
|
||||||
|
path: ./out/renderdiff_tests
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-14, ubuntu-22.04]
|
os: [macos-14-xlarge, ubuntu-22.04-32core]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Decide Git ref
|
- name: Decide Git ref
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
TAG=${REF##*/}
|
TAG=${REF##*/}
|
||||||
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.git_ref.outputs.ref }}
|
ref: ${{ steps.git_ref.outputs.ref }}
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
name: build-web
|
name: build-web
|
||||||
runs-on: macos-14
|
runs-on: ubuntu-22.04-16core
|
||||||
if: github.event_name == 'release' || github.event.inputs.platform == 'web'
|
if: github.event_name == 'release' || github.event.inputs.platform == 'web'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
TAG=${REF##*/}
|
TAG=${REF##*/}
|
||||||
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.git_ref.outputs.ref }}
|
ref: ${{ steps.git_ref.outputs.ref }}
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
|
|
||||||
build-android:
|
build-android:
|
||||||
name: build-android
|
name: build-android
|
||||||
runs-on: macos-14
|
runs-on: ubuntu-22.04-16core
|
||||||
if: github.event_name == 'release' || github.event.inputs.platform == 'android'
|
if: github.event_name == 'release' || github.event.inputs.platform == 'android'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -109,7 +109,7 @@ jobs:
|
|||||||
TAG=${REF##*/}
|
TAG=${REF##*/}
|
||||||
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.git_ref.outputs.ref }}
|
ref: ${{ steps.git_ref.outputs.ref }}
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
@@ -120,7 +120,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TAG: ${{ steps.git_ref.outputs.tag }}
|
TAG: ${{ steps.git_ref.outputs.tag }}
|
||||||
run: |
|
run: |
|
||||||
cd build/android && printf "y" | ./build.sh release
|
cd build/android && printf "y" | ./build.sh release armeabi-v7a,arm64-v8a,x86,x86_64
|
||||||
cd ../..
|
cd ../..
|
||||||
mv out/filament-android-release.aar out/filament-${TAG}-android.aar
|
mv out/filament-android-release.aar out/filament-${TAG}-android.aar
|
||||||
mv out/filamat-android-release.aar out/filamat-${TAG}-android.aar
|
mv out/filamat-android-release.aar out/filamat-${TAG}-android.aar
|
||||||
@@ -152,7 +152,7 @@ jobs:
|
|||||||
|
|
||||||
build-ios:
|
build-ios:
|
||||||
name: build-ios
|
name: build-ios
|
||||||
runs-on: macos-14
|
runs-on: macos-14-xlarge
|
||||||
if: github.event_name == 'release' || github.event.inputs.platform == 'ios'
|
if: github.event_name == 'release' || github.event.inputs.platform == 'ios'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -163,7 +163,7 @@ jobs:
|
|||||||
TAG=${REF##*/}
|
TAG=${REF##*/}
|
||||||
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.git_ref.outputs.ref }}
|
ref: ${{ steps.git_ref.outputs.ref }}
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
@@ -185,7 +185,7 @@ jobs:
|
|||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
name: build-windows
|
name: build-windows
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019-32core
|
||||||
if: github.event_name == 'release' || github.event.inputs.platform == 'windows'
|
if: github.event_name == 'release' || github.event.inputs.platform == 'windows'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -197,7 +197,7 @@ jobs:
|
|||||||
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
echo "ref=${REF}" >> $GITHUB_OUTPUT
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.git_ref.outputs.ref }}
|
ref: ${{ steps.git_ref.outputs.ref }}
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
@@ -205,6 +205,7 @@ jobs:
|
|||||||
TAG: ${{ steps.git_ref.outputs.tag }}
|
TAG: ${{ steps.git_ref.outputs.tag }}
|
||||||
run: |
|
run: |
|
||||||
build\windows\build-github.bat release
|
build\windows\build-github.bat release
|
||||||
|
echo on
|
||||||
move out\filament-windows.tgz out\filament-%TAG%-windows.tgz
|
move out\filament-windows.tgz out\filament-%TAG%-windows.tgz
|
||||||
shell: cmd
|
shell: cmd
|
||||||
- uses: actions/github-script@v6
|
- uses: actions/github-script@v6
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-web:
|
build-web:
|
||||||
name: build-web
|
name: build-web
|
||||||
runs-on: macos-14
|
runs-on: ubuntu-22.04-16core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
cd build/web && printf "y" | ./build.sh continuous
|
cd build/web && printf "y" | ./build.sh continuous
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: filament-web
|
name: filament-web
|
||||||
path: out/filament-release-web.tgz
|
path: out/filament-release-web.tgz
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
name: build-windows
|
name: build-windows
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019-32core
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.3.0
|
- uses: actions/checkout@v4.1.6
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
build\windows\build-github.bat continuous
|
build\windows\build-github.bat continuous
|
||||||
shell: cmd
|
shell: cmd
|
||||||
- uses: actions/upload-artifact@v1.0.0
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: filament-windows
|
name: filament-windows
|
||||||
path: out/filament-windows.tgz
|
path: out/filament-windows.tgz
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ The following CMake options are boolean options specific to Filament:
|
|||||||
- `FILAMENT_SUPPORTS_VULKAN`: Include the Vulkan backend
|
- `FILAMENT_SUPPORTS_VULKAN`: Include the Vulkan backend
|
||||||
- `FILAMENT_INSTALL_BACKEND_TEST`: Install the backend test library so it can be consumed on iOS
|
- `FILAMENT_INSTALL_BACKEND_TEST`: Install the backend test library so it can be consumed on iOS
|
||||||
- `FILAMENT_USE_EXTERNAL_GLES3`: Experimental: Compile Filament against OpenGL ES 3
|
- `FILAMENT_USE_EXTERNAL_GLES3`: Experimental: Compile Filament against OpenGL ES 3
|
||||||
- `FILAMENT_USE_SWIFTSHADER`: Compile Filament against SwiftShader
|
|
||||||
- `FILAMENT_SKIP_SAMPLES`: Don't build sample apps
|
- `FILAMENT_SKIP_SAMPLES`: Don't build sample apps
|
||||||
|
|
||||||
To turn an option on or off:
|
To turn an option on or off:
|
||||||
@@ -357,7 +356,7 @@ same version that our continuous builds use.
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd <your chosen parent folder for the emscripten SDK>
|
cd <your chosen parent folder for the emscripten SDK>
|
||||||
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.15.zip > emsdk.zip
|
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.60.zip > emsdk.zip
|
||||||
unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk
|
unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk
|
||||||
python ./emsdk.py install latest
|
python ./emsdk.py install latest
|
||||||
python ./emsdk.py activate latest
|
python ./emsdk.py activate latest
|
||||||
@@ -426,7 +425,7 @@ value is the desired roughness between 0 and 1.
|
|||||||
|
|
||||||
## Generating C++ documentation
|
## Generating C++ documentation
|
||||||
|
|
||||||
To generate the documentation you must first install `doxygen` and `graphviz`, then run the
|
To generate the documentation you must first install `doxygen` and `graphviz`, then run the
|
||||||
following commands:
|
following commands:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -436,32 +435,62 @@ doxygen docs/doxygen/filament.doxygen
|
|||||||
|
|
||||||
Finally simply open `docs/html/index.html` in your web browser.
|
Finally simply open `docs/html/index.html` in your web browser.
|
||||||
|
|
||||||
## SwiftShader
|
## Software Rasterization
|
||||||
|
|
||||||
To try out Filament's Vulkan support with SwiftShader, first build SwiftShader and set the
|
We have tested swiftshader and Mesa for software rasterization on the Vulkan/GL backends.
|
||||||
`SWIFTSHADER_LD_LIBRARY_PATH` variable to the folder that contains `libvk_swiftshader.dylib`:
|
|
||||||
|
To use this for Vulkan, please first make sure that the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) is
|
||||||
|
installed on your machine. If you are doing a manual installation of the SDK on Linux, you will have
|
||||||
|
to source `setup-env.sh` in the SDK's root folder to make sure the Vulkan loader is the first lib loaded.
|
||||||
|
|
||||||
|
### Swiftshader (Vulkan) [tested on macOS and Linux]
|
||||||
|
|
||||||
|
First, build SwiftShader
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/google/swiftshader.git
|
git clone https://github.com/google/swiftshader.git
|
||||||
cd swiftshader/build
|
cd swiftshader/build
|
||||||
cmake .. && make -j
|
cmake .. && make -j
|
||||||
export SWIFTSHADER_LD_LIBRARY_PATH=`pwd`
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, go to your Filament repo and use the [easy build](#easy-build) script with `-t`.
|
and then set `VK_ICD_FILENAMES` to the ICD json produced in the build. For example,
|
||||||
|
```shell
|
||||||
|
export VK_ICD_FILENAMES=/Users/user/swiftshader/build/Darwin/vk_swiftshader_icd.json
|
||||||
|
```
|
||||||
|
|
||||||
## SwiftShader for CI
|
Build and run Filament as usual and specify the Vulkan backend when creating the Engine.
|
||||||
|
|
||||||
Continuous testing turnaround can be quite slow if you need to build SwiftShader from scratch, so we
|
### Mesa's LLVMPipe (GL) and Lavapipe (Vulkan) [tested on Linux]
|
||||||
provide an Ubuntu-based Docker image that has it already built. The Docker image also includes
|
|
||||||
everything necessary for building Filament. You can fetch and run the image as follows:
|
We will only cover steps that build Mesa from source. The official documentation of Mesa mentioned
|
||||||
|
that in general precompiled libraries [are **not** made available](https://docs.mesa3d.org/precompiled.html).
|
||||||
|
|
||||||
|
Download the repo and make sure you have the build depedencies. For example (assuming an Ubuntu/Debian distro),
|
||||||
|
```shell
|
||||||
|
git clone https://gitlab.freedesktop.org/mesa/mesa.git
|
||||||
|
sudo apt-get build-dep mesa
|
||||||
|
```
|
||||||
|
|
||||||
|
To build both the GL and Vulkan rasterizers,
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker pull ghcr.io/filament-assets/swiftshader
|
cd mesa
|
||||||
docker run -it ghcr.io/filament-assets/swiftshader
|
mkdir -p out
|
||||||
|
meson setup builddir/ -Dprefix=$(pwd)/out -Dglx=xlib -Dgallium-drivers=swrast -Dvulkan-drivers=swrast
|
||||||
|
meson install -C builddir/
|
||||||
```
|
```
|
||||||
|
|
||||||
To do more with the container, see the helper script at `build/swiftshader/test.sh`.
|
For GL, we need to ensure that we load the GL lib from the mesa output directory. For example, to run
|
||||||
|
the debug `gltf_viewer`, we would execute
|
||||||
|
```shell
|
||||||
|
LD_LIBRARY_PATH=/Users/user/mesa/out/lib/x86_64-linux-gnu \
|
||||||
|
./out/cmake-debug/samples/gltf_viewer -a opengl
|
||||||
|
```
|
||||||
|
|
||||||
If you are a team member, you can update the public image to the latest SwiftShader by
|
For Vulkan, we need to set the path to the ICD json, which tells the loader where to find the driver
|
||||||
following the instructions at the top of `build/swiftshader/Dockerfile`.
|
library. To run `gltf_viewer`, we would execute
|
||||||
|
```shell
|
||||||
|
VK_ICD_FILENAMES=/Users/user/mesa/out/share/vulkan/icd.d/lvp_icd.x86_64.json \
|
||||||
|
./out/cmake-debug/samples/gltf_viewer -a vulkan
|
||||||
|
|
||||||
|
```
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ project(TNT)
|
|||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
option(FILAMENT_USE_EXTERNAL_GLES3 "Experimental: Compile Filament against OpenGL ES 3" OFF)
|
option(FILAMENT_USE_EXTERNAL_GLES3 "Experimental: Compile Filament against OpenGL ES 3" OFF)
|
||||||
|
|
||||||
option(FILAMENT_USE_SWIFTSHADER "Compile Filament against SwiftShader" OFF)
|
|
||||||
|
|
||||||
option(FILAMENT_ENABLE_LTO "Enable link-time optimizations if supported by the compiler" OFF)
|
option(FILAMENT_ENABLE_LTO "Enable link-time optimizations if supported by the compiler" OFF)
|
||||||
|
|
||||||
option(FILAMENT_SKIP_SAMPLES "Don't build samples" OFF)
|
option(FILAMENT_SKIP_SAMPLES "Don't build samples" OFF)
|
||||||
@@ -47,6 +45,8 @@ option(FILAMENT_ENABLE_FEATURE_LEVEL_0 "Enable Feature Level 0" ON)
|
|||||||
|
|
||||||
option(FILAMENT_ENABLE_MULTIVIEW "Enable multiview for Filament" OFF)
|
option(FILAMENT_ENABLE_MULTIVIEW "Enable multiview for Filament" OFF)
|
||||||
|
|
||||||
|
option(FILAMENT_SUPPORTS_OSMESA "Enable OSMesa (headless GL context) for Filament" OFF)
|
||||||
|
|
||||||
set(FILAMENT_NDK_VERSION "" CACHE STRING
|
set(FILAMENT_NDK_VERSION "" CACHE STRING
|
||||||
"Android NDK version or version prefix to be used when building for Android."
|
"Android NDK version or version prefix to be used when building for Android."
|
||||||
)
|
)
|
||||||
@@ -71,6 +71,14 @@ set(FILAMENT_METAL_HANDLE_ARENA_SIZE_IN_MB "8" CACHE STRING
|
|||||||
"Size of the Metal handle arena, default 8."
|
"Size of the Metal handle arena, default 8."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(FILAMENT_BACKEND_DEBUG_FLAG "" CACHE STRING
|
||||||
|
"A debug flag meant for enabling/disabling backend debugging paths"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(FILAMENT_OSMESA_PATH "" CACHE STRING
|
||||||
|
"Path to the OSMesa header and lib"
|
||||||
|
)
|
||||||
|
|
||||||
# Enable exceptions by default in spirv-cross.
|
# Enable exceptions by default in spirv-cross.
|
||||||
set(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS OFF)
|
set(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS OFF)
|
||||||
|
|
||||||
@@ -130,22 +138,27 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LINUX)
|
if (LINUX)
|
||||||
|
if (NOT FILAMENT_OSMESA_PATH STREQUAL "")
|
||||||
|
if (NOT EXISTS ${FILAMENT_OSMESA_PATH}/)
|
||||||
|
message(FATAL_ERROR "Cannot find specified OSMesa build directory: ${FILAMENT_OSMESA_PATH}")
|
||||||
|
endif()
|
||||||
|
set(FILAMENT_SUPPORTS_OSMESA TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (FILAMENT_SUPPORTS_WAYLAND)
|
if (FILAMENT_SUPPORTS_WAYLAND)
|
||||||
add_definitions(-DFILAMENT_SUPPORTS_WAYLAND)
|
add_definitions(-DFILAMENT_SUPPORTS_WAYLAND)
|
||||||
set(FILAMENT_SUPPORTS_X11 FALSE)
|
set(FILAMENT_SUPPORTS_X11 FALSE)
|
||||||
elseif (FILAMENT_SUPPORTS_EGL_ON_LINUX)
|
elseif (FILAMENT_SUPPORTS_EGL_ON_LINUX)
|
||||||
add_definitions(-DFILAMENT_SUPPORTS_EGL_ON_LINUX)
|
add_definitions(-DFILAMENT_SUPPORTS_EGL_ON_LINUX)
|
||||||
set(FILAMENT_SUPPORTS_X11 FALSE)
|
set(FILAMENT_SUPPORTS_X11 FALSE)
|
||||||
|
elseif (FILAMENT_SUPPORTS_OSMESA)
|
||||||
|
set(FILAMENT_SUPPORTS_X11 FALSE)
|
||||||
|
add_definitions(-DFILAMENT_SUPPORTS_OSMESA)
|
||||||
else ()
|
else ()
|
||||||
if (FILAMENT_SUPPORTS_XCB)
|
if (FILAMENT_SUPPORTS_XCB)
|
||||||
add_definitions(-DFILAMENT_SUPPORTS_XCB)
|
add_definitions(-DFILAMENT_SUPPORTS_XCB)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Default Swiftshader build does not enable the xlib extension
|
|
||||||
if (FILAMENT_SUPPORTS_XLIB AND FILAMENT_USE_SWIFTSHADER)
|
|
||||||
set(FILAMENT_SUPPORTS_XLIB OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (FILAMENT_SUPPORTS_XLIB)
|
if (FILAMENT_SUPPORTS_XLIB)
|
||||||
add_definitions(-DFILAMENT_SUPPORTS_XLIB)
|
add_definitions(-DFILAMENT_SUPPORTS_XLIB)
|
||||||
endif()
|
endif()
|
||||||
@@ -169,15 +182,6 @@ if (NOT ANDROID AND NOT WEBGL AND NOT IOS AND NOT FILAMENT_LINUX_IS_MOBILE)
|
|||||||
set(IS_HOST_PLATFORM TRUE)
|
set(IS_HOST_PLATFORM TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (IOS)
|
|
||||||
# Remove the headerpad_max_install_names linker flag on iOS. It causes warnings when linking
|
|
||||||
# executables with bitcode.
|
|
||||||
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
|
|
||||||
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS})
|
|
||||||
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
|
||||||
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# Link statically against c/c++ lib to avoid missing redistriburable such as
|
# Link statically against c/c++ lib to avoid missing redistriburable such as
|
||||||
# "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users
|
# "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users
|
||||||
@@ -332,10 +336,6 @@ if (FILAMENT_SUPPORTS_EGL_ON_LINUX)
|
|||||||
set(EGL TRUE)
|
set(EGL TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (FILAMENT_USE_SWIFTSHADER)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFILAMENT_USE_SWIFTSHADER")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES=1")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES=1")
|
||||||
endif()
|
endif()
|
||||||
@@ -389,8 +389,9 @@ endif()
|
|||||||
if (NOT MSVC AND NOT IOS)
|
if (NOT MSVC AND NOT IOS)
|
||||||
# Omitting stack frame pointers prevents the generation of readable stack traces in crash reports on iOS
|
# Omitting stack frame pointers prevents the generation of readable stack traces in crash reports on iOS
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
|
||||||
|
endif()
|
||||||
|
|
||||||
# These aren't compatible with -fembed-bitcode (and seem to have no effect on Apple platforms anyway)
|
if (NOT MSVC)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -455,8 +456,22 @@ endif()
|
|||||||
if (NOT WEBGL)
|
if (NOT WEBGL)
|
||||||
set(GC_SECTIONS "-Wl,--gc-sections")
|
set(GC_SECTIONS "-Wl,--gc-sections")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Prevents stacks from being made for executable by explicitly adding this linker flag. Otherwise,
|
||||||
|
# it generates warnings newly introduced as of GNU LD 2.39. Modern security practices strongly
|
||||||
|
# recommend marking the stack as non-executable using the -z noexecstack linker flag to prevent
|
||||||
|
# stack-based buffer overflow exploits.
|
||||||
|
# See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ffcf9c5700e49c0aee42dcba9a12ba21338e8136
|
||||||
|
if (LINUX)
|
||||||
|
set(NO_EXEC_STACK "-Wl,-z,noexecstack")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(B_SYMBOLIC_FUNCTIONS "-Wl,-Bsymbolic-functions")
|
set(B_SYMBOLIC_FUNCTIONS "-Wl,-Bsymbolic-functions")
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
set(BINARY_ALIGNMENT "-Wl,-z,max-page-size=16384")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(GC_SECTIONS "-Wl,-dead_strip")
|
set(GC_SECTIONS "-Wl,-dead_strip")
|
||||||
set(B_SYMBOLIC_FUNCTIONS "")
|
set(B_SYMBOLIC_FUNCTIONS "")
|
||||||
@@ -469,8 +484,8 @@ if (APPLE)
|
|||||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qc -S <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qc -S <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GC_SECTIONS}")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GC_SECTIONS} ${NO_EXEC_STACK}")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GC_SECTIONS} ${B_SYMBOLIC_FUNCTIONS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GC_SECTIONS} ${B_SYMBOLIC_FUNCTIONS} ${BINARY_ALIGNMENT}")
|
||||||
|
|
||||||
if (WEBGL_PTHREADS)
|
if (WEBGL_PTHREADS)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
|
||||||
@@ -519,11 +534,14 @@ else()
|
|||||||
option(FILAMENT_BUILD_FILAMAT "Build filamat and JNI buildings" OFF)
|
option(FILAMENT_BUILD_FILAMAT "Build filamat and JNI buildings" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# By default, link in matdbg for Desktop + Debug only since it pulls in filamat and a web server.
|
# By default, link in matdbg/fgviewer for Desktop + Debug only since it pulls in filamat and a web server.
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND IS_HOST_PLATFORM)
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND IS_HOST_PLATFORM)
|
||||||
option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" ON)
|
option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" ON)
|
||||||
|
# TODO: Uncomment below when fgviewer is ready
|
||||||
|
# option(FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" ON)
|
||||||
else()
|
else()
|
||||||
option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" OFF)
|
option(FILAMENT_ENABLE_MATDBG "Enable the material debugger" OFF)
|
||||||
|
option(FILAMENT_ENABLE_FGVIEWER "Enable the frame graph viewer" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Only optimize materials in Release mode (so error message lines match the source code)
|
# Only optimize materials in Release mode (so error message lines match the source code)
|
||||||
@@ -534,13 +552,15 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# This only affects the prebuilt shader files in gltfio and samples, not filament library.
|
# This only affects the prebuilt shader files in gltfio and samples, not filament library.
|
||||||
# The value can be either "instanced" or "multiview".
|
# The value can be either "instanced", "multiview", or "none"
|
||||||
set(FILAMENT_SAMPLES_STEREO_TYPE "instanced" CACHE STRING
|
set(FILAMENT_SAMPLES_STEREO_TYPE "none" CACHE STRING
|
||||||
"Stereoscopic type that shader files in gltfio and samples are built for."
|
"Stereoscopic type that shader files in gltfio and samples are built for."
|
||||||
)
|
)
|
||||||
string(TOLOWER "${FILAMENT_SAMPLES_STEREO_TYPE}" FILAMENT_SAMPLES_STEREO_TYPE)
|
string(TOLOWER "${FILAMENT_SAMPLES_STEREO_TYPE}" FILAMENT_SAMPLES_STEREO_TYPE)
|
||||||
if (NOT FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "instanced" AND NOT FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "multiview")
|
if (NOT FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "instanced"
|
||||||
message(FATAL_ERROR "Invalid stereo type: \"${FILAMENT_SAMPLES_STEREO_TYPE}\" choose either \"instanced\" or \"multiview\" ")
|
AND NOT FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "multiview"
|
||||||
|
AND NOT FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "none")
|
||||||
|
message(FATAL_ERROR "Invalid stereo type: \"${FILAMENT_SAMPLES_STEREO_TYPE}\" choose either \"instanced\", \"multiview\", or \"none\" ")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Compiling samples for multiview implies enabling multiview feature as well.
|
# Compiling samples for multiview implies enabling multiview feature as well.
|
||||||
@@ -548,6 +568,12 @@ if (FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "multiview")
|
|||||||
set(FILAMENT_ENABLE_MULTIVIEW ON)
|
set(FILAMENT_ENABLE_MULTIVIEW ON)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Define backend flag for debug only
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT FILAMENT_BACKEND_DEBUG_FLAG STREQUAL "")
|
||||||
|
add_definitions(-DFILAMENT_BACKEND_DEBUG_FLAG=${FILAMENT_BACKEND_DEBUG_FLAG})
|
||||||
|
unset(FILAMENT_BACKEND_DEBUG_FLAG)
|
||||||
|
endif()
|
||||||
|
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
# Material compilation flags
|
# Material compilation flags
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
@@ -641,10 +667,6 @@ function(list_licenses OUTPUT MODULES)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
set(COMBINE_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/build/linux/combine-static-libs.sh")
|
set(COMBINE_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/build/linux/combine-static-libs.sh")
|
||||||
if (WIN32)
|
|
||||||
set(COMBINE_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/build/windows/combine-static-libs.bat")
|
|
||||||
set(CMAKE_AR "lib.exe")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Add a custom command to TARGET that combines the static libraries in DEPS into a single archive.
|
# Add a custom command to TARGET that combines the static libraries in DEPS into a single archive.
|
||||||
function(combine_static_libs TARGET OUTPUT DEPS)
|
function(combine_static_libs TARGET OUTPUT DEPS)
|
||||||
@@ -659,12 +681,22 @@ function(combine_static_libs TARGET OUTPUT DEPS)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_command(
|
if (WIN32)
|
||||||
TARGET ${TARGET} POST_BUILD
|
add_custom_command(
|
||||||
COMMAND "${COMBINE_SCRIPT}" "${CMAKE_AR}" "${OUTPUT}" ${DEPS_FILES}
|
TARGET ${TARGET} POST_BUILD
|
||||||
COMMENT "Combining ${target} dependencies into single shared library"
|
COMMAND lib.exe /nologo /out:temp.lib ${DEPS_FILES}
|
||||||
VERBATIM
|
COMMAND "${CMAKE_COMMAND}" -E rename temp.lib ${OUTPUT}
|
||||||
)
|
COMMENT "Combining ${target} dependencies into single shared library"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${TARGET} POST_BUILD
|
||||||
|
COMMAND "${COMBINE_SCRIPT}" "${CMAKE_AR}" "${OUTPUT}" ${DEPS_FILES}
|
||||||
|
COMMENT "Combining ${target} dependencies into single shared library"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
@@ -676,21 +708,6 @@ else()
|
|||||||
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${CMAKE_BUILD_TYPE}.cmake)
|
set(IMPORT_EXECUTABLES ${FILAMENT}/${IMPORT_EXECUTABLES_DIR}/ImportExecutables-${CMAKE_BUILD_TYPE}.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ==================================================================================================
|
|
||||||
# Try to find Vulkan if the SDK is installed, otherwise fall back to the bundled version.
|
|
||||||
# This needs to stay in our top-level CMakeLists because it sets up variables that are used by the
|
|
||||||
# "bluevk" and "samples" targets.
|
|
||||||
# ==================================================================================================
|
|
||||||
|
|
||||||
if (FILAMENT_USE_SWIFTSHADER)
|
|
||||||
if (NOT FILAMENT_SUPPORTS_VULKAN)
|
|
||||||
message(ERROR "SwiftShader is only useful when Vulkan is enabled.")
|
|
||||||
endif()
|
|
||||||
find_library(SWIFTSHADER_VK NAMES vk_swiftshader HINTS "$ENV{SWIFTSHADER_LD_LIBRARY_PATH}")
|
|
||||||
message(STATUS "Found SwiftShader VK library in: ${SWIFTSHADER_VK}.")
|
|
||||||
add_definitions(-DFILAMENT_VKLIBRARY_PATH=\"${SWIFTSHADER_VK}\")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
# Common Functions
|
# Common Functions
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
@@ -750,9 +767,9 @@ add_subdirectory(${LIBRARIES}/utils)
|
|||||||
add_subdirectory(${LIBRARIES}/viewer)
|
add_subdirectory(${LIBRARIES}/viewer)
|
||||||
add_subdirectory(${FILAMENT}/filament)
|
add_subdirectory(${FILAMENT}/filament)
|
||||||
add_subdirectory(${FILAMENT}/shaders)
|
add_subdirectory(${FILAMENT}/shaders)
|
||||||
|
add_subdirectory(${EXTERNAL}/abseil/tnt)
|
||||||
add_subdirectory(${EXTERNAL}/basisu/tnt)
|
add_subdirectory(${EXTERNAL}/basisu/tnt)
|
||||||
add_subdirectory(${EXTERNAL}/civetweb/tnt)
|
add_subdirectory(${EXTERNAL}/civetweb/tnt)
|
||||||
add_subdirectory(${EXTERNAL}/hat-trie/tnt)
|
|
||||||
add_subdirectory(${EXTERNAL}/imgui/tnt)
|
add_subdirectory(${EXTERNAL}/imgui/tnt)
|
||||||
add_subdirectory(${EXTERNAL}/robin-map/tnt)
|
add_subdirectory(${EXTERNAL}/robin-map/tnt)
|
||||||
add_subdirectory(${EXTERNAL}/smol-v/tnt)
|
add_subdirectory(${EXTERNAL}/smol-v/tnt)
|
||||||
@@ -780,6 +797,11 @@ if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM)
|
|||||||
if (FILAMENT_ENABLE_MATDBG OR IS_HOST_PLATFORM)
|
if (FILAMENT_ENABLE_MATDBG OR IS_HOST_PLATFORM)
|
||||||
add_subdirectory(${LIBRARIES}/matdbg)
|
add_subdirectory(${LIBRARIES}/matdbg)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# TODO: Uncomment below when fgviewer is ready
|
||||||
|
# if (FILAMENT_ENABLE_FGVIEWER OR IS_HOST_PLATFORM)
|
||||||
|
# add_subdirectory(${LIBRARIES}/fgviewer)
|
||||||
|
# endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (FILAMENT_SUPPORTS_VULKAN)
|
if (FILAMENT_SUPPORTS_VULKAN)
|
||||||
@@ -819,6 +841,9 @@ if (IS_HOST_PLATFORM)
|
|||||||
add_subdirectory(${TOOLS}/glslminifier)
|
add_subdirectory(${TOOLS}/glslminifier)
|
||||||
add_subdirectory(${TOOLS}/matc)
|
add_subdirectory(${TOOLS}/matc)
|
||||||
add_subdirectory(${TOOLS}/matinfo)
|
add_subdirectory(${TOOLS}/matinfo)
|
||||||
|
if (NOT WIN32) # matedit not yet supported on Windows
|
||||||
|
add_subdirectory(${TOOLS}/matedit)
|
||||||
|
endif()
|
||||||
add_subdirectory(${TOOLS}/mipgen)
|
add_subdirectory(${TOOLS}/mipgen)
|
||||||
add_subdirectory(${TOOLS}/normal-blending)
|
add_subdirectory(${TOOLS}/normal-blending)
|
||||||
add_subdirectory(${TOOLS}/resgen)
|
add_subdirectory(${TOOLS}/resgen)
|
||||||
|
|||||||
@@ -121,9 +121,21 @@ private:
|
|||||||
- other headers are sorted in reverse order of their layering, that is, lower layer headers last
|
- other headers are sorted in reverse order of their layering, that is, lower layer headers last
|
||||||
- within a layer, headers are sorted alphabetically
|
- within a layer, headers are sorted alphabetically
|
||||||
- strive for implementing one class per file
|
- strive for implementing one class per file
|
||||||
- `STL` limited in public headers to:
|
- `STL` limited in **filament** public headers to:
|
||||||
- `type_traits`
|
- `array`
|
||||||
|
- `initializer_list`
|
||||||
|
- `iterator`
|
||||||
- `limits`
|
- `limits`
|
||||||
|
- `optional`
|
||||||
|
- `type_traits`
|
||||||
|
- `utility`
|
||||||
|
- `variant`
|
||||||
|
|
||||||
|
For **libfilament** the rule of thumb is that STL headers that don't generate code are allowed (e.g. `type_traits`),
|
||||||
|
conversely containers and algorithms are not allowed. There are exceptions such as `array`. See above for the full list.
|
||||||
|
- The following `STL` headers are banned entirely, from public and private headers as well as implementation files:
|
||||||
|
- `iostream`
|
||||||
|
|
||||||
|
|
||||||
*Sorting the headers is important to help catching missing `#include` directives.*
|
*Sorting the headers is important to help catching missing `#include` directives.*
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,5 @@ for next branch cut* header.
|
|||||||
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
|
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
|
||||||
|
|
||||||
## Release notes for next branch cut
|
## Release notes for next branch cut
|
||||||
|
|
||||||
|
- Support including PlatformMetal.h in C++ files.
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.google.android.filament:filament-android:1.51.2'
|
implementation 'com.google.android.filament:filament-android:1.57.0'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -51,19 +51,9 @@ Here are all the libraries available in the group `com.google.android.filament`:
|
|||||||
iOS projects can use CocoaPods to install the latest release:
|
iOS projects can use CocoaPods to install the latest release:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pod 'Filament', '~> 1.51.2'
|
pod 'Filament', '~> 1.57.0'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Snapshots
|
|
||||||
|
|
||||||
If you prefer to live on the edge, you can download a continuous build by following the following
|
|
||||||
steps:
|
|
||||||
|
|
||||||
1. Find the [commit](https://github.com/google/filament/commits/main) you're interested in.
|
|
||||||
2. Click the green check mark under the commit message.
|
|
||||||
3. Click on the _Details_ link for the platform you're interested in.
|
|
||||||
4. On the top left click _Summary_, then in the _Artifacts_ section choose the desired artifact.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
- [Filament](https://google.github.io/filament/Filament.html), an in-depth explanation of
|
- [Filament](https://google.github.io/filament/Filament.html), an in-depth explanation of
|
||||||
@@ -176,6 +166,7 @@ steps:
|
|||||||
- [x] KHR_materials_unlit
|
- [x] KHR_materials_unlit
|
||||||
- [x] KHR_materials_variants
|
- [x] KHR_materials_variants
|
||||||
- [x] KHR_materials_volume
|
- [x] KHR_materials_volume
|
||||||
|
- [x] KHR_materials_specular
|
||||||
- [x] KHR_mesh_quantization
|
- [x] KHR_mesh_quantization
|
||||||
- [x] KHR_texture_basisu
|
- [x] KHR_texture_basisu
|
||||||
- [x] KHR_texture_transform
|
- [x] KHR_texture_transform
|
||||||
|
|||||||
@@ -7,6 +7,134 @@ A new header is inserted each time a *tag* is created.
|
|||||||
Instead, if you are authoring a PR for the main branch, add your release note to
|
Instead, if you are authoring a PR for the main branch, add your release note to
|
||||||
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
|
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
|
||||||
|
|
||||||
|
## v1.57.1
|
||||||
|
|
||||||
|
|
||||||
|
## v1.57.0
|
||||||
|
|
||||||
|
- matdbg: Add support for debugging ESSL 1.0 shaders
|
||||||
|
- backend: New platform API to better handle external textures [⚠️ **New Material Version**]
|
||||||
|
|
||||||
|
## v1.56.8
|
||||||
|
|
||||||
|
|
||||||
|
## v1.56.7
|
||||||
|
|
||||||
|
|
||||||
|
## v1.56.6
|
||||||
|
|
||||||
|
fix crash: the 'target_node' of Animation Channel may be nullpointer.
|
||||||
|
|
||||||
|
## v1.56.5
|
||||||
|
|
||||||
|
|
||||||
|
## v1.56.4
|
||||||
|
|
||||||
|
|
||||||
|
## v1.56.3
|
||||||
|
|
||||||
|
|
||||||
|
## v1.56.2
|
||||||
|
|
||||||
|
- vk: fix stage pool gc logic
|
||||||
|
|
||||||
|
## v1.56.1
|
||||||
|
|
||||||
|
## v1.56.0
|
||||||
|
|
||||||
|
- backend: descriptor layouts distinguish samplers and external samplers (b/376089915) [⚠️ **New Material Version**]
|
||||||
|
|
||||||
|
## v1.55.1
|
||||||
|
|
||||||
|
|
||||||
|
## v1.55.0
|
||||||
|
- Add descriptor sets to describe shader resources. [⚠️ **New Material Version**]
|
||||||
|
|
||||||
|
## v1.54.5
|
||||||
|
|
||||||
|
|
||||||
|
## v1.54.4
|
||||||
|
|
||||||
|
- Add support for multi-layered render target with array textures.
|
||||||
|
|
||||||
|
## v1.54.3
|
||||||
|
|
||||||
|
|
||||||
|
## v1.54.2
|
||||||
|
|
||||||
|
- Add a `name` API to Filament objects for debugging handle use-after-free assertions
|
||||||
|
|
||||||
|
## v1.54.1
|
||||||
|
|
||||||
|
|
||||||
|
## v1.54.0
|
||||||
|
|
||||||
|
- materials: add a new `stereoscopicType` material parameter. [⚠️ **New Material Version**]
|
||||||
|
- Fix a crash when compiling shaders on IMG devices
|
||||||
|
|
||||||
|
## v1.53.5
|
||||||
|
|
||||||
|
- engine: Fix bug causing certain sampler parameters to not be applied correctly in GLES 2.0 and on
|
||||||
|
certain GLES 3.0 drivers.
|
||||||
|
|
||||||
|
## v1.53.4
|
||||||
|
|
||||||
|
|
||||||
|
## v1.53.3
|
||||||
|
|
||||||
|
- Add drag and drop support for IBL files for desktop gltf_viewer.
|
||||||
|
|
||||||
|
## v1.53.2
|
||||||
|
|
||||||
|
|
||||||
|
## v1.53.1
|
||||||
|
|
||||||
|
|
||||||
|
## v1.53.0
|
||||||
|
|
||||||
|
- engine: fix skinning normals with large transforms (b/342459864) [⚠️ **New Material Version**]
|
||||||
|
|
||||||
|
## v1.52.3
|
||||||
|
|
||||||
|
|
||||||
|
## v1.52.2
|
||||||
|
|
||||||
|
|
||||||
|
## v1.52.1
|
||||||
|
|
||||||
|
- Add instructions for using Mesa for software rasterization
|
||||||
|
|
||||||
|
## v1.51.9
|
||||||
|
|
||||||
|
|
||||||
|
## v1.51.8
|
||||||
|
|
||||||
|
- filagui: Fix regression which broke WebGL
|
||||||
|
- Add a new Engine::Config setting to control preferred shader language
|
||||||
|
- Add `getEyeIndex` vertex API
|
||||||
|
- ios: Remove bitcode from iOS builds
|
||||||
|
|
||||||
|
## v1.51.7
|
||||||
|
|
||||||
|
- Add new matedit tool
|
||||||
|
- filagui: Support rendering `GL_TEXTURE_EXTERNAL_OES` textures.
|
||||||
|
- `setFrameScheduledCallback` now takes a `utils::Invocable`.
|
||||||
|
- engine: Add `isPaused()`
|
||||||
|
|
||||||
|
## v1.51.6
|
||||||
|
|
||||||
|
- Add new matedit tool
|
||||||
|
- filagui: Support rendering `GL_TEXTURE_EXTERNAL_OES` textures.
|
||||||
|
|
||||||
|
## v1.51.5
|
||||||
|
|
||||||
|
|
||||||
|
## v1.51.4
|
||||||
|
|
||||||
|
|
||||||
|
## v1.51.3
|
||||||
|
|
||||||
|
|
||||||
## v1.51.2
|
## v1.51.2
|
||||||
|
|
||||||
- engine: Add experimental APIs `Engine::builder::paused()` and `Engine::setPaused()`
|
- engine: Add experimental APIs `Engine::builder::paused()` and `Engine::setPaused()`
|
||||||
@@ -563,7 +691,7 @@ Instead, if you are authoring a PR for the main branch, add your release note to
|
|||||||
|
|
||||||
- engine: Binary size improvements.
|
- engine: Binary size improvements.
|
||||||
- engine: Add basic support for instanced renderables [**NEW API**].
|
- engine: Add basic support for instanced renderables [**NEW API**].
|
||||||
- engine: Fix, first imaged passsed to `Stream::SetAcquiredImage` is ignored and leaked.
|
- engine: Fix, first imaged passed to `Stream::SetAcquiredImage` is ignored and leaked.
|
||||||
- Vulkan: Robustness improvements.
|
- Vulkan: Robustness improvements.
|
||||||
- Java: Fix, lookAt z axis negated.
|
- Java: Fix, lookAt z axis negated.
|
||||||
- gltfio: Be graceful when model has > 4 weights per vert.
|
- gltfio: Be graceful when model has > 4 weights per vert.
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
// com.google.android.filament.exclude-vulkan
|
// com.google.android.filament.exclude-vulkan
|
||||||
// When set, support for Vulkan will be excluded.
|
// When set, support for Vulkan will be excluded.
|
||||||
//
|
//
|
||||||
|
// com.google.android.filament.fgviewer
|
||||||
|
// When set, enables fgviewer
|
||||||
|
//
|
||||||
// com.google.android.filament.matdbg
|
// com.google.android.filament.matdbg
|
||||||
// When set, enables matdbg
|
// When set, enables matdbg
|
||||||
//
|
//
|
||||||
@@ -61,6 +64,11 @@ buildscript {
|
|||||||
.gradleProperty("com.google.android.filament.exclude-vulkan")
|
.gradleProperty("com.google.android.filament.exclude-vulkan")
|
||||||
.isPresent()
|
.isPresent()
|
||||||
|
|
||||||
|
// TODO: Uncomment below when fgviewer is ready
|
||||||
|
// def fgviewer = providers
|
||||||
|
// .gradleProperty("com.google.android.filament.fgviewer")
|
||||||
|
// .isPresent()
|
||||||
|
|
||||||
def matdbg = providers
|
def matdbg = providers
|
||||||
.gradleProperty("com.google.android.filament.matdbg")
|
.gradleProperty("com.google.android.filament.matdbg")
|
||||||
.isPresent()
|
.isPresent()
|
||||||
@@ -83,12 +91,12 @@ buildscript {
|
|||||||
'minSdk': 21,
|
'minSdk': 21,
|
||||||
'targetSdk': 34,
|
'targetSdk': 34,
|
||||||
'compileSdk': 34,
|
'compileSdk': 34,
|
||||||
'kotlin': '1.9.21',
|
'kotlin': '2.0.21',
|
||||||
'kotlin_coroutines': '1.7.3',
|
'kotlin_coroutines': '1.9.0',
|
||||||
'buildTools': '34.0.0',
|
'buildTools': '35.0.0',
|
||||||
'ndk': '26.1.10909125',
|
'ndk': '27.0.11718014',
|
||||||
'androidx_core': '1.12.0',
|
'androidx_core': '1.13.1',
|
||||||
'androidx_annotations': '1.7.0'
|
'androidx_annotations': '1.9.0'
|
||||||
]
|
]
|
||||||
|
|
||||||
ext.deps = [
|
ext.deps = [
|
||||||
@@ -104,7 +112,7 @@ buildscript {
|
|||||||
]
|
]
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.2.0'
|
classpath 'com.android.tools.build:gradle:8.6.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,6 +123,8 @@ buildscript {
|
|||||||
"-DANDROID_STL=c++_static",
|
"-DANDROID_STL=c++_static",
|
||||||
"-DFILAMENT_DIST_DIR=${filamentPath}".toString(),
|
"-DFILAMENT_DIST_DIR=${filamentPath}".toString(),
|
||||||
"-DFILAMENT_SUPPORTS_VULKAN=${excludeVulkan ? 'OFF' : 'ON'}".toString(),
|
"-DFILAMENT_SUPPORTS_VULKAN=${excludeVulkan ? 'OFF' : 'ON'}".toString(),
|
||||||
|
// TODO: Uncomment below when fgviewer is ready
|
||||||
|
// "-DFILAMENT_ENABLE_FGVIEWER=${fgviewer ? 'ON' : 'OFF'}".toString(),
|
||||||
"-DFILAMENT_ENABLE_MATDBG=${matdbg ? 'ON' : 'OFF'}".toString(),
|
"-DFILAMENT_ENABLE_MATDBG=${matdbg ? 'ON' : 'OFF'}".toString(),
|
||||||
"-DFILAMENT_DISABLE_MATOPT=${matnopt ? 'ON' : 'OFF'}".toString()
|
"-DFILAMENT_DISABLE_MATOPT=${matnopt ? 'ON' : 'OFF'}".toString()
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ set(FILAMAT_INCLUDE_DIRS
|
|||||||
include_directories(${FILAMENT_DIR}/include)
|
include_directories(${FILAMENT_DIR}/include)
|
||||||
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${CMAKE_SOURCE_DIR}/libfilamat-jni.map")
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${CMAKE_SOURCE_DIR}/libfilamat-jni.map")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
|
||||||
|
|
||||||
add_library(filamat-jni SHARED src/main/cpp/MaterialBuilder.cpp)
|
add_library(filamat-jni SHARED src/main/cpp/MaterialBuilder.cpp)
|
||||||
target_include_directories(filamat-jni PRIVATE ${FILAMAT_INCLUDE_DIRS})
|
target_include_directories(filamat-jni PRIVATE ${FILAMAT_INCLUDE_DIRS})
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.19)
|
|||||||
project(filament-android)
|
project(filament-android)
|
||||||
|
|
||||||
option(FILAMENT_SUPPORTS_VULKAN "Enables Vulkan on Android" OFF)
|
option(FILAMENT_SUPPORTS_VULKAN "Enables Vulkan on Android" OFF)
|
||||||
|
# TODO: Uncomment below when fgviewer is ready
|
||||||
|
# option(FILAMENT_ENABLE_FGVIEWER "Enables Frame Graph Viewer" OFF)
|
||||||
option(FILAMENT_ENABLE_MATDBG "Enables Material debugger" OFF)
|
option(FILAMENT_ENABLE_MATDBG "Enables Material debugger" OFF)
|
||||||
option(FILAMENT_DISABLE_MATOPT "Disables material optimizations" OFF)
|
option(FILAMENT_DISABLE_MATOPT "Disables material optimizations" OFF)
|
||||||
|
|
||||||
@@ -51,6 +53,13 @@ add_library(smol-v STATIC IMPORTED)
|
|||||||
set_target_properties(smol-v PROPERTIES IMPORTED_LOCATION
|
set_target_properties(smol-v PROPERTIES IMPORTED_LOCATION
|
||||||
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libsmol-v.a)
|
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libsmol-v.a)
|
||||||
|
|
||||||
|
# TODO: Uncomment below when fgviewer is ready
|
||||||
|
# if (FILAMENT_ENABLE_FGVIEWER)
|
||||||
|
# add_library(fgviewer STATIC IMPORTED)
|
||||||
|
# set_target_properties(fgviewer PROPERTIES IMPORTED_LOCATION
|
||||||
|
# ${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfgviewer.a)
|
||||||
|
# endif()
|
||||||
|
|
||||||
if (FILAMENT_ENABLE_MATDBG)
|
if (FILAMENT_ENABLE_MATDBG)
|
||||||
add_library(matdbg STATIC IMPORTED)
|
add_library(matdbg STATIC IMPORTED)
|
||||||
set_target_properties(matdbg PROPERTIES IMPORTED_LOCATION
|
set_target_properties(matdbg PROPERTIES IMPORTED_LOCATION
|
||||||
@@ -59,6 +68,7 @@ endif()
|
|||||||
|
|
||||||
set(VERSION_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/libfilament-jni.map")
|
set(VERSION_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/libfilament-jni.map")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${VERSION_SCRIPT}")
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${VERSION_SCRIPT}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
|
||||||
|
|
||||||
add_library(filament-jni SHARED
|
add_library(filament-jni SHARED
|
||||||
src/main/cpp/BufferObject.cpp
|
src/main/cpp/BufferObject.cpp
|
||||||
@@ -116,6 +126,8 @@ target_link_libraries(filament-jni
|
|||||||
# libgeometry is PUBLIC because gltfio uses it.
|
# libgeometry is PUBLIC because gltfio uses it.
|
||||||
PUBLIC geometry
|
PUBLIC geometry
|
||||||
|
|
||||||
|
# TODO: Uncomment below when fgviewer is ready
|
||||||
|
# $<$<STREQUAL:${FILAMENT_ENABLE_FGVIEWER},ON>:fgviewer>
|
||||||
$<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:matdbg>
|
$<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:matdbg>
|
||||||
$<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:filamat>
|
$<$<STREQUAL:${FILAMENT_ENABLE_MATDBG},ON>:filamat>
|
||||||
$<$<STREQUAL:${FILAMENT_SUPPORTS_VULKAN},ON>:bluevk>
|
$<$<STREQUAL:${FILAMENT_SUPPORTS_VULKAN},ON>:bluevk>
|
||||||
|
|||||||
@@ -342,6 +342,21 @@ Java_com_google_android_filament_Engine_nIsValidMaterial(JNIEnv*, jclass,
|
|||||||
return (jboolean)engine->isValid((Material*)nativeMaterial);
|
return (jboolean)engine->isValid((Material*)nativeMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nIsValidMaterialInstance(JNIEnv*, jclass,
|
||||||
|
jlong nativeEngine, jlong nativeMaterial, jlong nativeMaterialInstance) {
|
||||||
|
Engine* engine = (Engine *)nativeEngine;
|
||||||
|
return (jboolean)engine->isValid((Material*)nativeMaterial,
|
||||||
|
(MaterialInstance*)nativeMaterialInstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nIsValidExpensiveMaterialInstance(JNIEnv*, jclass,
|
||||||
|
jlong nativeEngine, jlong nativeMaterialInstance) {
|
||||||
|
Engine* engine = (Engine *)nativeEngine;
|
||||||
|
return (jboolean)engine->isValidExpensive((MaterialInstance*)nativeMaterialInstance);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jboolean JNICALL
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
Java_com_google_android_filament_Engine_nIsValidSkybox(JNIEnv*, jclass,
|
Java_com_google_android_filament_Engine_nIsValidSkybox(JNIEnv*, jclass,
|
||||||
jlong nativeEngine, jlong nativeSkybox) {
|
jlong nativeEngine, jlong nativeSkybox) {
|
||||||
@@ -377,11 +392,11 @@ Java_com_google_android_filament_Engine_nIsValidSwapChain(JNIEnv*, jclass,
|
|||||||
return (jboolean)engine->isValid((SwapChain*)nativeSwapChain);
|
return (jboolean)engine->isValid((SwapChain*)nativeSwapChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
Java_com_google_android_filament_Engine_nFlushAndWait(JNIEnv*, jclass,
|
Java_com_google_android_filament_Engine_nFlushAndWait(JNIEnv*, jclass,
|
||||||
jlong nativeEngine) {
|
jlong nativeEngine, jlong timeout) {
|
||||||
Engine* engine = (Engine*) nativeEngine;
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
engine->flushAndWait();
|
return engine->flushAndWait((uint64_t)timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
@@ -391,6 +406,13 @@ Java_com_google_android_filament_Engine_nFlush(JNIEnv*, jclass,
|
|||||||
engine->flush();
|
engine->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nIsPaused(JNIEnv*, jclass,
|
||||||
|
jlong nativeEngine) {
|
||||||
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
|
return (jboolean)engine->isPaused();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_google_android_filament_Engine_nSetPaused(JNIEnv*, jclass,
|
Java_com_google_android_filament_Engine_nSetPaused(JNIEnv*, jclass,
|
||||||
jlong nativeEngine, jboolean paused) {
|
jlong nativeEngine, jboolean paused) {
|
||||||
@@ -398,6 +420,13 @@ Java_com_google_android_filament_Engine_nSetPaused(JNIEnv*, jclass,
|
|||||||
engine->setPaused(paused);
|
engine->setPaused(paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nUnprotected(JNIEnv*, jclass,
|
||||||
|
jlong nativeEngine, jboolean paused) {
|
||||||
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
|
engine->unprotected();
|
||||||
|
}
|
||||||
|
|
||||||
// Managers...
|
// Managers...
|
||||||
|
|
||||||
extern "C" JNIEXPORT jlong JNICALL
|
extern "C" JNIEXPORT jlong JNICALL
|
||||||
@@ -470,6 +499,37 @@ Java_com_google_android_filament_Engine_nGetActiveFeatureLevel(JNIEnv *, jclass,
|
|||||||
return (jint)engine->getActiveFeatureLevel();
|
return (jint)engine->getActiveFeatureLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nHasFeatureFlag(JNIEnv *env, jclass clazz,
|
||||||
|
jlong nativeEngine, jstring name_) {
|
||||||
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
|
const char *name = env->GetStringUTFChars(name_, 0);
|
||||||
|
std::optional<bool> result = engine->getFeatureFlag(name);
|
||||||
|
env->ReleaseStringUTFChars(name_, name);
|
||||||
|
return result.has_value();
|
||||||
|
}
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nSetFeatureFlag(JNIEnv *env, jclass clazz,
|
||||||
|
jlong nativeEngine, jstring name_, jboolean value) {
|
||||||
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
|
const char *name = env->GetStringUTFChars(name_, 0);
|
||||||
|
jboolean result = engine->setFeatureFlag(name, (bool)value);
|
||||||
|
env->ReleaseStringUTFChars(name_, name);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nGetFeatureFlag(JNIEnv *env, jclass clazz,
|
||||||
|
jlong nativeEngine, jstring name_) {
|
||||||
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
|
const char *name = env->GetStringUTFChars(name_, 0);
|
||||||
|
std::optional<bool> result = engine->getFeatureFlag(name);
|
||||||
|
env->ReleaseStringUTFChars(name_, name);
|
||||||
|
return result.value_or(false); // we should never fail here
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jlong JNICALL Java_com_google_android_filament_Engine_nCreateBuilder(JNIEnv*,
|
extern "C" JNIEXPORT jlong JNICALL Java_com_google_android_filament_Engine_nCreateBuilder(JNIEnv*,
|
||||||
jclass) {
|
jclass) {
|
||||||
Engine::Builder* builder = new Engine::Builder{};
|
Engine::Builder* builder = new Engine::Builder{};
|
||||||
@@ -491,11 +551,12 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu
|
|||||||
extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBuilderConfig(JNIEnv*,
|
extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBuilderConfig(JNIEnv*,
|
||||||
jclass, jlong nativeBuilder, jlong commandBufferSizeMB, jlong perRenderPassArenaSizeMB,
|
jclass, jlong nativeBuilder, jlong commandBufferSizeMB, jlong perRenderPassArenaSizeMB,
|
||||||
jlong driverHandleArenaSizeMB, jlong minCommandBufferSizeMB, jlong perFrameCommandsSizeMB,
|
jlong driverHandleArenaSizeMB, jlong minCommandBufferSizeMB, jlong perFrameCommandsSizeMB,
|
||||||
jlong jobSystemThreadCount,
|
jlong jobSystemThreadCount, jboolean disableParallelShaderCompile,
|
||||||
jlong textureUseAfterFreePoolSize, jboolean disableParallelShaderCompile,
|
|
||||||
jint stereoscopicType, jlong stereoscopicEyeCount,
|
jint stereoscopicType, jlong stereoscopicEyeCount,
|
||||||
jlong resourceAllocatorCacheSizeMB, jlong resourceAllocatorCacheMaxAge,
|
jlong resourceAllocatorCacheSizeMB, jlong resourceAllocatorCacheMaxAge,
|
||||||
jboolean disableHandleUseAfterFreeCheck) {
|
jboolean disableHandleUseAfterFreeCheck,
|
||||||
|
jint preferredShaderLanguage,
|
||||||
|
jboolean forceGLES2Context, jboolean assertNativeWindowIsValid) {
|
||||||
Engine::Builder* builder = (Engine::Builder*) nativeBuilder;
|
Engine::Builder* builder = (Engine::Builder*) nativeBuilder;
|
||||||
Engine::Config config = {
|
Engine::Config config = {
|
||||||
.commandBufferSizeMB = (uint32_t) commandBufferSizeMB,
|
.commandBufferSizeMB = (uint32_t) commandBufferSizeMB,
|
||||||
@@ -504,13 +565,15 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu
|
|||||||
.minCommandBufferSizeMB = (uint32_t) minCommandBufferSizeMB,
|
.minCommandBufferSizeMB = (uint32_t) minCommandBufferSizeMB,
|
||||||
.perFrameCommandsSizeMB = (uint32_t) perFrameCommandsSizeMB,
|
.perFrameCommandsSizeMB = (uint32_t) perFrameCommandsSizeMB,
|
||||||
.jobSystemThreadCount = (uint32_t) jobSystemThreadCount,
|
.jobSystemThreadCount = (uint32_t) jobSystemThreadCount,
|
||||||
.textureUseAfterFreePoolSize = (uint32_t) textureUseAfterFreePoolSize,
|
|
||||||
.disableParallelShaderCompile = (bool) disableParallelShaderCompile,
|
.disableParallelShaderCompile = (bool) disableParallelShaderCompile,
|
||||||
.stereoscopicType = (Engine::StereoscopicType) stereoscopicType,
|
.stereoscopicType = (Engine::StereoscopicType) stereoscopicType,
|
||||||
.stereoscopicEyeCount = (uint8_t) stereoscopicEyeCount,
|
.stereoscopicEyeCount = (uint8_t) stereoscopicEyeCount,
|
||||||
.resourceAllocatorCacheSizeMB = (uint32_t) resourceAllocatorCacheSizeMB,
|
.resourceAllocatorCacheSizeMB = (uint32_t) resourceAllocatorCacheSizeMB,
|
||||||
.resourceAllocatorCacheMaxAge = (uint8_t) resourceAllocatorCacheMaxAge,
|
.resourceAllocatorCacheMaxAge = (uint8_t) resourceAllocatorCacheMaxAge,
|
||||||
.disableHandleUseAfterFreeCheck = (bool) disableHandleUseAfterFreeCheck,
|
.disableHandleUseAfterFreeCheck = (bool) disableHandleUseAfterFreeCheck,
|
||||||
|
.preferredShaderLanguage = (Engine::Config::ShaderLanguage) preferredShaderLanguage,
|
||||||
|
.forceGLES2Context = (bool) forceGLES2Context,
|
||||||
|
.assertNativeWindowIsValid = (bool) assertNativeWindowIsValid,
|
||||||
};
|
};
|
||||||
builder->config(&config);
|
builder->config(&config);
|
||||||
}
|
}
|
||||||
@@ -533,8 +596,24 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu
|
|||||||
builder->paused((bool) paused);
|
builder->paused((bool) paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_nSetBuilderFeature(JNIEnv *env, jclass clazz,
|
||||||
|
jlong nativeBuilder, jstring name_, jboolean value) {
|
||||||
|
Engine::Builder* builder = (Engine::Builder*) nativeBuilder;
|
||||||
|
const char *name = env->GetStringUTFChars(name_, 0);
|
||||||
|
builder->feature(name, (bool)value);
|
||||||
|
env->ReleaseStringUTFChars(name_, name);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jlong JNICALL
|
extern "C" JNIEXPORT jlong JNICALL
|
||||||
Java_com_google_android_filament_Engine_nBuilderBuild(JNIEnv*, jclass, jlong nativeBuilder) {
|
Java_com_google_android_filament_Engine_nBuilderBuild(JNIEnv*, jclass, jlong nativeBuilder) {
|
||||||
Engine::Builder* builder = (Engine::Builder*) nativeBuilder;
|
Engine::Builder* builder = (Engine::Builder*) nativeBuilder;
|
||||||
return (jlong) builder->build();
|
return (jlong) builder->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jlong JNICALL
|
||||||
|
Java_com_google_android_filament_Engine_getSteadyClockTimeNano(JNIEnv *env, jclass clazz) {
|
||||||
|
return (jlong)Engine::getSteadyClockTimeNano();
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Java_com_google_android_filament_EntityManager_nCreateArray(JNIEnv* env, jclass,
|
|||||||
// (which it is), but still.
|
// (which it is), but still.
|
||||||
em->create((size_t) n, reinterpret_cast<Entity *>(entities));
|
em->create((size_t) n, reinterpret_cast<Entity *>(entities));
|
||||||
|
|
||||||
env->ReleaseIntArrayElements(entities_, entities, JNI_ABORT);
|
env->ReleaseIntArrayElements(entities_, entities, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jint JNICALL
|
extern "C" JNIEXPORT jint JNICALL
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ Java_com_google_android_filament_IndirectLight_nGetDirectionEstimateStatic(JNIEn
|
|||||||
jfloat *outDirection = env->GetFloatArrayElements(outDirection_, NULL);
|
jfloat *outDirection = env->GetFloatArrayElements(outDirection_, NULL);
|
||||||
*reinterpret_cast<filament::math::float3*>(outDirection) = IndirectLight::getDirectionEstimate((filament::math::float3*)sh);
|
*reinterpret_cast<filament::math::float3*>(outDirection) = IndirectLight::getDirectionEstimate((filament::math::float3*)sh);
|
||||||
env->ReleaseFloatArrayElements(outDirection_, outDirection, 0);
|
env->ReleaseFloatArrayElements(outDirection_, outDirection, 0);
|
||||||
env->ReleaseFloatArrayElements(sh_, sh, JNI_ABORT);
|
env->ReleaseFloatArrayElements(sh_, sh, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
@@ -178,5 +178,5 @@ Java_com_google_android_filament_IndirectLight_nGetColorEstimateStatic(JNIEnv *e
|
|||||||
*reinterpret_cast<filament::math::float4*>(outColor) =
|
*reinterpret_cast<filament::math::float4*>(outColor) =
|
||||||
IndirectLight::getColorEstimate((filament::math::float3*)sh, math::float3{x, y, z});
|
IndirectLight::getColorEstimate((filament::math::float3*)sh, math::float3{x, y, z});
|
||||||
env->ReleaseFloatArrayElements(outColor_, outColor, 0);
|
env->ReleaseFloatArrayElements(outColor_, outColor, 0);
|
||||||
env->ReleaseFloatArrayElements(sh_, sh, JNI_ABORT);
|
env->ReleaseFloatArrayElements(sh_, sh, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,12 +25,18 @@ using namespace filament;
|
|||||||
|
|
||||||
extern "C" JNIEXPORT jlong JNICALL
|
extern "C" JNIEXPORT jlong JNICALL
|
||||||
Java_com_google_android_filament_Material_nBuilderBuild(JNIEnv *env, jclass,
|
Java_com_google_android_filament_Material_nBuilderBuild(JNIEnv *env, jclass,
|
||||||
jlong nativeEngine, jobject buffer_, jint size) {
|
jlong nativeEngine, jobject buffer_, jint size, jint shBandCount, jint shadowQuality) {
|
||||||
Engine* engine = (Engine*) nativeEngine;
|
Engine* engine = (Engine*) nativeEngine;
|
||||||
AutoBuffer buffer(env, buffer_, size);
|
AutoBuffer buffer(env, buffer_, size);
|
||||||
Material* material = Material::Builder()
|
auto builder = Material::Builder();
|
||||||
|
if (shBandCount) {
|
||||||
|
builder.sphericalHarmonicsBandCount(shBandCount);
|
||||||
|
}
|
||||||
|
builder.shadowSamplingQuality((Material::Builder::ShadowSamplingQuality)shadowQuality);
|
||||||
|
Material* material = builder
|
||||||
.package(buffer.getData(), buffer.getSize())
|
.package(buffer.getData(), buffer.getSize())
|
||||||
.build(*engine);
|
.build(*engine);
|
||||||
|
|
||||||
return (jlong) material;
|
return (jlong) material;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -329,6 +329,18 @@ Java_com_google_android_filament_MaterialInstance_nSetCullingMode(JNIEnv*,
|
|||||||
instance->setCullingMode((MaterialInstance::CullingMode) cullingMode);
|
instance->setCullingMode((MaterialInstance::CullingMode) cullingMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_MaterialInstance_nSetCullingModeSeparate(JNIEnv*, jclass,
|
||||||
|
jlong nativeMaterialInstance,
|
||||||
|
jlong colorPassCullingMode, jlong shadowPassCullingMode) {
|
||||||
|
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
|
||||||
|
instance->setCullingMode(
|
||||||
|
(MaterialInstance::CullingMode) colorPassCullingMode,
|
||||||
|
(MaterialInstance::CullingMode) shadowPassCullingMode);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_com_google_android_filament_MaterialInstance_nSetColorWrite(JNIEnv*,
|
Java_com_google_android_filament_MaterialInstance_nSetColorWrite(JNIEnv*,
|
||||||
@@ -505,6 +517,14 @@ Java_com_google_android_filament_MaterialInstance_nGetCullingMode(JNIEnv* env, j
|
|||||||
return (jint)instance->getCullingMode();
|
return (jint)instance->getCullingMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT jint JNICALL
|
||||||
|
Java_com_google_android_filament_MaterialInstance_nGetShadowCullingMode(JNIEnv* env, jclass,
|
||||||
|
jlong nativeMaterialInstance) {
|
||||||
|
MaterialInstance* instance = (MaterialInstance*)nativeMaterialInstance;
|
||||||
|
return (jint)instance->getShadowCullingMode();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jboolean JNICALL
|
JNIEXPORT jboolean JNICALL
|
||||||
Java_com_google_android_filament_MaterialInstance_nIsColorWriteEnabled(JNIEnv* env, jclass clazz,
|
Java_com_google_android_filament_MaterialInstance_nIsColorWriteEnabled(JNIEnv* env, jclass clazz,
|
||||||
|
|||||||
@@ -245,12 +245,18 @@ Java_com_google_android_filament_RenderableManager_nBuilderMorphing(JNIEnv*, jcl
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_google_android_filament_RenderableManager_nBuilderSetMorphTargetBufferAt(JNIEnv*, jclass,
|
Java_com_google_android_filament_RenderableManager_nBuilderMorphingStandard(JNIEnv*, jclass,
|
||||||
jlong nativeBuilder, int level, int primitiveIndex, jlong nativeMorphTargetBuffer,
|
jlong nativeBuilder, jlong nativeMorphTargetBuffer) {
|
||||||
int offset, int count) {
|
|
||||||
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
|
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
|
||||||
MorphTargetBuffer *morphTargetBuffer = (MorphTargetBuffer *) nativeMorphTargetBuffer;
|
MorphTargetBuffer *morphTargetBuffer = (MorphTargetBuffer *) nativeMorphTargetBuffer;
|
||||||
builder->morphing(level, primitiveIndex, morphTargetBuffer, offset, count);
|
builder->morphing(morphTargetBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_RenderableManager_nBuilderSetMorphTargetBufferOffsetAt(JNIEnv*, jclass,
|
||||||
|
jlong nativeBuilder, int level, int primitiveIndex, int offset) {
|
||||||
|
RenderableManager::Builder *builder = (RenderableManager::Builder *) nativeBuilder;
|
||||||
|
builder->morphing(level, primitiveIndex, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
@@ -322,13 +328,12 @@ Java_com_google_android_filament_RenderableManager_nSetMorphWeights(JNIEnv* env,
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_google_android_filament_RenderableManager_nSetMorphTargetBufferAt(JNIEnv*,
|
Java_com_google_android_filament_RenderableManager_nSetMorphTargetBufferOffsetAt(JNIEnv*,
|
||||||
jclass, jlong nativeRenderableManager, jint i, int level, jint primitiveIndex,
|
jclass, jlong nativeRenderableManager, jint i, int level, jint primitiveIndex,
|
||||||
jlong nativeMorphTargetBuffer, jint offset, jint count) {
|
jlong, jint offset) {
|
||||||
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||||
MorphTargetBuffer *morphTargetBuffer = (MorphTargetBuffer *) nativeMorphTargetBuffer;
|
rm->setMorphTargetBufferOffsetAt((RenderableManager::Instance) i, (uint8_t) level,
|
||||||
rm->setMorphTargetBufferAt((RenderableManager::Instance) i, (uint8_t) level,
|
(size_t) primitiveIndex, (size_t) offset);
|
||||||
(size_t) primitiveIndex, morphTargetBuffer, (size_t) offset, (size_t) count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jint JNICALL
|
extern "C" JNIEXPORT jint JNICALL
|
||||||
@@ -454,6 +459,13 @@ Java_com_google_android_filament_RenderableManager_nSetMaterialInstanceAt(JNIEnv
|
|||||||
materialInstance);
|
materialInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_RenderableManager_nClearMaterialInstanceAt(JNIEnv*, jclass,
|
||||||
|
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
|
||||||
|
RenderableManager *rm = (RenderableManager *) nativeRenderableManager;
|
||||||
|
rm->clearMaterialInstanceAt((RenderableManager::Instance) i, (size_t) primitiveIndex);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jlong JNICALL
|
extern "C" JNIEXPORT jlong JNICALL
|
||||||
Java_com_google_android_filament_RenderableManager_nGetMaterialInstanceAt(JNIEnv*, jclass,
|
Java_com_google_android_filament_RenderableManager_nGetMaterialInstanceAt(JNIEnv*, jclass,
|
||||||
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
|
jlong nativeRenderableManager, jint i, jint primitiveIndex) {
|
||||||
|
|||||||
@@ -28,6 +28,14 @@
|
|||||||
using namespace filament;
|
using namespace filament;
|
||||||
using namespace backend;
|
using namespace backend;
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_Renderer_nSkipFrame(JNIEnv *, jclass, jlong nativeRenderer,
|
||||||
|
jlong vsyncSteadyClockTimeNano) {
|
||||||
|
Renderer *renderer = (Renderer *) nativeRenderer;
|
||||||
|
renderer->skipFrame(uint64_t(vsyncSteadyClockTimeNano));
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jboolean JNICALL
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
Java_com_google_android_filament_Renderer_nBeginFrame(JNIEnv *, jclass, jlong nativeRenderer,
|
Java_com_google_android_filament_Renderer_nBeginFrame(JNIEnv *, jclass, jlong nativeRenderer,
|
||||||
jlong nativeSwapChain, jlong frameTimeNanos) {
|
jlong nativeSwapChain, jlong frameTimeNanos) {
|
||||||
@@ -187,3 +195,10 @@ Java_com_google_android_filament_Renderer_nSetPresentationTime(JNIEnv *, jclass
|
|||||||
Renderer *renderer = (Renderer *) nativeRenderer;
|
Renderer *renderer = (Renderer *) nativeRenderer;
|
||||||
renderer->setPresentationTime(monotonicClockNanos);
|
renderer->setPresentationTime(monotonicClockNanos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_Renderer_nSetVsyncTime(JNIEnv *, jclass,
|
||||||
|
jlong nativeRenderer, jlong steadyClockTimeNano) {
|
||||||
|
Renderer *renderer = (Renderer *) nativeRenderer;
|
||||||
|
renderer->setVsyncTime(steadyClockTimeNano);
|
||||||
|
}
|
||||||
|
|||||||
@@ -138,6 +138,13 @@ Java_com_google_android_filament_Texture_nBuilderImportTexture(JNIEnv*, jclass,
|
|||||||
builder->import((intptr_t)id);
|
builder->import((intptr_t)id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_Texture_nBuilderExternal(JNIEnv*, jclass, jlong nativeBuilder) {
|
||||||
|
Texture::Builder *builder = (Texture::Builder *) nativeBuilder;
|
||||||
|
builder->external();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jlong JNICALL
|
extern "C" JNIEXPORT jlong JNICALL
|
||||||
Java_com_google_android_filament_Texture_nBuilderBuild(JNIEnv*, jclass,
|
Java_com_google_android_filament_Texture_nBuilderBuild(JNIEnv*, jclass,
|
||||||
jlong nativeBuilder, jlong nativeEngine) {
|
jlong nativeBuilder, jlong nativeEngine) {
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ Java_com_google_android_filament_View_nSetCamera(JNIEnv*, jclass,
|
|||||||
view->setCamera(camera);
|
view->setCamera(camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_View_nHasCamera(JNIEnv*, jclass, jlong nativeView) {
|
||||||
|
View* view = (View*) nativeView;
|
||||||
|
return (jboolean)view->hasCamera();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_google_android_filament_View_nSetColorGrading(JNIEnv*, jclass,
|
Java_com_google_android_filament_View_nSetColorGrading(JNIEnv*, jclass,
|
||||||
jlong nativeView, jlong nativeColorGrading) {
|
jlong nativeView, jlong nativeColorGrading) {
|
||||||
@@ -216,6 +222,20 @@ Java_com_google_android_filament_View_nIsFrontFaceWindingInverted(JNIEnv*,
|
|||||||
return static_cast<jboolean>(view->isFrontFaceWindingInverted());
|
return static_cast<jboolean>(view->isFrontFaceWindingInverted());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_View_nSetTransparentPickingEnabled(JNIEnv*,
|
||||||
|
jclass, jlong nativeView, jboolean enabled) {
|
||||||
|
View* view = (View*) nativeView;
|
||||||
|
view->setTransparentPickingEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT jboolean JNICALL
|
||||||
|
Java_com_google_android_filament_View_nIsTransparentPickingEnabled(JNIEnv*,
|
||||||
|
jclass, jlong nativeView) {
|
||||||
|
View* view = (View*) nativeView;
|
||||||
|
return static_cast<jboolean>(view->isTransparentPickingEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT void JNICALL
|
extern "C" JNIEXPORT void JNICALL
|
||||||
Java_com_google_android_filament_View_nSetAmbientOcclusion(JNIEnv*, jclass, jlong nativeView, jint ordinal) {
|
Java_com_google_android_filament_View_nSetAmbientOcclusion(JNIEnv*, jclass, jlong nativeView, jint ordinal) {
|
||||||
View* view = (View*) nativeView;
|
View* view = (View*) nativeView;
|
||||||
@@ -525,3 +545,12 @@ Java_com_google_android_filament_View_nGetFogEntity(JNIEnv *env, jclass clazz,
|
|||||||
View *view = (View *) nativeView;
|
View *view = (View *) nativeView;
|
||||||
return (jint)view->getFogEntity().getId();
|
return (jint)view->getFogEntity().getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_google_android_filament_View_nClearFrameHistory(JNIEnv *env, jclass clazz,
|
||||||
|
jlong nativeView, jlong nativeEngine) {
|
||||||
|
View *view = (View *) nativeView;
|
||||||
|
Engine *engine = (Engine *) nativeEngine;
|
||||||
|
view->clearFrameHistory(*engine);
|
||||||
|
}
|
||||||
|
|||||||
@@ -159,9 +159,12 @@ public class Engine {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of technique for stereoscopic rendering
|
* The type of technique for stereoscopic rendering. (Note that the materials used will need to be
|
||||||
|
* compatible with the chosen technique.)
|
||||||
*/
|
*/
|
||||||
public enum StereoscopicType {
|
public enum StereoscopicType {
|
||||||
|
/** No stereoscopic rendering. */
|
||||||
|
NONE,
|
||||||
/** Stereoscopic rendering is performed using instanced rendering technique. */
|
/** Stereoscopic rendering is performed using instanced rendering technique. */
|
||||||
INSTANCED,
|
INSTANCED,
|
||||||
/** Stereoscopic rendering is performed using the multiview feature from the graphics backend. */
|
/** Stereoscopic rendering is performed using the multiview feature from the graphics backend. */
|
||||||
@@ -221,11 +224,12 @@ public class Engine {
|
|||||||
nSetBuilderConfig(mNativeBuilder, config.commandBufferSizeMB,
|
nSetBuilderConfig(mNativeBuilder, config.commandBufferSizeMB,
|
||||||
config.perRenderPassArenaSizeMB, config.driverHandleArenaSizeMB,
|
config.perRenderPassArenaSizeMB, config.driverHandleArenaSizeMB,
|
||||||
config.minCommandBufferSizeMB, config.perFrameCommandsSizeMB,
|
config.minCommandBufferSizeMB, config.perFrameCommandsSizeMB,
|
||||||
config.jobSystemThreadCount,
|
config.jobSystemThreadCount, config.disableParallelShaderCompile,
|
||||||
config.textureUseAfterFreePoolSize, config.disableParallelShaderCompile,
|
|
||||||
config.stereoscopicType.ordinal(), config.stereoscopicEyeCount,
|
config.stereoscopicType.ordinal(), config.stereoscopicEyeCount,
|
||||||
config.resourceAllocatorCacheSizeMB, config.resourceAllocatorCacheMaxAge,
|
config.resourceAllocatorCacheSizeMB, config.resourceAllocatorCacheMaxAge,
|
||||||
config.disableHandleUseAfterFreeCheck);
|
config.disableHandleUseAfterFreeCheck,
|
||||||
|
config.preferredShaderLanguage.ordinal(),
|
||||||
|
config.forceGLES2Context, config.assertNativeWindowIsValid);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,6 +258,17 @@ public class Engine {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a feature flag value. This is the only way to set constant feature flags.
|
||||||
|
* @param name feature name
|
||||||
|
* @param value true to enable, false to disable
|
||||||
|
* @return A reference to this Builder for chaining calls.
|
||||||
|
*/
|
||||||
|
public Builder feature(@NonNull String name, boolean value) {
|
||||||
|
nSetBuilderFeature(mNativeBuilder, name, value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of Engine
|
* Creates an instance of Engine
|
||||||
*
|
*
|
||||||
@@ -389,6 +404,7 @@ public class Engine {
|
|||||||
/**
|
/**
|
||||||
* Set to `true` to forcibly disable parallel shader compilation in the backend.
|
* Set to `true` to forcibly disable parallel shader compilation in the backend.
|
||||||
* Currently only honored by the GL backend.
|
* Currently only honored by the GL backend.
|
||||||
|
* @Deprecated use "backend.disable_parallel_shader_compile" feature flag instead
|
||||||
*/
|
*/
|
||||||
public boolean disableParallelShaderCompile = false;
|
public boolean disableParallelShaderCompile = false;
|
||||||
|
|
||||||
@@ -403,7 +419,7 @@ public class Engine {
|
|||||||
*
|
*
|
||||||
* @see View#setStereoscopicOptions
|
* @see View#setStereoscopicOptions
|
||||||
*/
|
*/
|
||||||
public StereoscopicType stereoscopicType = StereoscopicType.INSTANCED;
|
public StereoscopicType stereoscopicType = StereoscopicType.NONE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of eyes to render when stereoscopic rendering is enabled. Supported values are
|
* The number of eyes to render when stereoscopic rendering is enabled. Supported values are
|
||||||
@@ -414,20 +430,61 @@ public class Engine {
|
|||||||
*/
|
*/
|
||||||
public long stereoscopicEyeCount = 2;
|
public long stereoscopicEyeCount = 2;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* @Deprecated This value is no longer used.
|
* @Deprecated This value is no longer used.
|
||||||
*/
|
*/
|
||||||
public long resourceAllocatorCacheSizeMB = 64;
|
public long resourceAllocatorCacheSizeMB = 64;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* This value determines for how many frames are texture entries kept in the cache.
|
* This value determines how many frames texture entries are kept for in the cache. This
|
||||||
|
* is a soft limit, meaning some texture older than this are allowed to stay in the cache.
|
||||||
|
* Typically only one texture is evicted per frame.
|
||||||
|
* The default is 1.
|
||||||
*/
|
*/
|
||||||
public long resourceAllocatorCacheMaxAge = 2;
|
public long resourceAllocatorCacheMaxAge = 1;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Disable backend handles use-after-free checks.
|
* Disable backend handles use-after-free checks.
|
||||||
|
* @Deprecated use "backend.disable_handle_use_after_free_check" feature flag instead
|
||||||
*/
|
*/
|
||||||
public boolean disableHandleUseAfterFreeCheck = false;
|
public boolean disableHandleUseAfterFreeCheck = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a preferred shader language for Filament to use.
|
||||||
|
*
|
||||||
|
* The Metal backend supports two shader languages: MSL (Metal Shading Language) and
|
||||||
|
* METAL_LIBRARY (precompiled .metallib). This option controls which shader language is
|
||||||
|
* used when materials contain both.
|
||||||
|
*
|
||||||
|
* By default, when preferredShaderLanguage is unset, Filament will prefer METAL_LIBRARY
|
||||||
|
* shaders if present within a material, falling back to MSL. Setting
|
||||||
|
* preferredShaderLanguage to ShaderLanguage::MSL will instead instruct Filament to check
|
||||||
|
* for the presence of MSL in a material first, falling back to METAL_LIBRARY if MSL is not
|
||||||
|
* present.
|
||||||
|
*
|
||||||
|
* When using a non-Metal backend, setting this has no effect.
|
||||||
|
*/
|
||||||
|
public enum ShaderLanguage {
|
||||||
|
DEFAULT,
|
||||||
|
MSL,
|
||||||
|
METAL_LIBRARY,
|
||||||
|
};
|
||||||
|
public ShaderLanguage preferredShaderLanguage = ShaderLanguage.DEFAULT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When the OpenGL ES backend is used, setting this value to true will force a GLES2.0
|
||||||
|
* context if supported by the Platform, or if not, will have the backend pretend
|
||||||
|
* it's a GLES2 context. Ignored on other backends.
|
||||||
|
*/
|
||||||
|
public boolean forceGLES2Context = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assert the native window associated to a SwapChain is valid when calling makeCurrent().
|
||||||
|
* This is only supported for:
|
||||||
|
* - PlatformEGLAndroid
|
||||||
|
* @Deprecated use "backend.opengl.assert_native_window_is_valid" feature flag instead
|
||||||
|
*/
|
||||||
|
public boolean assertNativeWindowIsValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Engine(long nativeEngine, Config config) {
|
private Engine(long nativeEngine, Config config) {
|
||||||
@@ -650,11 +707,11 @@ public class Engine {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the maximum number of stereoscopic eyes supported by Filament. The actual number of
|
* Returns the maximum number of stereoscopic eyes supported by Filament. The actual number of
|
||||||
* eyes rendered is set at Engine creation time with the {@link
|
* eyes rendered is set at Engine creation time with the {@link Config#stereoscopicEyeCount}
|
||||||
* Engine#Config#stereoscopicEyeCount} setting.
|
* setting.
|
||||||
*
|
*
|
||||||
* @return the max number of stereoscopic eyes supported
|
* @return the max number of stereoscopic eyes supported
|
||||||
* @see Engine#Config#stereoscopicEyeCount
|
* @see Config#stereoscopicEyeCount
|
||||||
*/
|
*/
|
||||||
public long getMaxStereoscopicEyes() {
|
public long getMaxStereoscopicEyes() {
|
||||||
return nGetMaxStereoscopicEyes(getNativeObject());
|
return nGetMaxStereoscopicEyes(getNativeObject());
|
||||||
@@ -849,6 +906,25 @@ public class Engine {
|
|||||||
return nIsValidMaterial(getNativeObject(), object.getNativeObject());
|
return nIsValidMaterial(getNativeObject(), object.getNativeObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the object is valid.
|
||||||
|
* @param ma Material
|
||||||
|
* @param mi MaterialInstance to check for validity
|
||||||
|
* @return returns true if the specified object is valid.
|
||||||
|
*/
|
||||||
|
public boolean isValidMaterialInstance(@NonNull Material ma, MaterialInstance mi) {
|
||||||
|
return nIsValidMaterialInstance(getNativeObject(), ma.getNativeObject(), mi.getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the object is valid.
|
||||||
|
* @param object Object to check for validity
|
||||||
|
* @return returns true if the specified object is valid.
|
||||||
|
*/
|
||||||
|
public boolean isValidExpensiveMaterialInstance(@NonNull MaterialInstance object) {
|
||||||
|
return nIsValidExpensiveMaterialInstance(getNativeObject(), object.getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the object is valid.
|
* Returns whether the object is valid.
|
||||||
* @param object Object to check for validity
|
* @param object Object to check for validity
|
||||||
@@ -1195,7 +1271,28 @@ public class Engine {
|
|||||||
* {@link android.view.SurfaceHolder.Callback#surfaceDestroyed surfaceDestroyed}.</p>
|
* {@link android.view.SurfaceHolder.Callback#surfaceDestroyed surfaceDestroyed}.</p>
|
||||||
*/
|
*/
|
||||||
public void flushAndWait() {
|
public void flushAndWait() {
|
||||||
nFlushAndWait(getNativeObject());
|
boolean unused = flushAndWait(Fence.WAIT_FOR_EVER);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kicks the hardware thread (e.g. the OpenGL, Vulkan or Metal thread) and blocks until
|
||||||
|
* all commands to this point are executed. Note that does guarantee that the
|
||||||
|
* hardware is actually finished.
|
||||||
|
*
|
||||||
|
* A timeout can be specified, if for some reason this flushAndWait doesn't complete before the timeout, it will
|
||||||
|
* return false, true otherwise.
|
||||||
|
*
|
||||||
|
* <p>This is typically used right after destroying the <code>SwapChain</code>,
|
||||||
|
* in cases where a guarantee about the <code>SwapChain</code> destruction is needed in a
|
||||||
|
* timely fashion, such as when responding to Android's
|
||||||
|
* <code>android.view.SurfaceHolder.Callback.surfaceDestroyed</code></p>
|
||||||
|
*
|
||||||
|
* @param timeout A timeout in nanoseconds
|
||||||
|
* @return true if successful, false if flushAndWait timed out, in which case it wasn't successful and commands
|
||||||
|
* might still be executing on both the CPU and GPU sides.
|
||||||
|
*/
|
||||||
|
public boolean flushAndWait(long timeout) {
|
||||||
|
return nFlushAndWait(getNativeObject(), timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1209,6 +1306,17 @@ public class Engine {
|
|||||||
nFlush(getNativeObject());
|
nFlush(getNativeObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get paused state of rendering thread.
|
||||||
|
*
|
||||||
|
* <p>Warning: This is an experimental API.
|
||||||
|
*
|
||||||
|
* @see #setPaused
|
||||||
|
*/
|
||||||
|
public boolean isPaused() {
|
||||||
|
return nIsPaused(getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pause or resume the rendering thread.
|
* Pause or resume the rendering thread.
|
||||||
*
|
*
|
||||||
@@ -1226,6 +1334,57 @@ public class Engine {
|
|||||||
nSetPaused(getNativeObject(), paused);
|
nSetPaused(getNativeObject(), paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switch the command queue to unprotected mode. Protected mode can be activated via
|
||||||
|
* Renderer::beginFrame() using a protected SwapChain.
|
||||||
|
* @see Renderer
|
||||||
|
* @see SwapChain
|
||||||
|
*/
|
||||||
|
public void unprotected() {
|
||||||
|
nUnprotected(getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current time. This is a convenience function that simply returns the
|
||||||
|
* time in nanosecond since epoch of std::chrono::steady_clock.
|
||||||
|
* @return current time in nanosecond since epoch of std::chrono::steady_clock.
|
||||||
|
* @see Renderer#beginFrame
|
||||||
|
*/
|
||||||
|
public static native long getSteadyClockTimeNano();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a feature flag exists
|
||||||
|
* @param name name of the feature flag to check
|
||||||
|
* @return true if it exists false otherwise
|
||||||
|
*/
|
||||||
|
public boolean hasFeatureFlag(@NonNull String name) {
|
||||||
|
return nHasFeatureFlag(mNativeObject, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of a non-constant feature flag.
|
||||||
|
* @param name name of the feature flag to set
|
||||||
|
* @param value value to set
|
||||||
|
* @return true if the value was set, false if the feature flag is constant or doesn't exist.
|
||||||
|
*/
|
||||||
|
public boolean setFeatureFlag(@NonNull String name, boolean value) {
|
||||||
|
return nSetFeatureFlag(mNativeObject, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the value of any feature flag.
|
||||||
|
* @param name name of the feature flag
|
||||||
|
* @return the value of the flag if it exists
|
||||||
|
* @exception IllegalArgumentException is thrown if the feature flag doesn't exist
|
||||||
|
*/
|
||||||
|
public boolean getFeatureFlag(@NonNull String name) {
|
||||||
|
if (!hasFeatureFlag(name)) {
|
||||||
|
throw new IllegalArgumentException("The feature flag \"" + name + "\" doesn't exist");
|
||||||
|
}
|
||||||
|
return nGetFeatureFlag(mNativeObject, name);
|
||||||
|
}
|
||||||
|
|
||||||
@UsedByReflection("TextureHelper.java")
|
@UsedByReflection("TextureHelper.java")
|
||||||
public long getNativeObject() {
|
public long getNativeObject() {
|
||||||
if (mNativeObject == 0) {
|
if (mNativeObject == 0) {
|
||||||
@@ -1291,15 +1450,19 @@ public class Engine {
|
|||||||
private static native boolean nIsValidSkinningBuffer(long nativeEngine, long nativeSkinningBuffer);
|
private static native boolean nIsValidSkinningBuffer(long nativeEngine, long nativeSkinningBuffer);
|
||||||
private static native boolean nIsValidIndirectLight(long nativeEngine, long nativeIndirectLight);
|
private static native boolean nIsValidIndirectLight(long nativeEngine, long nativeIndirectLight);
|
||||||
private static native boolean nIsValidMaterial(long nativeEngine, long nativeMaterial);
|
private static native boolean nIsValidMaterial(long nativeEngine, long nativeMaterial);
|
||||||
|
private static native boolean nIsValidMaterialInstance(long nativeEngine, long nativeMaterial, long nativeMaterialInstance);
|
||||||
|
private static native boolean nIsValidExpensiveMaterialInstance(long nativeEngine, long nativeMaterialInstance);
|
||||||
private static native boolean nIsValidSkybox(long nativeEngine, long nativeSkybox);
|
private static native boolean nIsValidSkybox(long nativeEngine, long nativeSkybox);
|
||||||
private static native boolean nIsValidColorGrading(long nativeEngine, long nativeColorGrading);
|
private static native boolean nIsValidColorGrading(long nativeEngine, long nativeColorGrading);
|
||||||
private static native boolean nIsValidTexture(long nativeEngine, long nativeTexture);
|
private static native boolean nIsValidTexture(long nativeEngine, long nativeTexture);
|
||||||
private static native boolean nIsValidRenderTarget(long nativeEngine, long nativeTarget);
|
private static native boolean nIsValidRenderTarget(long nativeEngine, long nativeTarget);
|
||||||
private static native boolean nIsValidSwapChain(long nativeEngine, long nativeSwapChain);
|
private static native boolean nIsValidSwapChain(long nativeEngine, long nativeSwapChain);
|
||||||
private static native void nDestroyEntity(long nativeEngine, int entity);
|
private static native void nDestroyEntity(long nativeEngine, int entity);
|
||||||
private static native void nFlushAndWait(long nativeEngine);
|
private static native boolean nFlushAndWait(long nativeEngine, long timeout);
|
||||||
private static native void nFlush(long nativeEngine);
|
private static native void nFlush(long nativeEngine);
|
||||||
|
private static native boolean nIsPaused(long nativeEngine);
|
||||||
private static native void nSetPaused(long nativeEngine, boolean paused);
|
private static native void nSetPaused(long nativeEngine, boolean paused);
|
||||||
|
private static native void nUnprotected(long nativeEngine);
|
||||||
private static native long nGetTransformManager(long nativeEngine);
|
private static native long nGetTransformManager(long nativeEngine);
|
||||||
private static native long nGetLightManager(long nativeEngine);
|
private static native long nGetLightManager(long nativeEngine);
|
||||||
private static native long nGetRenderableManager(long nativeEngine);
|
private static native long nGetRenderableManager(long nativeEngine);
|
||||||
@@ -1311,6 +1474,9 @@ public class Engine {
|
|||||||
private static native int nGetSupportedFeatureLevel(long nativeEngine);
|
private static native int nGetSupportedFeatureLevel(long nativeEngine);
|
||||||
private static native int nSetActiveFeatureLevel(long nativeEngine, int ordinal);
|
private static native int nSetActiveFeatureLevel(long nativeEngine, int ordinal);
|
||||||
private static native int nGetActiveFeatureLevel(long nativeEngine);
|
private static native int nGetActiveFeatureLevel(long nativeEngine);
|
||||||
|
private static native boolean nHasFeatureFlag(long nativeEngine, String name);
|
||||||
|
private static native boolean nSetFeatureFlag(long nativeEngine, String name, boolean value);
|
||||||
|
private static native boolean nGetFeatureFlag(long nativeEngine, String name);
|
||||||
|
|
||||||
private static native long nCreateBuilder();
|
private static native long nCreateBuilder();
|
||||||
private static native void nDestroyBuilder(long nativeBuilder);
|
private static native void nDestroyBuilder(long nativeBuilder);
|
||||||
@@ -1318,12 +1484,14 @@ public class Engine {
|
|||||||
private static native void nSetBuilderConfig(long nativeBuilder, long commandBufferSizeMB,
|
private static native void nSetBuilderConfig(long nativeBuilder, long commandBufferSizeMB,
|
||||||
long perRenderPassArenaSizeMB, long driverHandleArenaSizeMB,
|
long perRenderPassArenaSizeMB, long driverHandleArenaSizeMB,
|
||||||
long minCommandBufferSizeMB, long perFrameCommandsSizeMB, long jobSystemThreadCount,
|
long minCommandBufferSizeMB, long perFrameCommandsSizeMB, long jobSystemThreadCount,
|
||||||
long textureUseAfterFreePoolSize, boolean disableParallelShaderCompile,
|
boolean disableParallelShaderCompile, int stereoscopicType, long stereoscopicEyeCount,
|
||||||
int stereoscopicType, long stereoscopicEyeCount,
|
|
||||||
long resourceAllocatorCacheSizeMB, long resourceAllocatorCacheMaxAge,
|
long resourceAllocatorCacheSizeMB, long resourceAllocatorCacheMaxAge,
|
||||||
boolean disableHandleUseAfterFreeCheck);
|
boolean disableHandleUseAfterFreeCheck,
|
||||||
|
int preferredShaderLanguage,
|
||||||
|
boolean forceGLES2Context, boolean assertNativeWindowIsValid);
|
||||||
private static native void nSetBuilderFeatureLevel(long nativeBuilder, int ordinal);
|
private static native void nSetBuilderFeatureLevel(long nativeBuilder, int ordinal);
|
||||||
private static native void nSetBuilderSharedContext(long nativeBuilder, long sharedContext);
|
private static native void nSetBuilderSharedContext(long nativeBuilder, long sharedContext);
|
||||||
private static native void nSetBuilderPaused(long nativeBuilder, boolean paused);
|
private static native void nSetBuilderPaused(long nativeBuilder, boolean paused);
|
||||||
|
private static native void nSetBuilderFeature(long nativeBuilder, String name, boolean value);
|
||||||
private static native long nBuilderBuild(long nativeBuilder);
|
private static native long nBuilderBuild(long nativeBuilder);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,8 +344,18 @@ public class Material {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
public enum ShadowSamplingQuality {
|
||||||
|
/** 2x2 PCF */
|
||||||
|
HARD,
|
||||||
|
/** 3x3 gaussian filter */
|
||||||
|
LOW,
|
||||||
|
}
|
||||||
|
|
||||||
private Buffer mBuffer;
|
private Buffer mBuffer;
|
||||||
private int mSize;
|
private int mSize;
|
||||||
|
private int mShBandCount = 0;
|
||||||
|
private ShadowSamplingQuality mShadowSamplingQuality = ShadowSamplingQuality.LOW;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies the material data. The material data is a binary blob produced by
|
* Specifies the material data. The material data is a binary blob produced by
|
||||||
@@ -361,6 +371,34 @@ public class Material {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the quality of the indirect lights computations. This is only taken into account
|
||||||
|
* if this material is lit and in the surface domain. This setting will affect the
|
||||||
|
* IndirectLight computation if one is specified on the Scene and Spherical Harmonics
|
||||||
|
* are used for the irradiance.
|
||||||
|
*
|
||||||
|
* @param shBandCount Number of spherical harmonic bands. Must be 1, 2 or 3 (default).
|
||||||
|
* @return Reference to this Builder for chaining calls.
|
||||||
|
* @see IndirectLight
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder sphericalHarmonicsBandCount(@IntRange(from = 0) int shBandCount) {
|
||||||
|
mShBandCount = shBandCount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the quality of shadow sampling. This is only taken into account
|
||||||
|
* if this material is lit and in the surface domain.
|
||||||
|
* @param quality
|
||||||
|
* @return Reference to this Builder for chaining calls.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder shadowSamplingQuality(ShadowSamplingQuality quality) {
|
||||||
|
mShadowSamplingQuality = quality;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns the Material object.
|
* Creates and returns the Material object.
|
||||||
*
|
*
|
||||||
@@ -372,7 +410,8 @@ public class Material {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public Material build(@NonNull Engine engine) {
|
public Material build(@NonNull Engine engine) {
|
||||||
long nativeMaterial = nBuilderBuild(engine.getNativeObject(), mBuffer, mSize);
|
long nativeMaterial = nBuilderBuild(engine.getNativeObject(),
|
||||||
|
mBuffer, mSize, mShBandCount, mShadowSamplingQuality.ordinal());
|
||||||
if (nativeMaterial == 0) throw new IllegalStateException("Couldn't create Material");
|
if (nativeMaterial == 0) throw new IllegalStateException("Couldn't create Material");
|
||||||
return new Material(nativeMaterial);
|
return new Material(nativeMaterial);
|
||||||
}
|
}
|
||||||
@@ -1023,7 +1062,7 @@ public class Material {
|
|||||||
mNativeObject = 0;
|
mNativeObject = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native long nBuilderBuild(long nativeEngine, @NonNull Buffer buffer, int size);
|
private static native long nBuilderBuild(long nativeEngine, @NonNull Buffer buffer, int size, int shBandCount, int shadowQuality);
|
||||||
private static native long nCreateInstance(long nativeMaterial);
|
private static native long nCreateInstance(long nativeMaterial);
|
||||||
private static native long nCreateInstanceWithName(long nativeMaterial, @NonNull String name);
|
private static native long nCreateInstanceWithName(long nativeMaterial, @NonNull String name);
|
||||||
private static native long nGetDefaultInstance(long nativeMaterial);
|
private static native long nGetDefaultInstance(long nativeMaterial);
|
||||||
|
|||||||
@@ -556,6 +556,20 @@ public class MaterialInstance {
|
|||||||
nSetCullingMode(getNativeObject(), mode.ordinal());
|
nSetCullingMode(getNativeObject(), mode.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overrides the default triangle culling state that was set on the material separately for the
|
||||||
|
* color and shadow passes
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* <a href="https://google.github.io/filament/Materials.html#materialdefinitions/materialblock/rasterization:culling">
|
||||||
|
* Rasterization: culling</a>
|
||||||
|
*/
|
||||||
|
public void setCullingMode(@NonNull Material.CullingMode colorPassCullingMode,
|
||||||
|
@NonNull Material.CullingMode shadowPassCullingMode) {
|
||||||
|
nSetCullingModeSeparate(getNativeObject(),
|
||||||
|
colorPassCullingMode.ordinal(), shadowPassCullingMode.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the face culling mode.
|
* Returns the face culling mode.
|
||||||
*/
|
*/
|
||||||
@@ -564,6 +578,14 @@ public class MaterialInstance {
|
|||||||
return sCullingModeValues[nGetCullingMode(getNativeObject())];
|
return sCullingModeValues[nGetCullingMode(getNativeObject())];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the face culling mode for the shadow passes.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Material.CullingMode getShadowCullingMode() {
|
||||||
|
return sCullingModeValues[nGetShadowCullingMode(getNativeObject())];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides the default color-buffer write state that was set on the material.
|
* Overrides the default color-buffer write state that was set on the material.
|
||||||
*
|
*
|
||||||
@@ -920,6 +942,8 @@ public class MaterialInstance {
|
|||||||
|
|
||||||
private static native void nSetDoubleSided(long nativeMaterialInstance, boolean doubleSided);
|
private static native void nSetDoubleSided(long nativeMaterialInstance, boolean doubleSided);
|
||||||
private static native void nSetCullingMode(long nativeMaterialInstance, long mode);
|
private static native void nSetCullingMode(long nativeMaterialInstance, long mode);
|
||||||
|
private static native void nSetCullingModeSeparate(long nativeMaterialInstance,
|
||||||
|
long colorPassCullingMode, long shadowPassCullingMode);
|
||||||
private static native void nSetColorWrite(long nativeMaterialInstance, boolean enable);
|
private static native void nSetColorWrite(long nativeMaterialInstance, boolean enable);
|
||||||
private static native void nSetDepthWrite(long nativeMaterialInstance, boolean enable);
|
private static native void nSetDepthWrite(long nativeMaterialInstance, boolean enable);
|
||||||
private static native void nSetStencilWrite(long nativeMaterialInstance, boolean enable);
|
private static native void nSetStencilWrite(long nativeMaterialInstance, boolean enable);
|
||||||
@@ -952,6 +976,7 @@ public class MaterialInstance {
|
|||||||
private static native float nGetSpecularAntiAliasingThreshold(long nativeMaterialInstance);
|
private static native float nGetSpecularAntiAliasingThreshold(long nativeMaterialInstance);
|
||||||
private static native boolean nIsDoubleSided(long nativeMaterialInstance);
|
private static native boolean nIsDoubleSided(long nativeMaterialInstance);
|
||||||
private static native int nGetCullingMode(long nativeMaterialInstance);
|
private static native int nGetCullingMode(long nativeMaterialInstance);
|
||||||
|
private static native int nGetShadowCullingMode(long nativeMaterialInstance);
|
||||||
private static native boolean nIsColorWriteEnabled(long nativeMaterialInstance);
|
private static native boolean nIsColorWriteEnabled(long nativeMaterialInstance);
|
||||||
private static native boolean nIsDepthWriteEnabled(long nativeMaterialInstance);
|
private static native boolean nIsDepthWriteEnabled(long nativeMaterialInstance);
|
||||||
private static native boolean nIsStencilWriteEnabled(long nativeMaterialInstance);
|
private static native boolean nIsStencilWriteEnabled(long nativeMaterialInstance);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class MorphTargetBuffer {
|
|||||||
*
|
*
|
||||||
* @exception IllegalStateException if the MorphTargetBuffer could not be created
|
* @exception IllegalStateException if the MorphTargetBuffer could not be created
|
||||||
*
|
*
|
||||||
* @see #setMorphTargetBufferAt
|
* @see #setMorphTargetBufferOffsetAt
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public MorphTargetBuffer build(@NonNull Engine engine) {
|
public MorphTargetBuffer build(@NonNull Engine engine) {
|
||||||
|
|||||||
@@ -524,14 +524,7 @@ public class RenderableManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls if the renderable has vertex morphing targets, zero by default. This is
|
* Controls if the renderable has legacy vertex morphing targets, zero by default.
|
||||||
* required to enable GPU morphing.
|
|
||||||
*
|
|
||||||
* <p>Filament supports two morphing modes: standard (default) and legacy.</p>
|
|
||||||
*
|
|
||||||
* <p>For standard morphing, A {@link MorphTargetBuffer} must be created and provided via
|
|
||||||
* {@link RenderableManager#setMorphTargetBufferAt}. Standard morphing supports up to
|
|
||||||
* <code>CONFIG_MAX_MORPH_TARGET_COUNT</code> morph targets.</p>
|
|
||||||
*
|
*
|
||||||
* For legacy morphing, the attached {@link VertexBuffer} must provide data in the
|
* For legacy morphing, the attached {@link VertexBuffer} must provide data in the
|
||||||
* appropriate {@link VertexBuffer.VertexAttribute} slots (<code>MORPH_POSITION_0</code> etc).
|
* appropriate {@link VertexBuffer.VertexAttribute} slots (<code>MORPH_POSITION_0</code> etc).
|
||||||
@@ -549,6 +542,22 @@ public class RenderableManager {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controls if the renderable has vertex morphing targets, zero by default.
|
||||||
|
*
|
||||||
|
* <p>For standard morphing, A {@link MorphTargetBuffer} must be provided.
|
||||||
|
* Standard morphing supports up to
|
||||||
|
* <code>CONFIG_MAX_MORPH_TARGET_COUNT</code> morph targets.</p>
|
||||||
|
*
|
||||||
|
* <p>See also {@link RenderableManager#setMorphWeights}, which can be called on a per-frame basis
|
||||||
|
* to advance the animation.</p>
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder morphing(@NonNull MorphTargetBuffer morphTargetBuffer) {
|
||||||
|
nBuilderMorphingStandard(mNativeBuilder, morphTargetBuffer.getNativeObject());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies the morph target buffer for a primitive.
|
* Specifies the morph target buffer for a primitive.
|
||||||
*
|
*
|
||||||
@@ -560,31 +569,13 @@ public class RenderableManager {
|
|||||||
*
|
*
|
||||||
* @param level the level of detail (lod), only 0 can be specified
|
* @param level the level of detail (lod), only 0 can be specified
|
||||||
* @param primitiveIndex zero-based index of the primitive, must be less than the count passed to Builder constructor
|
* @param primitiveIndex zero-based index of the primitive, must be less than the count passed to Builder constructor
|
||||||
* @param morphTargetBuffer specifies the morph target buffer
|
|
||||||
* @param offset specifies where in the morph target buffer to start reading (expressed as a number of vertices)
|
* @param offset specifies where in the morph target buffer to start reading (expressed as a number of vertices)
|
||||||
* @param count number of vertices in the morph target buffer to read, must equal the geometry's count (for triangles, this should be a multiple of 3)
|
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public Builder morphing(@IntRange(from = 0) int level,
|
public Builder morphing(@IntRange(from = 0) int level,
|
||||||
@IntRange(from = 0) int primitiveIndex,
|
@IntRange(from = 0) int primitiveIndex,
|
||||||
@NonNull MorphTargetBuffer morphTargetBuffer,
|
@IntRange(from = 0) int offset) {
|
||||||
@IntRange(from = 0) int offset,
|
nBuilderSetMorphTargetBufferOffsetAt(mNativeBuilder, level, primitiveIndex, offset);
|
||||||
@IntRange(from = 0) int count) {
|
|
||||||
nBuilderSetMorphTargetBufferAt(mNativeBuilder, level, primitiveIndex,
|
|
||||||
morphTargetBuffer.getNativeObject(), offset, count);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Utility method to specify morph target buffer for a primitive.
|
|
||||||
* For details, see the {@link RenderableManager.Builder#morphing}.
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
public Builder morphing(@IntRange(from = 0) int level,
|
|
||||||
@IntRange(from = 0) int primitiveIndex,
|
|
||||||
@NonNull MorphTargetBuffer morphTargetBuffer) {
|
|
||||||
nBuilderSetMorphTargetBufferAt(mNativeBuilder, level, primitiveIndex,
|
|
||||||
morphTargetBuffer.getNativeObject(), 0, morphTargetBuffer.getVertexCount());
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,26 +678,11 @@ public class RenderableManager {
|
|||||||
*
|
*
|
||||||
* @see Builder#morphing
|
* @see Builder#morphing
|
||||||
*/
|
*/
|
||||||
public void setMorphTargetBufferAt(@EntityInstance int i,
|
public void setMorphTargetBufferOffsetAt(@EntityInstance int i,
|
||||||
@IntRange(from = 0) int level,
|
@IntRange(from = 0) int level,
|
||||||
@IntRange(from = 0) int primitiveIndex,
|
@IntRange(from = 0) int primitiveIndex,
|
||||||
@NonNull MorphTargetBuffer morphTargetBuffer,
|
@IntRange(from = 0) int offset) {
|
||||||
@IntRange(from = 0) int offset,
|
nSetMorphTargetBufferOffsetAt(mNativeObject, i, level, primitiveIndex, 0, offset);
|
||||||
@IntRange(from = 0) int count) {
|
|
||||||
nSetMorphTargetBufferAt(mNativeObject, i, level, primitiveIndex,
|
|
||||||
morphTargetBuffer.getNativeObject(), offset, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Utility method to change morph target buffer for the given primitive.
|
|
||||||
* For details, see the {@link RenderableManager#setMorphTargetBufferAt}.
|
|
||||||
*/
|
|
||||||
public void setMorphTargetBufferAt(@EntityInstance int i,
|
|
||||||
@IntRange(from = 0) int level,
|
|
||||||
@IntRange(from = 0) int primitiveIndex,
|
|
||||||
@NonNull MorphTargetBuffer morphTargetBuffer) {
|
|
||||||
nSetMorphTargetBufferAt(mNativeObject, i, level, primitiveIndex,
|
|
||||||
morphTargetBuffer.getNativeObject(), 0, morphTargetBuffer.getVertexCount());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -893,6 +869,13 @@ public class RenderableManager {
|
|||||||
nSetMaterialInstanceAt(mNativeObject, i, primitiveIndex, materialInstance.getNativeObject());
|
nSetMaterialInstanceAt(mNativeObject, i, primitiveIndex, materialInstance.getNativeObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the material instance for the given primitive.
|
||||||
|
*/
|
||||||
|
public void clearMaterialInstanceAt(@EntityInstance int i, @IntRange(from = 0) int primitiveIndex) {
|
||||||
|
nClearMaterialInstanceAt(mNativeObject, i, primitiveIndex);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a MaterialInstance Java wrapper object for a particular material instance.
|
* Creates a MaterialInstance Java wrapper object for a particular material instance.
|
||||||
*/
|
*/
|
||||||
@@ -1006,7 +989,8 @@ public class RenderableManager {
|
|||||||
private static native int nBuilderSkinningBones(long nativeBuilder, int boneCount, Buffer bones, int remaining);
|
private static native int nBuilderSkinningBones(long nativeBuilder, int boneCount, Buffer bones, int remaining);
|
||||||
private static native void nBuilderSkinningBuffer(long nativeBuilder, long nativeSkinningBuffer, int boneCount, int offset);
|
private static native void nBuilderSkinningBuffer(long nativeBuilder, long nativeSkinningBuffer, int boneCount, int offset);
|
||||||
private static native void nBuilderMorphing(long nativeBuilder, int targetCount);
|
private static native void nBuilderMorphing(long nativeBuilder, int targetCount);
|
||||||
private static native void nBuilderSetMorphTargetBufferAt(long nativeBuilder, int level, int primitiveIndex, long nativeMorphTargetBuffer, int offset, int count);
|
private static native void nBuilderMorphingStandard(long nativeBuilder, long nativeMorphTargetBuffer);
|
||||||
|
private static native void nBuilderSetMorphTargetBufferOffsetAt(long nativeBuilder, int level, int primitiveIndex, int offset);
|
||||||
private static native void nBuilderEnableSkinningBuffers(long nativeBuilder, boolean enabled);
|
private static native void nBuilderEnableSkinningBuffers(long nativeBuilder, boolean enabled);
|
||||||
private static native void nBuilderFog(long nativeBuilder, boolean enabled);
|
private static native void nBuilderFog(long nativeBuilder, boolean enabled);
|
||||||
private static native void nBuilderLightChannel(long nativeRenderableManager, int channel, boolean enable);
|
private static native void nBuilderLightChannel(long nativeRenderableManager, int channel, boolean enable);
|
||||||
@@ -1016,7 +1000,7 @@ public class RenderableManager {
|
|||||||
private static native int nSetBonesAsMatrices(long nativeObject, int i, Buffer matrices, int remaining, int boneCount, int offset);
|
private static native int nSetBonesAsMatrices(long nativeObject, int i, Buffer matrices, int remaining, int boneCount, int offset);
|
||||||
private static native int nSetBonesAsQuaternions(long nativeObject, int i, Buffer quaternions, int remaining, int boneCount, int offset);
|
private static native int nSetBonesAsQuaternions(long nativeObject, int i, Buffer quaternions, int remaining, int boneCount, int offset);
|
||||||
private static native void nSetMorphWeights(long nativeObject, int instance, float[] weights, int offset);
|
private static native void nSetMorphWeights(long nativeObject, int instance, float[] weights, int offset);
|
||||||
private static native void nSetMorphTargetBufferAt(long nativeObject, int i, int level, int primitiveIndex, long nativeMorphTargetBuffer, int offset, int count);
|
private static native void nSetMorphTargetBufferOffsetAt(long nativeObject, int i, int level, int primitiveIndex, long nativeMorphTargetBuffer, int offset);
|
||||||
private static native int nGetMorphTargetCount(long nativeObject, int i);
|
private static native int nGetMorphTargetCount(long nativeObject, int i);
|
||||||
private static native void nSetAxisAlignedBoundingBox(long nativeRenderableManager, int i, float cx, float cy, float cz, float ex, float ey, float ez);
|
private static native void nSetAxisAlignedBoundingBox(long nativeRenderableManager, int i, float cx, float cy, float cz, float ex, float ey, float ez);
|
||||||
private static native void nSetLayerMask(long nativeRenderableManager, int i, int select, int value);
|
private static native void nSetLayerMask(long nativeRenderableManager, int i, int select, int value);
|
||||||
@@ -1035,6 +1019,7 @@ public class RenderableManager {
|
|||||||
private static native void nGetAxisAlignedBoundingBox(long nativeRenderableManager, int i, float[] center, float[] halfExtent);
|
private static native void nGetAxisAlignedBoundingBox(long nativeRenderableManager, int i, float[] center, float[] halfExtent);
|
||||||
private static native int nGetPrimitiveCount(long nativeRenderableManager, int i);
|
private static native int nGetPrimitiveCount(long nativeRenderableManager, int i);
|
||||||
private static native void nSetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex, long nativeMaterialInstance);
|
private static native void nSetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex, long nativeMaterialInstance);
|
||||||
|
private static native void nClearMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex);
|
||||||
private static native long nGetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex);
|
private static native long nGetMaterialInstanceAt(long nativeRenderableManager, int i, int primitiveIndex);
|
||||||
private static native void nSetGeometryAt(long nativeRenderableManager, int i, int primitiveIndex, int primitiveType, long nativeVertexBuffer, long nativeIndexBuffer, int offset, int count);
|
private static native void nSetGeometryAt(long nativeRenderableManager, int i, int primitiveIndex, int primitiveType, long nativeVertexBuffer, long nativeIndexBuffer, int offset, int count);
|
||||||
private static native void nSetBlendOrderAt(long nativeRenderableManager, int i, int primitiveIndex, int blendOrder);
|
private static native void nSetBlendOrderAt(long nativeRenderableManager, int i, int primitiveIndex, int blendOrder);
|
||||||
|
|||||||
@@ -284,6 +284,33 @@ public class Renderer {
|
|||||||
nSetPresentationTime(getNativeObject(), monotonicClockNanos);
|
nSetPresentationTime(getNativeObject(), monotonicClockNanos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The use of this method is optional. It sets the VSYNC time expressed as the duration in
|
||||||
|
* nanosecond since epoch of std::chrono::steady_clock.
|
||||||
|
* If called, passing 0 to frameTimeNanos in Renderer.BeginFrame will use this
|
||||||
|
* time instead.
|
||||||
|
* @param steadyClockTimeNano duration in nanosecond since epoch of std::chrono::steady_clock
|
||||||
|
* @see Engine#getSteadyClockTimeNano
|
||||||
|
* @see Renderer#beginFrame
|
||||||
|
*/
|
||||||
|
public void setVsyncTime(long steadyClockTimeNano) {
|
||||||
|
nSetVsyncTime(getNativeObject(), steadyClockTimeNano);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call skipFrame when momentarily skipping frames, for instance if the content of the
|
||||||
|
* scene doesn't change.
|
||||||
|
*
|
||||||
|
* @param vsyncSteadyClockTimeNano The time in nanoseconds when the frame started being rendered,
|
||||||
|
* in the {@link System#nanoTime()} timebase. Divide this value by 1000000 to
|
||||||
|
* convert it to the {@link android.os.SystemClock#uptimeMillis()}
|
||||||
|
* time base. This typically comes from
|
||||||
|
* {@link android.view.Choreographer.FrameCallback}.
|
||||||
|
*/
|
||||||
|
public void skipFrame(long vsyncSteadyClockTimeNano) {
|
||||||
|
nSkipFrame(getNativeObject(), vsyncSteadyClockTimeNano);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up a frame for this <code>Renderer</code>.
|
* Sets up a frame for this <code>Renderer</code>.
|
||||||
* <p><code>beginFrame</code> manages frame pacing, and returns whether or not a frame should be
|
* <p><code>beginFrame</code> manages frame pacing, and returns whether or not a frame should be
|
||||||
@@ -702,6 +729,8 @@ public class Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static native void nSetPresentationTime(long nativeObject, long monotonicClockNanos);
|
private static native void nSetPresentationTime(long nativeObject, long monotonicClockNanos);
|
||||||
|
private static native void nSetVsyncTime(long nativeObject, long steadyClockTimeNano);
|
||||||
|
private static native void nSkipFrame(long nativeObject, long vsyncSteadyClockTimeNano);
|
||||||
private static native boolean nBeginFrame(long nativeRenderer, long nativeSwapChain, long frameTimeNanos);
|
private static native boolean nBeginFrame(long nativeRenderer, long nativeSwapChain, long frameTimeNanos);
|
||||||
private static native void nEndFrame(long nativeRenderer);
|
private static native void nEndFrame(long nativeRenderer);
|
||||||
private static native void nRender(long nativeRenderer, long nativeView);
|
private static native void nRender(long nativeRenderer, long nativeView);
|
||||||
|
|||||||
@@ -800,6 +800,19 @@ public class Texture {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an external texture. The content must be set using setExternalImage().
|
||||||
|
* The sampler can be SAMPLER_EXTERNAL or SAMPLER_2D depending on the format. Generally
|
||||||
|
* YUV formats must use SAMPLER_EXTERNAL. This depends on the backend features and is not
|
||||||
|
* validated.
|
||||||
|
* @return This Builder, for chaining calls.
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder external() {
|
||||||
|
nBuilderExternal(mNativeBuilder);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new <code>Texture</code> instance.
|
* Creates a new <code>Texture</code> instance.
|
||||||
* @param engine The {@link Engine} to associate this <code>Texture</code> with.
|
* @param engine The {@link Engine} to associate this <code>Texture</code> with.
|
||||||
@@ -1261,6 +1274,7 @@ public class Texture {
|
|||||||
private static native void nBuilderUsage(long nativeBuilder, int flags);
|
private static native void nBuilderUsage(long nativeBuilder, int flags);
|
||||||
private static native void nBuilderSwizzle(long nativeBuilder, int r, int g, int b, int a);
|
private static native void nBuilderSwizzle(long nativeBuilder, int r, int g, int b, int a);
|
||||||
private static native void nBuilderImportTexture(long nativeBuilder, long id);
|
private static native void nBuilderImportTexture(long nativeBuilder, long id);
|
||||||
|
private static native void nBuilderExternal(long nativeBuilder);
|
||||||
private static native long nBuilderBuild(long nativeBuilder, long nativeEngine);
|
private static native long nBuilderBuild(long nativeBuilder, long nativeEngine);
|
||||||
|
|
||||||
private static native int nGetWidth(long nativeTexture, int level);
|
private static native int nGetWidth(long nativeTexture, int level);
|
||||||
|
|||||||
@@ -241,6 +241,15 @@ public class View {
|
|||||||
nSetCamera(getNativeObject(), camera == null ? 0 : camera.getNativeObject());
|
nSetCamera(getNativeObject(), camera == null ? 0 : camera.getNativeObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether a camera is set.
|
||||||
|
* @return true if a camera is set, false otherwise
|
||||||
|
* @see #setCamera
|
||||||
|
*/
|
||||||
|
public boolean hasCamera() {
|
||||||
|
return nHasCamera(getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets this View's associated Camera, or null if none has been assigned.
|
* Gets this View's associated Camera, or null if none has been assigned.
|
||||||
*
|
*
|
||||||
@@ -736,6 +745,33 @@ public class View {
|
|||||||
nSetFrontFaceWindingInverted(getNativeObject(), inverted);
|
nSetFrontFaceWindingInverted(getNativeObject(), inverted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if transparent picking is enabled.
|
||||||
|
*
|
||||||
|
* @see #setTransparentPickingEnabled
|
||||||
|
*/
|
||||||
|
public boolean isTransparentPickingEnabled() {
|
||||||
|
return nIsTransparentPickingEnabled(getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables or disables transparent picking. Disabled by default.
|
||||||
|
*
|
||||||
|
* When transparent picking is enabled, View::pick() will pick from both
|
||||||
|
* transparent and opaque renderables. When disabled, View::pick() will only
|
||||||
|
* pick from opaque renderables.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Transparent picking will create an extra pass for rendering depth
|
||||||
|
* from both transparent and opaque renderables.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param enabled true enables transparent picking, false disables it.
|
||||||
|
*/
|
||||||
|
public void setTransparentPickingEnabled(boolean enabled) {
|
||||||
|
nSetTransparentPickingEnabled(getNativeObject(), enabled);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets options relative to dynamic lighting for this view.
|
* Sets options relative to dynamic lighting for this view.
|
||||||
*
|
*
|
||||||
@@ -1224,6 +1260,18 @@ public class View {
|
|||||||
return nGetFogEntity(getNativeObject());
|
return nGetFogEntity(getNativeObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When certain temporal features are used (e.g.: TAA or Screen-space reflections), the view
|
||||||
|
* keeps a history of previous frame renders associated with the Renderer the view was last
|
||||||
|
* used with. When switching Renderer, it may be necessary to clear that history by calling
|
||||||
|
* this method. Similarly, if the whole content of the screen change, like when a cut-scene
|
||||||
|
* starts, clearing the history might be needed to avoid artifacts due to the previous frame
|
||||||
|
* being very different.
|
||||||
|
*/
|
||||||
|
public void clearFrameHistory(Engine engine) {
|
||||||
|
nClearFrameHistory(getNativeObject(), engine.getNativeObject());
|
||||||
|
}
|
||||||
|
|
||||||
public long getNativeObject() {
|
public long getNativeObject() {
|
||||||
if (mNativeObject == 0) {
|
if (mNativeObject == 0) {
|
||||||
throw new IllegalStateException("Calling method on destroyed View");
|
throw new IllegalStateException("Calling method on destroyed View");
|
||||||
@@ -1238,6 +1286,7 @@ public class View {
|
|||||||
private static native void nSetName(long nativeView, String name);
|
private static native void nSetName(long nativeView, String name);
|
||||||
private static native void nSetScene(long nativeView, long nativeScene);
|
private static native void nSetScene(long nativeView, long nativeScene);
|
||||||
private static native void nSetCamera(long nativeView, long nativeCamera);
|
private static native void nSetCamera(long nativeView, long nativeCamera);
|
||||||
|
private static native boolean nHasCamera(long nativeView);
|
||||||
private static native void nSetViewport(long nativeView, int left, int bottom, int width, int height);
|
private static native void nSetViewport(long nativeView, int left, int bottom, int width, int height);
|
||||||
private static native void nSetVisibleLayers(long nativeView, int select, int value);
|
private static native void nSetVisibleLayers(long nativeView, int select, int value);
|
||||||
private static native void nSetShadowingEnabled(long nativeView, boolean enabled);
|
private static native void nSetShadowingEnabled(long nativeView, boolean enabled);
|
||||||
@@ -1259,6 +1308,8 @@ public class View {
|
|||||||
private static native boolean nIsPostProcessingEnabled(long nativeView);
|
private static native boolean nIsPostProcessingEnabled(long nativeView);
|
||||||
private static native void nSetFrontFaceWindingInverted(long nativeView, boolean inverted);
|
private static native void nSetFrontFaceWindingInverted(long nativeView, boolean inverted);
|
||||||
private static native boolean nIsFrontFaceWindingInverted(long nativeView);
|
private static native boolean nIsFrontFaceWindingInverted(long nativeView);
|
||||||
|
private static native void nSetTransparentPickingEnabled(long nativeView, boolean enabled);
|
||||||
|
private static native boolean nIsTransparentPickingEnabled(long nativeView);
|
||||||
private static native void nSetAmbientOcclusion(long nativeView, int ordinal);
|
private static native void nSetAmbientOcclusion(long nativeView, int ordinal);
|
||||||
private static native int nGetAmbientOcclusion(long nativeView);
|
private static native int nGetAmbientOcclusion(long nativeView);
|
||||||
private static native void nSetAmbientOcclusionOptions(long nativeView, float radius, float bias, float power, float resolution, float intensity, float bilateralThreshold, int quality, int lowPassFilter, int upsampling, boolean enabled, boolean bentNormals, float minHorizonAngleRad);
|
private static native void nSetAmbientOcclusionOptions(long nativeView, float radius, float bias, float power, float resolution, float intensity, float bilateralThreshold, int quality, int lowPassFilter, int upsampling, boolean enabled, boolean bentNormals, float minHorizonAngleRad);
|
||||||
@@ -1284,7 +1335,7 @@ public class View {
|
|||||||
private static native void nSetMaterialGlobal(long nativeView, int index, float x, float y, float z, float w);
|
private static native void nSetMaterialGlobal(long nativeView, int index, float x, float y, float z, float w);
|
||||||
private static native void nGetMaterialGlobal(long nativeView, int index, float[] out);
|
private static native void nGetMaterialGlobal(long nativeView, int index, float[] out);
|
||||||
private static native int nGetFogEntity(long nativeView);
|
private static native int nGetFogEntity(long nativeView);
|
||||||
|
private static native void nClearFrameHistory(long nativeView, long nativeEngine);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of available ambient occlusion techniques.
|
* List of available ambient occlusion techniques.
|
||||||
@@ -1369,10 +1420,10 @@ public class View {
|
|||||||
/**
|
/**
|
||||||
* Upscaling quality
|
* Upscaling quality
|
||||||
* LOW: bilinear filtered blit. Fastest, poor quality
|
* LOW: bilinear filtered blit. Fastest, poor quality
|
||||||
* MEDIUM: AMD FidelityFX FSR1 w/ mobile optimizations
|
* MEDIUM: Qualcomm Snapdragon Game Super Resolution (SGSR) 1.0
|
||||||
* HIGH: AMD FidelityFX FSR1 w/ mobile optimizations
|
* HIGH: AMD FidelityFX FSR1 w/ mobile optimizations
|
||||||
* ULTRA: AMD FidelityFX FSR1
|
* ULTRA: AMD FidelityFX FSR1
|
||||||
* FSR1 require a well anti-aliased (MSAA or TAA), noise free scene.
|
* FSR1 and SGSR require a well anti-aliased (MSAA or TAA), noise free scene. Avoid FXAA and dithering.
|
||||||
*
|
*
|
||||||
* The default upscaling quality is set to LOW.
|
* The default upscaling quality is set to LOW.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ set_target_properties(iblprefilter PROPERTIES IMPORTED_LOCATION
|
|||||||
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfilament-iblprefilter.a)
|
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfilament-iblprefilter.a)
|
||||||
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libfilament-utils-jni.map")
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libfilament-utils-jni.map")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
|
||||||
|
|
||||||
add_library(filament-utils-jni SHARED
|
add_library(filament-utils-jni SHARED
|
||||||
src/main/cpp/AutomationEngine.cpp
|
src/main/cpp/AutomationEngine.cpp
|
||||||
|
|||||||
@@ -125,6 +125,11 @@ extern "C" JNIEXPORT void Java_com_google_android_filament_utils_Manipulator_nBu
|
|||||||
builder->groundPlane(a, b, c, d);
|
builder->groundPlane(a, b, c, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void Java_com_google_android_filament_utils_Manipulator_nBuilderPanning(JNIEnv*, jclass, jlong nativeBuilder, jboolean enabled) {
|
||||||
|
Builder* builder = (Builder*) nativeBuilder;
|
||||||
|
builder->panning(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT long Java_com_google_android_filament_utils_Manipulator_nBuilderBuild(JNIEnv*, jclass, jlong nativeBuilder, jint mode) {
|
extern "C" JNIEXPORT long Java_com_google_android_filament_utils_Manipulator_nBuilderBuild(JNIEnv*, jclass, jlong nativeBuilder, jint mode) {
|
||||||
Builder* builder = (Builder*) nativeBuilder;
|
Builder* builder = (Builder*) nativeBuilder;
|
||||||
return (jlong) builder->build((Mode) mode);
|
return (jlong) builder->build((Mode) mode);
|
||||||
|
|||||||
@@ -274,6 +274,17 @@ public class Manipulator {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether panning is enabled in the manipulator.
|
||||||
|
*
|
||||||
|
* @return this <code>Builder</code> object for chaining calls
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public Builder panning(Boolean enabled) {
|
||||||
|
nBuilderPanning(mNativeBuilder, enabled);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns the <code>Manipulator</code> object.
|
* Creates and returns the <code>Manipulator</code> object.
|
||||||
*
|
*
|
||||||
@@ -483,6 +494,7 @@ public class Manipulator {
|
|||||||
private static native void nBuilderFlightPanSpeed(long nativeBuilder, float x, float y);
|
private static native void nBuilderFlightPanSpeed(long nativeBuilder, float x, float y);
|
||||||
private static native void nBuilderFlightMoveDamping(long nativeBuilder, float damping);
|
private static native void nBuilderFlightMoveDamping(long nativeBuilder, float damping);
|
||||||
private static native void nBuilderGroundPlane(long nativeBuilder, float a, float b, float c, float d);
|
private static native void nBuilderGroundPlane(long nativeBuilder, float a, float b, float c, float d);
|
||||||
|
private static native void nBuilderPanning(long nativeBuilder, Boolean enabled);
|
||||||
private static native long nBuilderBuild(long nativeBuilder, int mode);
|
private static native long nBuilderBuild(long nativeBuilder, int mode);
|
||||||
|
|
||||||
private static native void nDestroyManipulator(long nativeManip);
|
private static native void nDestroyManipulator(long nativeManip);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ set_target_properties(uberarchive PROPERTIES IMPORTED_LOCATION
|
|||||||
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libuberarchive.a)
|
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libuberarchive.a)
|
||||||
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libgltfio-jni.map")
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libgltfio-jni.map")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384")
|
||||||
|
|
||||||
set(GLTFIO_SRCS
|
set(GLTFIO_SRCS
|
||||||
${GLTFIO_DIR}/include/gltfio/Animator.h
|
${GLTFIO_DIR}/include/gltfio/Animator.h
|
||||||
@@ -86,7 +87,10 @@ set(GLTFIO_SRCS
|
|||||||
${GLTFIO_DIR}/src/Wireframe.cpp
|
${GLTFIO_DIR}/src/Wireframe.cpp
|
||||||
${GLTFIO_DIR}/src/Wireframe.h
|
${GLTFIO_DIR}/src/Wireframe.h
|
||||||
${GLTFIO_DIR}/src/downcast.h
|
${GLTFIO_DIR}/src/downcast.h
|
||||||
|
${GLTFIO_DIR}/src/extended/AssetLoaderExtended.cpp
|
||||||
${GLTFIO_DIR}/src/extended/AssetLoaderExtended.h
|
${GLTFIO_DIR}/src/extended/AssetLoaderExtended.h
|
||||||
|
${GLTFIO_DIR}/src/extended/ResourceLoaderExtended.cpp
|
||||||
|
${GLTFIO_DIR}/src/extended/ResourceLoaderExtended.h
|
||||||
${GLTFIO_DIR}/src/extended/TangentsJobExtended.cpp
|
${GLTFIO_DIR}/src/extended/TangentsJobExtended.cpp
|
||||||
${GLTFIO_DIR}/src/extended/TangentsJobExtended.h
|
${GLTFIO_DIR}/src/extended/TangentsJobExtended.h
|
||||||
${GLTFIO_DIR}/src/extended/TangentSpaceMeshWrapper.cpp
|
${GLTFIO_DIR}/src/extended/TangentSpaceMeshWrapper.cpp
|
||||||
@@ -116,7 +120,6 @@ set(GLTFIO_INCLUDE_DIRS
|
|||||||
../../third_party/cgltf
|
../../third_party/cgltf
|
||||||
../../third_party/meshoptimizer/src
|
../../third_party/meshoptimizer/src
|
||||||
../../third_party/robin-map
|
../../third_party/robin-map
|
||||||
../../third_party/hat-trie
|
|
||||||
../../third_party/stb
|
../../third_party/stb
|
||||||
../../libs/utils/include
|
../../libs/utils/include
|
||||||
../../libs/ktxreader/include
|
../../libs/ktxreader/include
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
GROUP=com.google.android.filament
|
GROUP=com.google.android.filament
|
||||||
VERSION_NAME=1.51.2
|
VERSION_NAME=1.57.0
|
||||||
|
|
||||||
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
|
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#Wed Nov 17 10:40:18 PST 2021
|
#Wed Nov 17 10:40:18 PST 2021
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ plugins {
|
|||||||
|
|
||||||
project.ext.isSample = true
|
project.ext.isSample = true
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvmToolchain(versions.jdk)
|
||||||
|
}
|
||||||
|
|
||||||
filamentTools {
|
filamentTools {
|
||||||
cmgenArgs = "-q --format=ktx --size=256 --extract-blur=0.1 --deploy=src/main/assets/envs/default_env"
|
cmgenArgs = "-q --format=ktx --size=256 --extract-blur=0.1 --deploy=src/main/assets/envs/default_env"
|
||||||
iblInputFile = project.layout.projectDirectory.file("../../../third_party/environments/lightroom_14b.hdr")
|
iblInputFile = project.layout.projectDirectory.file("../../../third_party/environments/lightroom_14b.hdr")
|
||||||
@@ -13,7 +17,7 @@ filamentTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't forget to update MainACtivity.kt when/if changing this.
|
// don't forget to update MainACtivity.kt when/if changing this.
|
||||||
task copyMesh(type: Copy) {
|
tasks.register('copyMesh', Copy) {
|
||||||
from "../../../third_party/models/BusterDrone"
|
from "../../../third_party/models/BusterDrone"
|
||||||
into "src/main/assets/models"
|
into "src/main/assets/models"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,13 @@ class MainActivity : Activity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupFilament() {
|
private fun setupFilament() {
|
||||||
engine = Engine.Builder().featureLevel(Engine.FeatureLevel.FEATURE_LEVEL_0).build()
|
val config = Engine.Config()
|
||||||
|
//config.forceGLES2Context = true
|
||||||
|
|
||||||
|
engine = Engine.Builder()
|
||||||
|
.config(config)
|
||||||
|
.featureLevel(Engine.FeatureLevel.FEATURE_LEVEL_0)
|
||||||
|
.build()
|
||||||
renderer = engine.createRenderer()
|
renderer = engine.createRenderer()
|
||||||
scene = engine.createScene()
|
scene = engine.createScene()
|
||||||
view = engine.createView()
|
view = engine.createView()
|
||||||
@@ -123,7 +129,9 @@ class MainActivity : Activity() {
|
|||||||
scene.skybox = Skybox.Builder().color(0.035f, 0.035f, 0.035f, 1.0f).build(engine)
|
scene.skybox = Skybox.Builder().color(0.035f, 0.035f, 0.035f, 1.0f).build(engine)
|
||||||
|
|
||||||
// post-processing is not supported at feature level 0
|
// post-processing is not supported at feature level 0
|
||||||
view.isPostProcessingEnabled = false
|
if (engine.activeFeatureLevel == Engine.FeatureLevel.FEATURE_LEVEL_0) {
|
||||||
|
view.isPostProcessingEnabled = false
|
||||||
|
}
|
||||||
|
|
||||||
// Tell the view which camera we want to use
|
// Tell the view which camera we want to use
|
||||||
view.camera = camera
|
view.camera = camera
|
||||||
@@ -321,7 +329,7 @@ class MainActivity : Activity() {
|
|||||||
var flags = uiHelper.swapChainFlags
|
var flags = uiHelper.swapChainFlags
|
||||||
if (engine.activeFeatureLevel == Engine.FeatureLevel.FEATURE_LEVEL_0) {
|
if (engine.activeFeatureLevel == Engine.FeatureLevel.FEATURE_LEVEL_0) {
|
||||||
if (SwapChain.isSRGBSwapChainSupported(engine)) {
|
if (SwapChain.isSRGBSwapChainSupported(engine)) {
|
||||||
flags = flags or SwapChain.CONFIG_SRGB_COLORSPACE
|
flags = flags or SwapChainFlags.CONFIG_SRGB_COLORSPACE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ function print_help {
|
|||||||
echo " This is sometimes needed instead of -c (which still misses some clean steps)."
|
echo " This is sometimes needed instead of -c (which still misses some clean steps)."
|
||||||
echo " -d"
|
echo " -d"
|
||||||
echo " Enable matdbg."
|
echo " Enable matdbg."
|
||||||
|
echo " -t"
|
||||||
|
echo " Enable fgviewer."
|
||||||
echo " -f"
|
echo " -f"
|
||||||
echo " Always invoke CMake before incremental builds."
|
echo " Always invoke CMake before incremental builds."
|
||||||
echo " -g"
|
echo " -g"
|
||||||
@@ -44,8 +46,6 @@ function print_help {
|
|||||||
echo " Exclude Vulkan support from the Android build."
|
echo " Exclude Vulkan support from the Android build."
|
||||||
echo " -s"
|
echo " -s"
|
||||||
echo " Add iOS simulator support to the iOS build."
|
echo " Add iOS simulator support to the iOS build."
|
||||||
echo " -t"
|
|
||||||
echo " Enable SwiftShader support for Vulkan in desktop builds."
|
|
||||||
echo " -e"
|
echo " -e"
|
||||||
echo " Enable EGL on Linux support for desktop builds."
|
echo " Enable EGL on Linux support for desktop builds."
|
||||||
echo " -l"
|
echo " -l"
|
||||||
@@ -61,6 +61,17 @@ function print_help {
|
|||||||
echo " -b"
|
echo " -b"
|
||||||
echo " Enable Address and Undefined Behavior Sanitizers (asan/ubsan) for debugging."
|
echo " Enable Address and Undefined Behavior Sanitizers (asan/ubsan) for debugging."
|
||||||
echo " This is only for the desktop build."
|
echo " This is only for the desktop build."
|
||||||
|
echo " -x value"
|
||||||
|
echo " Define a preprocessor flag FILAMENT_BACKEND_DEBUG_FLAG with [value]. This is useful for"
|
||||||
|
echo " enabling debug paths in the backend from the build script. For example, make a"
|
||||||
|
echo " systrace-enabled build without directly changing #defines. Remember to add -f when"
|
||||||
|
echo " changing this option."
|
||||||
|
echo " -X osmesa_path"
|
||||||
|
echo " Indicates a path to a completed OSMesa build. OSMesa is used to create an offscreen GL"
|
||||||
|
echo " context for software rasterization"
|
||||||
|
echo " -S type"
|
||||||
|
echo " Enable stereoscopic rendering where type is one of [instanced|multiview]. This is only"
|
||||||
|
echo " meant for building the samples."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Build types:"
|
echo "Build types:"
|
||||||
echo " release"
|
echo " release"
|
||||||
@@ -116,6 +127,27 @@ function print_matdbg_help {
|
|||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function print_fgviewer_help {
|
||||||
|
echo "fgviewer is enabled in the build, but some extra steps are needed."
|
||||||
|
echo ""
|
||||||
|
echo "FOR DESKTOP BUILDS:"
|
||||||
|
echo ""
|
||||||
|
echo "Please set the port environment variable before launching. e.g., on macOS do:"
|
||||||
|
echo " export FILAMENT_FGVIEWER_PORT=8085"
|
||||||
|
echo ""
|
||||||
|
echo "FOR ANDROID BUILDS:"
|
||||||
|
echo ""
|
||||||
|
echo "1) For Android Studio builds, make sure to set:"
|
||||||
|
echo " -Pcom.google.android.filament.fgviewer"
|
||||||
|
echo " option in Preferences > Build > Compiler > Command line options."
|
||||||
|
echo ""
|
||||||
|
echo "2) The port number is hardcoded to 8085 so you will need to do:"
|
||||||
|
echo " adb forward tcp:8085 tcp:8085"
|
||||||
|
echo ""
|
||||||
|
echo "3) Be sure to enable INTERNET permission in your app's manifest file."
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
# Unless explicitly specified, NDK version will be selected as highest available version within same major release chain
|
# Unless explicitly specified, NDK version will be selected as highest available version within same major release chain
|
||||||
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION:-$(cat `dirname $0`/build/android/ndk.version | cut -f 1 -d ".")}
|
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION:-$(cat `dirname $0`/build/android/ndk.version | cut -f 1 -d ".")}
|
||||||
|
|
||||||
@@ -160,11 +192,10 @@ INSTALL_COMMAND=
|
|||||||
VULKAN_ANDROID_OPTION="-DFILAMENT_SUPPORTS_VULKAN=ON"
|
VULKAN_ANDROID_OPTION="-DFILAMENT_SUPPORTS_VULKAN=ON"
|
||||||
VULKAN_ANDROID_GRADLE_OPTION=""
|
VULKAN_ANDROID_GRADLE_OPTION=""
|
||||||
|
|
||||||
SWIFTSHADER_OPTION="-DFILAMENT_USE_SWIFTSHADER=OFF"
|
|
||||||
|
|
||||||
EGL_ON_LINUX_OPTION="-DFILAMENT_SUPPORTS_EGL_ON_LINUX=OFF"
|
EGL_ON_LINUX_OPTION="-DFILAMENT_SUPPORTS_EGL_ON_LINUX=OFF"
|
||||||
|
|
||||||
MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=OFF"
|
MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=OFF"
|
||||||
|
FGVIEWER_OPTION="-DFILAMENT_ENABLE_FGVIEWER=OFF"
|
||||||
MATDBG_GRADLE_OPTION=""
|
MATDBG_GRADLE_OPTION=""
|
||||||
|
|
||||||
MATOPT_OPTION=""
|
MATOPT_OPTION=""
|
||||||
@@ -172,6 +203,12 @@ MATOPT_GRADLE_OPTION=""
|
|||||||
|
|
||||||
ASAN_UBSAN_OPTION=""
|
ASAN_UBSAN_OPTION=""
|
||||||
|
|
||||||
|
BACKEND_DEBUG_FLAG_OPTION=""
|
||||||
|
|
||||||
|
STEREOSCOPIC_OPTION=""
|
||||||
|
|
||||||
|
OSMESA_OPTION=""
|
||||||
|
|
||||||
IOS_BUILD_SIMULATOR=false
|
IOS_BUILD_SIMULATOR=false
|
||||||
BUILD_UNIVERSAL_LIBRARIES=false
|
BUILD_UNIVERSAL_LIBRARIES=false
|
||||||
|
|
||||||
@@ -226,11 +263,14 @@ function build_desktop_target {
|
|||||||
-DIMPORT_EXECUTABLES_DIR=out \
|
-DIMPORT_EXECUTABLES_DIR=out \
|
||||||
-DCMAKE_BUILD_TYPE="$1" \
|
-DCMAKE_BUILD_TYPE="$1" \
|
||||||
-DCMAKE_INSTALL_PREFIX="../${lc_target}/filament" \
|
-DCMAKE_INSTALL_PREFIX="../${lc_target}/filament" \
|
||||||
${SWIFTSHADER_OPTION} \
|
|
||||||
${EGL_ON_LINUX_OPTION} \
|
${EGL_ON_LINUX_OPTION} \
|
||||||
|
${FGVIEWER_OPTION} \
|
||||||
${MATDBG_OPTION} \
|
${MATDBG_OPTION} \
|
||||||
${MATOPT_OPTION} \
|
${MATOPT_OPTION} \
|
||||||
${ASAN_UBSAN_OPTION} \
|
${ASAN_UBSAN_OPTION} \
|
||||||
|
${BACKEND_DEBUG_FLAG_OPTION} \
|
||||||
|
${STEREOSCOPIC_OPTION} \
|
||||||
|
${OSMESA_OPTION} \
|
||||||
${architectures} \
|
${architectures} \
|
||||||
../..
|
../..
|
||||||
ln -sf "out/cmake-${lc_target}/compile_commands.json" \
|
ln -sf "out/cmake-${lc_target}/compile_commands.json" \
|
||||||
@@ -289,6 +329,7 @@ function build_webgl_with_target {
|
|||||||
-DCMAKE_BUILD_TYPE="$1" \
|
-DCMAKE_BUILD_TYPE="$1" \
|
||||||
-DCMAKE_INSTALL_PREFIX="../webgl-${lc_target}/filament" \
|
-DCMAKE_INSTALL_PREFIX="../webgl-${lc_target}/filament" \
|
||||||
-DWEBGL=1 \
|
-DWEBGL=1 \
|
||||||
|
${BACKEND_DEBUG_FLAG_OPTION} \
|
||||||
../..
|
../..
|
||||||
ln -sf "out/cmake-webgl-${lc_target}/compile_commands.json" \
|
ln -sf "out/cmake-webgl-${lc_target}/compile_commands.json" \
|
||||||
../../compile_commands.json
|
../../compile_commands.json
|
||||||
@@ -360,9 +401,12 @@ function build_android_target {
|
|||||||
-DFILAMENT_NDK_VERSION="${FILAMENT_NDK_VERSION}" \
|
-DFILAMENT_NDK_VERSION="${FILAMENT_NDK_VERSION}" \
|
||||||
-DCMAKE_INSTALL_PREFIX="../android-${lc_target}/filament" \
|
-DCMAKE_INSTALL_PREFIX="../android-${lc_target}/filament" \
|
||||||
-DCMAKE_TOOLCHAIN_FILE="../../build/toolchain-${arch}-linux-android.cmake" \
|
-DCMAKE_TOOLCHAIN_FILE="../../build/toolchain-${arch}-linux-android.cmake" \
|
||||||
|
${FGVIEWER_OPTION} \
|
||||||
${MATDBG_OPTION} \
|
${MATDBG_OPTION} \
|
||||||
${MATOPT_OPTION} \
|
${MATOPT_OPTION} \
|
||||||
${VULKAN_ANDROID_OPTION} \
|
${VULKAN_ANDROID_OPTION} \
|
||||||
|
${BACKEND_DEBUG_FLAG_OPTION} \
|
||||||
|
${STEREOSCOPIC_OPTION} \
|
||||||
../..
|
../..
|
||||||
ln -sf "out/cmake-android-${lc_target}-${arch}/compile_commands.json" \
|
ln -sf "out/cmake-android-${lc_target}-${arch}/compile_commands.json" \
|
||||||
../../compile_commands.json
|
../../compile_commands.json
|
||||||
@@ -595,8 +639,10 @@ function build_ios_target {
|
|||||||
-DPLATFORM_NAME="${platform}" \
|
-DPLATFORM_NAME="${platform}" \
|
||||||
-DIOS=1 \
|
-DIOS=1 \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=../../third_party/clang/iOS.cmake \
|
-DCMAKE_TOOLCHAIN_FILE=../../third_party/clang/iOS.cmake \
|
||||||
|
${FGVIEWER_OPTION} \
|
||||||
${MATDBG_OPTION} \
|
${MATDBG_OPTION} \
|
||||||
${MATOPT_OPTION} \
|
${MATOPT_OPTION} \
|
||||||
|
${STEREOSCOPIC_OPTION} \
|
||||||
../..
|
../..
|
||||||
ln -sf "out/cmake-ios-${lc_target}-${arch}/compile_commands.json" \
|
ln -sf "out/cmake-ios-${lc_target}-${arch}/compile_commands.json" \
|
||||||
../../compile_commands.json
|
../../compile_commands.json
|
||||||
@@ -730,6 +776,13 @@ function validate_build_command {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure FILAMENT_BACKEND_DEBUG_FLAG is only meant for debug builds
|
||||||
|
if [[ "${ISSUE_DEBUG_BUILD}" != "true" ]] && [[ ! -z "${BACKEND_DEBUG_FLAG_OPTION}" ]]; then
|
||||||
|
echo "Error: cannot specify FILAMENT_BACKEND_DEBUG_FLAG in non-debug build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -776,7 +829,7 @@ function check_debug_release_build {
|
|||||||
|
|
||||||
pushd "$(dirname "$0")" > /dev/null
|
pushd "$(dirname "$0")" > /dev/null
|
||||||
|
|
||||||
while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do
|
while getopts ":hacCfgijmp:q:uvslwedtk:bx:S:X:" opt; do
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
h)
|
h)
|
||||||
print_help
|
print_help
|
||||||
@@ -797,6 +850,12 @@ while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do
|
|||||||
MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=ON, -DFILAMENT_BUILD_FILAMAT=ON"
|
MATDBG_OPTION="-DFILAMENT_ENABLE_MATDBG=ON, -DFILAMENT_BUILD_FILAMAT=ON"
|
||||||
MATDBG_GRADLE_OPTION="-Pcom.google.android.filament.matdbg"
|
MATDBG_GRADLE_OPTION="-Pcom.google.android.filament.matdbg"
|
||||||
;;
|
;;
|
||||||
|
t)
|
||||||
|
# TODO: Uncomment below when fgviewer is ready
|
||||||
|
# PRINT_FGVIEWER_HELP=true
|
||||||
|
# FGVIEWER_OPTION="-DFILAMENT_ENABLE_FGVIEWER=ON"
|
||||||
|
#FGVIEWER_GRADLE_OPTION="-Pcom.google.android.filament.fgviewer"
|
||||||
|
;;
|
||||||
f)
|
f)
|
||||||
ISSUE_CMAKE_ALWAYS=true
|
ISSUE_CMAKE_ALWAYS=true
|
||||||
;;
|
;;
|
||||||
@@ -840,7 +899,7 @@ while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do
|
|||||||
echo "Platform must be one of [desktop|android|ios|webgl|all]"
|
echo "Platform must be one of [desktop|android|ios|webgl|all]"
|
||||||
echo ""
|
echo ""
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
@@ -895,10 +954,6 @@ while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do
|
|||||||
IOS_BUILD_SIMULATOR=true
|
IOS_BUILD_SIMULATOR=true
|
||||||
echo "iOS simulator support enabled."
|
echo "iOS simulator support enabled."
|
||||||
;;
|
;;
|
||||||
t)
|
|
||||||
SWIFTSHADER_OPTION="-DFILAMENT_USE_SWIFTSHADER=ON"
|
|
||||||
echo "SwiftShader support enabled."
|
|
||||||
;;
|
|
||||||
e)
|
e)
|
||||||
EGL_ON_LINUX_OPTION="-DFILAMENT_SUPPORTS_EGL_ON_LINUX=ON -DFILAMENT_SKIP_SDL2=ON -DFILAMENT_SKIP_SAMPLES=ON"
|
EGL_ON_LINUX_OPTION="-DFILAMENT_SUPPORTS_EGL_ON_LINUX=ON -DFILAMENT_SKIP_SDL2=ON -DFILAMENT_SKIP_SAMPLES=ON"
|
||||||
echo "EGL on Linux support enabled; skipping SDL2."
|
echo "EGL on Linux support enabled; skipping SDL2."
|
||||||
@@ -918,6 +973,24 @@ while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do
|
|||||||
b) ASAN_UBSAN_OPTION="-DFILAMENT_ENABLE_ASAN_UBSAN=ON"
|
b) ASAN_UBSAN_OPTION="-DFILAMENT_ENABLE_ASAN_UBSAN=ON"
|
||||||
echo "Enabled ASAN/UBSAN"
|
echo "Enabled ASAN/UBSAN"
|
||||||
;;
|
;;
|
||||||
|
x) BACKEND_DEBUG_FLAG_OPTION="-DFILAMENT_BACKEND_DEBUG_FLAG=${OPTARG}"
|
||||||
|
;;
|
||||||
|
S) case $(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') in
|
||||||
|
instanced)
|
||||||
|
STEREOSCOPIC_OPTION="-DFILAMENT_SAMPLES_STEREO_TYPE=instanced"
|
||||||
|
;;
|
||||||
|
multiview)
|
||||||
|
STEREOSCOPIC_OPTION="-DFILAMENT_SAMPLES_STEREO_TYPE=multiview"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown stereoscopic type ${OPTARG}"
|
||||||
|
echo "Type must be one of [instanced|multiview]"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
X) OSMESA_OPTION="-DFILAMENT_OSMESA_PATH=${OPTARG}"
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -${OPTARG}" >&2
|
echo "Invalid option: -${OPTARG}" >&2
|
||||||
echo ""
|
echo ""
|
||||||
@@ -987,3 +1060,7 @@ fi
|
|||||||
if [[ "${PRINT_MATDBG_HELP}" == "true" ]]; then
|
if [[ "${PRINT_MATDBG_HELP}" == "true" ]]; then
|
||||||
print_matdbg_help
|
print_matdbg_help
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${PRINT_FGVIEWER_HELP}" == "true" ]]; then
|
||||||
|
print_fgviewer_help
|
||||||
|
fi
|
||||||
|
|||||||
@@ -57,15 +57,10 @@ FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION:-$(cat `dirname $0`/ndk.version)}
|
|||||||
|
|
||||||
# Install the required NDK version specifically (if not present)
|
# Install the required NDK version specifically (if not present)
|
||||||
if [[ ! -d "${ANDROID_HOME}/ndk/$FILAMENT_NDK_VERSION" ]]; then
|
if [[ ! -d "${ANDROID_HOME}/ndk/$FILAMENT_NDK_VERSION" ]]; then
|
||||||
${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;$FILAMENT_NDK_VERSION" > /dev/null
|
yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses
|
||||||
|
${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;$FILAMENT_NDK_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only build 1 64 bit target during presubmit to cut down build times during presubmit
|
|
||||||
# Continuous builds will build everything
|
|
||||||
ANDROID_ABIS=
|
ANDROID_ABIS=
|
||||||
if [[ "$TARGET" == "presubmit" ]]; then
|
|
||||||
ANDROID_ABIS="-q arm64-v8a"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build the Android sample-gltf-viewer APK during release.
|
# Build the Android sample-gltf-viewer APK during release.
|
||||||
BUILD_SAMPLES=
|
BUILD_SAMPLES=
|
||||||
@@ -73,5 +68,19 @@ if [[ "$TARGET" == "release" ]]; then
|
|||||||
BUILD_SAMPLES="-k sample-gltf-viewer"
|
BUILD_SAMPLES="-k sample-gltf-viewer"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function build_android() {
|
||||||
|
local ABI=$1
|
||||||
|
|
||||||
|
# Do the following in two steps so that we do not run out of space
|
||||||
|
if [[ -n "${BUILD_DEBUG}" ]]; then
|
||||||
|
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android -q ${ABI} -c ${BUILD_SAMPLES} ${GENERATE_ARCHIVES} ${BUILD_DEBUG}
|
||||||
|
rm -rf out/cmake-android-debug-*
|
||||||
|
fi
|
||||||
|
if [[ -n "${BUILD_RELEASE}" ]]; then
|
||||||
|
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android -q ${ABI} -c ${BUILD_SAMPLES} ${GENERATE_ARCHIVES} ${BUILD_RELEASE}
|
||||||
|
rm -rf out/cmake-android-release-*
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
pushd `dirname $0`/../.. > /dev/null
|
pushd `dirname $0`/../.. > /dev/null
|
||||||
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android $ANDROID_ABIS -c $BUILD_SAMPLES $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
|
build_android $2
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
26.1.10909125
|
27.0.11718014
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# version of clang we want to use
|
# version of clang we want to use
|
||||||
GITHUB_CLANG_VERSION=14
|
export GITHUB_CLANG_VERSION=14
|
||||||
# version of CMake to use instead of the default one
|
# version of CMake to use instead of the default one
|
||||||
CMAKE_VERSION=3.19.5
|
export GITHUB_CMAKE_VERSION=3.19.5
|
||||||
# version of ninja to use
|
# version of ninja to use
|
||||||
NINJA_VERSION=1.10.2
|
export GITHUB_NINJA_VERSION=1.10.2
|
||||||
|
|
||||||
# Steps for GitHub Workflows
|
# Steps for GitHub Workflows
|
||||||
if [[ "$GITHUB_WORKFLOW" ]]; then
|
if [[ "$GITHUB_WORKFLOW" ]]; then
|
||||||
# Install ninja
|
# Install ninja
|
||||||
wget -q https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-linux.zip
|
wget -q https://github.com/ninja-build/ninja/releases/download/v$GITHUB_NINJA_VERSION/ninja-linux.zip
|
||||||
unzip -q ninja-linux.zip
|
unzip -q ninja-linux.zip
|
||||||
export PATH="$PWD:$PATH"
|
export PATH="$PWD:$PATH"
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ if [[ "$GITHUB_WORKFLOW" ]]; then
|
|||||||
mkdir -p cmake
|
mkdir -p cmake
|
||||||
cd cmake
|
cd cmake
|
||||||
|
|
||||||
sudo wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.sh
|
sudo wget https://github.com/Kitware/CMake/releases/download/v$GITHUB_CMAKE_VERSION/cmake-$GITHUB_CMAKE_VERSION-Linux-x86_64.sh
|
||||||
sudo chmod +x ./cmake-$CMAKE_VERSION-Linux-x86_64.sh
|
sudo chmod +x ./cmake-$GITHUB_CMAKE_VERSION-Linux-x86_64.sh
|
||||||
sudo ./cmake-$CMAKE_VERSION-Linux-x86_64.sh --skip-license > /dev/null
|
sudo ./cmake-$GITHUB_CMAKE_VERSION-Linux-x86_64.sh --skip-license > /dev/null
|
||||||
sudo update-alternatives --install /usr/bin/cmake cmake $(pwd)/bin/cmake 1000 --force
|
sudo update-alternatives --install /usr/bin/cmake cmake $(pwd)/bin/cmake 1000 --force
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ if [[ "${has_universal}" == "true" ]]; then
|
|||||||
archives+=("$REPLY")
|
archives+=("$REPLY")
|
||||||
done < <(find "$(pwd)/${archs_temp_dir}/${arch}" -iname '*.a' -print0)
|
done < <(find "$(pwd)/${archs_temp_dir}/${arch}" -iname '*.a' -print0)
|
||||||
|
|
||||||
combine_static_libs "$arch_output" "$archives"
|
combine_static_libs "$arch_output" "${archives[@]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Finally, combine the single-architecture archives into a universal binary.
|
# Finally, combine the single-architecture archives into a universal binary.
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
# Build the image:
|
|
||||||
# docker build --no-cache --tag ssfilament -f build/swiftshader/Dockerfile .
|
|
||||||
# docker tag ssfilament ghcr.io/filament-assets/swiftshader
|
|
||||||
#
|
|
||||||
# Publish the image:
|
|
||||||
# docker login ghcr.io --username <user> --password <token>
|
|
||||||
# docker push ghcr.io/filament-assets/swiftshader
|
|
||||||
#
|
|
||||||
# Run the image and mount the current directory:
|
|
||||||
# docker run -it -v `pwd`:/trees/filament -t ssfilament
|
|
||||||
|
|
||||||
FROM ubuntu:focal
|
|
||||||
WORKDIR /trees
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
ENV SWIFTSHADER_LD_LIBRARY_PATH=/trees/swiftshader/build
|
|
||||||
ENV CXXFLAGS='-fno-builtin -Wno-pass-failed'
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get --no-install-recommends install -y \
|
|
||||||
apt-transport-https \
|
|
||||||
apt-utils \
|
|
||||||
build-essential \
|
|
||||||
cmake \
|
|
||||||
ca-certificates \
|
|
||||||
git \
|
|
||||||
ninja-build \
|
|
||||||
python \
|
|
||||||
python3 \
|
|
||||||
xorg-dev \
|
|
||||||
clang-7 \
|
|
||||||
libc++-7-dev \
|
|
||||||
libc++abi-7-dev \
|
|
||||||
lldb
|
|
||||||
|
|
||||||
# Ensure that clang is used instead of gcc.
|
|
||||||
RUN set -eux ;\
|
|
||||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-7 100 ;\
|
|
||||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-7 100 ;\
|
|
||||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 ;\
|
|
||||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
|
|
||||||
|
|
||||||
# Get patch files from the local Filament tree.
|
|
||||||
COPY build/swiftshader/*.diff .
|
|
||||||
|
|
||||||
# Clone SwiftShader, apply patches, and build it.
|
|
||||||
RUN set -eux ;\
|
|
||||||
git clone https://swiftshader.googlesource.com/SwiftShader swiftshader ;\
|
|
||||||
cd swiftshader ;\
|
|
||||||
git checkout 139f5c3 ;\
|
|
||||||
git apply /trees/*.diff ;\
|
|
||||||
cd build ;\
|
|
||||||
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release ;\
|
|
||||||
ninja
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
import os
|
|
||||||
|
|
||||||
spath = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
|
|
||||||
path = Path(spath)
|
|
||||||
|
|
||||||
folder = "../../results/"
|
|
||||||
|
|
||||||
images = list(path.glob(folder + '*.png'))
|
|
||||||
|
|
||||||
images.sort()
|
|
||||||
|
|
||||||
gallery = open(path.absolute().joinpath(folder + 'index.html'), 'w')
|
|
||||||
|
|
||||||
gallery.write("""<html>
|
|
||||||
<head>
|
|
||||||
<script type="module" src="https://unpkg.com/img-comparison-slider@latest/dist/component/component.esm.js"></script>
|
|
||||||
<script nomodule="" src="https://unpkg.com/img-comparison-slider@latest/dist/component/component.js"></script>
|
|
||||||
<link rel="stylesheet" href="https://unpkg.com/img-comparison-slider@latest/dist/collection/styles/initial.css"/>
|
|
||||||
<style>
|
|
||||||
h2 {
|
|
||||||
font-weight: normal;
|
|
||||||
margin-top: 150px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
""")
|
|
||||||
|
|
||||||
tag = ''
|
|
||||||
|
|
||||||
for image in images:
|
|
||||||
group = image.stem.rstrip('0123456789')
|
|
||||||
before = f'https://filament-assets.github.io/golden/{group}/{image.name}'
|
|
||||||
after = image.name
|
|
||||||
gallery.write('\n')
|
|
||||||
gallery.write(f'<h2><a href="{image.stem}.json">{image.stem}.json</a></h2>\n')
|
|
||||||
gallery.write('<img-comparison-slider>\n')
|
|
||||||
gallery.write(f'<img slot="before" src="{before}" /> <img slot="after" src="{after}" />\n')
|
|
||||||
gallery.write('</img-comparison-slider>\n')
|
|
||||||
|
|
||||||
gallery.write("""</body>
|
|
||||||
</html>
|
|
||||||
""")
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
diff --git a/src/Vulkan/VkPipeline.cpp b/src/Vulkan/VkPipeline.cpp
|
|
||||||
index 86913ec72..3b35345af 100644
|
|
||||||
--- a/src/Vulkan/VkPipeline.cpp
|
|
||||||
+++ b/src/Vulkan/VkPipeline.cpp
|
|
||||||
@@ -71,7 +71,56 @@ std::vector<uint32_t> preprocessSpirv(
|
|
||||||
if(optimize)
|
|
||||||
{
|
|
||||||
// Full optimization list taken from spirv-opt.
|
|
||||||
- opt.RegisterPerformancePasses();
|
|
||||||
+
|
|
||||||
+ // We have removed CreateRedundancyEliminationPass because it segfaults when encountering:
|
|
||||||
+ // %389 = OpCompositeConstruct %7 %386 %387 %388 %86
|
|
||||||
+ // When inserting an entry into instruction_to_value_ (which is an unordered_map)
|
|
||||||
+ // This could perhaps be investigated further with help from asan.
|
|
||||||
+
|
|
||||||
+ using namespace spvtools;
|
|
||||||
+ opt.RegisterPass(CreateWrapOpKillPass())
|
|
||||||
+ .RegisterPass(CreateDeadBranchElimPass())
|
|
||||||
+ .RegisterPass(CreateMergeReturnPass())
|
|
||||||
+ .RegisterPass(CreateInlineExhaustivePass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreatePrivateToLocalPass())
|
|
||||||
+ .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateLocalSingleStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateScalarReplacementPass())
|
|
||||||
+ .RegisterPass(CreateLocalAccessChainConvertPass())
|
|
||||||
+ .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateLocalSingleStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateLocalMultiStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateCCPPass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateLoopUnrollPass(true))
|
|
||||||
+ .RegisterPass(CreateDeadBranchElimPass())
|
|
||||||
+ .RegisterPass(CreateRedundancyEliminationPass()) // workaround for SEGFAULT
|
|
||||||
+ .RegisterPass(CreateCombineAccessChainsPass())
|
|
||||||
+ .RegisterPass(CreateSimplificationPass())
|
|
||||||
+ .RegisterPass(CreateScalarReplacementPass())
|
|
||||||
+ .RegisterPass(CreateLocalAccessChainConvertPass())
|
|
||||||
+ .RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateLocalSingleStoreElimPass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateSSARewritePass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateVectorDCEPass())
|
|
||||||
+ .RegisterPass(CreateDeadInsertElimPass())
|
|
||||||
+ .RegisterPass(CreateDeadBranchElimPass())
|
|
||||||
+ .RegisterPass(CreateSimplificationPass())
|
|
||||||
+ .RegisterPass(CreateIfConversionPass())
|
|
||||||
+ .RegisterPass(CreateCopyPropagateArraysPass())
|
|
||||||
+ .RegisterPass(CreateReduceLoadSizePass())
|
|
||||||
+ .RegisterPass(CreateAggressiveDCEPass())
|
|
||||||
+ .RegisterPass(CreateBlockMergePass())
|
|
||||||
+ .RegisterPass(CreateRedundancyEliminationPass()) // workaround for SEGFAULT
|
|
||||||
+ .RegisterPass(CreateDeadBranchElimPass())
|
|
||||||
+ .RegisterPass(CreateBlockMergePass())
|
|
||||||
+ .RegisterPass(CreateSimplificationPass());
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<uint32_t> optimized;
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function print_help {
|
|
||||||
local self_name=$(basename "$0")
|
|
||||||
echo "This script issues docker commands for testing Filament with SwiftShader."
|
|
||||||
echo "The usual sequence of commands is: fetch, start, build filament release, and run."
|
|
||||||
echo ""
|
|
||||||
echo "Usage:"
|
|
||||||
echo " $self_name [command]"
|
|
||||||
echo ""
|
|
||||||
echo "Commands:"
|
|
||||||
echo " build filament [debug | release]"
|
|
||||||
echo " Use the container to build Filament."
|
|
||||||
echo " build swiftshader [debug | release]"
|
|
||||||
echo " Use the container to do a clean rebuild of SwiftShader."
|
|
||||||
echo " (Note that the container already has SwiftShader built.)"
|
|
||||||
echo " fetch"
|
|
||||||
echo " Download the docker image from the central repository."
|
|
||||||
echo " help"
|
|
||||||
echo " Print this help message."
|
|
||||||
echo " logs"
|
|
||||||
echo " Print messages from the container's kernel ring buffer."
|
|
||||||
echo " This is useful for diagnosing OOM issues."
|
|
||||||
echo " run [lldb]"
|
|
||||||
echo " Launch a test inside the container, optionally via lldb."
|
|
||||||
echo " shell"
|
|
||||||
echo " Interact with a bash prompt in the container."
|
|
||||||
echo " start"
|
|
||||||
echo " Start a container from the image."
|
|
||||||
echo " stop"
|
|
||||||
echo " Stop the container."
|
|
||||||
echo ""
|
|
||||||
}
|
|
||||||
|
|
||||||
# Change the current working directory to the Filament root.
|
|
||||||
pushd "$(dirname "$0")/../.." > /dev/null
|
|
||||||
|
|
||||||
if [[ "$1" == "build" ]] && [[ "$2" == "filament" ]]; then
|
|
||||||
docker exec runner filament/build.sh -t $3 gltf_viewer
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "build" ]] && [[ "$2" == "swiftshader" ]]; then
|
|
||||||
BUILD_TYPE="$3"
|
|
||||||
BUILD_TYPE="$(tr '[:lower:]' '[:upper:]' <<< ${BUILD_TYPE:0:1})${BUILD_TYPE:1}"
|
|
||||||
docker exec --workdir /trees/swiftshader runner rm -rf build
|
|
||||||
docker exec --workdir /trees/swiftshader runner mkdir build
|
|
||||||
docker exec --workdir /trees/swiftshader/build runner cmake -GNinja -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
|
|
||||||
docker exec --workdir /trees/swiftshader/build runner ninja
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "fetch" ]]; then
|
|
||||||
docker pull ghcr.io/filament-assets/swiftshader:latest
|
|
||||||
docker tag ghcr.io/filament-assets/swiftshader:latest ssfilament
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "help" ]]; then
|
|
||||||
print_help
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "logs" ]]; then
|
|
||||||
docker exec runner dmesg --human --read-clear
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "run" ]] && [[ "$2" == "lldb" ]]; then
|
|
||||||
docker exec -i --workdir /trees/filament/results runner \
|
|
||||||
lldb --batch -o run -o bt -- \
|
|
||||||
../out/cmake-release/samples/gltf_viewer \
|
|
||||||
--headless \
|
|
||||||
--batch ../libs/viewer/tests/basic.json \
|
|
||||||
--api vulkan
|
|
||||||
docker exec runner /trees/filament/build/swiftshader/gallery.py
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "run" ]]; then
|
|
||||||
docker exec --tty --workdir /trees/filament/results runner \
|
|
||||||
/usr/bin/catchsegv \
|
|
||||||
../out/cmake-release/samples/gltf_viewer \
|
|
||||||
--headless \
|
|
||||||
--batch ../libs/viewer/tests/basic.json \
|
|
||||||
--api vulkan
|
|
||||||
docker exec runner /trees/filament/build/swiftshader/gallery.py
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "shell" ]]; then
|
|
||||||
docker exec --interactive --tty runner /bin/bash
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Notes on options being passed to docker's run command:
|
|
||||||
#
|
|
||||||
# - The memory constraint seems to prevent an OOM signal in GitHub Actions.
|
|
||||||
# - The cap / security args allow use of lldb and creation of core dumps.
|
|
||||||
# - The privileged arg allows use of dmesg for examining OOM logs.
|
|
||||||
#
|
|
||||||
# Currently, a GitHub Actions VM has 2 CPUs, 7 GB RAM, and 14 GB of SSD disk space.
|
|
||||||
#
|
|
||||||
# Please be aware that Docker Desktop might impose additional resource constraints, and that those
|
|
||||||
# settings can only be controlled with its GUI. We recommend at least 7 GB of memory and 2 GB swap.
|
|
||||||
if [[ "$1" == "start" ]]; then
|
|
||||||
mkdir -p results
|
|
||||||
docker run --tty --rm --detach --privileged \
|
|
||||||
--memory 6.5g \
|
|
||||||
--name runner \
|
|
||||||
--cap-add=SYS_PTRACE \
|
|
||||||
--security-opt seccomp=unconfined \
|
|
||||||
--security-opt apparmor=unconfined \
|
|
||||||
--volume `pwd`:/trees/filament \
|
|
||||||
--workdir /trees \
|
|
||||||
ssfilament
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "stop" ]]; then
|
|
||||||
docker container rm runner --force
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
print_help
|
|
||||||
exit 1
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ `uname` == "Linux" ];then
|
if [ `uname` == "Linux" ];then
|
||||||
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
source `dirname $0`/../linux/ci-common.sh
|
||||||
unzip -q ninja-linux.zip
|
|
||||||
elif [ `uname` == "Darwin" ];then
|
elif [ `uname` == "Darwin" ];then
|
||||||
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip
|
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip
|
||||||
unzip -q ninja-mac.zip
|
unzip -q ninja-mac.zip
|
||||||
@@ -13,11 +12,8 @@ fi
|
|||||||
chmod +x ninja
|
chmod +x ninja
|
||||||
export PATH="$PWD:$PATH"
|
export PATH="$PWD:$PATH"
|
||||||
|
|
||||||
# FIXME: kokoro machines have node and npm but currently they are symlinked to non-existent files
|
|
||||||
# npm install -g typescript
|
|
||||||
|
|
||||||
# Install emscripten.
|
# Install emscripten.
|
||||||
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.15.zip > emsdk.zip
|
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.60.zip > emsdk.zip
|
||||||
unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk
|
unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk
|
||||||
./emsdk install latest
|
./emsdk install latest
|
||||||
./emsdk activate latest
|
./emsdk activate latest
|
||||||
|
|||||||
@@ -115,17 +115,23 @@ cmake ..\.. ^
|
|||||||
-DFILAMENT_SUPPORTS_VULKAN=ON ^
|
-DFILAMENT_SUPPORTS_VULKAN=ON ^
|
||||||
|| exit /b
|
|| exit /b
|
||||||
|
|
||||||
|
set build_flags=-j %NUMBER_OF_PROCESSORS%
|
||||||
|
|
||||||
|
@echo on
|
||||||
|
|
||||||
|
:: we've upgraded the windows machines, so the following are no longer accurate as of 09/19/24, but
|
||||||
|
:: keeping around the comment for record.
|
||||||
|
|
||||||
:: Attempt to fix "error C1060: compiler is out of heap space" seen on CI.
|
:: Attempt to fix "error C1060: compiler is out of heap space" seen on CI.
|
||||||
:: Some resource libraries require significant heap space to compile, so first compile them serially.
|
:: Some resource libraries require significant heap space to compile, so first compile them serially.
|
||||||
@echo on
|
:: cmake --build . --target filagui --config %config% %build_flags% || exit /b
|
||||||
cmake --build . --target filagui --config %config% || exit /b
|
:: cmake --build . --target uberarchive --config %config% %build_flags% || exit /b
|
||||||
cmake --build . --target uberarchive --config %config% || exit /b
|
:: cmake --build . --target gltf-demo-resources --config %config% %build_flags% || exit /b
|
||||||
cmake --build . --target gltf-demo-resources --config %config% || exit /b
|
:: cmake --build . --target filamentapp-resources --config %config% %build_flags% || exit /b
|
||||||
cmake --build . --target filamentapp-resources --config %config% || exit /b
|
:: cmake --build . --target sample-resources --config %config% %build_flags% || exit /b
|
||||||
cmake --build . --target sample-resources --config %config% || exit /b
|
:: cmake --build . --target suzanne-resources --config %config% %build_flags% || exit /b
|
||||||
cmake --build . --target suzanne-resources --config %config% || exit /b
|
|
||||||
|
|
||||||
cmake --build . %INSTALL% --config %config% -- /m || exit /b
|
cmake --build . %INSTALL% --config %config% %build_flags% -- /m || exit /b
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
echo Disk info after building variant: %variant%
|
echo Disk info after building variant: %variant%
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
@echo off
|
|
||||||
set selfName=%0
|
|
||||||
|
|
||||||
:: Check that we have at least 3 arguments.
|
|
||||||
set argC=0
|
|
||||||
for %%x in (%*) do Set /A argC+=1
|
|
||||||
if %argC% LSS 3 goto :print_help
|
|
||||||
|
|
||||||
set AR_TOOL=%1
|
|
||||||
shift
|
|
||||||
set OUTPUT_PATH=%1
|
|
||||||
shift
|
|
||||||
|
|
||||||
set ARCHIVES=
|
|
||||||
:loop
|
|
||||||
if [%1]==[] goto :finished
|
|
||||||
set ARCHIVES=%ARCHIVES% %1
|
|
||||||
shift
|
|
||||||
goto :loop
|
|
||||||
|
|
||||||
:finished
|
|
||||||
|
|
||||||
%AR_TOOL% /nologo /out:%OUTPUT_PATH% %ARCHIVES% || goto :error
|
|
||||||
|
|
||||||
exit /B %ERRORLEVEL%
|
|
||||||
|
|
||||||
:print_help
|
|
||||||
echo %selfName%. Combine multiple static libraries using an archiver tool.
|
|
||||||
echo;
|
|
||||||
echo Usage:
|
|
||||||
echo %selfName% ^<path-to-ar^> ^<output-archive^> ^<archives^>...
|
|
||||||
echo;
|
|
||||||
echo Notes:
|
|
||||||
echo ^<archives^> must be a list of absolute paths to static library archives.
|
|
||||||
echo This script creates a temporary working directory inside the current directory.
|
|
||||||
exit /B 1
|
|
||||||
|
|
||||||
:error
|
|
||||||
exit /B %ERRORLEVEL%
|
|
||||||
@@ -1308,7 +1308,12 @@ Description
|
|||||||
declare a variable called `eyeDirection` you can access it in the fragment shader using
|
declare a variable called `eyeDirection` you can access it in the fragment shader using
|
||||||
`variable_eyeDirection`. In the vertex shader, the interpolant name is simply a member of
|
`variable_eyeDirection`. In the vertex shader, the interpolant name is simply a member of
|
||||||
the `MaterialVertexInputs` structure (`material.eyeDirection` in your example). Each
|
the `MaterialVertexInputs` structure (`material.eyeDirection` in your example). Each
|
||||||
interpolant is of type `float4` (`vec4`) in the shaders.
|
interpolant is of type `float4` (`vec4`) in the shaders. By default the precision of the
|
||||||
|
interpolant is `highp` in *both* the vertex and fragment shaders.
|
||||||
|
An alternate syntax can be used to specify both the name and precision of the interpolant.
|
||||||
|
In this case the specified precision is used as-is in both fragment and vertex stages, in
|
||||||
|
particular if `default` is specified the default precision is used is the fragment shader
|
||||||
|
(`mediump`) and in the vertex shader (`highp`).
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON
|
||||||
material {
|
material {
|
||||||
@@ -1320,7 +1325,11 @@ material {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
variables : [
|
variables : [
|
||||||
eyeDirection
|
eyeDirection,
|
||||||
|
{
|
||||||
|
name : eyeColor,
|
||||||
|
precision : medium
|
||||||
|
}
|
||||||
],
|
],
|
||||||
vertexDomain : device,
|
vertexDomain : device,
|
||||||
depthWrite : false,
|
depthWrite : false,
|
||||||
@@ -1397,7 +1406,7 @@ Type
|
|||||||
: `string`
|
: `string`
|
||||||
|
|
||||||
Value
|
Value
|
||||||
: Any of `opaque`, `transparent`, `fade`, `add`, `masked`, `multiply`, `screen`. Defaults to `opaque`.
|
: Any of `opaque`, `transparent`, `fade`, `add`, `masked`, `multiply`, `screen`, `custom`. Defaults to `opaque`.
|
||||||
|
|
||||||
Description
|
Description
|
||||||
: Defines how/if the rendered object is blended with the content of the render target.
|
: Defines how/if the rendered object is blended with the content of the render target.
|
||||||
@@ -1420,6 +1429,7 @@ Description
|
|||||||
of the material's output defines whether a fragment is discarded or not. Additionally,
|
of the material's output defines whether a fragment is discarded or not. Additionally,
|
||||||
ALPHA_TO_COVERAGE is enabled for non-translucent views. See the maskThreshold section for more
|
ALPHA_TO_COVERAGE is enabled for non-translucent views. See the maskThreshold section for more
|
||||||
information.
|
information.
|
||||||
|
- **Custom**: blending is enabled. But the blending function is user specified. See `blendFunction`.
|
||||||
|
|
||||||
!!! Note
|
!!! Note
|
||||||
When `blending` is set to `masked`, alpha to coverage is automatically enabled for the material.
|
When `blending` is set to `masked`, alpha to coverage is automatically enabled for the material.
|
||||||
@@ -1432,6 +1442,36 @@ material {
|
|||||||
}
|
}
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
### Blending and transparency: blendFunction
|
||||||
|
|
||||||
|
Type
|
||||||
|
: `object`
|
||||||
|
|
||||||
|
Fields
|
||||||
|
: `srcRGB`, `srcA`, `dstRGB`, `dstA`
|
||||||
|
|
||||||
|
Description
|
||||||
|
: - *srcRGB*: source function applied to the RGB channels
|
||||||
|
- *srcA*: source function applied to the alpha channel
|
||||||
|
- *srcRGB*: destination function applied to the RGB channels
|
||||||
|
- *srcRGB*: destination function applied to the alpha channel
|
||||||
|
The values possible for each functions are one of `zero`, `one`, `srcColor`, `oneMinusSrcColor`,
|
||||||
|
`dstColor`, `oneMinusDstColor`, `srcAlpha`, `oneMinusSrcAlpha`, `dstAlpha`,
|
||||||
|
`oneMinusDstAlpha`, `srcAlphaSaturate`
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON
|
||||||
|
material {
|
||||||
|
blending : custom,
|
||||||
|
blendFunction :
|
||||||
|
{
|
||||||
|
srcRGB: one,
|
||||||
|
srcA: one,
|
||||||
|
dstRGB: oneMinusSrcColor,
|
||||||
|
dstA: oneMinusSrcAlpha
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
### Blending and transparency: postLightingBlending
|
### Blending and transparency: postLightingBlending
|
||||||
|
|
||||||
Type
|
Type
|
||||||
@@ -2394,6 +2434,7 @@ The following APIs are only available from the vertex block:
|
|||||||
**getWorldFromModelMatrix()** | float4x4 | Matrix that converts from model (object) space to world space
|
**getWorldFromModelMatrix()** | float4x4 | Matrix that converts from model (object) space to world space
|
||||||
**getWorldFromModelNormalMatrix()** | float3x3 | Matrix that converts normals from model (object) space to world space
|
**getWorldFromModelNormalMatrix()** | float3x3 | Matrix that converts normals from model (object) space to world space
|
||||||
**getVertexIndex()** | int | Index of the current vertex
|
**getVertexIndex()** | int | Index of the current vertex
|
||||||
|
**getEyeIndex()** | int | Index of the eye being rendered, starting at 0
|
||||||
|
|
||||||
### Fragment only
|
### Fragment only
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ filament-viewer::part(canvas) {
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<script src="https://unpkg.com/filament@1.44.0/filament.js"></script>
|
<script src="https://unpkg.com/filament@1.51.6/filament.js"></script>
|
||||||
<script src="https://unpkg.com/gltumble"></script>
|
<script src="https://unpkg.com/gltumble"></script>
|
||||||
<script src="filament-viewer.js" type="module"></script>
|
<script src="filament-viewer.js" type="module"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
book
|
||||||
|
src/dup/*.md
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# Documentation
|
||||||
|
|
||||||
|
Filament's documentation (which you are reading) is a collection of pages created with [`mdBook`].
|
||||||
|
|
||||||
|
## How the book is created and updated {#how-to-create}
|
||||||
|
### Prerequisites
|
||||||
|
- Install [`mdBook`] for your platform
|
||||||
|
- `selenium` package for python
|
||||||
|
```shell
|
||||||
|
python3 -m pip install selenium
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generate {#how-to-generate}
|
||||||
|
We wrote a python script to gather and transform the different documents in the project tree into a
|
||||||
|
single book. This script can be found in [`docs_src/build/run.py`]. In addition,
|
||||||
|
[`docs_src/build/duplicates.json`] is used to describe the markdown files that are copied and
|
||||||
|
transformed from the source tree. These copies are placed into `docs_src/src/dup`.
|
||||||
|
|
||||||
|
To collect the pages and generate the book, run the following
|
||||||
|
```shell
|
||||||
|
cd docs_src
|
||||||
|
python3 build/run.py
|
||||||
|
```
|
||||||
|
|
||||||
|
### Copy to `docs`
|
||||||
|
`docs` is the github-specfic directory for producing a web frontend (i.e. documentation) for a
|
||||||
|
project.
|
||||||
|
|
||||||
|
(To be completed)
|
||||||
|
|
||||||
|
## Document sources
|
||||||
|
We list the different document sources and how they are copied and processed into the collection
|
||||||
|
of markdown files that are then processed with `mdBook`.
|
||||||
|
|
||||||
|
### Introductory docs {#introductory-doc}
|
||||||
|
The [github landing page] for Filament displays an extensive introduction to Filament. It
|
||||||
|
links to `BUILDING.md` and `CONTRIBUTING.md`, which are conventional pages for building or
|
||||||
|
contributing to the project. We copy these pages from their respective locations in the project
|
||||||
|
tree into `docs_src/src/dup`. Moreover, to restore valid linkage between the pages, we need
|
||||||
|
to perform a number of URL replacements in addition to the copy. These replacements are
|
||||||
|
described in [`docs_src/build/duplicates.json`].
|
||||||
|
|
||||||
|
### Core concept docs
|
||||||
|
The primary design of Filament as a phyiscally-based renderer and details of its materials
|
||||||
|
system are described in `Filament.md.html` and `Materials.md.html`, respectively. These two
|
||||||
|
documents are written in [`markdeep`]. To embed them into our book, we
|
||||||
|
1. Convert the markdeep into html
|
||||||
|
2. Embed the html output in a markdown file
|
||||||
|
3. Place the markdown file in `docs_src/src/main`
|
||||||
|
|
||||||
|
We describe step 1 in detail for the sake of record:
|
||||||
|
- Start a local-only server to serve the markdeep file (e.g. `Filament.md.html`)
|
||||||
|
- Start a `selenium` driver (essentially run chromium in headless mode)
|
||||||
|
- Visit the local page through the driver (i.e. open url `http://localhost:xx/Filament.md.html?export`)
|
||||||
|
- Parse out the exported output in the retrieved html (note that the output of the markdeep
|
||||||
|
export is an html with the output captured in a `<pre>` tag).
|
||||||
|
- Replace css styling in the exported output as needed (so they don't interfere with the book's css.
|
||||||
|
- Replace resource urls to refer to locations relative to the mdbook structure.
|
||||||
|
|
||||||
|
### READMEs
|
||||||
|
Filament depends on a number of libraries, which reside in the directory `libs`. These individual
|
||||||
|
libaries often have README.md in their root to describe itself. We collect these descriptions into our
|
||||||
|
book. In addition, client usage of Filament also requires using a set of binary tools, which are
|
||||||
|
located in `tools`. Some of tools also have README.md as description. We also collect them into the book.
|
||||||
|
|
||||||
|
The process for copying and processing these READMEs is outlined in [Introductory docs](#introductory-doc).
|
||||||
|
|
||||||
|
### Other technical notes
|
||||||
|
These are technical documents that do not fit into a library, tool, or directory of the
|
||||||
|
Filament source tree. We collect them into the `docs_src/src/notes` directory. No additional
|
||||||
|
processing are needed for these documents.
|
||||||
|
|
||||||
|
## Adding more documents
|
||||||
|
To add any documentation, first consider the type of the document you like to add. If it
|
||||||
|
belongs to any of the above sources, then simply place the document in the appropriate place,
|
||||||
|
add a link in `SUMMARY.md`, and perform the steps outlined in
|
||||||
|
[how-to create section](#how-to-create).
|
||||||
|
|
||||||
|
For example, if you are adding a general technical note, then you would
|
||||||
|
- Place the document (file with extension `.md`) in `docs_src/src/notes`
|
||||||
|
- Add a link in [`docs_src/src/SUMMARY.md`]
|
||||||
|
- Run the commands in the [Generate](#how-to-generate) section
|
||||||
|
|
||||||
|
[github landing page]: https://google.github.io/filament
|
||||||
|
[`mdBook`]: https://rust-lang.github.io/mdBook/
|
||||||
|
[`markdeep`]: https://casual-effects.com/markdeep/
|
||||||
|
[`docs_src/build/run.py`]: https://github.com/google/filament/blob/main/docs_src/build/run.py
|
||||||
|
[`docs_src/build/duplicates.json`]: https://github.com/google/filament/blob/main/docs_src/build/duplicates.json
|
||||||
|
[`docs_src/src/SUMMARY.md`]: https://github.com/google/filament/blob/main/docs_src/src/SUMMARY.md
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[book]
|
||||||
|
authors = []
|
||||||
|
language = "en"
|
||||||
|
multilingual = false
|
||||||
|
src = "src"
|
||||||
|
title = "Filament"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
create-missing = false
|
||||||
|
|
||||||
|
[output.html]
|
||||||
|
mathjax-support = true
|
||||||
|
default-theme = "light"
|
||||||
|
preferred-dark-theme = "light"
|
||||||
|
|
||||||
|
[output.html.print]
|
||||||
|
enable = false
|
||||||
|
|
||||||
|
[output.html.fold]
|
||||||
|
enable = false
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
# Copyright (C) 2025 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# This script contains several checks on the current commit, each corresponds to `possible_conditions`
|
||||||
|
# in the main function below
|
||||||
|
# - Direct (non-filamentbot) edits of /docs
|
||||||
|
# - Edits to sources of READMEs that are duplicated to /docs
|
||||||
|
# or edits to /docs_src sources
|
||||||
|
# - Commit message has DOCS_BYPASS
|
||||||
|
# - Commit message has DOCS_FORCE
|
||||||
|
# - Commit message has DOCS_ALLOW_DIRECT_EDITS
|
||||||
|
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
from utils import execute, ArgParseImpl
|
||||||
|
|
||||||
|
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
ROOT_DIR = os.path.join(CUR_DIR, '../../')
|
||||||
|
|
||||||
|
def get_last_commit_hash():
|
||||||
|
res, ret = execute('git rev-parse HEAD', cwd=ROOT_DIR)
|
||||||
|
assert res == 0, 'Failed to get the last commit hash'
|
||||||
|
return ret.strip()
|
||||||
|
|
||||||
|
def get_edited_files(commit_hash):
|
||||||
|
INSERT = '#####?????'
|
||||||
|
res, ret = execute(f'git show --name-only --pretty=%b{INSERT} {commit_hash}')
|
||||||
|
assert res == 0, 'Failed to get edited filed'
|
||||||
|
files = []
|
||||||
|
_, after = ret.split(INSERT)
|
||||||
|
for r in filter(lambda a: len(a) > 0, after.split('\n')):
|
||||||
|
if r.startswith('commit'):
|
||||||
|
break
|
||||||
|
files.append(r)
|
||||||
|
return files
|
||||||
|
|
||||||
|
# Returns True if there were no direct edits to '/docs'
|
||||||
|
def check_no_direct_edits(commit_hash, printing=True):
|
||||||
|
bad = [f'\t{f}' for f in get_edited_files(commit_hash) if f.startswith('docs/')]
|
||||||
|
if printing and len(bad) > 0:
|
||||||
|
print(f'Found edits to /docs:\n' + '\n'.join(bad))
|
||||||
|
return len(bad) == 0
|
||||||
|
|
||||||
|
# Returns True if docs sources have been modified
|
||||||
|
def check_has_source_edits(commit_hash, printing=True):
|
||||||
|
config = {}
|
||||||
|
with open(f'{CUR_DIR}/duplicates.json') as config_txt:
|
||||||
|
config = json.loads(config_txt.read())
|
||||||
|
source_files = set(config.keys())
|
||||||
|
edited_files = set(get_edited_files(commit_hash))
|
||||||
|
overlap = [f'\t{f}' for f in list(source_files & edited_files)]
|
||||||
|
if printing and len(overlap) > 0:
|
||||||
|
print(f'Found edited source files:\n' + '\n'.join(overlap))
|
||||||
|
return len(overlap) > 0
|
||||||
|
|
||||||
|
# Returns true in a given TAG is found in the commit msg
|
||||||
|
def commit_msg_has_tag(commit_hash, tag, printing=True):
|
||||||
|
res, ret = execute(f'git log --pretty=%B {commit_hash}', cwd=ROOT_DIR)
|
||||||
|
for l in ret.split('\n'):
|
||||||
|
if tag == l.strip():
|
||||||
|
if printing:
|
||||||
|
print(f'Found tag={tag} in commit message')
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = ArgParseImpl()
|
||||||
|
|
||||||
|
TAG_DOCS_BYPASS = 'DOCS_BYPASS'
|
||||||
|
TAG_DOCS_FORCE = 'DOCS_FORCE'
|
||||||
|
TAG_DOCS_ALLOW_DIRECT_EDITS = 'DOCS_ALLOW_DIRECT_EDITS'
|
||||||
|
|
||||||
|
possible_conditions = {
|
||||||
|
'no_direct_edits':
|
||||||
|
check_no_direct_edits,
|
||||||
|
'source_edits':
|
||||||
|
check_has_source_edits,
|
||||||
|
'commit_docs_bypass':
|
||||||
|
lambda h: commit_msg_has_tag(h, TAG_DOCS_BYPASS),
|
||||||
|
'commit_docs_force':
|
||||||
|
lambda h: commit_msg_has_tag(h, TAG_DOCS_FORCE),
|
||||||
|
'commit_docs_allow_direct_edits':
|
||||||
|
lambda h: commit_msg_has_tag(h, TAG_DOCS_ALLOW_DIRECT_EDITS),
|
||||||
|
}
|
||||||
|
|
||||||
|
possible_str = ', '.join(list(possible_conditions.keys()))
|
||||||
|
parser.add_argument(
|
||||||
|
'--do-and',
|
||||||
|
type=str,
|
||||||
|
help=(
|
||||||
|
f'A conjunction of boolean conditions. Possible values are={possible_str}. '
|
||||||
|
'Negation is done with `-`'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--do-or',
|
||||||
|
type=str,
|
||||||
|
help=(
|
||||||
|
f'A disjunction of boolean conditions. Possible values are={possible_str}. '
|
||||||
|
'Negation is done with `-`'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
args, _ = parser.parse_known_args(sys.argv[1:len(sys.argv) - 1])
|
||||||
|
commit_hash = sys.argv[-1]
|
||||||
|
|
||||||
|
assert not (args.do_and and args.do_or), "Must not supply both '--do-and' and '--do-or'"
|
||||||
|
assert args.do_and or args.do_or, "Must supply argument '--do-and' or '--do-or'"
|
||||||
|
conds = args.do_and.split(',') if args.do_and else args.do_or.split(',')
|
||||||
|
conds = [c.strip() for c in conds]
|
||||||
|
assert all(
|
||||||
|
[c in possible_conditions.keys() for c in
|
||||||
|
[(c.replace('-', '') if c.startswith('-') else c) for c in conds]]),\
|
||||||
|
f"Not all conditions are valid names. Only {possible_str} are accepted"
|
||||||
|
|
||||||
|
res = []
|
||||||
|
for cond in conds:
|
||||||
|
if cond.startswith('-'):
|
||||||
|
f = lambda: not possible_conditions[cond.replace('-', '')]()
|
||||||
|
else:
|
||||||
|
f = possible_conditions[cond]
|
||||||
|
res.append(f(commit_hash))
|
||||||
|
|
||||||
|
if args.do_and:
|
||||||
|
exit(0 if all(res) else 1)
|
||||||
|
else:
|
||||||
|
exit(0 if any(res) else 1)
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"README.md": {
|
||||||
|
"dest": "dup/intro.md",
|
||||||
|
"link_transforms": {
|
||||||
|
"BUILDING.md": "building.md",
|
||||||
|
"/CONTRIBUTING.md": "contributing.md",
|
||||||
|
"/CODE_STYLE.md": "code_style.md",
|
||||||
|
"docs/images/samples": "../images/samples"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"BUILDING.md": {
|
||||||
|
"dest": "dup/building.md"
|
||||||
|
},
|
||||||
|
"CONTRIBUTING.md": {
|
||||||
|
"dest": "dup/contributing.md"
|
||||||
|
},
|
||||||
|
"CODE_STYLE.md": {
|
||||||
|
"dest": "dup/code_style.md"
|
||||||
|
},
|
||||||
|
"libs/uberz/README.md": {
|
||||||
|
"dest": "dup/uberz.md"
|
||||||
|
},
|
||||||
|
"libs/bluegl/README.md": {
|
||||||
|
"dest": "dup/bluegl.md"
|
||||||
|
},
|
||||||
|
"libs/bluevk/README.md": {
|
||||||
|
"dest": "dup/bluevk.md"
|
||||||
|
},
|
||||||
|
"libs/gltfio/README.md": {
|
||||||
|
"dest": "dup/gltfio.md"
|
||||||
|
},
|
||||||
|
"libs/filamat/README.md": {
|
||||||
|
"dest": "dup/filamat.md"
|
||||||
|
},
|
||||||
|
"libs/iblprefilter/README.md": {
|
||||||
|
"dest": "dup/iblprefilter.md"
|
||||||
|
},
|
||||||
|
"libs/matdbg/README.md": {
|
||||||
|
"dest": "dup/matdbg.md"
|
||||||
|
},
|
||||||
|
"tools/normal-blending/README.md": {
|
||||||
|
"dest": "dup/normal_blending.md"
|
||||||
|
},
|
||||||
|
"tools/filamesh/README.md": {
|
||||||
|
"dest": "dup/filamesh.md"
|
||||||
|
},
|
||||||
|
"tools/beamsplitter/README.md": {
|
||||||
|
"dest": "dup/beamsplitter.md"
|
||||||
|
},
|
||||||
|
"tools/cmgen/README.md": {
|
||||||
|
"dest": "dup/cmgen.md"
|
||||||
|
},
|
||||||
|
"tools/mipgen/README.md": {
|
||||||
|
"dest": "dup/mipgen.md"
|
||||||
|
},
|
||||||
|
"tools/matinfo/README.md": {
|
||||||
|
"dest": "dup/matinfo.md"
|
||||||
|
},
|
||||||
|
"tools/roughness-prefilter/README.md": {
|
||||||
|
"dest": "dup/roughness_prefilter.md"
|
||||||
|
},
|
||||||
|
"tools/zbloat/README.md": {
|
||||||
|
"dest": "dup/zbloat.md"
|
||||||
|
},
|
||||||
|
"tools/cso-lut/README.md": {
|
||||||
|
"dest": "dup/cso_lut.md"
|
||||||
|
},
|
||||||
|
"tools/specular-color/README.md": {
|
||||||
|
"dest": "dup/specular_color.md"
|
||||||
|
},
|
||||||
|
"docs_src/README.md": {
|
||||||
|
"dest": "dup/docs.md"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
# Copyright (C) 2025 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
DARWIN_X86=1
|
||||||
|
LINUX_X86=2
|
||||||
|
DARWIN_ARM=3
|
||||||
|
LINUX_ARM=4
|
||||||
|
|
||||||
|
function add_cargo_path() {
|
||||||
|
local BASH_P="${HOME}/.bashrc"
|
||||||
|
local PATH_LINE='export PATH=${PATH}:~/.cargo/bin'
|
||||||
|
local TYPE=$1
|
||||||
|
if [ ${TYPE} == ${DARWIN_ARM} ] || [ ${TYPE} == ${DARWIN_X86} ]; then
|
||||||
|
BASH_P="${HOME}/.bash_profile"
|
||||||
|
fi
|
||||||
|
if ! (grep "${PATH_LINE}" ${BASH_P}); then
|
||||||
|
echo "${PATH_LINE}" >> ${BASH_P}
|
||||||
|
fi
|
||||||
|
source ${BASH_P}
|
||||||
|
}
|
||||||
|
|
||||||
|
function download_mdbook() {
|
||||||
|
if command -v mdbook >/dev/null 2>&1; then
|
||||||
|
echo "mdbook already installed"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local CHECK_UNAME="
|
||||||
|
import sys;
|
||||||
|
parts=[a.lower() for a in sys.stdin.read().strip().split(' ')];
|
||||||
|
def get_type():
|
||||||
|
if 'darwin' in parts:
|
||||||
|
if 'x86_64' in parts:
|
||||||
|
return ${DARWIN_X86}
|
||||||
|
elif 'aarch' in parts:
|
||||||
|
return ${DARWIN_ARM}
|
||||||
|
elif 'linux' in parts:
|
||||||
|
if 'x86_64' in parts:
|
||||||
|
return ${LINUX_X86}
|
||||||
|
elif 'aarch' in parts:
|
||||||
|
return ${LINUX_ARM}
|
||||||
|
return 0
|
||||||
|
print(get_type())
|
||||||
|
"
|
||||||
|
local TYPE=`uname -a | python3 -c "${CHECK_UNAME}"`
|
||||||
|
if [ ${TYPE} == ${DARWIN_ARM} ] || [ ${TYPE} == ${LINUX_ARM} ]; then
|
||||||
|
# No github prebuilts are available, we build it with rust from source.
|
||||||
|
# First, need to install rust and cargo
|
||||||
|
if ! (command -v rustc >/dev/null 2>&1) || ! (command -v cargo >/dev/null 2>&1); then
|
||||||
|
echo "*** Need to install Rust ***"
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
fi
|
||||||
|
if ! (command -v cargo >/dev/null 2>&1); then
|
||||||
|
echo "*** Still cannot find `cargo` ***"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cargo install mdbook
|
||||||
|
else
|
||||||
|
# Download prebuilts from github
|
||||||
|
mkdir -p ${HOME}/.cargo/bin
|
||||||
|
echo "*** Downloading mdbook from github release ***"
|
||||||
|
DL_URL='https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-apple-darwin.tar.gz '
|
||||||
|
if [ ${TYPE} == ${LINUX_X86} ]; then
|
||||||
|
DL_URL='https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz'
|
||||||
|
fi
|
||||||
|
curl -L -o ~/Downloads/mdbook.tar.gz ${DL_URL}
|
||||||
|
mkdir -p /tmp/mdbook
|
||||||
|
tar -xvzf ~/Downloads/mdbook.tar.gz -C /tmp/mdbook >/dev/null 2>&1
|
||||||
|
mv /tmp/mdbook/mdbook ~/.cargo/bin/
|
||||||
|
fi
|
||||||
|
add_cargo_path ${TYPE}
|
||||||
|
}
|
||||||
|
|
||||||
|
download_mdbook
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
# Copyright (C) 2025 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
COMMIT_HASH=$1
|
||||||
|
python3 docs_src/build/checks.py --do-or="no_direct_edits,commit_docs_allow_direct_edits" $COMMIT_HASH ||\
|
||||||
|
(echo "Direct edits to /docs are not allowed. Please see /docs_src/README.md if you need to bypass this check." && exit 1)
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# Copyright (C) 2025 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
from utils import execute, ArgParseImpl
|
||||||
|
|
||||||
|
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
DOCS_SRC_DIR = os.path.join(CUR_DIR, '../')
|
||||||
|
ROOT_DIR = os.path.join(CUR_DIR, '../../')
|
||||||
|
SRC_DIR = os.path.join(CUR_DIR, '../src')
|
||||||
|
MARKDEEP_DIR = os.path.join(CUR_DIR, '../markdeep')
|
||||||
|
DUP_DIR = os.path.join(SRC_DIR, 'dup')
|
||||||
|
MAIN_DIR = os.path.join(SRC_DIR, 'main')
|
||||||
|
|
||||||
|
def transform_dup_file_link(line, transforms):
|
||||||
|
URL_CONTENT = '[-a-zA-Z0-9()@:%_\+.~#?&//=]+'
|
||||||
|
res = re.findall(f'\[(.+)\]\(({URL_CONTENT})\)', line)
|
||||||
|
for text, url in res:
|
||||||
|
word = f'[{text}]({url})'
|
||||||
|
for tkey in transforms.keys():
|
||||||
|
if url.startswith(tkey):
|
||||||
|
nurl = url.replace(tkey, transforms[tkey])
|
||||||
|
line = line.replace(word, f'[{text}]({nurl})')
|
||||||
|
break
|
||||||
|
return line
|
||||||
|
|
||||||
|
def pull_duplicates():
|
||||||
|
if not os.path.exists(DUP_DIR):
|
||||||
|
os.mkdir(DUP_DIR)
|
||||||
|
|
||||||
|
config = {}
|
||||||
|
with open(f'{CUR_DIR}/duplicates.json') as config_txt:
|
||||||
|
config = json.loads(config_txt.read())
|
||||||
|
|
||||||
|
for fin in config.keys():
|
||||||
|
new_name = config[fin]['dest']
|
||||||
|
link_transforms = config[fin].get('link_transforms', {})
|
||||||
|
fpath = os.path.join(ROOT_DIR, fin)
|
||||||
|
new_fpath = os.path.join(SRC_DIR, new_name)
|
||||||
|
|
||||||
|
with open(fpath, 'r') as in_file:
|
||||||
|
with open(new_fpath, 'w') as out_file:
|
||||||
|
for line in in_file.readlines():
|
||||||
|
out_file.write(transform_dup_file_link(line, link_transforms))
|
||||||
|
|
||||||
|
def pull_markdeep_docs():
|
||||||
|
import http.server
|
||||||
|
import socketserver
|
||||||
|
import threading
|
||||||
|
from selenium import webdriver
|
||||||
|
from selenium.webdriver.chrome.options import Options
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
import time
|
||||||
|
|
||||||
|
class Server(socketserver.ThreadingMixIn, http.server.HTTPServer):
|
||||||
|
"""Handle requests in a separate thread."""
|
||||||
|
|
||||||
|
class Handler(http.server.SimpleHTTPRequestHandler):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, directory=MARKDEEP_DIR, **kwargs)
|
||||||
|
|
||||||
|
def start_server(port):
|
||||||
|
"""Starts the web server in a separate thread."""
|
||||||
|
httpd = Server(("", port), Handler)
|
||||||
|
server_thread = threading.Thread(target=httpd.serve_forever)
|
||||||
|
server_thread.daemon = True # Allow main thread to exit
|
||||||
|
server_thread.start()
|
||||||
|
print(f"Server started on port {port}...")
|
||||||
|
return httpd
|
||||||
|
|
||||||
|
PORT = 12345
|
||||||
|
httpd = start_server(PORT)
|
||||||
|
|
||||||
|
# Set up Chrome options for headless mode
|
||||||
|
chrome_options = Options()
|
||||||
|
chrome_options.add_argument("--headless")
|
||||||
|
|
||||||
|
# This option is necessary for running on some VMs
|
||||||
|
chrome_options.add_argument("--no-sandbox")
|
||||||
|
|
||||||
|
# Create a new Chrome instance in headless mode
|
||||||
|
driver = webdriver.Chrome(options=chrome_options)
|
||||||
|
|
||||||
|
for doc in ['Filament', 'Materials']:
|
||||||
|
# Open the URL with ?export, which markdeep will export the resulting html.
|
||||||
|
driver.get(f"http://localhost:{PORT}/{doc}.md.html?export")
|
||||||
|
|
||||||
|
time.sleep(3)
|
||||||
|
# We extract the html from the resulting "page" (an html output itself).
|
||||||
|
text = driver.find_elements(By.TAG_NAME, "pre")[0].text
|
||||||
|
|
||||||
|
# 1. Remove the double empty lines. These make the following text seem like markdown text as oppose to embedded html.
|
||||||
|
# 2. Remove the max-width styling from the body tag.
|
||||||
|
# 3. Remove the font-family styling from the body tag.
|
||||||
|
text = text.replace("\n\n","\n")\
|
||||||
|
.replace("max-width:680px;", "")\
|
||||||
|
.replace("font-family:Palatino", "--font-family:Palatino")\
|
||||||
|
.replace("\"./images", "\"../images")\
|
||||||
|
.replace("\"images/", "\"../images/")
|
||||||
|
|
||||||
|
# Save the page source as .md with embedded html
|
||||||
|
with open(f'{MAIN_DIR}/{doc.lower()}.md', "w", encoding="utf-8") as f:
|
||||||
|
f.write(text)
|
||||||
|
|
||||||
|
# Close the browser
|
||||||
|
driver.quit()
|
||||||
|
# Shutdown the server
|
||||||
|
httpd.shutdown()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
pull_duplicates()
|
||||||
|
pull_markdeep_docs()
|
||||||
|
|
||||||
|
res, err = execute('mdbook build', cwd=DOCS_SRC_DIR)
|
||||||
|
assert res == 0, f"failed to execute `mdbook`. return-code={res} err=\"{err}\""
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Copyright (C) 2025 The Android Open Source Project
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
import os
|
||||||
|
import argparse
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def execute(cmd,
|
||||||
|
cwd=None,
|
||||||
|
capture_output=True,
|
||||||
|
stdin=None,
|
||||||
|
env=None,
|
||||||
|
raise_errors=False):
|
||||||
|
in_env = os.environ
|
||||||
|
in_env.update(env if env else {})
|
||||||
|
home = os.environ['HOME']
|
||||||
|
if f'{home}/bin' not in in_env['PATH']:
|
||||||
|
in_env['PATH'] = in_env['PATH'] + f':{home}/bin'
|
||||||
|
|
||||||
|
stdout = subprocess.PIPE if capture_output else sys.stdout
|
||||||
|
stderr = subprocess.PIPE if capture_output else sys.stdout
|
||||||
|
output = ''
|
||||||
|
err_output = ''
|
||||||
|
return_code = -1
|
||||||
|
kwargs = {
|
||||||
|
'cwd': cwd,
|
||||||
|
'env': in_env,
|
||||||
|
'stdout': stdout,
|
||||||
|
'stderr': stderr,
|
||||||
|
'stdin': stdin,
|
||||||
|
'universal_newlines': True
|
||||||
|
}
|
||||||
|
if capture_output:
|
||||||
|
process = subprocess.Popen(cmd.split(' '), **kwargs)
|
||||||
|
output, err_output = process.communicate()
|
||||||
|
return_code = process.returncode
|
||||||
|
else:
|
||||||
|
return_code = subprocess.call(cmd.split(' '), **kwargs)
|
||||||
|
|
||||||
|
if return_code:
|
||||||
|
# Error
|
||||||
|
if raise_errors:
|
||||||
|
raise subprocess.CalledProcessError(return_code, cmd)
|
||||||
|
if output:
|
||||||
|
if type(output) != str:
|
||||||
|
try:
|
||||||
|
output = output.decode('utf-8').strip()
|
||||||
|
except UnicodeDecodeError as e:
|
||||||
|
print('cannot decode ', output, file=sys.stderr)
|
||||||
|
return return_code, (output if return_code == 0 else err_output)
|
||||||
|
|
||||||
|
class ArgParseImpl(argparse.ArgumentParser):
|
||||||
|
def error(self, message):
|
||||||
|
sys.stderr.write('error: %s\n' % message)
|
||||||
|
self.print_help()
|
||||||
|
sys.exit(1)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Markdeep documents
|
||||||
|
|
||||||
|
Markdeep documents require special processing before they can be compiled into the group.
|
||||||
|
The "original" are stored in this folder. The processing part takes place in
|
||||||
|
`docs_src/build/run.py`.
|
||||||
|
|
||||||
|
## Editing
|
||||||
|
While editing the file, you might consider doing the following
|
||||||
|
- `python3 -m http.server 8001`
|
||||||
|
- visit `http://localhost:8001/Filament.md.html` in the browser to view the result
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Summary
|
||||||
|
|
||||||
|
- [Introduction](./dup/intro.md)
|
||||||
|
- [Build](./dup/building.md)
|
||||||
|
- [Build for Android on Windows](./build/windows_android.md)
|
||||||
|
- [Contribute](./dup/contributing.md)
|
||||||
|
- [Coding Style](./dup/code_style.md)
|
||||||
|
- [Core Concepts](./main/README.md)
|
||||||
|
- [Filament](./main/filament.md)
|
||||||
|
- [Materials](./main/materials.md)
|
||||||
|
- [Tutorials and Samples](./samples/README.md)
|
||||||
|
- [iOS Tutorial](./samples/ios.md)
|
||||||
|
- [Web Tutorial](./samples/web.md)
|
||||||
|
- [Technical Notes](./notes/README.md)
|
||||||
|
- [Versioning](./notes/versioning.md)
|
||||||
|
- [Documentation](./dup/docs.md)
|
||||||
|
- [Debugging](./notes/debugging.md)
|
||||||
|
- [Metal](./notes/metal_debugging.md)
|
||||||
|
- [Vulkan](./notes/vulkan_debugging.md)
|
||||||
|
- [SPIR-V](./notes/spirv_debugging.md)
|
||||||
|
- [Libraries](./notes/libs.md)
|
||||||
|
- [bluegl](./dup/bluegl.md)
|
||||||
|
- [bluevk](./dup/bluevk.md)
|
||||||
|
- [filamat](./dup/filamat.md)
|
||||||
|
- [gltfio](./dup/gltfio.md)
|
||||||
|
- [iblprefilter](./dup/iblprefilter.md)
|
||||||
|
- [matdbg](./dup/matdbg.md)
|
||||||
|
- [uberz](./dup/uberz.md)
|
||||||
|
- [Tools](./notes/tools.md)
|
||||||
|
- [beamsplitter](./dup/beamsplitter.md)
|
||||||
|
- [cmgen](./dup/cmgen.md)
|
||||||
|
- [cso-lut](./dup/cso_lut.md)
|
||||||
|
- [filamesh](./dup/filamesh.md)
|
||||||
|
- [normal-blending](./dup/normal_blending.md)
|
||||||
|
- [mipgen](./dup/mipgen.md)
|
||||||
|
- [matinfo](./dup/matinfo.md)
|
||||||
|
- [roughness-prefilter](./dup/roughness_prefilter.md)
|
||||||
|
- [specular-color](./dup/specular_color.md)
|
||||||
|
- [zbloat](./dup/zbloat.md)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Do not manually edit any file in this folder. They have been autogenerated
|
||||||
|
by a script.
|
||||||
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 236 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 54 KiB |