#How to create a shader that would have a texture offset support and blur support?

1 messages · Page 1 of 1 (latest)

coral mauve
#

**
**

#

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?

coral mauve
#

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.

spring frost
#

How do you get a sprite to support blur
Assuming you mean DoF, that requires opaque geometry, which sprites shaders normally cannot be

coral mauve
spring frost
#

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

coral mauve