@luma.gl/engine 9.1.0-beta.8 → 9.2.0-alpha.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/README.md +5 -0
- package/dist/animation-loop/animation-loop.d.ts +11 -11
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +25 -49
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/animation-loop/animation-props.d.ts +3 -4
- package/dist/animation-loop/animation-props.d.ts.map +1 -1
- package/dist/async-texture/async-texture.d.ts +106 -2
- package/dist/async-texture/async-texture.d.ts.map +1 -1
- package/dist/async-texture/async-texture.js +278 -5
- package/dist/async-texture/async-texture.js.map +1 -1
- package/dist/compute/computation.d.ts +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/swap.d.ts.map +1 -1
- package/dist/compute/swap.js +6 -2
- package/dist/compute/swap.js.map +1 -1
- package/dist/compute/texture-transform.d.ts.map +1 -1
- package/dist/compute/texture-transform.js +1 -0
- package/dist/compute/texture-transform.js.map +1 -1
- package/dist/debug/copy-texture-to-image.d.ts +23 -1
- package/dist/debug/copy-texture-to-image.d.ts.map +1 -1
- package/dist/debug/copy-texture-to-image.js +37 -1
- package/dist/debug/copy-texture-to-image.js.map +1 -1
- package/dist/dist.dev.js +316 -153
- package/dist/dist.min.js +23 -23
- package/dist/index.cjs +334 -172
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/model.d.ts +4 -19
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +1 -44
- package/dist/model/model.js.map +1 -1
- package/dist/models/billboard-texture-model.d.ts.map +1 -1
- package/dist/models/billboard-texture-model.js +6 -4
- package/dist/models/billboard-texture-model.js.map +1 -1
- package/dist/modules/picking/legacy-picking-manager.d.ts +1 -1
- package/dist/modules/picking/legacy-picking-manager.d.ts.map +1 -1
- package/dist/modules/picking/legacy-picking-manager.js +1 -1
- package/dist/modules/picking/legacy-picking-manager.js.map +1 -1
- package/dist/modules/picking/picking-manager.d.ts +1 -1
- package/dist/modules/picking/picking-manager.d.ts.map +1 -1
- package/dist/modules/picking/picking-manager.js +1 -1
- package/dist/modules/picking/picking-manager.js.map +1 -1
- package/dist/passes/get-fragment-shader.js +2 -2
- package/dist/passes/shader-pass-renderer.d.ts +4 -4
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +15 -5
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/shader-inputs.js +1 -1
- package/dist/shader-inputs.js.map +1 -1
- package/package.json +4 -4
- package/src/animation-loop/animation-loop.ts +30 -58
- package/src/animation-loop/animation-props.ts +3 -5
- package/src/async-texture/async-texture.ts +382 -16
- package/src/async-texture/texture-setters.ts.disabled +296 -0
- package/src/compute/computation.ts +1 -1
- package/src/compute/swap.ts +7 -2
- package/src/compute/texture-transform.ts +1 -0
- package/src/debug/copy-texture-to-image.ts +52 -2
- package/src/index.ts +12 -0
- package/src/model/model.ts +4 -55
- package/src/models/billboard-texture-model.ts +6 -4
- package/src/modules/picking/legacy-picking-manager.ts +2 -2
- package/src/modules/picking/picking-manager.ts +2 -2
- package/src/passes/get-fragment-shader.ts +2 -2
- package/src/passes/shader-pass-renderer.ts +18 -8
- package/src/shader-inputs.ts +1 -1
|
@@ -44,9 +44,9 @@ export class ShaderPassRenderer {
|
|
|
44
44
|
);
|
|
45
45
|
this.shaderInputs = props.shaderInputs || new ShaderInputs(modules);
|
|
46
46
|
|
|
47
|
-
const size = device.getCanvasContext().
|
|
47
|
+
const size = device.getCanvasContext().getDrawingBufferSize();
|
|
48
48
|
this.swapFramebuffers = new SwapFramebuffers(device, {
|
|
49
|
-
colorAttachments: [
|
|
49
|
+
colorAttachments: [device.preferredColorFormat],
|
|
50
50
|
width: size[0],
|
|
51
51
|
height: size[1]
|
|
52
52
|
});
|
|
@@ -99,7 +99,7 @@ void main() {
|
|
|
99
99
|
// this.props.passes.forEach(pass => pass.resize(width, height));
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
renderToScreen(options: {sourceTexture: AsyncTexture; uniforms
|
|
102
|
+
renderToScreen(options: {sourceTexture: AsyncTexture; uniforms?: any; bindings?: any}): boolean {
|
|
103
103
|
// Run the shader passes and generate an output texture
|
|
104
104
|
const outputTexture = this.renderToTexture(options);
|
|
105
105
|
if (!outputTexture) {
|
|
@@ -107,7 +107,16 @@ void main() {
|
|
|
107
107
|
return false;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
const
|
|
110
|
+
const framebuffer = this.device
|
|
111
|
+
.getDefaultCanvasContext()
|
|
112
|
+
// @ts-expect-error TODO - remove after republish
|
|
113
|
+
.getCurrentFramebuffer({depthStencilAttachment: false});
|
|
114
|
+
const renderPass = this.device.beginRenderPass({
|
|
115
|
+
id: 'shader-pass-renderer-to-screen',
|
|
116
|
+
framebuffer,
|
|
117
|
+
clearColor: [0, 0, 0, 1],
|
|
118
|
+
clearDepth: 1
|
|
119
|
+
});
|
|
111
120
|
this.clipSpace.setBindings({sourceTexture: outputTexture});
|
|
112
121
|
this.clipSpace.draw(renderPass);
|
|
113
122
|
renderPass.end();
|
|
@@ -119,8 +128,8 @@ void main() {
|
|
|
119
128
|
*/
|
|
120
129
|
renderToTexture(options: {
|
|
121
130
|
sourceTexture: AsyncTexture;
|
|
122
|
-
uniforms
|
|
123
|
-
bindings
|
|
131
|
+
uniforms?: any;
|
|
132
|
+
bindings?: any;
|
|
124
133
|
}): Texture | null {
|
|
125
134
|
const {sourceTexture} = options;
|
|
126
135
|
if (!sourceTexture.isReady) {
|
|
@@ -134,6 +143,7 @@ void main() {
|
|
|
134
143
|
|
|
135
144
|
// Clear the current texture before we begin
|
|
136
145
|
const clearTexturePass = this.device.beginRenderPass({
|
|
146
|
+
id: 'shader-pass-renderer-clear-texture',
|
|
137
147
|
framebuffer: this.swapFramebuffers.current,
|
|
138
148
|
clearColor: [0, 0, 0, 1]
|
|
139
149
|
});
|
|
@@ -163,6 +173,7 @@ void main() {
|
|
|
163
173
|
};
|
|
164
174
|
|
|
165
175
|
const renderPass = this.device.beginRenderPass({
|
|
176
|
+
id: 'shader-pass-renderer-run-pass',
|
|
166
177
|
framebuffer: this.swapFramebuffers.next,
|
|
167
178
|
clearColor: [0, 0, 0, 1],
|
|
168
179
|
clearDepth: 1
|
|
@@ -226,8 +237,7 @@ class SubPassRenderer {
|
|
|
226
237
|
fs,
|
|
227
238
|
modules: [shaderPass],
|
|
228
239
|
parameters: {
|
|
229
|
-
depthWriteEnabled: false
|
|
230
|
-
depthCompare: 'always'
|
|
240
|
+
depthWriteEnabled: false
|
|
231
241
|
}
|
|
232
242
|
});
|
|
233
243
|
}
|
package/src/shader-inputs.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type {Binding, UniformValue} from '@luma.gl/core';
|
|
6
6
|
import {log} from '@luma.gl/core';
|
|
7
|
-
// import type {
|
|
7
|
+
// import type {VariableShaderType, UniformValue, UniformFormat, UniformInfoDevice, Texture, Sampler} from '@luma.gl/core';
|
|
8
8
|
import {getShaderModuleDependencies, ShaderModule} from '@luma.gl/shadertools';
|
|
9
9
|
import {splitUniformsAndBindings} from './model/split-uniforms-and-bindings';
|
|
10
10
|
|