// Rusting shader packs, version 1: the per-frame block every pack hook
// sees as `frame`. std140, 1168 bytes; fields are only ever added at the end.
// The engine shader that includes this picks the set and binding;
// shaders without one (particles) define RUSTING_NO_FRAME.
#if !defined(RUSTING_FRAME_GLSL) && !defined(RUSTING_NO_FRAME)
#define RUSTING_FRAME_GLSL
#ifndef RUSTING_FRAME_SET
#define RUSTING_FRAME_SET 0
#endif
#ifndef RUSTING_FRAME_BINDING
#define RUSTING_FRAME_BINDING 20
#endif
layout(std140, set = RUSTING_FRAME_SET, binding = RUSTING_FRAME_BINDING)
uniform RustingFrame {
mat4 view;
mat4 projection;
mat4 view_projection;
mat4 inverse_view;
mat4 inverse_projection;
mat4 previous_view;
mat4 previous_projection;
mat4 previous_view_projection;
// xyz camera position, w near plane.
vec4 camera_position;
// xyz last frame's camera position, w far plane.
vec4 previous_camera_position;
// xyz unit direction toward the sun, w sun illuminance (lux).
vec4 sun_direction;
// xyz unit direction toward the moon, w moon illuminance (lux).
vec4 moon_direction;
// rgb sun colour, w unused.
vec4 sun_color;
// seconds, world time, day fraction (0..1), moon phase.
vec4 time;
// width, height, 1 / width, 1 / height in pixels.
vec4 screen;
// rain, thunder, temperature, humidity.
vec4 weather;
// underwater (0 or 1), eye sky light, eye block light, frame index.
vec4 eye;
// Game-defined values (`ShaderWorld::params`), zero unless set.
vec4 params[32];
} frame;
#define RUSTING_FRAME_PARAMS 32
#endif