@threepipe/webgi-plugins 0.7.0 → 0.9.0-r172.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/LICENSE +182 -16
- package/README.md +5 -7
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/index.js +3946 -4433
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3825 -4404
- package/dist/index.mjs.map +1 -1
- package/dist/passes/BilateralFilterPass.d.ts +1 -1
- package/dist/passes/BilateralFilterPass.d.ts.map +1 -1
- package/dist/plugins/buffer/VelocityBufferPlugin.d.ts +23 -0
- package/dist/plugins/buffer/VelocityBufferPlugin.d.ts.map +1 -1
- package/dist/plugins/extras/AdvancedGroundPlugin.d.ts +1 -1
- package/dist/plugins/extras/AdvancedGroundPlugin.d.ts.map +1 -1
- package/dist/plugins/extras/AnisotropyPlugin.d.ts +5 -4
- package/dist/plugins/extras/AnisotropyPlugin.d.ts.map +1 -1
- package/dist/plugins/extras/WatchHandsPlugin.d.ts +1 -1
- package/dist/plugins/extras/WatchHandsPlugin.d.ts.map +1 -1
- package/dist/plugins/index.d.ts +9 -9
- package/dist/plugins/postprocessing/BloomPlugin.d.ts.map +1 -1
- package/dist/plugins/postprocessing/DepthOfFieldPlugin.d.ts.map +1 -1
- package/dist/plugins/postprocessing/OutlinePlugin.d.ts +4 -1
- package/dist/plugins/postprocessing/OutlinePlugin.d.ts.map +1 -1
- package/dist/plugins/postprocessing/SSContactShadowsPlugin.d.ts.map +1 -1
- package/dist/plugins/postprocessing/SSGIPlugin.d.ts +1 -1
- package/dist/plugins/postprocessing/SSGIPlugin.d.ts.map +1 -1
- package/dist/plugins/postprocessing/SSReflectionPlugin.d.ts.map +1 -1
- package/dist/plugins/postprocessing/TemporalAAPlugin.d.ts +14 -0
- package/dist/plugins/postprocessing/TemporalAAPlugin.d.ts.map +1 -1
- package/dist/utils/FSShadowMaterial.d.ts.map +1 -1
- package/dist/utils/RandomizedDirectionalLight.d.ts.map +1 -1
- package/dist/utils/Reflector2.d.ts +4 -4
- package/dist/utils/Reflector2.d.ts.map +1 -1
- package/dist/utils/ShadowMapBaker.d.ts +1 -1
- package/dist/utils/ShadowMapBaker.d.ts.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +4 -4
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +18 -3
- package/docs/classes/AdvancedGroundPlugin.html +678 -11
- package/docs/classes/AnisotropyPlugin.html +400 -8
- package/docs/classes/BloomPlugin.html +436 -7
- package/docs/classes/BloomPluginPass.html +301 -12
- package/docs/classes/DepthOfFieldPlugin.html +459 -7
- package/docs/classes/DepthOfFieldPluginPass.html +315 -12
- package/docs/classes/OutlinePlugin.html +632 -11
- package/docs/classes/OutlineRenderPass.html +239 -12
- package/docs/classes/SSContactShadowsPlugin.html +390 -6
- package/docs/classes/SSGIPlugin.html +454 -8
- package/docs/classes/SSGIPluginPass.html +372 -12
- package/docs/classes/SSReflectionPlugin.html +460 -8
- package/docs/classes/SSReflectionPluginPass.html +377 -12
- package/docs/classes/SSVelocityMaterial.html +123 -5
- package/docs/classes/TemporalAAPlugin.html +418 -8
- package/docs/classes/TemporalAAPluginPass.html +357 -13
- package/docs/classes/VelocityBufferPlugin.html +466 -7
- package/docs/classes/WatchHandsPlugin.html +410 -6
- package/docs/hierarchy.html +28 -1
- package/docs/index.html +38 -1
- package/docs/types/OutlinePluginPass.html +32 -1
- package/docs/types/OutlinePluginTarget.html +32 -1
- package/docs/types/SSGIPluginTarget.html +32 -1
- package/docs/types/SSReflectionPluginTarget.html +32 -1
- package/docs/types/VelocityBufferPluginPass.html +32 -1
- package/docs/types/VelocityBufferPluginTarget.html +32 -1
- package/docs/variables/anisotropyGLTFExtension.html +43 -1
- package/docs/variables/webgiPlugins.html +32 -1
- package/package.json +6 -3
- package/src/plugins/buffer/VelocityBufferPlugin.ts +119 -8
- package/src/plugins/buffer/shaders/VelocityBufferPlugin.mat.frag.glsl +9 -1
- package/src/plugins/buffer/shaders/VelocityBufferPlugin.mat.vert.glsl +14 -1
- package/src/plugins/extras/AnisotropyPlugin.ts +2 -2
- package/src/plugins/postprocessing/BloomPlugin.ts +5 -2
- package/src/plugins/postprocessing/DepthOfFieldPlugin.ts +3 -3
- package/src/plugins/postprocessing/OutlinePlugin.ts +53 -38
- package/src/plugins/postprocessing/SSContactShadowsPlugin.ts +1 -1
- package/src/plugins/postprocessing/TemporalAAPlugin.ts +42 -0
- package/src/utils/shaders/temporalaa.glsl +9 -0
- package/tsconfig.json +2 -1
|
@@ -1 +1,32 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>VelocityBufferPluginPass | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>VelocityBufferPluginPass | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container"><a href="../index.html" class="title">WebGi Rendering Plugins</a>
|
|
3
|
+
<div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
|
|
4
|
+
<ul role="listbox" id="tsd-search-results"></ul>
|
|
5
|
+
<div id="tsd-search-status" aria-live="polite" aria-atomic="true">
|
|
6
|
+
<div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header>
|
|
7
|
+
<div class="container container-main">
|
|
8
|
+
<div class="col-content">
|
|
9
|
+
<div class="tsd-page-title">
|
|
10
|
+
<ul class="tsd-breadcrumb" aria-label="Breadcrumb">
|
|
11
|
+
<li><a href="" aria-current="page">VelocityBufferPluginPass</a></li></ul>
|
|
12
|
+
<h1>Type Alias VelocityBufferPluginPass</h1></div>
|
|
13
|
+
<div class="tsd-signature"><span class="tsd-kind-type-alias">VelocityBufferPluginPass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">GBufferRenderPass</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">"velocityBuffer"</span><span class="tsd-signature-symbol">,</span><br/> <a href="VelocityBufferPluginTarget.html" class="tsd-signature-type tsd-kind-type-alias">VelocityBufferPluginTarget</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources">
|
|
14
|
+
<ul>
|
|
15
|
+
<li>Defined in <a href="https://github.com/repalash/threepipe/blob/71bf604f43d1a10824e50393efbc9ac3a2c7e80e/plugins/webgi-plugins/src/plugins/buffer/VelocityBufferPlugin.ts#L48" class="external" target="_blank">plugins/webgi-plugins/src/plugins/buffer/VelocityBufferPlugin.ts:48</a></li></ul></aside></div>
|
|
16
|
+
<div class="col-sidebar">
|
|
17
|
+
<div class="page-menu">
|
|
18
|
+
<div class="tsd-navigation settings">
|
|
19
|
+
<details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>
|
|
20
|
+
<h3>Settings</h3></summary>
|
|
21
|
+
<div class="tsd-accordion-details">
|
|
22
|
+
<div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span>
|
|
23
|
+
<ul id="tsd-filter-options">
|
|
24
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
25
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div>
|
|
26
|
+
<div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
|
|
27
|
+
<div class="site-menu">
|
|
28
|
+
<nav class="tsd-navigation"><a href="../index.html">WebGi Rendering Plugins</a>
|
|
29
|
+
<ul class="tsd-small-nested-navigation" id="tsd-nav-container">
|
|
30
|
+
<li>Loading...</li></ul></nav></div></div></div><footer>
|
|
31
|
+
<p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
|
|
32
|
+
<div class="overlay"></div></body></html>
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>VelocityBufferPluginTarget | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>VelocityBufferPluginTarget | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container"><a href="../index.html" class="title">WebGi Rendering Plugins</a>
|
|
3
|
+
<div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
|
|
4
|
+
<ul role="listbox" id="tsd-search-results"></ul>
|
|
5
|
+
<div id="tsd-search-status" aria-live="polite" aria-atomic="true">
|
|
6
|
+
<div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header>
|
|
7
|
+
<div class="container container-main">
|
|
8
|
+
<div class="col-content">
|
|
9
|
+
<div class="tsd-page-title">
|
|
10
|
+
<ul class="tsd-breadcrumb" aria-label="Breadcrumb">
|
|
11
|
+
<li><a href="" aria-current="page">VelocityBufferPluginTarget</a></li></ul>
|
|
12
|
+
<h1>Type Alias VelocityBufferPluginTarget</h1></div>
|
|
13
|
+
<div class="tsd-signature"><span class="tsd-kind-type-alias">VelocityBufferPluginTarget</span><span class="tsd-signature-symbol">:</span> <a href="https://threejs.org/docs" class="tsd-signature-type external" target="_blank">WebGLRenderTarget</a></div><aside class="tsd-sources">
|
|
14
|
+
<ul>
|
|
15
|
+
<li>Defined in <a href="https://github.com/repalash/threepipe/blob/71bf604f43d1a10824e50393efbc9ac3a2c7e80e/plugins/webgi-plugins/src/plugins/buffer/VelocityBufferPlugin.ts#L47" class="external" target="_blank">plugins/webgi-plugins/src/plugins/buffer/VelocityBufferPlugin.ts:47</a></li></ul></aside></div>
|
|
16
|
+
<div class="col-sidebar">
|
|
17
|
+
<div class="page-menu">
|
|
18
|
+
<div class="tsd-navigation settings">
|
|
19
|
+
<details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>
|
|
20
|
+
<h3>Settings</h3></summary>
|
|
21
|
+
<div class="tsd-accordion-details">
|
|
22
|
+
<div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span>
|
|
23
|
+
<ul id="tsd-filter-options">
|
|
24
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
25
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div>
|
|
26
|
+
<div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
|
|
27
|
+
<div class="site-menu">
|
|
28
|
+
<nav class="tsd-navigation"><a href="../index.html">WebGi Rendering Plugins</a>
|
|
29
|
+
<ul class="tsd-small-nested-navigation" id="tsd-nav-container">
|
|
30
|
+
<li>Loading...</li></ul></nav></div></div></div><footer>
|
|
31
|
+
<p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
|
|
32
|
+
<div class="overlay"></div></body></html>
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>anisotropyGLTFExtension | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>anisotropyGLTFExtension | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container"><a href="../index.html" class="title">WebGi Rendering Plugins</a>
|
|
3
|
+
<div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
|
|
4
|
+
<ul role="listbox" id="tsd-search-results"></ul>
|
|
5
|
+
<div id="tsd-search-status" aria-live="polite" aria-atomic="true">
|
|
6
|
+
<div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header>
|
|
7
|
+
<div class="container container-main">
|
|
8
|
+
<div class="col-content">
|
|
9
|
+
<div class="tsd-page-title">
|
|
10
|
+
<ul class="tsd-breadcrumb" aria-label="Breadcrumb">
|
|
11
|
+
<li><a href="" aria-current="page">anisotropyGLTFExtension</a></li></ul>
|
|
12
|
+
<h1>Variable anisotropyGLTFExtension<code class="tsd-tag">Const</code></h1></div>
|
|
13
|
+
<div class="tsd-signature"><span class="tsd-kind-variable">anisotropyGLTFExtension</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">export</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">w</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">GLTFWriter2</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">writeMaterialAsync</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">material</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">materialDef</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">import</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">p</span><span class="tsd-signature-symbol">:</span> <a href="https://threejs.org/docs" class="tsd-signature-type external" target="_blank">GLTFParser</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">GLTFMaterialsAnisotropyExtensionImport</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">textures</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">anisotropyDirection</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div>
|
|
14
|
+
<div class="tsd-type-declaration">
|
|
15
|
+
<h4>Type Declaration</h4>
|
|
16
|
+
<ul class="tsd-parameters">
|
|
17
|
+
<li class="tsd-parameter">
|
|
18
|
+
<h5 id="export"><span class="tsd-kind-property">export</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">w</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">GLTFWriter2</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">writeMaterialAsync</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">material</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">materialDef</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></h5></li>
|
|
19
|
+
<li class="tsd-parameter">
|
|
20
|
+
<h5 id="import"><span class="tsd-kind-property">import</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">p</span><span class="tsd-signature-symbol">:</span> <a href="https://threejs.org/docs" class="tsd-signature-type external" target="_blank">GLTFParser</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">GLTFMaterialsAnisotropyExtensionImport</span></h5></li>
|
|
21
|
+
<li class="tsd-parameter">
|
|
22
|
+
<h5 id="name"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li>
|
|
23
|
+
<li class="tsd-parameter">
|
|
24
|
+
<h5 id="textures"><span class="tsd-kind-property">textures</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">anisotropyDirection</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span></h5></li></ul></div><aside class="tsd-sources">
|
|
25
|
+
<ul>
|
|
26
|
+
<li>Defined in <a href="https://github.com/repalash/threepipe/blob/71bf604f43d1a10824e50393efbc9ac3a2c7e80e/plugins/webgi-plugins/src/plugins/extras/AnisotropyPlugin.ts#L512" class="external" target="_blank">plugins/webgi-plugins/src/plugins/extras/AnisotropyPlugin.ts:512</a></li></ul></aside></div>
|
|
27
|
+
<div class="col-sidebar">
|
|
28
|
+
<div class="page-menu">
|
|
29
|
+
<div class="tsd-navigation settings">
|
|
30
|
+
<details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>
|
|
31
|
+
<h3>Settings</h3></summary>
|
|
32
|
+
<div class="tsd-accordion-details">
|
|
33
|
+
<div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span>
|
|
34
|
+
<ul id="tsd-filter-options">
|
|
35
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
36
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div>
|
|
37
|
+
<div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
|
|
38
|
+
<div class="site-menu">
|
|
39
|
+
<nav class="tsd-navigation"><a href="../index.html">WebGi Rendering Plugins</a>
|
|
40
|
+
<ul class="tsd-small-nested-navigation" id="tsd-nav-container">
|
|
41
|
+
<li>Loading...</li></ul></nav></div></div></div><footer>
|
|
42
|
+
<p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
|
|
43
|
+
<div class="overlay"></div></body></html>
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>webgiPlugins | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>webgiPlugins | WebGi Rendering Plugins</title><meta name="description" content="Documentation for WebGi Rendering Plugins"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container"><a href="../index.html" class="title">WebGi Rendering Plugins</a>
|
|
3
|
+
<div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
|
|
4
|
+
<ul role="listbox" id="tsd-search-results"></ul>
|
|
5
|
+
<div id="tsd-search-status" aria-live="polite" aria-atomic="true">
|
|
6
|
+
<div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header>
|
|
7
|
+
<div class="container container-main">
|
|
8
|
+
<div class="col-content">
|
|
9
|
+
<div class="tsd-page-title">
|
|
10
|
+
<ul class="tsd-breadcrumb" aria-label="Breadcrumb">
|
|
11
|
+
<li><a href="" aria-current="page">webgiPlugins</a></li></ul>
|
|
12
|
+
<h1>Variable webgiPlugins<code class="tsd-tag">Const</code></h1></div>
|
|
13
|
+
<div class="tsd-signature"><span class="tsd-kind-variable">webgiPlugins</span><span class="tsd-signature-symbol">:</span> (<br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/TemporalAAPlugin.html" class="tsd-signature-type tsd-kind-class">TemporalAAPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/VelocityBufferPlugin.html" class="tsd-signature-type tsd-kind-class">VelocityBufferPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/BloomPlugin.html" class="tsd-signature-type tsd-kind-class">BloomPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/SSReflectionPlugin.html" class="tsd-signature-type tsd-kind-class">SSReflectionPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/SSContactShadowsPlugin.html" class="tsd-signature-type tsd-kind-class">SSContactShadowsPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/DepthOfFieldPlugin.html" class="tsd-signature-type tsd-kind-class">DepthOfFieldPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/OutlinePlugin.html" class="tsd-signature-type tsd-kind-class">OutlinePlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/SSGIPlugin.html" class="tsd-signature-type tsd-kind-class">SSGIPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/AnisotropyPlugin.html" class="tsd-signature-type tsd-kind-class">AnisotropyPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/AdvancedGroundPlugin.html" class="tsd-signature-type tsd-kind-class">AdvancedGroundPlugin</a><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <a href="../classes/WatchHandsPlugin.html" class="tsd-signature-type tsd-kind-class">WatchHandsPlugin</a><br/>)<span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
|
|
14
|
+
<ul>
|
|
15
|
+
<li>Defined in <a href="https://github.com/repalash/threepipe/blob/71bf604f43d1a10824e50393efbc9ac3a2c7e80e/plugins/webgi-plugins/src/plugins/index.ts#L26" class="external" target="_blank">plugins/webgi-plugins/src/plugins/index.ts:26</a></li></ul></aside></div>
|
|
16
|
+
<div class="col-sidebar">
|
|
17
|
+
<div class="page-menu">
|
|
18
|
+
<div class="tsd-navigation settings">
|
|
19
|
+
<details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>
|
|
20
|
+
<h3>Settings</h3></summary>
|
|
21
|
+
<div class="tsd-accordion-details">
|
|
22
|
+
<div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span>
|
|
23
|
+
<ul id="tsd-filter-options">
|
|
24
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
25
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div>
|
|
26
|
+
<div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
|
|
27
|
+
<div class="site-menu">
|
|
28
|
+
<nav class="tsd-navigation"><a href="../index.html">WebGi Rendering Plugins</a>
|
|
29
|
+
<ul class="tsd-small-nested-navigation" id="tsd-nav-container">
|
|
30
|
+
<li>Loading...</li></ul></nav></div></div></div><footer>
|
|
31
|
+
<p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
|
|
32
|
+
<div class="overlay"></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threepipe/webgi-plugins",
|
|
3
3
|
"description": "WebGi - Realistic Rendering Plugins for ThreePipe.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0-r172.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"tag": "three-r172"
|
|
7
|
+
},
|
|
5
8
|
"dependencies": {},
|
|
6
9
|
"peerDependencies": {
|
|
7
|
-
"threepipe": ">=0.5.1"
|
|
10
|
+
"threepipe": ">=0.5.1 || >=0.8.0-r172.1"
|
|
8
11
|
},
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
@@ -33,7 +36,7 @@
|
|
|
33
36
|
"THIRD_PARTY_NOTICES.md"
|
|
34
37
|
],
|
|
35
38
|
"author": "repalash <palash@shaders.app> (https://repalash.com)",
|
|
36
|
-
"license": "
|
|
39
|
+
"license": "Apache-2.0",
|
|
37
40
|
"keywords": [
|
|
38
41
|
"3d",
|
|
39
42
|
"three.js",
|
|
@@ -2,6 +2,11 @@ import {
|
|
|
2
2
|
BufferGeometry,
|
|
3
3
|
Camera,
|
|
4
4
|
Color,
|
|
5
|
+
DataTexture,
|
|
6
|
+
FloatType,
|
|
7
|
+
InstancedMesh,
|
|
8
|
+
NearestFilter,
|
|
9
|
+
RGBAFormat,
|
|
5
10
|
DoubleSide,
|
|
6
11
|
GBufferRenderPass,
|
|
7
12
|
ICamera,
|
|
@@ -22,8 +27,11 @@ import {
|
|
|
22
27
|
Texture,
|
|
23
28
|
TextureDataType,
|
|
24
29
|
ThreeViewer,
|
|
30
|
+
onChange,
|
|
31
|
+
serialize,
|
|
25
32
|
uiFolderContainer,
|
|
26
33
|
uiImage,
|
|
34
|
+
uiSlider,
|
|
27
35
|
Group,
|
|
28
36
|
UnsignedByteType,
|
|
29
37
|
Vector2,
|
|
@@ -56,6 +64,27 @@ export class VelocityBufferPlugin
|
|
|
56
64
|
@uiImage('Velocity Buffer', {readOnly: true}) texture?: Texture
|
|
57
65
|
readonly material: SSVelocityMaterial = new SSVelocityMaterial()
|
|
58
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Debug: a split of the screen at this x (0 to 1, 0 is off). Left of it the buffer holds the camera's motion only,
|
|
69
|
+
* as if there were no velocity buffer, so TAA and the screen-space reflections and GI smear moving objects there;
|
|
70
|
+
* right of it, the full motion. Off (0), the shader is as without it.
|
|
71
|
+
*/
|
|
72
|
+
@uiSlider('Split', [0, 1], 0.01, {tags: ['debug']})
|
|
73
|
+
@onChange(VelocityBufferPlugin.prototype._splitChanged)
|
|
74
|
+
@serialize() split = 0
|
|
75
|
+
|
|
76
|
+
protected _splitChanged() {
|
|
77
|
+
const m = this.material, on = this.split > 0
|
|
78
|
+
m.uniforms.velocitySplitX.value = this.split
|
|
79
|
+
if (!!m.defines.VELOCITY_SPLIT !== on) {
|
|
80
|
+
if (on) m.defines.VELOCITY_SPLIT = 1
|
|
81
|
+
else delete m.defines.VELOCITY_SPLIT
|
|
82
|
+
m.needsUpdate = true
|
|
83
|
+
}
|
|
84
|
+
// (also set while constructing, before the extension below exists)
|
|
85
|
+
if (this._viewer) this.setDirty()
|
|
86
|
+
}
|
|
87
|
+
|
|
59
88
|
// @onChange2(VelocityBufferPlugin.prototype._createTarget)
|
|
60
89
|
// @uiDropdown('Buffer Type', threeConstMappings.TextureDataType.uiConfig)
|
|
61
90
|
readonly bufferType: TextureDataType // cannot be changed after creation (for now)
|
|
@@ -146,6 +175,9 @@ export class VelocityBufferPlugin
|
|
|
146
175
|
|
|
147
176
|
onRemove(viewer: ThreeViewer): void {
|
|
148
177
|
this._disposeTarget()
|
|
178
|
+
// the per-mesh history (instance matrix textures, listeners on the meshes) lives in the material: released
|
|
179
|
+
// here, not only when each mesh is disposed. The material is reused if the plugin is added again.
|
|
180
|
+
this.material.dispose()
|
|
149
181
|
return super.onRemove(viewer)
|
|
150
182
|
}
|
|
151
183
|
|
|
@@ -209,6 +241,7 @@ export class SSVelocityMaterial extends ShaderMaterial {
|
|
|
209
241
|
alphaMapTransform: {value: /* @__PURE__*/ new Matrix3()},
|
|
210
242
|
currentProjectionViewMatrix: {value: new Matrix4()},
|
|
211
243
|
lastProjectionViewMatrix: {value: new Matrix4()},
|
|
244
|
+
velocitySplitX: {value: 0},
|
|
212
245
|
},
|
|
213
246
|
blending: NoBlending, // todo?
|
|
214
247
|
})
|
|
@@ -216,21 +249,99 @@ export class SSVelocityMaterial extends ShaderMaterial {
|
|
|
216
249
|
|
|
217
250
|
extraUniformsToUpload: Record<string, IUniform> = {
|
|
218
251
|
modelMatrixPrevious: {value: new Matrix4().identity()},
|
|
252
|
+
// instanced meshes: the previous frame's instance matrices, 4 texels (columns) per instance, 1024 per row
|
|
253
|
+
instanceMatrixPrevious: {value: null},
|
|
254
|
+
hasInstanceMatrixPrevious: {value: false},
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The world matrix of each object in the last and in this frame's velocity render. Advanced once per render
|
|
259
|
+
* (`frame`): an object with several material groups is drawn (and gets onBeforeRender) once per group, and
|
|
260
|
+
* copying the matrix at each draw left every group after the first with no motion.
|
|
261
|
+
*/
|
|
262
|
+
private _previousWorldMatrices: Record<string, {previous: Matrix4, current: Matrix4, frame: number}> = {}
|
|
263
|
+
/**
|
|
264
|
+
* Previous instance matrices per instanced mesh: two float textures, the one written last frame is read by this
|
|
265
|
+
* frame's draw while this frame's matrices go into the other (once per render, for all of the mesh's groups).
|
|
266
|
+
* Without them every instance got the mesh's motion only (camera motion for a static mesh), so TAA and the
|
|
267
|
+
* SSGI/SSR history smeared moving instances.
|
|
268
|
+
*/
|
|
269
|
+
private _previousInstanceMatrices: Record<string, {textures: [DataTexture, DataTexture], data: [Float32Array, Float32Array], read: 0 | 1, valid: boolean, capacity: number, frame: number, readNow: DataTexture | null}> = {}
|
|
270
|
+
/** The dispose listener added to each instanced mesh with a history (removed in {@link dispose}). */
|
|
271
|
+
private _meshListeners = new Map<string, {object: IObject3D, listener: () => void}>()
|
|
272
|
+
|
|
273
|
+
private _instancePrevious(object: InstancedMesh, frame: number) {
|
|
274
|
+
const capacity = object.instanceMatrix.count
|
|
275
|
+
let e = this._previousInstanceMatrices[object.uuid]
|
|
276
|
+
if (!e || e.capacity !== capacity) {
|
|
277
|
+
if (e) e.textures.forEach(t => t.dispose())
|
|
278
|
+
else if ((object as any as IObject3D).addEventListener) {
|
|
279
|
+
const o = object as any as IObject3D
|
|
280
|
+
const listener = () => {
|
|
281
|
+
const d = this._previousInstanceMatrices[object.uuid]
|
|
282
|
+
if (d) d.textures.forEach(t => t.dispose())
|
|
283
|
+
delete this._previousInstanceMatrices[object.uuid]
|
|
284
|
+
delete this._previousWorldMatrices[object.uuid]
|
|
285
|
+
this._meshListeners.delete(object.uuid)
|
|
286
|
+
o.removeEventListener('dispose', listener)
|
|
287
|
+
}
|
|
288
|
+
o.addEventListener('dispose', listener)
|
|
289
|
+
this._meshListeners.set(object.uuid, {object: o, listener})
|
|
290
|
+
}
|
|
291
|
+
// the texture's layout is the instanceMatrix array's: instance i's 16 floats at i * 16
|
|
292
|
+
const width = 4 * Math.min(capacity, 1024), height = Math.ceil(capacity / 1024)
|
|
293
|
+
const data = [new Float32Array(width * height * 4), new Float32Array(width * height * 4)] as const
|
|
294
|
+
const make = (i: 0 | 1) => {
|
|
295
|
+
const t = new DataTexture(data[i], width, height, RGBAFormat, FloatType)
|
|
296
|
+
t.minFilter = t.magFilter = NearestFilter
|
|
297
|
+
t.generateMipmaps = false
|
|
298
|
+
t.name = 'instanceMatrixPrevious'
|
|
299
|
+
return t
|
|
300
|
+
}
|
|
301
|
+
e = this._previousInstanceMatrices[object.uuid] = {textures: [make(0), make(1)], data: [data[0], data[1]], read: 0, valid: false, capacity, frame: -1, readNow: null}
|
|
302
|
+
}
|
|
303
|
+
if (e.frame !== frame) {
|
|
304
|
+
e.frame = frame
|
|
305
|
+
e.readNow = e.valid ? e.textures[e.read] : null
|
|
306
|
+
// this frame's matrices, for the next frame
|
|
307
|
+
const w = 1 - e.read as 0 | 1
|
|
308
|
+
e.data[w].set(object.instanceMatrix.array)
|
|
309
|
+
e.textures[w].needsUpdate = true
|
|
310
|
+
e.read = 1 - e.read as 0 | 1
|
|
311
|
+
e.valid = true
|
|
312
|
+
}
|
|
313
|
+
const u = this.extraUniformsToUpload
|
|
314
|
+
u.instanceMatrixPrevious.value = e.readNow
|
|
315
|
+
u.hasInstanceMatrixPrevious.value = !!e.readNow
|
|
219
316
|
}
|
|
220
317
|
|
|
221
|
-
|
|
318
|
+
dispose() {
|
|
319
|
+
for (const e of Object.values(this._previousInstanceMatrices)) e.textures.forEach(t => t.dispose())
|
|
320
|
+
for (const {object, listener} of this._meshListeners.values()) object.removeEventListener('dispose', listener)
|
|
321
|
+
this._meshListeners.clear()
|
|
322
|
+
this._previousInstanceMatrices = {}
|
|
323
|
+
this._previousWorldMatrices = {}
|
|
324
|
+
super.dispose()
|
|
325
|
+
}
|
|
222
326
|
|
|
223
327
|
// this gets called for each object.
|
|
224
328
|
onBeforeRender(_r: WebGLRenderer, _s: Scene, _c: Camera, _geometry: BufferGeometry, object: IObject3D, group: Group) {
|
|
225
329
|
super.onBeforeRender(_r, _s, _c, _geometry, object, group)
|
|
226
|
-
|
|
227
|
-
|
|
330
|
+
// one velocity render is one renderer.render call: its frame counter tells a new frame from another group's draw
|
|
331
|
+
const frame = _r.info.render.frame
|
|
332
|
+
let world = this._previousWorldMatrices[object.uuid]
|
|
333
|
+
if (!world) world = this._previousWorldMatrices[object.uuid] = {previous: object.matrixWorld.clone(), current: object.matrixWorld.clone(), frame}
|
|
334
|
+
else if (world.frame !== frame) {
|
|
335
|
+
world.previous.copy(world.current)
|
|
336
|
+
world.current.copy(object.matrixWorld)
|
|
337
|
+
world.frame = frame
|
|
338
|
+
}
|
|
339
|
+
this.extraUniformsToUpload.modelMatrixPrevious.value.copy(world.previous)
|
|
228
340
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
this._previousWorldMatrices[object.uuid] = object.matrixWorld.clone()
|
|
341
|
+
if ((object as any).isInstancedMesh) this._instancePrevious(object as any as InstancedMesh, frame)
|
|
342
|
+
else {
|
|
343
|
+
this.extraUniformsToUpload.instanceMatrixPrevious.value = null
|
|
344
|
+
this.extraUniformsToUpload.hasInstanceMatrixPrevious.value = false
|
|
234
345
|
}
|
|
235
346
|
|
|
236
347
|
// todo: add support for all this in the shaders.
|
|
@@ -10,10 +10,18 @@ varying vec3 vWorldPosition;
|
|
|
10
10
|
varying vec3 vWorldPositionPrevious;
|
|
11
11
|
uniform mat4 currentProjectionViewMatrix;
|
|
12
12
|
uniform mat4 lastProjectionViewMatrix;
|
|
13
|
+
#ifdef VELOCITY_SPLIT
|
|
14
|
+
// left of it (screen x, 0 to 1) the objects' own motion is left out: the camera's only, as without a velocity buffer
|
|
15
|
+
uniform float velocitySplitX;
|
|
16
|
+
#endif
|
|
13
17
|
|
|
14
18
|
vec2 computeScreenSpaceVelocity2() {
|
|
15
19
|
vec4 currentPositionClip = currentProjectionViewMatrix * vec4(vWorldPosition, 1.0);
|
|
16
|
-
|
|
20
|
+
vec3 previousWorld = vWorldPositionPrevious;
|
|
21
|
+
#ifdef VELOCITY_SPLIT
|
|
22
|
+
if (currentPositionClip.x / currentPositionClip.w * 0.5 + 0.5 < velocitySplitX) previousWorld = vWorldPosition;
|
|
23
|
+
#endif
|
|
24
|
+
vec4 prevPositionClip = lastProjectionViewMatrix * vec4(previousWorld, 1.0);
|
|
17
25
|
|
|
18
26
|
vec2 currentPositionNDC = currentPositionClip.xy / currentPositionClip.w;
|
|
19
27
|
vec2 prevPositionNDC = prevPositionClip.xy / prevPositionClip.w;
|
|
@@ -15,6 +15,17 @@ varying vec3 vWorldPositionPrevious;
|
|
|
15
15
|
|
|
16
16
|
uniform mat4 modelMatrixPrevious;
|
|
17
17
|
|
|
18
|
+
#ifdef USE_INSTANCING
|
|
19
|
+
// the previous frame's instance matrices (VelocityBufferPlugin): 4 texels (columns) per instance, 1024 instances a row
|
|
20
|
+
uniform sampler2D instanceMatrixPrevious;
|
|
21
|
+
uniform bool hasInstanceMatrixPrevious;
|
|
22
|
+
mat4 getInstanceMatrixPrevious() {
|
|
23
|
+
int x = (gl_InstanceID % 1024) * 4, y = gl_InstanceID / 1024;
|
|
24
|
+
return mat4(texelFetch(instanceMatrixPrevious, ivec2(x, y), 0), texelFetch(instanceMatrixPrevious, ivec2(x + 1, y), 0),
|
|
25
|
+
texelFetch(instanceMatrixPrevious, ivec2(x + 2, y), 0), texelFetch(instanceMatrixPrevious, ivec2(x + 3, y), 0));
|
|
26
|
+
}
|
|
27
|
+
#endif
|
|
28
|
+
|
|
18
29
|
void main() {
|
|
19
30
|
|
|
20
31
|
#include <uv_vertex>
|
|
@@ -29,15 +40,17 @@ void main() {
|
|
|
29
40
|
// project_vertex
|
|
30
41
|
|
|
31
42
|
vec4 mvPosition = vec4( transformed, 1.0 );
|
|
43
|
+
vec4 previousPosition = mvPosition;
|
|
32
44
|
|
|
33
45
|
#ifdef USE_INSTANCING
|
|
34
46
|
|
|
47
|
+
previousPosition = hasInstanceMatrixPrevious ? getInstanceMatrixPrevious() * mvPosition : instanceMatrix * mvPosition;
|
|
35
48
|
mvPosition = instanceMatrix * mvPosition;
|
|
36
49
|
|
|
37
50
|
#endif
|
|
38
51
|
|
|
39
52
|
vWorldPosition = (modelMatrix * mvPosition).xyz;
|
|
40
|
-
vWorldPositionPrevious = (modelMatrixPrevious *
|
|
53
|
+
vWorldPositionPrevious = (modelMatrixPrevious * previousPosition).xyz;
|
|
41
54
|
|
|
42
55
|
mvPosition = modelViewMatrix * mvPosition;
|
|
43
56
|
|
|
@@ -478,7 +478,7 @@ class GLTFMaterialsAnisotropyExtensionImport implements GLTFLoaderPlugin {
|
|
|
478
478
|
|
|
479
479
|
|
|
480
480
|
const glTFMaterialsAnisotropyExtensionExport = (w: GLTFWriter2)=> ({
|
|
481
|
-
|
|
481
|
+
writeMaterialAsync: async(material: any, materialDef: any) => {
|
|
482
482
|
if (!material.isMeshStandardMaterial || !material.userData._isAnisotropic) return
|
|
483
483
|
|
|
484
484
|
if ((material.userData._anisotropyFactor || 0) < 0.001) return // todo: is this correct?
|
|
@@ -493,7 +493,7 @@ const glTFMaterialsAnisotropyExtensionExport = (w: GLTFWriter2)=> ({
|
|
|
493
493
|
|
|
494
494
|
if (w.checkEmptyMap(material.userData._anisotropyDirectionMap) && extensionDef.anisotropyDirectionMode !== 'CONSTANT') {
|
|
495
495
|
|
|
496
|
-
const anisotropyDirectionMapDef = {index: w.
|
|
496
|
+
const anisotropyDirectionMapDef = {index: await w.processTextureAsync(material.userData._anisotropyDirectionMap)}
|
|
497
497
|
w.applyTextureTransform(anisotropyDirectionMapDef, material.userData._anisotropyDirectionMap)
|
|
498
498
|
extensionDef.anisotropyDirection = anisotropyDirectionMapDef
|
|
499
499
|
|
|
@@ -207,11 +207,11 @@ export class BloomPluginPass<Tid extends IPassID> extends ExtendedShaderPass imp
|
|
|
207
207
|
@serialize() softThreshold = 0.5
|
|
208
208
|
|
|
209
209
|
@uiSlider('Intensity', [0, 3])
|
|
210
|
-
@serialize() @uniform() intensity = 0.2
|
|
210
|
+
@serialize() @uniform({onChange: BloomPluginPass.prototype.setDirty}) intensity = 0.2
|
|
211
211
|
|
|
212
212
|
@uiToggle('Background Bloom')
|
|
213
213
|
@serialize()
|
|
214
|
-
@matDefineBool('BACKGROUND_BLOOM')
|
|
214
|
+
@matDefineBool('BACKGROUND_BLOOM', undefined, undefined, BloomPluginPass.prototype.setDirty)
|
|
215
215
|
backgroundBloom = false
|
|
216
216
|
|
|
217
217
|
@uiSlider('Iterations', [2, 7], 1)
|
|
@@ -233,9 +233,12 @@ export class BloomPluginPass<Tid extends IPassID> extends ExtendedShaderPass imp
|
|
|
233
233
|
this.prefilter.y = this.softThreshold
|
|
234
234
|
this.prefilter.z = 2 * this.prefilter.x * this.prefilter.y
|
|
235
235
|
this.prefilter.w = this.uniforms?.prefilter ? .125 / (this.uniforms.prefilter.value.z + 0.00001) : 0
|
|
236
|
+
// the prefilter vector changes in place, so its uniform setter does not run: render again
|
|
237
|
+
this.setDirty()
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
@uiToggle('Debug')
|
|
241
|
+
@onChange2(BloomPluginPass.prototype.setDirty)
|
|
239
242
|
bloomDebug = false
|
|
240
243
|
|
|
241
244
|
private _weights: any = []
|