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: PMREM #27829

Merged
merged 19 commits into from
Feb 29, 2024
Merged

WebGPURenderer: PMREM #27829

merged 19 commits into from
Feb 29, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Feb 27, 2024

Description

PMREMGenerator for WebGPURenderer version, and pmremTexture( texture, uv, roughness ) TSL function.

webgpu_pmrem_scene

webgpu_pmrem_equirectangular

webgpu_pmrem_cubemap

Example

// simplified

const pmremBackground = pmremTexture( someTexture, normalWorld, pmremRoughness );

// or

const renderTarget = new PMREMGenerator( renderer ).fromEquirectangular( someTexture );
const pmremBackground = pmremTexture( renderTarget.texture, normalWorld, pmremRoughness );

//

scene.backgroundNode = pmremBackground;

@sunag sunag added this to the r162 milestone Feb 27, 2024
@mrdoob
Copy link
Owner

mrdoob commented Feb 28, 2024

/fyi @elalish

@elalish
Copy link
Contributor

elalish commented Feb 28, 2024

Very cool! Let me know if you run into any problems with it.

@sunag
Copy link
Collaborator Author

sunag commented Feb 28, 2024

Thanks @elalish , I imagine it was a lot of work create this code originally, I'm trying to follow it as close to the original as possible :)

@elalish
Copy link
Contributor

elalish commented Feb 28, 2024

Thanks @sunag! That was probably my single biggest contribution to PBR, and written with only a few months of JS background, so I apologize if it's a bit hard to follow.

@sunag sunag changed the title WebGPURenderer: PMREM (WIP) WebGPURenderer: PMREM Feb 29, 2024
@sunag sunag marked this pull request as ready for review February 29, 2024 08:12
@mrdoob
Copy link
Owner

mrdoob commented Feb 29, 2024

Lets move this to the next milestone.

@mrdoob mrdoob removed this from the r162 milestone Feb 29, 2024
@mrdoob mrdoob added this to the r163 milestone Feb 29, 2024
@sunag sunag merged commit 12b08b2 into mrdoob:dev Feb 29, 2024
11 checks passed
@RenaudRohlinger
Copy link
Collaborator

@sunag Pretty sure this PR broke webgpu_cubemap_adjustments, webgpu_cubemap_mix and webgpu_parallax_uv

@sunag
Copy link
Collaborator Author

sunag commented Mar 10, 2024

@RenaudRohlinger It's happening just in WebGLBackend for you too?

@RenaudRohlinger
Copy link
Collaborator

It's happening when the device is slow if I understand correctly. WebGPU backend being a lot faster seems to almost always avoid the issue but it does happen sometimes.

@RenaudRohlinger
Copy link
Collaborator

RenaudRohlinger commented Mar 20, 2024

The issue was related to unresolved texture in the loaders (slow internet). I updated the example and now handle better this kind of error in #27951

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.

4 participants