"Sample color buffer" reads from previous frame instead of current


I want to read cameraOpaqueTexture because there are fullscreen effects that obscures the source color. I found that the above block samples RawColorHistory, which is from a previous frame and will interfere with my effect.

Is there any way I can read cameraOpaqueTexture ìn VFX Graph instead?

Hello,

The Main Camera color buffer relies on SRP integration:

  • In the case of HDRP, this is ColorBufferMipChain which is provided (color values just before the color pyramid)
  • In the case of URP, this is RawColorHistory which is provided (color value before post processing)

N.B.: You can look for VFXManager.SetCameraBuffer in SRP implementation for more details

For sure, in both cases, the VFX is sampling previously rendered effects with this color buffer.

There isn’t a built-in way to read opaque textures in VisualEffect.
However, if you need this data in the output context, you can use the Scene Color Node in ShaderGraph which returns the value of the current Camera Opaque Texture.

1 Like