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: Prevent PMREM to break when missing textures #27951

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

RenaudRohlinger
Copy link
Collaborator

@RenaudRohlinger RenaudRohlinger commented Mar 20, 2024

Related issue: #27829

Description
Fix webgpu_cubemap_adjustments, webgpu_cubemap_dynamic, webgpu_cubemap_mix and webgpu_parallax_uv, introduce loadCubemapAsync and throw error if a texture from a CubeMap is not loaded yet while trying to be used by PMREMNode.

Basically the material was trying to use the envmap generated by RGBMLoader but some texture from the CubeMap were not resolved yet. It was returning some empty values in the array making it difficult to identify so I now initialize to undefined the images in RGBMLoader. Also added a check for basic envmap.

If a texture is missing we now throw an error like so:
image

/cc @sunag

This contribution is funded by Utsubo

@RenaudRohlinger RenaudRohlinger added this to the r163 milestone Mar 20, 2024
@RenaudRohlinger RenaudRohlinger merged commit bd2845f into mrdoob:dev Mar 20, 2024
11 checks passed
@@ -109,7 +109,7 @@

// renderer

renderer = new WebGPURenderer( { antialias: true } );
renderer = new WebGPURenderer( { antialias: true, forceWebGL: false } );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to remove this line but this basically does nothing (WebGPURenderer will still fallback to webgl if the webgpu context is not available) so I will include a patch in another PR later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in #27952

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.

1 participant