use-shader-fx icon indicating copy to clipboard operation
use-shader-fx copied to clipboard

Color banding artifacts on `>= v1.1.37`

Open nhtoby311 opened this issue 1 year ago • 0 comments

From v1.1.37, I notice some color banding artifacts on my scene overlay FX, which is implemented similar to this https://github.com/FunTechInc/use-shader-fx/issues/50#issuecomment-1884499421

const offscreenScene = useMemo(() => new THREE.Scene(), []);
const { size, viewport, camera, gl } = useThree();

const [_, updateRenderTarget] = useSingleFBO({
  scene: offscreenScene,
  camera,
  size,
  dpr: viewport.dpr,
  samples: 8,
  depthBuffer: true,
});

const fxMaterial = useStore((state) => state.fxMaterial);

useFrame((props) => {
  if (morphing && fxMaterial) {
  fxMaterial.uniforms.u_texture.value = updateRenderTarget(gl);
}
});


return (
<>
	{createPortal(<mesh>{children}</mesh>, offscreenScene)}
</>

v1.1.36: image

v1.1.37: image

nhtoby311 avatar Aug 11 '24 08:08 nhtoby311