Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
aggregate1166877 / GodotCleanFisheyeBarrelDistortion.shader
Last active Jan 8, 2021
Godot fisheye / barrel distortion shader with minimal pixelation
View GodotCleanFisheyeBarrelDistortion.shader
* This shader creates fisheye or barrel distortion by sliding values in the
* desired direction. It aims to have a minimal amount of pixelation, and was
* originally conceived of to procedurally generate cartoon planets and bodies
* from easily generatable flat textures.
* Thanks to user Dan (6145) on Stack Overflow for providing the math. I also
* stole some code from here for the texture placement:
* This shader differs from the above gist in that it does not stretch the