[SOLVED] Overexposed shader in gsplat viewer

When rendering a PLY file using the GSplat component with orbit camera controls in PlayCanvas v1.68.0, the model appears overexposed (washed out) in my custom script, while the official PlayCanva examples display it correctly.

What I’ve Tried:

  • Using official PlayCanvas shader URLs (glslang.js and twgsl.js)
  • Enabling gamma correction (app.scene.gammaCorrection = pc.GAMMA_SRGB)
  • Adjusting the camera’s exposure
  • Verifying component system/resource handler settings

Question:
Are there known discrepancies in shader initialization or GSplat settings between custom setups and the official examples that could cause overexposure?

if needed, you can find my script here :

Capture d’écran 2025-03-09 224833

@slimbuck

1 Like

Is there a reason you’ll on engine 1.68?

I found it in your codePen example from the readme

codepen : https://codepen.io/playcanvas/pen/NPbxMj
readme : engine/README.md at main · playcanvas/engine · GitHub

Is there a better engine that I should use ?

Oh that is interesting, thanks.

The latest engine version is v1.76.3, so we should definitely update that codepen!! cc @will @mvaligursky Though when I try 1.76.3 that doesn’t work…

I will try investigate the blending issue today. We had another user struggling with something similar and I suspect they are the same issue.

I will let you know, thanks!

Ok I just realised what the issue is.

To fix this just set the DOM background’s CSS color to black.

The white you’re seeing on splats is actually just CSS blending the background in the canvas semitransparent areas.

2 Likes

it worked !
thank you very much :smiley:

I tried to replace the engine 1.68 to 1.76.3 like this :
import * as pc from "https://cdn.skypack.dev/playcanvas@v1.76.3";
but it shows an error message because it cannot be built.

Yes I’m not sure what this bundler is cc @mvaligursky @will

Yeah, I think skypack isn’t a thing any more. I’ve update it to use esm.run instead:

(It should be referencing latest now, namely 2.5.1).

1 Like