Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: StorageTexture #26769

Merged
merged 2 commits into from
Sep 17, 2023
Merged

WebGPURenderer: StorageTexture #26769

merged 2 commits into from
Sep 17, 2023

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Sep 15, 2023

Related issue: Closes #26749

Description

const storageTexture = new StorageTexture( width, height );
@sunag sunag added this to the r157 milestone Sep 15, 2023
@sunag sunag marked this pull request as ready for review September 16, 2023 01:06
@sunag sunag merged commit 2c8cfdf into mrdoob:dev Sep 17, 2023
18 checks passed
@Spiri0
Copy link
Contributor

Spiri0 commented Sep 18, 2023

Ok, then I'll be patient and wait for r157.

@sunag
Copy link
Collaborator Author

sunag commented Sep 18, 2023

@Spiri0 Can this example already help with your project?

@Spiri0
Copy link
Contributor

Spiri0 commented Sep 19, 2023

Yes very, this is my topic:

https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://tore.tuhh.de/bitstream/11420/1439/1/GPGPU_FFT_Ocean_Simulation.pdf&ved=2ahUKEwj07qP5vbWBAxUx1AIHHdE9AO4QFnoECBgQAQ&usg=AOvVaw0_z-QXC4vcYeIYLsP5WBfM

With r156 I also created the butterfly texture (pages 26 and 40) and the init spectras. This works very well with the node system and wgslFn. For the butterfly texture I only had to write my own bit-reverse fn but these are minor obstacles. The textures look exactly like in the paper. The only thing I was missing was the textureStore functionality before r156. I could have done the pingpong mechanic thing more complicatedly with two separate shaders, but with the pingpong possibility it's cleaner. I have this IFFT ocean since may in WebGL2, but with lots of render targets. But now I want to do all of this with computer shaders. Phil Crowther inspired me to do this because he has been looking for a gpu IFFT ocean for a longer time. Once I've finished it, he can add it as a module in three.js.
Thanks to your comment with the textureNode and the uniforms, I now understand the node system quite well and I like it.

@mrdoob
Copy link
Owner

mrdoob commented Sep 20, 2023

Is this how webgpu_compute_texture_pingpong is supposed to look like?

Screen.Recording.2023-09-20.at.4.31.26.PM.mov
@Spiri0
Copy link
Contributor

Spiri0 commented Sep 20, 2023

This looks good. It looks similar to what I have already implemented in WebGL2 with renderTargets. You probably used the noise pattern that I saw in the r157 example, but that's a user matter. The mechanism certainly looks correct. To us it just looks like noise. However, for the Fourier mechanism, these are numerous different wavelengths that evolve over time. The thing with the StorageTexture was a great idea. I wonder if you or sunag are aware that you have essentially made the DataTexture, which generates the textures on the CPU side, superfluous with the StorageTexture. In any case, I only see advantages in the StorageTexture.
Being able to generate textures on gpu side with the compute shaders is an enormous milestone.

@sunag sunag deleted the dev-storage-texture branch September 26, 2023 03:00
@mrdoob
Copy link
Owner

mrdoob commented Sep 28, 2023

Improved the example to make it more visually appealing in d6c8dd0

Screenshot 2023-09-28 at 23 49 19
sunag added a commit to aardgoose/three.js that referenced this pull request Sep 29, 2023
commit 181e04e
Author: Mr.doob <info@mrdoob.com>
Date:   Fri Sep 29 00:10:20 2023 +0900

    r157

commit cabaf21
Author: Mr.doob <info@mrdoob.com>
Date:   Fri Sep 29 00:08:47 2023 +0900

    Updated builds.

commit 1c85c95
Author: Mr.doob <info@mrdoob.com>
Date:   Thu Sep 28 23:41:31 2023 +0900

    Improved USDZLoader example.

commit d6c8dd0
Author: Mr.doob <info@mrdoob.com>
Date:   Thu Sep 28 22:53:05 2023 +0900

    Improved compute texture examples.

