Render a camera twice with a render texture in between?

I want to make this sandwich:

  1. Render with a camera, normally.
  2. Store that result as a render texture.
  3. Render the same camera again, with a different cullingMask.
  4. Wait a frame and repeat.

How? OnPostRender would be the best place to initiate 2-3, but OnPostRender would be an infinite loop.

Well, you could just have a boolean that gets reset every frame… If that boolean is false, then render again and set it to true. If it’s true, then set it to false and do nothing. That way you just have to assign a boolean a couple times a frame instead of doing anything complicated.

Thanks, but code is necessary. Camera.Render(), for example, makes no sense to me.