Is it possible to render a mesh (in this case just a circle), which already has a material with Domain set to Post Process, on top of other post processing effects like lens flares?
Hello Lumpiluk,
By on top of other post processing effects do you mean a ball that is uninfluenced by the post processing effect. All post processing calculations happen on the same pass. There are ways of assigning information, through Blueprints, to the material by adding the material as a blendable in a post processing volume.
If you would provide a little more information on why you need this particular circle to be drawn in front of a lens flare. I will then look into this issue further.
Hello, and thanks for the reply!
Our task is to package a perception experiment in a game. It would be nice if we were able to control exactly what color is rendered to the screen while keeping all these other nice dynamic effects.
Well, what you could do is a simple material instance. This would effectively allow you to assign parameters to a material. You could then set up an input, through blueprints, that would allow you to toggle the colors as you see fit.
This is our documentation on material instances that provide step by step instructions on how to set them up and how they can be used. I believe if you are trying to toggle or cycle materials then this will be a good place to start.
Let me know if this is a viable solution.
That’s what we already did (using dynamic material instances) and it works almost perfectly. Only when there’s a lens flare or bloom in front of the object its brightness seems to change. I included a screenshot to try to illustrate the problem.
(The relevant objects in this case are the two grey circles in the bottom left and bottom right of the space station. The one on the left is intentionally brighter than the one on the right.)
Ok, what you can do is set the material you want to not be influenced by the lens flare to a post processing material. This is done by opening your material and changing the Material Domain to Post Process. From there add this material as a blendable in a post process volume. From there set the influence to the blendable to 0. This is by default 1 and is located next to the blendable you have added in the volume.
Note: to see color you will need to add a value to the emissive color in your material.
I will add a few screenshots to show my process.
Material :
Post Process Volume Blendable :
Result :
Okay, thanks again for the quick reply!
I tried your advise but I don’t see any change. It’s especially noticeable when I set the material to black, but you can also see lens flares in front of the circle in your ppresult.jpg.
Hey, thank you for giving this a try. After pooling the knowledge of fellow members of my team we have concluded that this should be theoretically possible. This will involve the use of custom depth and some coding. I will be linking you a tutorial that covers the basics of how to pass a material into another depth buffer. Additionally you may have to do some coding to have this material look for effects like lens flares specifically. It is a fairly advanced process and is generally reserved for those with an advanced knowledge of rendering, custom depth, and post processing. I believe this tutorial will point you in the right direction if you still would like to eliminate the lens flares from rendering in front of your mesh.