- Home /
Glow Outline effect
Hello. First thing I'd like to point out is that I am complete newbie in shader graphics and rendering pipeline. I was avoiding this subject for too long but recently wanted to implement the highlighting effect. I've scratched for some videos and guieds and came up with a solution, but it's not working the way I'd love it to be working:
Here's how it is done:
1. I draw gameobjects that I want to be highlighted with a solid color on a texture.
2. I blur the copy of that texture
3. I substract step 1 texture from step 2 texture and apply it on the main texture
Steps 1 and 2 are made via command buffer hooked on to BeforeImageEffects event.
Step 3 is made via Graphics.Blit in OnRenderImage()
I get 2 issues after everything is done:
1) Objects glow through obstacles
2) When 2 glowing objects with different colors overlap, I get some 3d colored glow as a result of substraction.
I thought of trying to split rendering of glowing objects into groups divided by colors to prevent color "mixing", but it still won't help me unless I'll be able to somehow hide the glow if it's behind the obstacle, but I am totally lost now in all the information about rendering pipeline, depth buffer clearings etc. I'd really appreciate any help so I could find out where to dig or maybe how to change the whole system in order to make it work.
Thank you in advance!
Your answer
Follow this Question
Related Questions
Controlling Bloom Effect using Post Proccesing Behaviour (Include/Excluding Objects) 0 Answers
Modifying the depth buffer of an image effect? 0 Answers
Funky Glowing Things 1 Answer
Glowing shader glows through walls 0 Answers
Depth texture on Android/IOS 0 Answers