commit f886330
Author: GitHubDragonFly <69928501+GitHubDragonFly@users.noreply.github.com>
Date:   Thu Sep 28 03:23:34 2023 -0400

    USDZ Loader - texture scale + offset + rotation (mrdoob#26861)

commit cb64471
Author: Levi Pesin <35454228+LeviPesin@users.noreply.github.com>
Date:   Thu Sep 28 04:55:58 2023 +0930

    Nodes: Fix `addLightNode` in case of anonymizing classes (mrdoob#26858)

    * Fix `addLightNode` in case of anonymizing classes

    * Address comment

    * Update AmbientLightNode.js

    * Update DirectionalLightNode.js

    * Update HemisphereLightNode.js

    * Update IESSpotLightNode.js

    * Update PointLightNode.js

    * Update SpotLightNode.js

    * Fix

commit 688b749
Author: sunag <sunagbrasil@gmail.com>
Date:   Wed Sep 27 13:42:29 2023 -0300

    WebGLNodeBuilder: Fix Multi-Material (mrdoob#26841)

commit bf7a89e
Author: mrdoob <info@mrdoob.com>
Date:   Wed Sep 27 20:33:38 2023 +0900

    Fixed DeepScan issue.

commit 285c9b6
Author: YX <978345079@qq.com>
Date:   Wed Sep 27 16:32:50 2023 +0800

    Update SpriteMaterial.html (mrdoob#26855)

    Fixed incorrect Chinese translation.

commit 5c00457
Author: 郭斌勇 <guobinyong@qq.com>
Date:   Wed Sep 27 16:26:37 2023 +0800

    CurvePath: Use correct line type in `closePath()`. (mrdoob#26850)

    * fix mrdoob#26849

    * Update CurvePath.js

    ---------

    Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>

commit 083be57
Author: Shuhei Aoyama <mt.blue81@gmail.com>
Date:   Wed Sep 27 15:53:03 2023 +0900

    GLTFLoader: Fix to handle reject on afterRoot (mrdoob#26852)

commit 2d1695e
Author: Levi Pesin <35454228+LeviPesin@users.noreply.github.com>
Date:   Wed Sep 27 04:57:29 2023 +0930

    Nodes: Fix `addNodeClass` and `addNodeMaterial` in case of renaming classes (mrdoob#26846)

commit 6a5d6de
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 16:13:03 2023 -0300

    StorageTexture: Adds support for other formats. (mrdoob#26842)

    * TimeNode: Define `frameId` as integer

    * Renderer: Set `info` as public

    * StorageTexture: Adds support for other formats.

    * Update example to `temporal blur`

    * fix device in getFormat()

commit 9fe5ed2
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 16:10:10 2023 -0300

    TSL: Fix include one function under another. (mrdoob#26844)

    * TSL: Fix include one function under another.

    * Add include example

commit ca5c7cb
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 16:09:42 2023 -0300

    Examples: Rename some WebGPU Compute examples (mrdoob#26845)

    * webgpu_compute -> webgpu_compute_points

    * webgpu_audio_processing -> webgpu_compute_audio

commit 379038f
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 01:27:04 2023 -0300

    WebGPURenderer: Fix .flipY example

commit 2ccc5bc
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 23:54:10 2023 -0300

    Nodes: Rename `construct()` to `setup()` (mrdoob#26840)

    * Nodes: Rename `construct()` to `setup()`

    * deprecated alert

commit e2f5911
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 23:45:33 2023 -0300

    WebGPURenderer: GPU FlipY (mrdoob#26818)

    * GPU FlipY

    * use tempTexture.destroy()

    * fix name

    * Rename to `WebGPUTexturePassUtils` and `_getPassUtils()`

commit 0f65abb
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 22:51:02 2023 -0300

    TextureNode: Rename `.getTextureMatrix()` -> `.getTransformedUV()` (mrdoob#26839)

commit 8d241a6
Author: Marco Fugaro <marco.fugaro@gmail.com>
Date:   Tue Sep 26 02:51:33 2023 +0200

    Examples: Remove import maps polyfill (mrdoob#26836)

commit 1a67ba7
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 18:25:00 2023 -0300

    RenderNodes: Fix `context.material` reference. (mrdoob#26838)

commit 15e4656
Author: Sachin S <ssk4988@gmail.com>
Date:   Mon Sep 25 04:39:03 2023 -0400

    DragControls: Add `recursive` property.  (mrdoob#26747)

    * add recursive property to DragControls

    * Update DragControls.js

    Clean up.

    ---------

    Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>

commit 43d68fc
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 25 10:38:50 2023 +0200

    Update github/codeql-action digest to 6a28655 (mrdoob#26833)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 10e8823
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 25 10:38:42 2023 +0200

    Update actions/checkout digest to 8ade135 (mrdoob#26832)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit e857553
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 25 00:14:05 2023 +0000

    Update devDependencies (non-major) (mrdoob#26834)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 53c642e
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sun Sep 24 11:28:27 2023 +0200

    Docs: Clean up. (mrdoob#26831)

commit 53ee377
Author: Guilherme Avila <3927951+sciecode@users.noreply.github.com>
Date:   Sun Sep 24 06:22:08 2023 -0300

    EXRExporter: implements support for DataTexture export (mrdoob#26810)

    * EXRExporter: DataTexture support

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * EXRExporter: update API & docs

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * Examples: add misc_exporter_exr

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * fix MIME-type

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * update DataTexture usage example

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * update screenshot

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    ---------

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

commit c3a746a
Author: Isaac Mason <isaac@isaacmason.com>
Date:   Sun Sep 24 18:30:05 2023 +1000

    docs: add recast-navigation-js to libraries and plugins page (mrdoob#26828)

commit 89e698f
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Sat Sep 23 19:39:04 2023 +0200

    Updated builds.

commit 27f0400
Author: 林炳权 <695601626@qq.com>
Date:   Sun Sep 24 01:32:21 2023 +0800

    RenderTarget: Clean up. (mrdoob#26775)

    * RenderTarget: Clean up.

    * use `Object.assign()`

    * remove duplicate code

commit 72d0d3c
Author: Joe Pea <trusktr@gmail.com>
Date:   Sat Sep 23 10:29:01 2023 -0700

    Update Libraries-and-Plugins.html (mrdoob#26819)

    * Update Libraries-and-Plugins.html

    Add Lume, add a few descriptions, and separate open source wrappers/frameworks from closed source wrappers/frameworks.

    * Update Libraries-and-Plugins.html

    * Update Libraries-and-Plugins.html

commit 9d2d7eb
Author: sunag <sunagbrasil@gmail.com>
Date:   Sat Sep 23 01:16:29 2023 -0300

    TSL: Introduce ShaderCallNode & `tslFn` improvements (mrdoob#26824)

    * Add ShaderCallNode

    * cleanup

    * Use tslFn as default

commit 45505ed
Author: sunag <sunagbrasil@gmail.com>
Date:   Fri Sep 22 16:58:55 2023 -0300

    TSL: SetNode (mrdoob#26785)

    * Add SetNode

    * Use viewProj.setZ()

    * cleanup

commit aa7bec9
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Fri Sep 22 20:47:46 2023 +0100

    Nodes: consume labels() when used, to prevent duplicate uniform names. (mrdoob#26822)

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit 5bab962
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Fri Sep 22 17:38:55 2023 +0100

    WebGPURenderer: Support textureCompare() operations in WebGL backend (mrdoob#26823)

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit ac901f1
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Fri Sep 22 12:31:27 2023 +0200

    Updated builds.

commit 2ac424c
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Fri Sep 22 05:40:45 2023 +0100

    WebGPURenderer: Support multiple render targets (mrdoob#26808)

    * less var access (mrdoob#26817)

    actually use the framebuffer we have cached

    update examples

    update screenshots

    MRT

    allow example to run

    fix WGSL code

    address comments

    update screenshot

    * remove unused var

    * cleanup

    ---------

    Co-authored-by: ycw <ycw7788@gmail.com>
    Co-authored-by: aardgoose <angus.sawyer@email.com>
    Co-authored-by: sunag <sunagbrasil@gmail.com>

commit 309e5f6
Author: ycw <ycw7788@gmail.com>
Date:   Thu Sep 21 20:35:27 2023 +0800

    less var access (mrdoob#26817)

commit c1bf227
Author: ycw <ycw7788@gmail.com>
Date:   Thu Sep 21 16:14:29 2023 +0800

    AnimationUtils: Remove `arraySlice()`. (mrdoob#26756)

    * use default

    * exclusive

    * rm arraySlice

    * rm test, rm docs

commit ef417f0
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Wed Sep 20 17:33:28 2023 +0100

    WebGPURenderer: Basic render to texture support for WebGL backend (mrdoob#26801)

    * Support texture backed render targets

    * actually use the framebuffer we have cached

    * update examples

    * update screenshots

    ---------

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit bc69abb
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Wed Sep 20 15:56:06 2023 +0200

    Updated builds.

commit 7bf83b8
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Wed Sep 20 15:55:19 2023 +0200

    Shaders: Remove struct GeometricContext to improve Adreno GPU support. (mrdoob#26805)

commit 32cf0d1
Author: ycw <ycw7788@gmail.com>
Date:   Wed Sep 20 17:22:22 2023 +0800

    cleanup (mrdoob#26803)

commit 85f9f28
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 19 18:25:56 2023 -0300

    WebGPURenderer: CCW FrontFace as default (mrdoob#26807)

commit cf340b9
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 19 18:25:25 2023 -0300

    TSL: Fix `.negate()` (mrdoob#26804)

    * Fix dFdy().negate()

    * Fix .negate()

commit 1e673db
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 18 16:39:52 2023 -0300

    Updated screenshot of the `webgpu_lights_ies_spotlight` (mrdoob#26800)

commit 75b9699
Author: Tim Weißenfels <10491533+tim-we@users.noreply.github.com>
Date:   Mon Sep 18 20:01:06 2023 +0200

    Update documentation of Object3D#userData (mrdoob#26799)

    * Update userData description in Object3D.html

    Updated the documentation to make clear what the default value is (otherwise one could assume it might be null or undefined).

    * Update Texture.html

    * Update Material.html

    * Update BufferGeometry.html

commit 0b0a7d7
Author: StrandedKitty <kittyhawk3011@gmail.com>
Date:   Mon Sep 18 19:45:10 2023 +0200

    Use cameraPosition uniform instead of world origin (mrdoob#26766)

commit 217e20e
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Mon Sep 18 19:43:42 2023 +0200

    Updated builds.

commit 1454e7a
Author: ycw <ycw7788@gmail.com>
Date:   Tue Sep 19 01:42:56 2023 +0800

    ObjectLoader: Refector (de)serialization of Fog and FogExp2 (mrdoob#26793)

    * marshal fog/fogexp2 .name

    * use object literal

commit 1a7b805
Author: ycw <ycw7788@gmail.com>
Date:   Tue Sep 19 01:41:38 2023 +0800

    re order (mrdoob#26780)

commit f4488d8
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Mon Sep 18 19:41:00 2023 +0200

    LightProbeGenerator: Add support for half float render targets. (mrdoob#26773)

commit e74c655
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Mon Sep 18 18:21:40 2023 +0100

    WebGPURenderer: Texture fixes for WebGL backend (mrdoob#26797)

    * misc texture fixes

    handle VideoTexture.
    handle depth textures in GLSL shaders (depth in x component in returned
    vec4())
    map WGSL textureDimensions to GLSL textureSize()

    Examples fixed

    lights / ies /spotlights
    video / panorama
    material / video (partial)

    * remove surplus entry

    ---------

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit 18febaf
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 18 07:13:40 2023 -0300

    WebGPURenderer, CubeCamera: Add `.activeMipmapLevel` (mrdoob#26770)

    * CubeCamera: Add .activeMipmapLevel

    * Use CubeCamera

    * WebGPURenderer:  Add .activeMipmapLevel for set .setRenderTarget()

commit 16eaae5
Author: ycw <ycw7788@gmail.com>
Date:   Mon Sep 18 16:27:01 2023 +0800

    cleanup (mrdoob#26791)

commit 633d804
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Mon Sep 18 10:22:45 2023 +0200

    Editor: Fix `CapsuleGeometry` parameter. (mrdoob#26794)

commit fffeb0c
Author: ycw <ycw7788@gmail.com>
Date:   Mon Sep 18 15:32:50 2023 +0800

    fmt code block (mrdoob#26792)

commit b6150e4
Author: WestLangley <WestLangley@users.noreply.github.com>
Date:   Mon Sep 18 01:56:38 2023 -0400

    Simplify equation (mrdoob#26787)

commit 93c3589
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sun Sep 17 22:02:02 2023 +0000

    Update devDependencies (non-major) (mrdoob#26783)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 4ed78c7
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sun Sep 17 20:10:40 2023 +0200

    Update github/codeql-action digest to 04daf01 (mrdoob#26782)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 2c8cfdf
Author: sunag <sunagbrasil@gmail.com>
Date:   Sun Sep 17 00:10:52 2023 -0300

    WebGPURenderer: StorageTexture (mrdoob#26769)

    * Add StorageTexture

    * add `webgpu_compute_texture_pingpong` example

commit 80ba01c
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Sun Sep 17 03:19:42 2023 +0100

    negate dpdy only (mrdoob#26776)

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit 99d705f
Author: 林炳权 <695601626@qq.com>
Date:   Sun Sep 17 00:52:53 2023 +0800

    Sprite: Clean up. (mrdoob#26774)

commit c6cfa6a
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 10:46:13 2023 +0200

    CubeCamera: Add comment to clarify mipmap generation. (mrdoob#26772)

commit 51462bf
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:59:49 2023 +0200

    Updated builds.

commit b17a561
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:58:24 2023 +0200

    WebGLTextures: Increase default precision for depth buffers with WebGL 2. (mrdoob#26764)

    * WebGLTextures: Increase default precision for depth buffers with WebGL 2.

    * Examples: Update screenshots.

    * Examples: Update screenshots.

    * Add webgl2_multisampled_renderbuffers to exception list.

commit 8193d58
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:54:34 2023 +0200

    Updated builds.

commit 5238fae
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:53:35 2023 +0200

    WebGLRenderer: Introduce USE_LIGHT_PROBES define. (mrdoob#26768)

    * WebGLRenderer: Introduce USE_LIGHT_PROBES define.

    * Examples: Make use of USE_LIGHT_PROBES.

    * Add light probe define to vertex shader

    ---------

    Co-authored-by: WestLangley <WestLangley@users.noreply.github.com>

commit fbc28ae
Author: 林炳权 <695601626@qq.com>
Date:   Fri Sep 15 16:22:16 2023 +0800

    src: Clean up. (mrdoob#26763)

commit 18ae441
Author: Casey Primozic <casey@cprimozic.net>
Date:   Fri Sep 15 00:55:35 2023 -0700

    Docs: Add some missing options to `MeshPhysicalMaterial` demo. (mrdoob#26753)

    * Add some missing options to `MeshPhysicalMaterial` demo

     * Add GUI options for some missing properties including sheen, ior, iridescence, and others to the material browser embedded on the docs pages for materials

    * Use real default `sheenColor in material browser

    * Re-disable dirlights in `MeshPhysicalMaterial` material browser

    * Update docs to correct the default `sheenColor`

     * Docs stated it was 0xfffff, but it's actually 0x000000
     * Fixes mrdoob#26757

    * Add back deleted comment

commit 30164c9
Author: ycw <ycw7788@gmail.com>
Date:   Fri Sep 15 09:58:20 2023 +0800

    Camera: Simplify `getWorldDirection()`. (mrdoob#26743)

    * refactor getWorldDirection

    * revert object3d
@Spiri0
Copy link
Contributor

Spiri0 commented Sep 29, 2023

The example turned out very well. Not because it happens to be what I need, but because it conveys the node system very well in conjunction with slightly more extensive but not too large WGSL shaders. It also teaches pretty much everything one need to use compute shaders with their full potential for texture generation. In my opinion, the 3 compute examples and the materials example are sufficient to learn nearly everything about the node system. I'm now really looking forward to the weekend to port my IFFT generator with r157 into my WebGPU variant.

sunag pushed a commit that referenced this pull request Sep 29, 2023
* handle instanced geometries
handle interleaved buffers and deduplicate
add clear() for frame buffer

* remove redundant code

* adjust support message

* support InstancedMesh and updateAttribute()

* remove version inc

* Squashed commit of the following:

commit 181e04e
Author: Mr.doob <info@mrdoob.com>
Date:   Fri Sep 29 00:10:20 2023 +0900

    r157

commit cabaf21
Author: Mr.doob <info@mrdoob.com>
Date:   Fri Sep 29 00:08:47 2023 +0900

    Updated builds.

commit 1c85c95
Author: Mr.doob <info@mrdoob.com>
Date:   Thu Sep 28 23:41:31 2023 +0900

    Improved USDZLoader example.

commit d6c8dd0
Author: Mr.doob <info@mrdoob.com>
Date:   Thu Sep 28 22:53:05 2023 +0900

    Improved compute texture examples.

commit f886330
Author: GitHubDragonFly <69928501+GitHubDragonFly@users.noreply.github.com>
Date:   Thu Sep 28 03:23:34 2023 -0400

    USDZ Loader - texture scale + offset + rotation (#26861)

commit cb64471
Author: Levi Pesin <35454228+LeviPesin@users.noreply.github.com>
Date:   Thu Sep 28 04:55:58 2023 +0930

    Nodes: Fix `addLightNode` in case of anonymizing classes (#26858)

    * Fix `addLightNode` in case of anonymizing classes

    * Address comment

    * Update AmbientLightNode.js

    * Update DirectionalLightNode.js

    * Update HemisphereLightNode.js

    * Update IESSpotLightNode.js

    * Update PointLightNode.js

    * Update SpotLightNode.js

    * Fix

commit 688b749
Author: sunag <sunagbrasil@gmail.com>
Date:   Wed Sep 27 13:42:29 2023 -0300

    WebGLNodeBuilder: Fix Multi-Material (#26841)

commit bf7a89e
Author: mrdoob <info@mrdoob.com>
Date:   Wed Sep 27 20:33:38 2023 +0900

    Fixed DeepScan issue.

commit 285c9b6
Author: YX <978345079@qq.com>
Date:   Wed Sep 27 16:32:50 2023 +0800

    Update SpriteMaterial.html (#26855)

    Fixed incorrect Chinese translation.

commit 5c00457
Author: 郭斌勇 <guobinyong@qq.com>
Date:   Wed Sep 27 16:26:37 2023 +0800

    CurvePath: Use correct line type in `closePath()`. (#26850)

    * fix #26849

    * Update CurvePath.js

    ---------

    Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>

commit 083be57
Author: Shuhei Aoyama <mt.blue81@gmail.com>
Date:   Wed Sep 27 15:53:03 2023 +0900

    GLTFLoader: Fix to handle reject on afterRoot (#26852)

commit 2d1695e
Author: Levi Pesin <35454228+LeviPesin@users.noreply.github.com>
Date:   Wed Sep 27 04:57:29 2023 +0930

    Nodes: Fix `addNodeClass` and `addNodeMaterial` in case of renaming classes (#26846)

commit 6a5d6de
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 16:13:03 2023 -0300

    StorageTexture: Adds support for other formats. (#26842)

    * TimeNode: Define `frameId` as integer

    * Renderer: Set `info` as public

    * StorageTexture: Adds support for other formats.

    * Update example to `temporal blur`

    * fix device in getFormat()

commit 9fe5ed2
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 16:10:10 2023 -0300

    TSL: Fix include one function under another. (#26844)

    * TSL: Fix include one function under another.

    * Add include example

commit ca5c7cb
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 16:09:42 2023 -0300

    Examples: Rename some WebGPU Compute examples (#26845)

    * webgpu_compute -> webgpu_compute_points

    * webgpu_audio_processing -> webgpu_compute_audio

commit 379038f
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 26 01:27:04 2023 -0300

    WebGPURenderer: Fix .flipY example

commit 2ccc5bc
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 23:54:10 2023 -0300

    Nodes: Rename `construct()` to `setup()` (#26840)

    * Nodes: Rename `construct()` to `setup()`

    * deprecated alert

commit e2f5911
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 23:45:33 2023 -0300

    WebGPURenderer: GPU FlipY (#26818)

    * GPU FlipY

    * use tempTexture.destroy()

    * fix name

    * Rename to `WebGPUTexturePassUtils` and `_getPassUtils()`

commit 0f65abb
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 22:51:02 2023 -0300

    TextureNode: Rename `.getTextureMatrix()` -> `.getTransformedUV()` (#26839)

commit 8d241a6
Author: Marco Fugaro <marco.fugaro@gmail.com>
Date:   Tue Sep 26 02:51:33 2023 +0200

    Examples: Remove import maps polyfill (#26836)

commit 1a67ba7
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 25 18:25:00 2023 -0300

    RenderNodes: Fix `context.material` reference. (#26838)

commit 15e4656
Author: Sachin S <ssk4988@gmail.com>
Date:   Mon Sep 25 04:39:03 2023 -0400

    DragControls: Add `recursive` property.  (#26747)

    * add recursive property to DragControls

    * Update DragControls.js

    Clean up.

    ---------

    Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>

commit 43d68fc
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 25 10:38:50 2023 +0200

    Update github/codeql-action digest to 6a28655 (#26833)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 10e8823
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 25 10:38:42 2023 +0200

    Update actions/checkout digest to 8ade135 (#26832)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit e857553
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Sep 25 00:14:05 2023 +0000

    Update devDependencies (non-major) (#26834)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 53c642e
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sun Sep 24 11:28:27 2023 +0200

    Docs: Clean up. (#26831)

commit 53ee377
Author: Guilherme Avila <3927951+sciecode@users.noreply.github.com>
Date:   Sun Sep 24 06:22:08 2023 -0300

    EXRExporter: implements support for DataTexture export (#26810)

    * EXRExporter: DataTexture support

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * EXRExporter: update API & docs

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * Examples: add misc_exporter_exr

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * fix MIME-type

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * update DataTexture usage example

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    * update screenshot

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

    ---------

    Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>

commit c3a746a
Author: Isaac Mason <isaac@isaacmason.com>
Date:   Sun Sep 24 18:30:05 2023 +1000

    docs: add recast-navigation-js to libraries and plugins page (#26828)

commit 89e698f
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Sat Sep 23 19:39:04 2023 +0200

    Updated builds.

commit 27f0400
Author: 林炳权 <695601626@qq.com>
Date:   Sun Sep 24 01:32:21 2023 +0800

    RenderTarget: Clean up. (#26775)

    * RenderTarget: Clean up.

    * use `Object.assign()`

    * remove duplicate code

commit 72d0d3c
Author: Joe Pea <trusktr@gmail.com>
Date:   Sat Sep 23 10:29:01 2023 -0700

    Update Libraries-and-Plugins.html (#26819)

    * Update Libraries-and-Plugins.html

    Add Lume, add a few descriptions, and separate open source wrappers/frameworks from closed source wrappers/frameworks.

    * Update Libraries-and-Plugins.html

    * Update Libraries-and-Plugins.html

commit 9d2d7eb
Author: sunag <sunagbrasil@gmail.com>
Date:   Sat Sep 23 01:16:29 2023 -0300

    TSL: Introduce ShaderCallNode & `tslFn` improvements (#26824)

    * Add ShaderCallNode

    * cleanup

    * Use tslFn as default

commit 45505ed
Author: sunag <sunagbrasil@gmail.com>
Date:   Fri Sep 22 16:58:55 2023 -0300

    TSL: SetNode (#26785)

    * Add SetNode

    * Use viewProj.setZ()

    * cleanup

commit aa7bec9
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Fri Sep 22 20:47:46 2023 +0100

    Nodes: consume labels() when used, to prevent duplicate uniform names. (#26822)

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit 5bab962
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Fri Sep 22 17:38:55 2023 +0100

    WebGPURenderer: Support textureCompare() operations in WebGL backend (#26823)

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit ac901f1
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Fri Sep 22 12:31:27 2023 +0200

    Updated builds.

commit 2ac424c
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Fri Sep 22 05:40:45 2023 +0100

    WebGPURenderer: Support multiple render targets (#26808)

    * less var access (#26817)

    actually use the framebuffer we have cached

    update examples

    update screenshots

    MRT

    allow example to run

    fix WGSL code

    address comments

    update screenshot

    * remove unused var

    * cleanup

    ---------

    Co-authored-by: ycw <ycw7788@gmail.com>
    Co-authored-by: aardgoose <angus.sawyer@email.com>
    Co-authored-by: sunag <sunagbrasil@gmail.com>

commit 309e5f6
Author: ycw <ycw7788@gmail.com>
Date:   Thu Sep 21 20:35:27 2023 +0800

    less var access (#26817)

commit c1bf227
Author: ycw <ycw7788@gmail.com>
Date:   Thu Sep 21 16:14:29 2023 +0800

    AnimationUtils: Remove `arraySlice()`. (#26756)

    * use default

    * exclusive

    * rm arraySlice

    * rm test, rm docs

commit ef417f0
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Wed Sep 20 17:33:28 2023 +0100

    WebGPURenderer: Basic render to texture support for WebGL backend (#26801)

    * Support texture backed render targets

    * actually use the framebuffer we have cached

    * update examples

    * update screenshots

    ---------

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit bc69abb
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Wed Sep 20 15:56:06 2023 +0200

    Updated builds.

commit 7bf83b8
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Wed Sep 20 15:55:19 2023 +0200

    Shaders: Remove struct GeometricContext to improve Adreno GPU support. (#26805)

commit 32cf0d1
Author: ycw <ycw7788@gmail.com>
Date:   Wed Sep 20 17:22:22 2023 +0800

    cleanup (#26803)

commit 85f9f28
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 19 18:25:56 2023 -0300

    WebGPURenderer: CCW FrontFace as default (#26807)

commit cf340b9
Author: sunag <sunagbrasil@gmail.com>
Date:   Tue Sep 19 18:25:25 2023 -0300

    TSL: Fix `.negate()` (#26804)

    * Fix dFdy().negate()

    * Fix .negate()

commit 1e673db
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 18 16:39:52 2023 -0300

    Updated screenshot of the `webgpu_lights_ies_spotlight` (#26800)

commit 75b9699
Author: Tim Weißenfels <10491533+tim-we@users.noreply.github.com>
Date:   Mon Sep 18 20:01:06 2023 +0200

    Update documentation of Object3D#userData (#26799)

    * Update userData description in Object3D.html

    Updated the documentation to make clear what the default value is (otherwise one could assume it might be null or undefined).

    * Update Texture.html

    * Update Material.html

    * Update BufferGeometry.html

commit 0b0a7d7
Author: StrandedKitty <kittyhawk3011@gmail.com>
Date:   Mon Sep 18 19:45:10 2023 +0200

    Use cameraPosition uniform instead of world origin (#26766)

commit 217e20e
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Mon Sep 18 19:43:42 2023 +0200

    Updated builds.

commit 1454e7a
Author: ycw <ycw7788@gmail.com>
Date:   Tue Sep 19 01:42:56 2023 +0800

    ObjectLoader: Refector (de)serialization of Fog and FogExp2 (#26793)

    * marshal fog/fogexp2 .name

    * use object literal

commit 1a7b805
Author: ycw <ycw7788@gmail.com>
Date:   Tue Sep 19 01:41:38 2023 +0800

    re order (#26780)

commit f4488d8
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Mon Sep 18 19:41:00 2023 +0200

    LightProbeGenerator: Add support for half float render targets. (#26773)

commit e74c655
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Mon Sep 18 18:21:40 2023 +0100

    WebGPURenderer: Texture fixes for WebGL backend (#26797)

    * misc texture fixes

    handle VideoTexture.
    handle depth textures in GLSL shaders (depth in x component in returned
    vec4())
    map WGSL textureDimensions to GLSL textureSize()

    Examples fixed

    lights / ies /spotlights
    video / panorama
    material / video (partial)

    * remove surplus entry

    ---------

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit 18febaf
Author: sunag <sunagbrasil@gmail.com>
Date:   Mon Sep 18 07:13:40 2023 -0300

    WebGPURenderer, CubeCamera: Add `.activeMipmapLevel` (#26770)

    * CubeCamera: Add .activeMipmapLevel

    * Use CubeCamera

    * WebGPURenderer:  Add .activeMipmapLevel for set .setRenderTarget()

commit 16eaae5
Author: ycw <ycw7788@gmail.com>
Date:   Mon Sep 18 16:27:01 2023 +0800

    cleanup (#26791)

commit 633d804
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Mon Sep 18 10:22:45 2023 +0200

    Editor: Fix `CapsuleGeometry` parameter. (#26794)

commit fffeb0c
Author: ycw <ycw7788@gmail.com>
Date:   Mon Sep 18 15:32:50 2023 +0800

    fmt code block (#26792)

commit b6150e4
Author: WestLangley <WestLangley@users.noreply.github.com>
Date:   Mon Sep 18 01:56:38 2023 -0400

    Simplify equation (#26787)

commit 93c3589
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sun Sep 17 22:02:02 2023 +0000

    Update devDependencies (non-major) (#26783)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 4ed78c7
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sun Sep 17 20:10:40 2023 +0200

    Update github/codeql-action digest to 04daf01 (#26782)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

commit 2c8cfdf
Author: sunag <sunagbrasil@gmail.com>
Date:   Sun Sep 17 00:10:52 2023 -0300

    WebGPURenderer: StorageTexture (#26769)

    * Add StorageTexture

    * add `webgpu_compute_texture_pingpong` example

commit 80ba01c
Author: aardgoose <angus.sawyer@gmail.com>
Date:   Sun Sep 17 03:19:42 2023 +0100

    negate dpdy only (#26776)

    Co-authored-by: aardgoose <angus.sawyer@email.com>

commit 99d705f
Author: 林炳权 <695601626@qq.com>
Date:   Sun Sep 17 00:52:53 2023 +0800

    Sprite: Clean up. (#26774)

commit c6cfa6a
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 10:46:13 2023 +0200

    CubeCamera: Add comment to clarify mipmap generation. (#26772)

commit 51462bf
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:59:49 2023 +0200

    Updated builds.

commit b17a561
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:58:24 2023 +0200

    WebGLTextures: Increase default precision for depth buffers with WebGL 2. (#26764)

    * WebGLTextures: Increase default precision for depth buffers with WebGL 2.

    * Examples: Update screenshots.

    * Examples: Update screenshots.

    * Add webgl2_multisampled_renderbuffers to exception list.

commit 8193d58
Author: Mugen87 <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:54:34 2023 +0200

    Updated builds.

commit 5238fae
Author: Michael Herzog <michael.herzog@human-interactive.org>
Date:   Sat Sep 16 09:53:35 2023 +0200

    WebGLRenderer: Introduce USE_LIGHT_PROBES define. (#26768)

    * WebGLRenderer: Introduce USE_LIGHT_PROBES define.

    * Examples: Make use of USE_LIGHT_PROBES.

    * Add light probe define to vertex shader

    ---------

    Co-authored-by: WestLangley <WestLangley@users.noreply.github.com>

commit fbc28ae
Author: 林炳权 <695601626@qq.com>
Date:   Fri Sep 15 16:22:16 2023 +0800

    src: Clean up. (#26763)

commit 18ae441
Author: Casey Primozic <casey@cprimozic.net>
Date:   Fri Sep 15 00:55:35 2023 -0700

    Docs: Add some missing options to `MeshPhysicalMaterial` demo. (#26753)

    * Add some missing options to `MeshPhysicalMaterial` demo

     * Add GUI options for some missing properties including sheen, ior, iridescence, and others to the material browser embedded on the docs pages for materials

    * Use real default `sheenColor in material browser

    * Re-disable dirlights in `MeshPhysicalMaterial` material browser

    * Update docs to correct the default `sheenColor`

     * Docs stated it was 0xfffff, but it's actually 0x000000
     * Fixes #26757

    * Add back deleted comment

commit 30164c9
Author: ycw <ycw7788@gmail.com>
Date:   Fri Sep 15 09:58:20 2023 +0800

    Camera: Simplify `getWorldDirection()`. (#26743)

    * refactor getWorldDirection

    * revert object3d

* update screenshot

---------

Co-authored-by: aardgoose <angus.sawyer@email.com>
@Spiri0
Copy link
Contributor

Spiri0 commented Oct 5, 2023

Is writing here still correct to the topic? I don't want to create new issues unnecessarily. The pingpong mechanism works fine. I like the solution with the two compute initializations so that only the respective compute needs to be rendered. I have an idea for an extension of StorageTexture. I'm currently initializing this via an initialization compute.

import {wgslFn} from "../../../src/three-defs.js";

export const InitStorageTextureWGSL = wgslFn(`
   fn mainWGSL(
      writeTex: texture_storage_2d<rgba16float, write>,
      readTex: texture_2d<f32>,
      index: u32,
      size: f32
   ) -> void {
      var posX f32(index) % size;
      var posY f32(index) / size;
      var idx = vec2i(i32(posX), i32(posY));

      var tex textureLoad(readTex, idx, 0);
      textureStore(writeTex, idx, tex);
   }
`);
import {InitStorageTextureWGSL} from "../resources/shader/IFFT/initStorageTexture.js";

this.computeInitStorageTexture = InitStorageTextureWGSL({
   writeTex: textureStore(this.pingTexture),
   readTex: texture(this.hkt_Texture),
   index: instanceIndex,
   size: params.size
})

This is no effort but a method like ".setTexture(customTexture)" to initialize a storageTexture would be handy. A "setTexture()" method would be very practical for initializations in other classes to which textures are passed. But that's nothing urgent.

I have another topic that is really causing me problems and that would probably be something for a new issue. If I pass the iteration steps to a uniform in a for loop, they don't arrive correctly in the shader. I created a post about this in the forum:

https://discourse.threejs.org/t/has-anyone-noticed-any-unusual-behavior-in-the-uniform-node/56657

and made a CodePen example.

https://codepen.io/Spiri0/pen/QWzZVdZ?editors=0010

I really like the node system. I think you've created something great with it. I don't claim to fully understand it, but the behavior I'm seeing in my uniform is strange. The analog mechanism in webgl2 works as I expect.

@sunag
Copy link
Collaborator Author

sunag commented Oct 5, 2023

I don't think we have implement the entire uniform mechanism for WebGPU compute, so it could be a uniform bug in specific to WebGPURenderer.compute(), I'll be checking that.

@Spiri0
Copy link
Contributor

Spiri0 commented Oct 5, 2023

Seems like I can look forward to r158 then. There don't seem to be many people who are concerned with webgpu and the node system yet. But it's pretty elegant and saves code. It makes things easier. I tell myself that if interest in webgpu increases quickly, all of these points will already anticipate a lot.
I hope my codePen example is helpful and I'm curious to read what your analysis reveals. Mine surprised me and reassured me at the same time.
I can imagine my IFFT system as a module for three.js. This would then be easy to use for all possible frequency images so that users do not have to deal with the demanding IFFT mechanics themselves. I do this because I want a real ocean because for land I use real maps. But I could also easily create much more natural-looking artificial landscapes with my IFFT system than is possible with the usual noise functions.

@sunag
Copy link
Collaborator Author

sunag commented Oct 5, 2023

I think the concerned is because the system of nodes and TSL is something very new for many, it is not documented and WebGPURenderer and TSL is a WIP, comparisons usually between WebGLRenderer and WebGPURenderer are about the strengths of WebGLRenderer that have been polished over many years, we are closing several issues per month and I believe it is a matter of time before everything is resolved and we have the best of both worlds, and certainly projects like yours speed up development, makes us think about different needs and solutions and it does all the deep testing work which there was no time to do it.

@Spiri0
Copy link
Contributor

Spiri0 commented Oct 7, 2023

I think that might have been the last obstacle in my implementation. The pingpong routine in which I need the uniform for the current iteration step is the last step in the IFFT calculation. The progress in r156 and r157 was already clearly noticeable for me. I think this covers most of the cases that users will ever have to deal with when generating textures with compute shaders.

Not that I'm conjuring up the devil with my confidence, who will then confront me again with the next bug. But if that's the case, so be it.

@Spiri0
Copy link
Contributor

Spiri0 commented Oct 18, 2023

In the forum I see that other people are also interested in the node system and that makes me happy. Since there is still some time until r158, I thought I would take a look at what could possibly cause problems. Instead of THREE.HalfFloatType I tested THREE.FloatType and rgba32float in the shader. rgba16float is enough for me but I just wanted to see if rgba32float also works. That doesn't work and warnings appear in the console that remind me of #26576. But that's more of a luxury problem because with rgba16float I can do a lot of things and everything that I can currently imagine.
I'm really looking forward to r158.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants