Attention: Here be dragons
This is thelatest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
XR full screen effects
When adding custom full screen effects to your XR application, one approach isusing a full screen quad and applying effects to that quad's shader.Add aMeshInstance3D nodeto your scene as a child of yourXRCamera3D,and set themesh property to aQuadMesh.Set the width and height of the quad to2.

You can then add a shader to your quad to make it cover the screen. This is done by setting thevertex shader'sPOSITION built-in tovec4(VERTEX.xy,1.0,1.0).However, when creating an effect that is centered straight ahead in the user's view(such as a vignette effect), the end result may look incorrect in XR.
Below shows captures of the right-eye view with a vignette shader, both from the headset and the render target itself.The left captures are an unmodified shader; the right captures adjust the full screen quad using the projection matrix.While the capture on the left is centered in the render target, it is off-center in the headset view.But, after applying the projection matrix, we see that the effect is centered in the headset itself.

Applying the projection matrix
To properly center the effect, thePOSITION of the full screen quadneeds to take the asymmetric field of view into account. To do this while also ensuring the quadhas full coverage of the entire render target, we can subdivide the quad and apply the projection matrixto the inner vertices. Let's increase the subdivide width and depth of the quad.

Then, in the vertex function of our shader, we apply an offset from the projection matrix tothe inner vertices. Here's an example of how you might do this with the above simple vignette shader:
shader_typespatial;render_modedepth_test_disabled,skip_vertex_transform,unshaded,cull_disabled;// Modify VERTEX.xy using the projection matrix to correctly center the effect.voidvertex(){vec2vert_pos=VERTEX.xy;if(length(vert_pos)<0.99){vec4offset=PROJECTION_MATRIX*vec4(0.0,0.0,1.0,1.0);vert_pos+=(offset.xy/offset.w);}POSITION=vec4(vert_pos,1.0,1.0);}voidfragment(){ALBEDO=vec3(0.0);ALPHA=dot(UV*2.0-1.0,UV*2.0-1.0)*2.0;}
Note
For more info on asymmetric FOV and its purpose, see thisMeta Asymmetric Field of View FAQ.
Limitations
This full screen effect method has no performance concerns for per-pixel effects such as the above vignette shader.However, it is not recommended to read from the screen texture when using this technique.Full screen effects that require reading from the screen texture effectively disable all rendering performance optimizations in XR.This is because, when reading from the screen texture, Godot makes a full copy of the render buffer;this drastically increases the workload for the GPU and can create performance concerns.