I'm trying to create a particular kind of effect for the background of my SpriteKit game, and I've found some shaders on shadertoy that are close to what I want, but I'm struggling to adapt them to do exactly what I want..
There are a few shaders that simulate the sun with atmospheric scattering based on its xy position. here are some examples: https://www.shadertoy.com/view/MsVSWt https://www.shadertoy.com/view/MdtXD2
I want something similar to this effect but I want the glow to be symmetrical, so that when the 'sun' reaches close to bottom or top edge the glow effect is at a maximum, and when it is in the centre it is at a minimum. I've been playing with these shaders trying to get this effect but my understanding of webgl is clearly lacking as I'm struggling to achieve this.
What I've tried playing with is replacing variables such as sunPosition.y with abs(sunPosition.y) - my logic being that the y axis ranges from -1 to 1 so I should be able to get symmetry by making everything positive.. but this in fact has no effect.
If someone can nudge me in the right direction would be greatly appreciated as I'm now thoroughly confused by webgl!