- Home /
BLUR Shader with Alpha Channel
I am looking for making a Blur effect
Not as a general property of the Camera (I have Pro)
but on specific Plane Materials & Alpha textures.
I want to toggle these on and off with touch
and I'd rather not make tow materials for every component... Seems this could be accomplished with shaders. But every thread I have encountered on BLUR Shaders with Alpha Channels comes up dry
?
Any ideas?
Thanks
~be
Sure this can be accomplished with shaders by sampling neighbouring pixels from the texture and averaging them. Note that this won't blur the edges of the object though - for that you'll need an image effect.
Answer by robusto · Jun 08, 2014 at 04:03 PM
If you want just the plane material with alpha textures to just be blurred just blur the actual textures in gimp or inkscape and make new materials and assign them when you tap the screen.
If you want to blur them in shaders, that will require 2 cameras. The first camera will have the post process blur shader. You need to create a new layer and set the Culling Mask to this new layer which also means you have to tag the Plane Material to this layer. When you tap the screen you have to swap the Plane between layers in script. The second camera will render everything normally and set the Clear Flags on the 2nd camera to "Don't Clear".
Thanks Robusto!
I was hoping that there was a shader that applied to Textures rather than having to make 2 textures, Load & swap
Rarely will I need a blur to be Universal, something will always be in focus.
Perhaps this is what the Depth of Field could accomplish?
Think of it like Windows Vista where there are shallow planes of semi transparent material with words that I am blurring & focusing between...?
Ideas?
Thanks!
~be
There is a way, you have to render the texture to a RenderTexture and apply the blur shader on that, save the RenderTexture dynamically and set it as the texture in the material that you want to apply. You have to read up on RenderTexture and understand the blur shader.
Your answer