- Home /
OnRenderImage not getting called
I am trying to implement a simple Graphics.Blit setup to show an effect shader. Unfortunately, MonoBehaviour.OnRenderImage is not being called for some reason. The script is attached to the main camera.
I've been over the docs for these methods and searched on 'the google' and as far as I can tell I'm doing it correctly. Did something change in 2019.3 that isn't reflected in the docs?
Answer by fffMalzbier · May 22, 2020 at 02:28 PM
You are probably using URP or HDRP as your renderpipeline. in SRP (Scriptable render pipeline) OnRenderImage is no longer called.
In the URP there is a feature called "Render Features" witch allow you to do rendering calls inside different points in the renderpipeline.
In the hdrp there is something similar called Custom-Pass: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@9.0/manual/Custom-Pass.html
I am indeed using URP. Would be nice if there was something in the docs to say it doesn't call the function in URP.
Thanks for the link, should be able to figure it out from there.
Answer by bruceweir1 · Jun 18, 2021 at 06:01 AM
The following tutorial covers the new method of applying effects of this sort when using the Universal Render Pipeline: https://learn.unity.com/tutorial/custom-render-passes-with-urp
Note that there is a missing instruction in that tutorial (unless they have fixed it). Right at the end, go to Edit -> Project Settings -> Quality and make sure that the render pipeline asset that you create in the tutorial is selected.
Your answer
![](https://koobas.hobune.stream/wayback/20220612234954im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Where to Graphics.Blit()? 1 Answer
OpenGL ES 2.0 support breaks simple shader 0 Answers
EPIC GIANT TEXTURE - possible? 3 Answers
Using stencil buffer with OnRenderImage()/Blit 0 Answers
Save a texture after a pass in shader 0 Answers