1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-09-19 11:56:01 +08:00
Files
Godot-Shader-Lib/addons/ShaderLib/Maths/Vector/ProjectOnPlane.gdshaderinc
2024-07-03 00:01:09 +05:30

3 lines
154 B
Plaintext

vec3 project_on_plane(vec3 vector, vec3 plane_normal) {
return vector - (plane_normal * (dot(vector, plane_normal) / dot(plane_normal, plane_normal)));
}