Skip to content

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Apr 22, 2025

@mvaligursky mvaligursky self-assigned this Apr 22, 2025
@mvaligursky mvaligursky requested a review from Copilot April 22, 2025 15:03
@mvaligursky mvaligursky added performance Relating to load times or frame rate area: graphics Graphics related issue labels Apr 22, 2025
@mvaligursky mvaligursky requested a review from a team April 22, 2025 15:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the morph target system to use texture arrays for storing morph targets and updates WGSL support accordingly. Key changes include the removal of legacy per-target texture declarations/evaluations, updating shader code (both GLSL and WGSL) to loop over texture arrays, and refactoring the Morph and MorphInstance classes to better handle texture array creation and blending.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/scene/shader-lib/chunks/internal/morph/frag/morphEvaluation.js Removed legacy morph evaluation code.
src/scene/shader-lib/chunks/internal/morph/frag/morphDeclaration.js Removed legacy morph declaration code.
src/scene/shader-lib/chunks/internal/morph/frag/morph.js Reworked shader to use a texture array and an explicit loop for morphing.
src/scene/shader-lib/chunks/chunks.js Removed references to legacy morph shader chunks.
src/scene/shader-lib/chunks-wgsl/internal/morph/frag/morph*.js Updated WGSL shaders to support texture arrays in morphing.
src/scene/shader-lib/chunks-wgsl/chunks-wgsl.js Removed references to deprecated WGSL morph includes.
src/scene/morph.js Refactored texture data creation, updated error handling, and memory cleanup.
src/scene/morph-target.js Updated destroy method and removed obsolete accessors.
src/scene/morph-instance.js Reworked shader creation and texture blending logic for morphing.
src/platform/graphics/webgpu/webgpu-shader-processor-wgsl.js Simplified texture resource parsing using updated mapping.
Comments suppressed due to low confidence (2)

src/scene/morph.js:191

  • The function changes its behavior by returning undefined instead of false on error. Review and update the return type and error-handling flow to maintain consistency with callers.
if (morphTextureHeight > maxTextureSize) { Debug.warnOnce(`Morph target data is too large ...`); return; }

src/scene/morph-instance.js:217

  • It appears that the constant 'BlendState' is used without an explicit import. Ensure that 'BlendState' is imported to avoid runtime errors.
device.setBlendState(BlendState.NOBLEND);

@mvaligursky mvaligursky merged commit 9181fdc into main Apr 22, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-texture-array-morphing branch April 22, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue performance Relating to load times or frame rate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use TextureArray to store MorphTargets

3 participants