Highlight breaks when using WebGPU with snapshot rendering

I am not sure if that is a question or straight up a bug report but here is my problem.

  • Context:
    I have a static complex scene that really needed optimizing so I figured I am going to use WebGPU which is stronger than WebGL and implementing the SnapshotRendering I managed to quadruple my FPS. Adapting all my features to it while following the documentation wasn’t too hard until i got to the HighlightLayer.
  • The Problem:
    Within the documentation there is a solution for effect layers that is showcased with the glow layer, but adapting it to the highlight layer didn’t work.
    • The highlight layer simply doesnt have a color, no matter what it’s always black.
    • It doesn’t update when the camera is moving when its not added to the update function (Expected)
    • If added to the update function all meshes within it become fully black and are no longer visibly highlighted
  • Demo:
    The demo is an edited version of the documentation demo with the glow layer just commented out. You can also try to comment / uncomment some parts to see the different unexpected behaviours that I am talking about.

With all that said is there an existing way to Highlight a mesh in WebGPU while making use of SnapshotRendering without changing its entire material color and making it glow?

Welcome aboard!

This PR will fix the problem and will let you use the highlight layer in fast snapshot mode:

3 Likes

Not sure that you’ve found solution on highlight color already or not but you’re using the Yellow function from Color3 wrong on line 14

Here the pg. I just add ‘()’ after BABYLON.Color3.Yellow on line 14 from your pg
https://playground.babylonjs.com/?webgpu#LRFB2D#950

2 Likes