2022-07-28 22:51:14 -04:00
|
|
|
#include "utils/spm_layout.h"
|
2022-08-25 21:36:30 -04:00
|
|
|
#include "../utils/get_world_location.vert"
|
2022-07-28 22:51:14 -04:00
|
|
|
|
|
|
|
layout(push_constant) uniform Constants
|
|
|
|
{
|
|
|
|
vec3 m_wind_direction;
|
|
|
|
} u_push_constants;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec3 offset = sin(u_push_constants.m_wind_direction * (v_position.y * 0.1));
|
|
|
|
offset += vec3(cos(u_push_constants.m_wind_direction) * 0.7);
|
|
|
|
|
2022-08-25 21:36:30 -04:00
|
|
|
vec4 v_world_position = getWorldPosition(
|
2022-09-10 23:05:33 -04:00
|
|
|
u_object_buffer.m_objects[gl_InstanceIndex].m_translation + offset *
|
2022-08-25 21:36:30 -04:00
|
|
|
v_color.r,
|
|
|
|
u_object_buffer.m_objects[gl_InstanceIndex].m_rotation,
|
2022-09-11 23:07:22 -04:00
|
|
|
u_object_buffer.m_objects[gl_InstanceIndex].m_scale, v_position);
|
2022-08-25 21:36:30 -04:00
|
|
|
gl_Position = u_camera.m_projection_view_matrix * v_world_position;
|
2022-07-28 22:51:14 -04:00
|
|
|
f_vertex_color = vec4(1.0);
|
|
|
|
f_uv = v_uv;
|
|
|
|
f_uv_two = v_uv_two;
|
|
|
|
f_material_id = u_object_buffer.m_objects[gl_InstanceIndex].m_material_id;
|
2022-09-10 23:05:33 -04:00
|
|
|
f_hue_change = u_object_buffer.m_objects[gl_InstanceIndex].m_hue_change;
|
2022-07-28 22:51:14 -04:00
|
|
|
}
|