From 853f8ed8ea965ac5be88b4479accbfb94337a933 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Mon, 16 Oct 2023 12:47:33 -0400 Subject: [PATCH 1/9] Three.js to v0.151.3 - multiple shader uv param changes --- package-lock.json | 130 +++++++++++------------ package.json | 4 +- source/client/shaders/uberPBRShader.frag | 20 ++-- source/client/shaders/uberPBRShader.vert | 25 +++-- 4 files changed, 88 insertions(+), 91 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2d42be04..7e39dffb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "voyager", - "version": "0.30.0", + "version": "0.33.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -275,9 +275,9 @@ "dev": true }, "@types/three": { - "version": "0.150.2", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.150.2.tgz", - "integrity": "sha512-cvcz/81Mmj4oiAA+uxzwaRK3t8lYw8WxejXKqIBfu6PqvwSAEEiCi3VfCiVY18UflBqL0LDX/za85+sfqjMoIw==", + "version": "0.151.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.151.0.tgz", + "integrity": "sha512-hwOyN4szaikHsNzqbYLBfGvXi+TA/1TIKvK3ujJi+cQXzYzE5ZymzlDnOA6/cTSozY1juPFE3u5agToVQKb9TQ==", "dev": true, "requires": { "@types/stats.js": "*", @@ -669,7 +669,7 @@ "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "array-shuffle": { "version": "1.0.1", @@ -679,7 +679,7 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true }, "as-number": { @@ -705,7 +705,7 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true }, "assertion-error": { @@ -723,19 +723,19 @@ "async-foreach": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "integrity": "sha512-VUeSMD8nEGBWaZK4lizI1sf3yEC7pnAQ/mrI7pC2fBz2s/tq5jWWEngTwaf0Gruu/OoXRGLGg1XFqpYBiGTYJA==", "dev": true }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true }, "aws4": { @@ -770,7 +770,7 @@ "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, "requires": { "tweetnacl": "^0.14.3" @@ -1024,7 +1024,7 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "dev": true }, "chai": { @@ -1210,7 +1210,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "concurrently": { "version": "6.3.0", @@ -1248,7 +1248,7 @@ "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", "dev": true }, "content-disposition": { @@ -1279,12 +1279,12 @@ "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "dev": true }, "create-require": { @@ -1467,7 +1467,7 @@ "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, "requires": { "assert-plus": "^1.0.0" @@ -1508,7 +1508,7 @@ "decamelize-keys": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "integrity": "sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg==", "dev": true, "requires": { "decamelize": "^1.1.0", @@ -1518,13 +1518,13 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true } } @@ -1559,13 +1559,13 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "dev": true }, "depd": { @@ -1674,7 +1674,7 @@ "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, "requires": { "jsbn": "~0.1.0", @@ -1707,7 +1707,7 @@ "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, "encoding": { "version": "0.1.13", @@ -1796,7 +1796,7 @@ "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "escape-string-regexp": { "version": "1.0.5", @@ -1839,7 +1839,7 @@ "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "events": { "version": "3.3.0", @@ -1939,7 +1939,7 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true }, "fast-deep-equal": { @@ -2063,7 +2063,7 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true }, "form-data": { @@ -2094,7 +2094,7 @@ "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, "fs-extra": { "version": "10.0.0", @@ -2190,7 +2190,7 @@ "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==", "dev": true }, "get-stream": { @@ -2204,7 +2204,7 @@ "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, "requires": { "assert-plus": "^1.0.0" @@ -2324,7 +2324,7 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "dev": true }, "har-validator": { @@ -2384,7 +2384,7 @@ "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "dev": true }, "he": { @@ -2515,7 +2515,7 @@ "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dev": true, "requires": { "assert-plus": "^1.0.0", @@ -2559,7 +2559,7 @@ "humanize-ms": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "dev": true, "requires": { "ms": "^2.0.0" @@ -2587,7 +2587,7 @@ "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==" }, "import-local": { "version": "3.1.0", @@ -2602,7 +2602,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "indent-string": { @@ -2658,7 +2658,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "is-binary-path": { @@ -2705,7 +2705,7 @@ "is-lambda": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", "dev": true }, "is-number": { @@ -2742,7 +2742,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "is-unicode-supported": { @@ -2754,7 +2754,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, "isexe": { @@ -2771,7 +2771,7 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, "jest-worker": { @@ -2826,7 +2826,7 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", "dev": true }, "json-buffer": { @@ -2863,7 +2863,7 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, "json5": { @@ -3231,7 +3231,7 @@ "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "meow": { "version": "9.0.0", @@ -3256,7 +3256,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true }, "hosted-git-info": { @@ -3294,7 +3294,7 @@ "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, "merge-stream": { "version": "2.0.0", @@ -3305,7 +3305,7 @@ "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, "micromatch": { "version": "4.0.4", @@ -3388,7 +3388,7 @@ "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true } } @@ -3803,7 +3803,7 @@ "nopt": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", "requires": { "abbrev": "1" } @@ -4091,7 +4091,7 @@ "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "pathval": { "version": "1.1.1", @@ -4102,7 +4102,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, "picocolors": { @@ -4507,7 +4507,7 @@ "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" }, "process-nextick-args": { "version": "2.0.1", @@ -4518,7 +4518,7 @@ "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", "dev": true }, "promise-retry": { @@ -4924,7 +4924,7 @@ "retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true }, "rimraf": { @@ -5148,7 +5148,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "setprototypeof": { @@ -5647,9 +5647,9 @@ } }, "three": { - "version": "0.150.1", - "resolved": "https://registry.npmjs.org/three/-/three-0.150.1.tgz", - "integrity": "sha512-5C1MqKUWaHYo13BX0Q64qcdwImgnnjSOFgBscOzAo8MYCzEtqfQqorEKMcajnA3FHy1yVlIe9AmaMQ0OQracNA==" + "version": "0.151.3", + "resolved": "https://registry.npmjs.org/three/-/three-0.151.3.tgz", + "integrity": "sha512-+vbuqxFy8kzLeO5MgpBHUvP/EAiecaDwDuOPPDe6SbrZr96kccF0ktLngXc7xA7bzyd3N0t2f6mw3Z9y6JCojQ==" }, "three-bmfont-text": { "version": "git+ssh://git@github.com/Smithsonian/three-bmfont-text.git#e611dac13d2d5bfd7f0e483f56bffa4185393e0d", @@ -5813,7 +5813,7 @@ "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, "requires": { "safe-buffer": "^5.0.1" @@ -5822,7 +5822,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", "dev": true }, "type-detect": { @@ -5931,7 +5931,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, "uri-js": { "version": "4.4.1", @@ -5983,7 +5983,7 @@ "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "uuid": { "version": "3.4.0", @@ -6004,7 +6004,7 @@ "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "vendors": { "version": "1.0.4", @@ -6015,7 +6015,7 @@ "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, "requires": { "assert-plus": "^1.0.0", diff --git a/package.json b/package.json index 055644f3..ba775935 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "simple-dropzone": "^0.8.3", "stream-browserify": "^3.0.0", "style-loader": "^3.3.1", - "three": "^0.150.1", + "three": "^0.151.3", "three-bmfont-text": "git+https://github.com/Smithsonian/three-bmfont-text.git#e611dac13d", "tinymce": "^6.3.1", "toposort": "^2.0.2", @@ -82,7 +82,7 @@ "@types/chai": "^4.2.21", "@types/mocha": "^9.0.0", "@types/node": "^14.0.26", - "@types/three": "^0.150.2", + "@types/three": "^0.151.0", "chai": "^4.3.8", "concurrently": "^6.2.1", "css-loader": "^6.2.0", diff --git a/source/client/shaders/uberPBRShader.frag b/source/client/shaders/uberPBRShader.frag index cef83795..78ba700c 100644 --- a/source/client/shaders/uberPBRShader.frag +++ b/source/client/shaders/uberPBRShader.frag @@ -43,11 +43,11 @@ varying vec3 vViewPosition; #include #include -//#include -//#include -// REPLACED WITH -#if defined(USE_MAP) || defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(USE_SPECULARMAP) || defined(USE_ALPHAMAP) || defined(USE_EMISSIVEMAP) || defined(USE_ROUGHNESSMAP) || defined(USE_METALNESSMAP) || defined(USE_LIGHTMAP) || defined(USE_AOMAP) - varying vec2 vUv; +#include + +// Zone map support +#if defined(USE_ZONEMAP) + varying vec2 vZoneUv; #endif #include @@ -125,12 +125,6 @@ void main() { #include #include #include - - // accumulation - #if defined(USE_LIGHTMAP) || defined(USE_AOMAP) - vec2 vUv2 = vUv; - #endif - #include #include #include @@ -146,7 +140,7 @@ void main() { #endif // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture - vec3 aoSample = texture2D(aoMap, vUv).rgb; + vec3 aoSample = texture2D(aoMap, vAoMapUv).rgb; vec3 aoFactors = mix(vec3(1.0), aoSample, clamp(aoMapMix * aoMapIntensity, 0.0, 1.0)); float ambientOcclusion = aoFactors.x * aoFactors.y * aoFactors.z; float ambientOcclusion2 = ambientOcclusion * ambientOcclusion; @@ -180,7 +174,7 @@ void main() { gl_FragColor = vec4(outgoingLight, diffuseColor.a); #ifdef USE_ZONEMAP - vec4 zoneColor = texture2D(zoneMap, vUv); + vec4 zoneColor = texture2D(zoneMap, vZoneUv); gl_FragColor += vec4(zoneColor.rgb, 1.0); #endif diff --git a/source/client/shaders/uberPBRShader.vert b/source/client/shaders/uberPBRShader.vert index bbcf63ad..02864438 100644 --- a/source/client/shaders/uberPBRShader.vert +++ b/source/client/shaders/uberPBRShader.vert @@ -7,12 +7,11 @@ varying vec3 vViewPosition; #include -//#include -//#include -// REPLACED WITH -#if defined(USE_MAP) || defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(USE_SPECULARMAP) || defined(USE_ALPHAMAP) || defined(USE_EMISSIVEMAP) || defined(USE_ROUGHNESSMAP) || defined(USE_METALNESSMAP) || defined(USE_LIGHTMAP) || defined(USE_AOMAP) - varying vec2 vUv; - uniform mat3 uvTransform; +#include + +// Zone map support +#if defined(USE_ZONEMAP) + varying vec2 vZoneUv; #endif #include @@ -34,11 +33,15 @@ varying vec3 vViewPosition; void main() { -// #include -// #include -// REPLACED WITH -#if defined(USE_MAP) || defined(USE_BUMPMAP) || defined(USE_NORMALMAP) || defined(USE_SPECULARMAP) || defined(USE_ALPHAMAP) || defined(USE_EMISSIVEMAP) || defined(USE_ROUGHNESSMAP) || defined(USE_METALNESSMAP) || defined(USE_LIGHTMAP) || defined(USE_AOMAP) - vUv = (uvTransform * vec3(uv, 1)).xy; + #include + +// Zone map support +#if defined(USE_ZONEMAP) + #if defined(USE_MAP) + vZoneUv = (mapTransform * vec3(vMapUv, 1)).xy; + #else + vZoneUv = uv; + #endif #endif #include From c637d93588fefedb310749d7b0ae4b31d5bc953a Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Mon, 16 Oct 2023 15:34:11 -0400 Subject: [PATCH 2/9] Three.js to v0.154.0 --- libs/ff-scene | 2 +- package-lock.json | 28 ++++++++++++++++++------ package.json | 4 ++-- source/client/io/ModelReader.ts | 4 ++-- source/client/shaders/uberPBRShader.frag | 2 +- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/libs/ff-scene b/libs/ff-scene index 6edc70f1..4f7cb3b6 160000 --- a/libs/ff-scene +++ b/libs/ff-scene @@ -1 +1 @@ -Subproject commit 6edc70f1dd39f876eb9503903526b93ba4126f9d +Subproject commit 4f7cb3b6e74e6a37a5a702a21ecd0153b3b0f635 diff --git a/package-lock.json b/package-lock.json index 7e39dffb..d9d64bdc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -200,6 +200,12 @@ "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", "dev": true }, + "@tweenjs/tween.js": { + "version": "18.6.4", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-18.6.4.tgz", + "integrity": "sha512-lB9lMjuqjtuJrx7/kOkqQBtllspPIN+96OvTCeJ2j5FEzinoAXTdAMFnDAQT1KVPRlnYfBrqxtqP66vDM40xxQ==", + "dev": true + }, "@types/chai": { "version": "4.2.22", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz", @@ -275,15 +281,17 @@ "dev": true }, "@types/three": { - "version": "0.151.0", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.151.0.tgz", - "integrity": "sha512-hwOyN4szaikHsNzqbYLBfGvXi+TA/1TIKvK3ujJi+cQXzYzE5ZymzlDnOA6/cTSozY1juPFE3u5agToVQKb9TQ==", + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.154.0.tgz", + "integrity": "sha512-IioqpGhch6FdLDh4zazRn3rXHj6Vn2nVOziJdXVbJFi9CaI65LtP9qqUtpzbsHK2Ezlox8NtsLNHSw3AQzucjA==", "dev": true, "requires": { + "@tweenjs/tween.js": "~18.6.4", "@types/stats.js": "*", "@types/webxr": "*", "fflate": "~0.6.9", - "lil-gui": "~0.17.0" + "lil-gui": "~0.17.0", + "meshoptimizer": "~0.18.1" } }, "@types/webxr": { @@ -3302,6 +3310,12 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==", + "dev": true + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -5647,9 +5661,9 @@ } }, "three": { - "version": "0.151.3", - "resolved": "https://registry.npmjs.org/three/-/three-0.151.3.tgz", - "integrity": "sha512-+vbuqxFy8kzLeO5MgpBHUvP/EAiecaDwDuOPPDe6SbrZr96kccF0ktLngXc7xA7bzyd3N0t2f6mw3Z9y6JCojQ==" + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.154.0.tgz", + "integrity": "sha512-Uzz8C/5GesJzv8i+Y2prEMYUwodwZySPcNhuJUdsVMH2Yn4Nm8qlbQe6qRN5fOhg55XB0WiLfTPBxVHxpE60ug==" }, "three-bmfont-text": { "version": "git+ssh://git@github.com/Smithsonian/three-bmfont-text.git#e611dac13d2d5bfd7f0e483f56bffa4185393e0d", diff --git a/package.json b/package.json index ba775935..ad94d5f2 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "simple-dropzone": "^0.8.3", "stream-browserify": "^3.0.0", "style-loader": "^3.3.1", - "three": "^0.151.3", + "three": "^0.154.0", "three-bmfont-text": "git+https://github.com/Smithsonian/three-bmfont-text.git#e611dac13d", "tinymce": "^6.3.1", "toposort": "^2.0.2", @@ -82,7 +82,7 @@ "@types/chai": "^4.2.21", "@types/mocha": "^9.0.0", "@types/node": "^14.0.26", - "@types/three": "^0.151.0", + "@types/three": "^0.154.0", "chai": "^4.3.8", "concurrently": "^6.2.1", "css-loader": "^6.2.0", diff --git a/source/client/io/ModelReader.ts b/source/client/io/ModelReader.ts index 9364ae51..1733cabc 100644 --- a/source/client/io/ModelReader.ts +++ b/source/client/io/ModelReader.ts @@ -16,7 +16,7 @@ */ //import resolvePathname from "resolve-pathname"; -import { LoadingManager, Object3D, Scene, Group, Mesh, MeshStandardMaterial, sRGBEncoding } from "three"; +import { LoadingManager, Object3D, Scene, Group, Mesh, MeshStandardMaterial, sRGBEncoding, SRGBColorSpace } from "three"; import {DRACOLoader} from 'three/examples/jsm/loaders/DRACOLoader.js'; import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader.js'; @@ -110,7 +110,7 @@ export default class ModelReader const material = mesh.material as MeshStandardMaterial; if (material.map) { - material.map.encoding = sRGBEncoding; + material.map.colorSpace = SRGBColorSpace; } mesh.geometry.computeBoundingBox(); diff --git a/source/client/shaders/uberPBRShader.frag b/source/client/shaders/uberPBRShader.frag index 78ba700c..fdf59452 100644 --- a/source/client/shaders/uberPBRShader.frag +++ b/source/client/shaders/uberPBRShader.frag @@ -179,7 +179,7 @@ void main() { #endif #include - #include + #include #include #include #include From 808630941bc11cf2930077298aa318781fa6d3b8 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Mon, 16 Oct 2023 15:58:13 -0400 Subject: [PATCH 3/9] Three.js to v0.155.0 --- libs/ff-scene | 2 +- package-lock.json | 12 ++++++------ package.json | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/ff-scene b/libs/ff-scene index 4f7cb3b6..a6918fa7 160000 --- a/libs/ff-scene +++ b/libs/ff-scene @@ -1 +1 @@ -Subproject commit 4f7cb3b6e74e6a37a5a702a21ecd0153b3b0f635 +Subproject commit a6918fa7825e3479e09594ad33f4a42c43e6ad76 diff --git a/package-lock.json b/package-lock.json index d9d64bdc..1787c368 100644 --- a/package-lock.json +++ b/package-lock.json @@ -281,9 +281,9 @@ "dev": true }, "@types/three": { - "version": "0.154.0", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.154.0.tgz", - "integrity": "sha512-IioqpGhch6FdLDh4zazRn3rXHj6Vn2nVOziJdXVbJFi9CaI65LtP9qqUtpzbsHK2Ezlox8NtsLNHSw3AQzucjA==", + "version": "0.155.1", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.155.1.tgz", + "integrity": "sha512-uNUwnz/wWRxahjIqTtDYQ1qdE1R1py21obxfuILkT+kKrjocMwRLQQA1l8nMxfQU7VXb7CXu04ucMo8OqZt4ZA==", "dev": true, "requires": { "@tweenjs/tween.js": "~18.6.4", @@ -5661,9 +5661,9 @@ } }, "three": { - "version": "0.154.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.154.0.tgz", - "integrity": "sha512-Uzz8C/5GesJzv8i+Y2prEMYUwodwZySPcNhuJUdsVMH2Yn4Nm8qlbQe6qRN5fOhg55XB0WiLfTPBxVHxpE60ug==" + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.155.0.tgz", + "integrity": "sha512-sNgCYmDijnIqkD/bMfk+1pHg3YzsxW7V2ChpuP6HCQ8NiZr3RufsXQr8M3SSUMjW4hG+sUk7YbyuY0DncaDTJQ==" }, "three-bmfont-text": { "version": "git+ssh://git@github.com/Smithsonian/three-bmfont-text.git#e611dac13d2d5bfd7f0e483f56bffa4185393e0d", diff --git a/package.json b/package.json index ad94d5f2..52373b14 100755 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "simple-dropzone": "^0.8.3", "stream-browserify": "^3.0.0", "style-loader": "^3.3.1", - "three": "^0.154.0", + "three": "^0.155.0", "three-bmfont-text": "git+https://github.com/Smithsonian/three-bmfont-text.git#e611dac13d", "tinymce": "^6.3.1", "toposort": "^2.0.2", @@ -82,7 +82,7 @@ "@types/chai": "^4.2.21", "@types/mocha": "^9.0.0", "@types/node": "^14.0.26", - "@types/three": "^0.154.0", + "@types/three": "^0.155.1", "chai": "^4.3.8", "concurrently": "^6.2.1", "css-loader": "^6.2.0", From 58371966a45c94ab841af7ab44d6c11ba9379664 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Tue, 24 Oct 2023 12:31:32 -0400 Subject: [PATCH 4/9] Three.js to v156. Vulnerability updates. --- package-lock.json | 50 +++++++++++++++++++++++++++-------------------- package.json | 4 ++-- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1787c368..2e3b1471 100644 --- a/package-lock.json +++ b/package-lock.json @@ -275,9 +275,9 @@ "dev": true }, "@types/stats.js": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.1.tgz", - "integrity": "sha512-OgfYE1x2w1jRUXzzKABX+kOdwz2y9PE0uSwnZabkWfJTWOzm7Pvfm4JI2xqRE0q2nwUe2jZLWcrcnhd9lQU63w==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.2.tgz", + "integrity": "sha512-j1oI+BOPiAAAKFysNNutE9aAIjvHqqILubCs2EeHKc19pi4uybaGAgBfLXsCgJYcyKWkiilEvl8CkFF/SL+baA==", "dev": true }, "@types/three": { @@ -295,9 +295,9 @@ } }, "@types/webxr": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.5.tgz", - "integrity": "sha512-HVOsSRTQYx3zpVl0c0FBmmmcY/60BkQLzVnpE9M1aG4f2Z0aKlBWfj4XZ2zr++XNBfkQWYcwhGlmuu44RJPDqg==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.7.tgz", + "integrity": "sha512-Rcgs5c2eNFnHp53YOjgtKfl/zWX1Y+uFGUwlSXrWcZWu3yhANRezmph4MninmqybUYT6g9ZE0aQ9QIdPkLR3Kg==", "dev": true }, "@webassemblyjs/ast": { @@ -3624,9 +3624,9 @@ "dev": true }, "nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==" + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" }, "negotiator": { "version": "0.6.2", @@ -4178,13 +4178,20 @@ } }, "postcss": { - "version": "8.3.11", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.11.tgz", - "integrity": "sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "requires": { - "nanoid": "^3.1.30", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", - "source-map-js": "^0.6.2" + "source-map-js": "^1.0.2" + }, + "dependencies": { + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" + } } }, "postcss-calc": { @@ -5094,9 +5101,9 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true }, "send": { @@ -5304,7 +5311,8 @@ "source-map-js": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", - "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==" + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true }, "source-map-loader": { "version": "3.0.0", @@ -5661,9 +5669,9 @@ } }, "three": { - "version": "0.155.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.155.0.tgz", - "integrity": "sha512-sNgCYmDijnIqkD/bMfk+1pHg3YzsxW7V2ChpuP6HCQ8NiZr3RufsXQr8M3SSUMjW4hG+sUk7YbyuY0DncaDTJQ==" + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.156.0.tgz", + "integrity": "sha512-r6meetGWDk3aYjDRh6NpKuUkzoPlI3yldDQe2SkwCcqTTB5NZn7vKQBUXyMExvlwZShaLmvAbsVWaFzp1rkk3A==" }, "three-bmfont-text": { "version": "git+ssh://git@github.com/Smithsonian/three-bmfont-text.git#e611dac13d2d5bfd7f0e483f56bffa4185393e0d", diff --git a/package.json b/package.json index 52373b14..58f13494 100755 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "moment": "^2.29.4", "morgan": "^1.10.0", "nodemon": "^3.0.1", - "postcss": "^8.3.6", + "postcss": "^8.4.31", "process": "^0.11.10", "readable-stream": "^3.6.0", "resolve-pathname": "^3.0.0", @@ -70,7 +70,7 @@ "simple-dropzone": "^0.8.3", "stream-browserify": "^3.0.0", "style-loader": "^3.3.1", - "three": "^0.155.0", + "three": "^0.156.0", "three-bmfont-text": "git+https://github.com/Smithsonian/three-bmfont-text.git#e611dac13d", "tinymce": "^6.3.1", "toposort": "^2.0.2", From f24413798c82bd8893e8b73d07fd5a2d3f04465c Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Wed, 8 Nov 2023 13:54:33 -0500 Subject: [PATCH 5/9] WIP shader update for advanced glTF material properties --- source/client/io/ModelReader.ts | 7 +- source/client/shaders/UberPBRAdvMaterial.ts | 256 ++++++++++++++++++++ source/client/shaders/uberPBRShader.frag | 110 ++++++--- source/client/shaders/uberPBRShader.vert | 28 ++- 4 files changed, 360 insertions(+), 41 deletions(-) create mode 100644 source/client/shaders/UberPBRAdvMaterial.ts diff --git a/source/client/io/ModelReader.ts b/source/client/io/ModelReader.ts index 1733cabc..fcf02bcc 100644 --- a/source/client/io/ModelReader.ts +++ b/source/client/io/ModelReader.ts @@ -16,7 +16,8 @@ */ //import resolvePathname from "resolve-pathname"; -import { LoadingManager, Object3D, Scene, Group, Mesh, MeshStandardMaterial, sRGBEncoding, SRGBColorSpace } from "three"; +import UberPBRAdvMaterial from "client/shaders/UberPBRAdvMaterial"; +import { LoadingManager, Object3D, Scene, Group, Mesh, MeshStandardMaterial, sRGBEncoding, SRGBColorSpace, MeshPhysicalMaterial } from "three"; import {DRACOLoader} from 'three/examples/jsm/loaders/DRACOLoader.js'; import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader.js'; @@ -115,10 +116,10 @@ export default class ModelReader mesh.geometry.computeBoundingBox(); - const uberMat = new UberPBRMaterial(); + const uberMat = material.type === "MeshPhysicalMaterial" ? new UberPBRAdvMaterial() : new UberPBRMaterial(); // copy properties from previous material - if (material.type === "MeshStandardMaterial") { + if (material.type === "MeshPhysicalMaterial" || material.type === "MeshStandardMaterial") { uberMat.copy(material); } diff --git a/source/client/shaders/UberPBRAdvMaterial.ts b/source/client/shaders/UberPBRAdvMaterial.ts new file mode 100644 index 00000000..99a03594 --- /dev/null +++ b/source/client/shaders/UberPBRAdvMaterial.ts @@ -0,0 +1,256 @@ +/** + * 3D Foundation Project + * Copyright 2023 Smithsonian Institution + * + * 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 { Vector3, Vector4, Color, Side, UniformsUtils, ShaderLib, NoBlending, DoubleSide, + AdditiveBlending, FrontSide, Texture, MeshPhysicalMaterial, MeshPhysicalMaterialParameters } from "three"; + +const fragmentShader = require("./uberPBRShader.frag").default; +const vertexShader = require("./uberPBRShader.vert").default; + +import { EShaderMode } from "client/schema/setup"; + +//////////////////////////////////////////////////////////////////////////////// + +export { EShaderMode }; + +export interface IUberPBRAdvShaderProps extends MeshPhysicalMaterialParameters +{ + +} + +export default class UberPBRMaterial extends MeshPhysicalMaterial +{ + isUberPBRMaterial: boolean; + isMeshStandardMaterial: boolean; + isMeshPhysicalMaterial: boolean; + + uniforms: { + aoMapMix: { value: Vector3 }, + cutPlaneDirection: { value: Vector4 }, + cutPlaneColor: { value: Vector3 }, + zoneMap: { value: Texture } + }; + + vertexShader: string; + fragmentShader: string; + + private _clayColor = new Color("#a67a6c").convertLinearToSRGB(); + private _wireColor = new Color("#004966").convertLinearToSRGB(); + private _wireEmissiveColor = new Color("#004966").convertLinearToSRGB(); + private _objectSpaceNormalMap = false; + private _paramCopy: any = {}; + private _sideCopy: Side = FrontSide; + + private _aoMapMix: Vector3; + private _cutPlaneDirection: Vector4; + private _cutPlaneColor: Vector3; + private _zoneMap: Texture; + + constructor(params?: IUberPBRAdvShaderProps) + { + super(); + + this.type = "UberPBRMaterial"; + + this.isUberPBRMaterial = true; + this.isMeshStandardMaterial = true; + this.isMeshPhysicalMaterial = true; + + this.defines = { + "STANDARD": true, + "PHYSICAL": true, + "OBJECTSPACE_NORMALMAP": false, + "MODE_NORMALS": false, + "MODE_XRAY": false, + "CUT_PLANE": false, + "USE_ZONEMAP": false, + }; + + this.uniforms = UniformsUtils.merge([ + ShaderLib.physical.uniforms, + { + aoMapMix: { value: new Vector3(0.25, 0.25, 0.25) }, + cutPlaneDirection: { value: new Vector4(0, 0, -1, 0) }, + cutPlaneColor: { value: new Vector3(1, 0, 0) }, + zoneMap: { value: null }, + } + ]); + + this._aoMapMix = this.uniforms.aoMapMix.value; + this._cutPlaneDirection = this.uniforms.cutPlaneDirection.value; + this._cutPlaneColor = this.uniforms.cutPlaneColor.value; + this._zoneMap = this.uniforms.zoneMap.value; + + //this.vertexShader = ShaderLib.standard.vertexShader; + this.vertexShader = vertexShader; + //this.fragmentShader = ShaderLib.standard.fragmentShader; + this.fragmentShader = fragmentShader; + + this.color = new Color(0xffffff); // diffuse + this.roughness = 0.7; + this.metalness = 0.0; + + if (params) { + this.setValues(params); + } + } + + set cutPlaneDirection(direction: Vector4) { + this._cutPlaneDirection.copy(direction); + } + get cutPlaneDirection() { + return this._cutPlaneDirection; + } + + set cutPlaneColor(color: Vector3) { + this._cutPlaneColor.copy(color); + } + get cutPlaneColor() { + return this._cutPlaneColor; + } + + set aoMapMix(mix: Vector3) { + this._aoMapMix.copy(mix); + } + get aoMapMix() { + return this._aoMapMix; + } + + set zoneMap(map) { + this._zoneMap = map; + this.uniforms.zoneMap.value = map; + this.needsUpdate = true; + } + get zoneMap() { + return this._zoneMap; + } + + setShaderMode(mode: EShaderMode) + { + Object.assign(this, this._paramCopy); + + this.defines["MODE_NORMALS"] = false; + this.defines["MODE_XRAY"] = false; + this.defines["OBJECTSPACE_NORMALMAP"] = !!(this.normalMap && this._objectSpaceNormalMap); + + this.side = this.defines["CUT_PLANE"] ? DoubleSide : this.side; + + this.needsUpdate = true; + + switch(mode) { + case EShaderMode.Clay: + this._paramCopy = { + color: this.color, + map: this.map, + roughness: this.roughness, + metalness: this.metalness, + aoMapIntensity: this.aoMapIntensity, + blending: this.blending, + transparent: this.transparent, + depthWrite: this.depthWrite, + }; + this.color = this._clayColor; + this.map = null; + this.roughness = 1; + this.metalness = 0; + this.aoMapIntensity *= 1; + this.blending = NoBlending; + this.transparent = false; + this.depthWrite = true; + break; + + case EShaderMode.Normals: + this._paramCopy = { + blending: this.blending, + transparent: this.transparent, + depthWrite: this.depthWrite, + }; + this.defines["MODE_NORMALS"] = true; + this.blending = NoBlending; + this.transparent = false; + this.depthWrite = true; + break; + + case EShaderMode.XRay: + this._paramCopy = { + side: this.side, + blending: this.blending, + transparent: this.transparent, + depthWrite: this.depthWrite, + }; + this.defines["MODE_XRAY"] = true; + this.side = DoubleSide; + this.blending = AdditiveBlending; + this.transparent = true; + this.depthWrite = false; + break; + + case EShaderMode.Wireframe: + this._paramCopy = { + color: this.color, + emissive: this.emissive, + roughness: this.roughness, + metalness: this.metalness, + wireframe: this.wireframe, + map: this.map, + aoMap: this.aoMap, + emissiveMap: this.emissiveMap, + normalMap: this.normalMap, + }; + this.color = this._wireColor; + this.emissive = this._wireEmissiveColor; + this.roughness = 0.8; + this.metalness = 0.1; + this.wireframe = true; + this.map = null; + this.aoMap = null; + this.emissiveMap = null; + this.normalMap = null; + this.defines["OBJECTSPACE_NORMALMAP"] = false; + break; + } + } + + enableCutPlane(enabled: boolean) + { + this.defines["CUT_PLANE"] = enabled; + + if (enabled) { + this._sideCopy = this.side; + this.side = DoubleSide; + } + else { + this.side = this._sideCopy; + } + } + + enableObjectSpaceNormalMap(useObjectSpace: boolean) + { + if (useObjectSpace !== this._objectSpaceNormalMap) { + this._objectSpaceNormalMap = useObjectSpace; + } + + if (this.normalMap) { + this.defines["OBJECTSPACE_NORMALMAP"] = useObjectSpace; + this.needsUpdate = true; + } + } + + enableZoneMap(enabled) { + this.defines["USE_ZONEMAP"] = enabled; + } +} \ No newline at end of file diff --git a/source/client/shaders/uberPBRShader.frag b/source/client/shaders/uberPBRShader.frag index fdf59452..d5f75b68 100644 --- a/source/client/shaders/uberPBRShader.frag +++ b/source/client/shaders/uberPBRShader.frag @@ -1,10 +1,8 @@ -//#define PHYSICAL //#define STANDARD #ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define TRANSPARENCY + #define IOR + #define USE_SPECULAR #endif uniform vec3 diffuse; @@ -13,27 +11,55 @@ uniform float roughness; uniform float metalness; uniform float opacity; -#ifdef TRANSPARENCY - uniform float transparency; +#ifdef IOR + uniform float ior; #endif -#ifdef REFLECTIVITY - uniform float reflectivity; +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif #endif -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif + +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN - uniform vec3 sheen; + uniform vec3 sheenColor; + uniform float sheenRoughness; + + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif #endif -//#ifndef STANDARD -// uniform float clearCoat; -// uniform float clearCoatRoughness; -//#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif varying vec3 vViewPosition; @@ -52,22 +78,25 @@ varying vec3 vViewPosition; #include #include +#include +#include #include #include #include -#include +#include #include #include -//#include #include #include #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -86,7 +115,7 @@ varying vec3 vViewPosition; #endif #ifdef CUT_PLANE - varying vec3 vWorldPosition; + //varying vec3 vWorldPosition; uniform vec4 cutPlaneDirection; uniform vec3 cutPlaneColor; #endif @@ -109,10 +138,11 @@ void main() { #include #include #include + #include #include #include #include - #include + #include #ifdef CUT_PLANE // on the cut surface (back facing fragments revealed), replace normal with cut plane direction @@ -125,15 +155,17 @@ void main() { #include #include #include + + // accumulation #include #include #include #include // modulation - //#include + #include // REPLACED WITH - #ifdef USE_AOMAP + /*#ifdef USE_AOMAP // if cut plane is enabled, disable ambient occlusion on back facing fragments #ifdef CUT_PLANE if (gl_FrontFacing) { @@ -156,14 +188,34 @@ void main() { #ifdef CUT_PLANE } #endif - #endif + #endif*/ - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - // this is a stub for the transparency model - #ifdef TRANSPARENCY - diffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ); - #endif + #include + + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + + #ifdef USE_SHEEN + + // Sheen energy compensation approximation calculation can be found at the end of + // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + + #endif + + #ifdef USE_CLEARCOAT + + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + + #endif #ifdef CUT_PLANE if (!gl_FrontFacing) { @@ -171,7 +223,7 @@ void main() { } #endif - gl_FragColor = vec4(outgoingLight, diffuseColor.a); + #include #ifdef USE_ZONEMAP vec4 zoneColor = texture2D(zoneMap, vZoneUv); diff --git a/source/client/shaders/uberPBRShader.vert b/source/client/shaders/uberPBRShader.vert index 02864438..804df66b 100644 --- a/source/client/shaders/uberPBRShader.vert +++ b/source/client/shaders/uberPBRShader.vert @@ -3,20 +3,23 @@ varying vec3 vViewPosition; -#include +#if defined(USE_TRANSMISSION) || defined(CUT_PLANE) -#include + varying vec3 vWorldPosition; -#include +#endif // Zone map support #if defined(USE_ZONEMAP) varying vec2 vZoneUv; #endif +#include +#include #include #include #include +#include #include #include #include @@ -27,9 +30,9 @@ varying vec3 vViewPosition; varying float vIntensity; #endif -#ifdef CUT_PLANE - varying vec3 vWorldPosition; -#endif +//#ifdef CUT_PLANE +// varying vec3 vWorldPosition; +//#endif void main() { @@ -45,6 +48,7 @@ void main() { #endif #include + #include #include #include @@ -65,17 +69,23 @@ void main() { #include #include - vViewPosition = -mvPosition.xyz; + vViewPosition = - mvPosition.xyz; // #include // REPLACED WITH - #if defined(USE_ENVMAP) || defined(DISTANCE) || defined(USE_SHADOWMAP) || defined(CUT_PLANE) + #if defined(USE_ENVMAP) || defined(DISTANCE) || defined(USE_SHADOWMAP) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 || defined(CUT_PLANE) vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 ); #endif #include #include +#ifdef USE_TRANSMISSION + + vWorldPosition = worldPosition.xyz; + +#endif + #ifdef CUT_PLANE vWorldPosition = worldPosition.xyz / worldPosition.w; #endif @@ -83,4 +93,4 @@ void main() { #ifdef MODE_NORMALS vNormal = normal; #endif -} +} \ No newline at end of file From 56f8bb57f11251ecf8dc2f65c4b4f47ccc2a8f71 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Thu, 9 Nov 2023 13:48:09 -0500 Subject: [PATCH 6/9] AO fix --- source/client/shaders/uberPBRShader.frag | 39 ++++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/source/client/shaders/uberPBRShader.frag b/source/client/shaders/uberPBRShader.frag index d5f75b68..816a1662 100644 --- a/source/client/shaders/uberPBRShader.frag +++ b/source/client/shaders/uberPBRShader.frag @@ -115,7 +115,9 @@ varying vec3 vViewPosition; #endif #ifdef CUT_PLANE - //varying vec3 vWorldPosition; + #if !defined(PHYSICAL) + varying vec3 vWorldPosition; + #endif uniform vec4 cutPlaneDirection; uniform vec3 cutPlaneColor; #endif @@ -163,9 +165,9 @@ void main() { #include // modulation - #include + //#include // REPLACED WITH - /*#ifdef USE_AOMAP + #ifdef USE_AOMAP // if cut plane is enabled, disable ambient occlusion on back facing fragments #ifdef CUT_PLANE if (gl_FrontFacing) { @@ -175,20 +177,31 @@ void main() { vec3 aoSample = texture2D(aoMap, vAoMapUv).rgb; vec3 aoFactors = mix(vec3(1.0), aoSample, clamp(aoMapMix * aoMapIntensity, 0.0, 1.0)); float ambientOcclusion = aoFactors.x * aoFactors.y * aoFactors.z; - float ambientOcclusion2 = ambientOcclusion * ambientOcclusion; - reflectedLight.directDiffuse *= ambientOcclusion2; - reflectedLight.directSpecular *= ambientOcclusion; - //reflectedLight.indirectDiffuse *= ambientOcclusion; - - #if defined(USE_ENVMAP) && defined(PHYSICAL) - float dotNV = saturate(dot(geometry.normal, geometry.viewDir)); - reflectedLight.indirectSpecular *= computeSpecularOcclusion(dotNV, ambientOcclusion, material.specularRoughness); - #endif + //float ambientOcclusion2 = ambientOcclusion * ambientOcclusion; + //reflectedLight.directDiffuse *= ambientOcclusion2; + //reflectedLight.directSpecular *= ambientOcclusion; + reflectedLight.indirectDiffuse *= ambientOcclusion; + + #if defined( USE_CLEARCOAT ) + clearcoatSpecularIndirect *= ambientOcclusion; + #endif + + #if defined( USE_SHEEN ) + sheenSpecularIndirect *= ambientOcclusion; + #endif + + #if defined( USE_ENVMAP ) && defined( STANDARD ) + + float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); + + reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); + + #endif #ifdef CUT_PLANE } #endif - #endif*/ + #endif vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; From 83b2e4c99339e02ea86db432ce74335ae3021a67 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Wed, 29 Nov 2023 13:18:29 -0500 Subject: [PATCH 7/9] Configurable AO shader fix --- source/client/shaders/uberPBRShader.frag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/client/shaders/uberPBRShader.frag b/source/client/shaders/uberPBRShader.frag index 816a1662..85c607dc 100644 --- a/source/client/shaders/uberPBRShader.frag +++ b/source/client/shaders/uberPBRShader.frag @@ -177,9 +177,9 @@ void main() { vec3 aoSample = texture2D(aoMap, vAoMapUv).rgb; vec3 aoFactors = mix(vec3(1.0), aoSample, clamp(aoMapMix * aoMapIntensity, 0.0, 1.0)); float ambientOcclusion = aoFactors.x * aoFactors.y * aoFactors.z; - //float ambientOcclusion2 = ambientOcclusion * ambientOcclusion; - //reflectedLight.directDiffuse *= ambientOcclusion2; - //reflectedLight.directSpecular *= ambientOcclusion; + float ambientOcclusion2 = ambientOcclusion * ambientOcclusion; + reflectedLight.directDiffuse *= ambientOcclusion2; + reflectedLight.directSpecular *= ambientOcclusion; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_CLEARCOAT ) From 9f8bebf342180da1add73fbde324a6cf5e9e22a3 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Thu, 30 Nov 2023 13:09:47 -0500 Subject: [PATCH 8/9] Configurable AO shader intensity tweak --- source/client/shaders/uberPBRShader.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/shaders/uberPBRShader.frag b/source/client/shaders/uberPBRShader.frag index 85c607dc..6221dae9 100644 --- a/source/client/shaders/uberPBRShader.frag +++ b/source/client/shaders/uberPBRShader.frag @@ -180,7 +180,7 @@ void main() { float ambientOcclusion2 = ambientOcclusion * ambientOcclusion; reflectedLight.directDiffuse *= ambientOcclusion2; reflectedLight.directSpecular *= ambientOcclusion; - reflectedLight.indirectDiffuse *= ambientOcclusion; + //reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_CLEARCOAT ) clearcoatSpecularIndirect *= ambientOcclusion; From 3c8991be779cb93431a95fab032c21a3999d7938 Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Thu, 30 Nov 2023 13:29:22 -0500 Subject: [PATCH 9/9] Exclude annotation materials from tonemapping --- source/client/annotations/CircleSprite.ts | 3 +++ source/client/annotations/ExtendedSprite.ts | 1 + source/client/annotations/StandardSprite.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/source/client/annotations/CircleSprite.ts b/source/client/annotations/CircleSprite.ts index ee9f3b34..61847213 100755 --- a/source/client/annotations/CircleSprite.ts +++ b/source/client/annotations/CircleSprite.ts @@ -98,6 +98,9 @@ export default class CircleSprite extends AnnotationSprite this.ringMaterialB, ); + this.ringMaterialA.toneMapped = false; + this.ringMaterialB.toneMapped = false; + const innerCircle = new Mesh( new CircleGeometry(0.45, 32), new MeshBasicMaterial({ color: 0, opacity: 0.65, transparent: true }), diff --git a/source/client/annotations/ExtendedSprite.ts b/source/client/annotations/ExtendedSprite.ts index 03378cd5..851f04a5 100755 --- a/source/client/annotations/ExtendedSprite.ts +++ b/source/client/annotations/ExtendedSprite.ts @@ -51,6 +51,7 @@ export default class ExtendedSprite extends AnnotationSprite const geometry = new BufferGeometry().setFromPoints(points); const material = new LineBasicMaterial({ color: "#009cde", transparent: true }); + material.toneMapped = false; this.stemLine = new Line(geometry, material); this.stemLine.frustumCulled = false; diff --git a/source/client/annotations/StandardSprite.ts b/source/client/annotations/StandardSprite.ts index 77e37153..965b42b7 100755 --- a/source/client/annotations/StandardSprite.ts +++ b/source/client/annotations/StandardSprite.ts @@ -50,6 +50,7 @@ export default class StandardSprite extends AnnotationSprite const geometry = new BufferGeometry().setFromPoints(points); const material = new LineBasicMaterial({ color: "#009cde", transparent: true }); + material.toneMapped = false; this.stemLine = new Line(geometry, material); this.stemLine.frustumCulled = false;