stk-code_catmod/data/shaders/ge_shaders/spm.vert

23 lines
974 B
GLSL
Raw Normal View History

2022-07-26 00:47:31 -04:00
#include "utils/spm_layout.h"
#include "utils/get_vertex_color.h"
#include "../utils/get_world_location.vert"
2022-07-26 00:47:31 -04:00
void main()
{
vec4 v_world_position = getWorldPosition(
2022-09-10 23:05:33 -04:00
u_object_buffer.m_objects[gl_InstanceIndex].m_translation,
u_object_buffer.m_objects[gl_InstanceIndex].m_rotation,
u_object_buffer.m_objects[gl_InstanceIndex].m_scale, v_position);
gl_Position = u_camera.m_projection_view_matrix * v_world_position;
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;
#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
}