- Home /
Is it possible to use a single function for OnRenderImage AND [ImageEffectOpaque]OnRenderImage?
I'm working on a chain of post processing effects where there is a lot of shared data and behaviour between each of the effects.
The design that makes the most sense for my project is to have a single MonoBehaviour for the user to interact with, however I don't know of a way to have something along the lines of:
class EffectsClass : MonoBehaviour {
//opaque pass
[ImageEffectOpaque]
void OnRenderImage(RenderTexture source, RenderTexture dest) {
// .....
}
//final pass
void OnRenderImage(RenderTexture source, RenderTexture dest) {
// .....
}
}
To get around this for the time being I have two additional components added to the GameObject: one which calls the Opaque pass, and one which calls the final pass.
If it's the only solution it'll have to do, but is there a better way? It feels dirty and unintuitive to new users.
Maybe there's some way of manipulating attributes, or some other C# trick that I'm not aware of?
Thanks!
Your answer
Follow this Question
Related Questions
How to render a RenderTexture into a specific mipLevel 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Why when changing the doors colors it's not changing anything ? 1 Answer
Texture2D.Resize and Shader 0 Answers