2022-07-26 00:47:31 -04:00
|
|
|
#include "utils/spm_layout.h"
|
2022-09-11 23:07:22 -04:00
|
|
|
#include "utils/get_vertex_color.h"
|
2022-08-25 21:36:30 -04:00
|
|
|
#include "../utils/get_world_location.vert"
|
2022-07-26 00:47:31 -04:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
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,
|
2022-08-25 21:36:30 -04:00
|
|
|
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-09-11 23:07:22 -04:00
|
|
|
f_vertex_color = v_color.zyxw * getVertexColor(
|
|
|
|
u_object_buffer.m_objects[gl_InstanceIndex].m_custom_vertex_color);
|
2022-09-01 21:07:43 -04:00
|
|
|
f_uv = v_uv + u_object_buffer.m_objects[gl_InstanceIndex].m_texture_trans;
|
2022-07-28 01:37:09 -04:00
|
|
|
f_uv_two = v_uv_two;
|
2022-07-26 00:47:31 -04:00
|
|
|
f_material_id = u_object_buffer.m_objects[gl_InstanceIndex].m_material_id;
|
2022-10-02 04:41:09 -04:00
|
|
|
#ifdef BIND_MESH_TEXTURES_AT_ONCE
|
|
|
|
if (f_material_id < 0)
|
|
|
|
f_material_id = u_material_ids.m_material_id[gl_DrawIDARB];
|
|
|
|
#endif
|
2022-09-10 23:05:33 -04:00
|
|
|
f_hue_change = u_object_buffer.m_objects[gl_InstanceIndex].m_hue_change;
|
2022-07-26 00:47:31 -04:00
|
|
|
}
|