I’m working on a tool that captures an image to a render texture for everything on a specific layer. The background must be transparent, which I set with clear flags using Color.clear. The render texture is then converted into a sprite and used in the game or saved out to a png. The issue I’m having is that I can’t seem to get post processing to apply to the result of the Camera.Render() call. I get all the opaques and transparents just fine. I’ve flipped every lever I can think of in the player settings, on the renderers, on the render texture, and on the camera. I tried ensuring the post processing was on the same layer. I’ve tried manually adding a Volume to the camera’s object and copying the settings from the existing global volume. I’ve tried creating a new Volume manually with the post processing I want. I want it to render out the full camera stack, as if it was doing a screenshot, but only a certain layer. So if there’s a bloom pass, it should get done, if there’s tone mapping applied, it should be applied, etc.
My post processing does work in my scene just fine for normal gameplay. Using the screenshot tools, the post processing is captured just fine.
Here’s some snippets of some important parts of the system, which may help.
public static bool CaptureToRenderTexture(Camera sourceCamera, Transform anchor, RenderTexture rTex) {
if (sourceCamera == null) return false;
// Clear any stale data
rTex.Clear();
// Configure camera
var glamourCam = new GameObject(
name: "GlamourCam",
components: new System.Type[1] { typeof(Camera) }
).GetComponent<Camera>();
glamourCam.CopyFrom(sourceCamera);
glamourCam.transform.SetPositionAndRotation(anchor.position, anchor.rotation);
glamourCam.tag = "GlamourCam";
glamourCam.cullingMask = 1 << LayerMask.NameToLayer("Glamour");
glamourCam.clearFlags = CameraClearFlags.SolidColor;
glamourCam.backgroundColor = Color.clear;
glamourCam.targetTexture = rTex;
// Work
glamourCam.Render();
// Cleanup & Return
GameObject.Destroy(glamourCam.gameObject);
return true;
}
public static Texture2D CaptureToTexture2D(Camera sourceCamera, (int width, int height) resolution, Transform anchor) {
RenderTexture rTex = new(resolution.width, resolution.height, 24);
rTex.Create();
if (!CaptureToRenderTexture(sourceCamera, anchor, rTex)) {
rTex.Release();
return null;
}
var tex = rTex.ConvertToTexture2D();
rTex.Release();
return tex;
}
public static void Clear(this RenderTexture rt) {
RenderTexture.active = rt;
GL.Clear(true, true, Color.clear);
RenderTexture.active = null;
}
public static Texture2D ConvertToTexture2D(this RenderTexture rTex) {
Texture2D tex = new(rTex.width, rTex.height, TextureFormat.RGBA32, false);
RenderTexture.active = rTex;
tex.ReadPixels(new Rect(0, 0, rTex.width, rTex.height), 0, 0);
tex.Apply();
RenderTexture.active = null;
return tex;
}
public static Sprite ConvertToSprite(this Texture2D tex) =>
Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
Here’s the global volume I’d like to use.
This is the camera that the settings are copied from.
Here’s the renderer used.
And here’s the pipeline asset. HDR is on.



