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: Texture2D Array #27190

Merged
merged 6 commits into from
Nov 16, 2023
Merged

WebGPURenderer: Texture2D Array #27190

merged 6 commits into from
Nov 16, 2023

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Nov 15, 2023

Description

I made revisions and added support for Texture2D Array.

Example

https://raw.githack.com/mrdoob/three.js/dev/examples/webgpu_textures_2d-array.html

TSL Syntax:

const map = new THREE.DataArrayTexture( ... );
const mapLayer = 3;

...

material.colorNode = texture( map ).depth( mapLayer );

@sunag sunag added this to the r159 milestone Nov 15, 2023
@mrdoob
Copy link
Owner

mrdoob commented Nov 15, 2023

/cc @0b5vr

@sunag sunag marked this pull request as ready for review November 16, 2023 02:44
@sunag sunag merged commit a091faa into mrdoob:dev Nov 16, 2023
11 checks passed
@sunag sunag deleted the dev-texture2d-array branch November 16, 2023 18:14
@WestLangley
Copy link
Collaborator

@sunag Something is wrong with webgpu_cubemap_adjustments. The dark triangle that appears on the bottom of the sphere should not be so visible. In the following screenshot, the material is modified with metalness 0 and roughness 0.

Screenshot 2023-11-16 at 8 14 20 PM

Compare with webgl_materials_envmaps_hdr.html.

I can file a separate bug report if you feel it is warranted.

@sunag
Copy link
Collaborator Author

sunag commented Nov 17, 2023

@WestLangley The hue() function is causing this, I will update the code, thanks!

@WestLangley
Copy link
Collaborator

@sunag I tested your PR and it still does not look correct for some reason. Compare with webgl_materials_envmaps_hdr.html and replace the geometry with a sphere.

@sunag
Copy link
Collaborator Author

sunag commented Nov 17, 2023

If it's due to the difference below it's because of PMREM, unfortunately I haven't managed to implement the node-based solution yet.

WebGL WebGPU
image image

@WestLangley
Copy link
Collaborator

Yes, that is what I am seeing.

@mrdoob
Copy link
Owner

mrdoob commented Nov 17, 2023

Does this enable webgpu_morphtargets_face? (webgl_morphtargets_face)

@sunag
Copy link
Collaborator Author

sunag commented Nov 17, 2023

Does this enable webgpu_morphtargets_face?

I will implement it in a separate PR, I would like to use compute() but this would not work in WebGLBackend at this time.

@sunag sunag mentioned this pull request Nov 18, 2023
4 tasks
AdaRoseCannon pushed a commit to AdaRoseCannon/three.js that referenced this pull request Jan 15, 2024
* WebGPURenderer: Texture2D Array

* WebGLNodeBuilder: Fix function names

* WebGLBackend: Add Texture2D Array

* Rename: getSamplerLevelNode() -> getTextureLevelNode()

* Simplifies the name of IBL context functions

* cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants