- Home /
Order of OnPostRender callbacks?
Is there a way to control the order of OnPostRender callbacks?
We are adding HUD elements using GL + Graphics, but there is also a color correction image effect on the camera which is applied after our scrip so it changes the colors of our HUD elements, which isn't what we want.
Is there any way to make sure the color correction runs before our script ?
Answer by amirabiri · Jun 17, 2012 at 10:21 PM
OK I've just realized that image effects actually use OnRenderImage and not OnPostRender. Turns out that Graphics.DrawTexture works just fine in OnRenderImage as well. The only thing is that you have to remember to Graphics.Blit() the result from source to destination:
public void OnRenderImage(RenderTexture source, RenderTexture destination)
{
Graphics.DrawTexture(...);
Graphics.Blit(source, destination);
}
It would appear that the order in which the components are added to the camera can be relied upon.
Your answer
![](https://koobas.hobune.stream/wayback/20220613072916im_/https://answers.unity.com/themes/thub/images/avi.jpg)