This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shader_type spatial; | |
| uniform vec3 strength = vec3(0.0); | |
| uniform vec3 center = vec3(0.0, 0.0, 1.0); | |
| vec4 quat_mult(vec4 q1, vec4 q2) { | |
| vec4 qr; | |
| qr.x = (q1.w * q2.x) + (q1.x * q2.w) + (q1.y * q2.z) - (q1.z * q2.y); | |
| qr.y = (q1.w * q2.y) - (q1.x * q2.z) + (q1.y * q2.w) + (q1.z * q2.x); | |
| qr.z = (q1.w * q2.z) + (q1.x * q2.y) - (q1.y * q2.x) + (q1.z * q2.w); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shader_type canvas_item; | |
| uniform float STRENGTH = 0.0; | |
| uniform vec2 CENTER = vec2(0.5); | |
| void fragment() { | |
| vec2 uv = UV - CENTER; | |
| float angle = STRENGTH * uv.y; | |
| mat2 rot = mat2( | |
| vec2( cos(angle), -sin(angle) ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shader_type spatial; | |
| uniform float strength_x = 0.0; | |
| uniform float strength_y = 0.0; | |
| uniform float strength_z = 0.0; | |
| uniform vec3 center = vec3(0.0, 0.0, 1.0); | |
| void vertex() { | |
| vec3 v = VERTEX - center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends Sprite | |
| var displacement := 0.0 | |
| var velocity := 0.0 | |
| export (float) var spring_constant := 150.0 | |
| export (float) var damp_constant := 5.0 | |
| func _process(delta): | |
| var force = -spring_constant * displacement + damp_constant * velocity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shader_type canvas_item; | |
| uniform float ANGLE = 0.0; | |
| uniform vec2 CENTER = vec2(0.5); | |
| uniform float TILING = 3.0; | |
| void fragment() { | |
| vec2 uv = (UV - CENTER)*TILING; | |
| mat2 rot = mat2( |