diff options
author | pryazha <pryadeiniv@mail.ru> | 2025-01-23 19:39:54 +0500 |
---|---|---|
committer | pryazha <pryadeiniv@mail.ru> | 2025-01-23 19:39:54 +0500 |
commit | bf1c59565096ac9774493846cfb15e259d3b0e66 (patch) | |
tree | 82e8182af128580b6f38437feccba8c0f48abdc1 /geometry_shader/shaders/explosion.gs | |
parent | 1ee094199af9c169e1ccaa53c7b0c186c4a3639e (diff) |
restructure
Diffstat (limited to 'geometry_shader/shaders/explosion.gs')
-rw-r--r-- | geometry_shader/shaders/explosion.gs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/geometry_shader/shaders/explosion.gs b/geometry_shader/shaders/explosion.gs deleted file mode 100644 index 1883ad2..0000000 --- a/geometry_shader/shaders/explosion.gs +++ /dev/null @@ -1,44 +0,0 @@ -#version 330 core -layout(triangles) in; -layout(triangle_strip, max_vertices = 3) out; - -in VS_OUT { - vec2 gtex_coords; -} gs_in[]; - -out vec2 ftex_coords; - -uniform float time; - -vec3 -get_normal(void) -{ - vec3 a = vec3(gl_in[0].gl_Position)-vec3(gl_in[1].gl_Position); - vec3 b = vec3(gl_in[2].gl_Position)-vec3(gl_in[1].gl_Position); - return(normalize(cross(a, b))); -} - -vec4 -explode(vec4 position, vec3 normal) -{ - float magnitude = 0.2f; - vec3 direction = normal*magnitude*((sin(time)+1.0f)/2.0f); - vec4 result = position+vec4(direction, 0.0f); - return(result); -} - -void -main(void) -{ - vec3 normal = get_normal(); - gl_Position = explode(gl_in[0].gl_Position, normal); - ftex_coords = gs_in[0].gtex_coords; - EmitVertex(); - gl_Position = explode(gl_in[1].gl_Position, normal); - ftex_coords = gs_in[1].gtex_coords; - EmitVertex(); - gl_Position = explode(gl_in[2].gl_Position, normal); - ftex_coords = gs_in[2].gtex_coords; - EmitVertex(); - EndPrimitive(); -} |