#How to create a shader that would have a texture offset support and blur support?
1 messages · Page 1 of 1 (latest)
I'm using URP. It's a 2D sprites project.
I'm working on creating a shifting sprite texture for background parallax effect and then blur it out.
The default URP Sprite Unlit and Lit shaders support blur but don't allow texture shift.
When I create a custom shader graph like this:
Now I can set the texture offset and have the parallax effect but the blur done with Global Volume Depth of Field override stops working.
How to have both?
I cloned Unity's 2D Sprite Unlit shader and added to it UV Shift support.
Very strange that Unity doesn't allow to do it out of the box.
How do you get a sprite to support blur
Assuming you mean DoF, that requires opaque geometry, which sprites shaders normally cannot be
I just cloned the Universal Render Pipeline / 2D / Sprite-Unlit-Default shader and edited it, this shader supports blur with DoF using the Volume component:
Technically it shouldn't support it any more than the sprite graphs do
All transparent geometry, sprites or otherwise will be blurred using the opaque depth value behind the material
So they will be blurred even if the shader doesn't support it, but they won't have real depth of field
What's the correct way to do this then?
Right now I only need a continuously scrolling background image at 0.7 meters per second and then blur it. The camera is static, it's a main menu background.