2017-12-25 01:00:10 -05:00
|
|
|
uniform vec3 wind_direction;
|
|
|
|
|
|
|
|
layout(location = 0) in vec3 i_position;
|
|
|
|
|
|
|
|
#if defined(Converts_10bit_Vector)
|
2017-12-26 22:33:30 -05:00
|
|
|
layout(location = 1) in vec4 i_normal_orig;
|
2017-12-25 01:00:10 -05:00
|
|
|
#else
|
|
|
|
layout(location = 1) in vec4 i_normal;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
layout(location = 2) in vec4 i_color;
|
|
|
|
layout(location = 3) in vec2 i_uv;
|
|
|
|
layout(location = 8) in vec3 i_origin;
|
|
|
|
layout(location = 9) in vec4 i_rotation;
|
|
|
|
layout(location = 10) in vec4 i_scale;
|
2017-12-26 23:31:21 -05:00
|
|
|
layout(location = 12) in ivec2 i_misc_data;
|
2017-12-25 01:00:10 -05:00
|
|
|
|
|
|
|
#stk_include "utils/get_world_location.vert"
|
|
|
|
|
|
|
|
out vec3 normal;
|
|
|
|
out vec2 uv;
|
2018-02-02 08:17:24 -05:00
|
|
|
out float hue_change;
|
2017-12-25 01:00:10 -05:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
|
|
|
|
#if defined(Converts_10bit_Vector)
|
2017-12-26 22:33:30 -05:00
|
|
|
vec4 i_normal = convert10BitVector(i_normal_orig);
|
2017-12-25 01:00:10 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
vec3 test = sin(wind_direction * (i_position.y * 0.1));
|
|
|
|
test += cos(wind_direction) * 0.7;
|
|
|
|
|
|
|
|
vec4 world_position = getWorldPosition(i_origin + test * i_color.r,
|
2018-04-12 04:27:48 -04:00
|
|
|
i_rotation, i_scale.xyz, i_position);
|
|
|
|
vec3 world_normal = rotateVector(i_rotation, i_normal.xyz);
|
2017-12-25 01:00:10 -05:00
|
|
|
|
|
|
|
normal = (u_view_matrix * vec4(world_normal, 0.0)).xyz;
|
|
|
|
uv = i_uv;
|
2017-12-26 23:31:21 -05:00
|
|
|
hue_change = float(i_misc_data.y) * 0.01;
|
2017-12-25 01:00:10 -05:00
|
|
|
gl_Position = u_projection_view_matrix * world_position;
|
|
|
|
}
|