Skip to content

WebGPU: changing texture uniforms requires a recompile of the material #34393

Description

@Mirei3D

Description

WebGPU renderer merges multiple texture uniform nodes into one uniform if they use the same texture at compile time. If one of these uniforms is updated at a later point, this requires a recompile of the material, so it seems rather slow.

There is an additional problem, that forcing a recompile is not trivial if the uniform values aren't exposed are properties on the material (see #34392).

Reproduction steps

  1. open the live example
  2. the sphere should become yellow after a second but stays red instead
  3. uncomment the // this.forceRecompile = 1; line
  4. now it should work as expected

Code

// code goes here

Live example

https://jsfiddle.net/6fochL70/

Screenshots

No response

Version

r185

Device

No response

Browser

No response

OS

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions