Hi,
I have created a couple of shaders that bend the world based on an objects distance from the camera. This means that everything in my game can be transformed in a straight line, but on screen it appears to be curving and bending.
One allows a color to be selected for the material, the other allows a texture. Every object in my game uses these shaders so that they are all ‘bent’ by the same amount.
I’ve download some fruit assets from the asset store and have changed their main material to use my shader. They now appear in the correct place on screen.
The fruits have animated faces. The face sprites use the Sprites-Default material which uses the Sprites/Default shader. The faces of the fruits are ‘unbent’ so appear to be detached from the fruits - See image.
I’ve attached a screenshot of the shader graph. It exposes two properties (HAmount, VAmount) that specify the level of bend in the horiztonal and vertical axes. I’ve also attached the shader as a Unity package.
I’d like to replace the Sprites/Default shader with a new variation of my own so that the sprites faces of the fruits bend in line with everything else, but am a bit lost as to where to start.
The project is URP based so any answers would need to be compatible.
If nothing else, hopefully the shader will be of use to someone else.
Thanks
8014439–1031636–WorldBenderShader.unitypackage (10.4 KB)