const int max_samples = 128;
-uniform CameraTransform
+layout(set=0) uniform CameraTransform
{
mat4 eye_world_matrix;
mat4 world_eye_matrix;
mat4 eye_clip_matrix;
};
-uniform sampler2D source;
-uniform sampler2D depth;
-uniform sampler2D occlusion;
-uniform sampler2D rotate;
-uniform AmbientOcclusionParams
+layout(set=2) uniform sampler2D source;
+layout(set=2) uniform sampler2D depth;
+layout(set=2) uniform sampler2D occlusion;
+layout(set=2) uniform sampler2D rotate;
+layout(set=2) uniform AmbientOcclusionParams
{
float darkness;
vec3 sample_points[max_samples];
-uniform sampler2D source;
-uniform sampler2D blurred;
-uniform BloomParams
+layout(set=2) uniform sampler2D source;
+layout(set=2) uniform sampler2D blurred;
+layout(set=2) uniform BloomParams
{
float factors[19];
int size;
float strength;
};
-uniform BloomPerPassParams
+layout(set=2) uniform BloomPerPassParams
{
uniform vec2 delta;
};
import flat_effect;
-uniform ToneMapping
+layout(set=2) uniform ToneMapping
{
float exposure;
vec3 brightness_response;
};
-uniform sampler2D source;
-uniform sampler1D curve;
+layout(set=2) uniform sampler2D source;
+layout(set=2) uniform sampler1D curve;
#pragma MSP stage(fragment)
layout(location=0) out vec4 frag_color;
float roughness;
};
-uniform samplerCube environment_map;
+layout(set=0) uniform samplerCube environment_map;
vec2 hammersley(int i, int count)
{
vec3 ozone_absorb;
};
-uniform Atmosphere
+layout(set=2) uniform Atmosphere
{
AtmosphericEvents events;
float rayleigh_density_decay;
int n_steps;
};
-uniform View
+layout(set=2) uniform View
{
float view_height;
vec4 light_color;
const float mie_asymmetry = 0.8;
-uniform sampler2D transmittance_lookup;
+layout(set=2) uniform sampler2D transmittance_lookup;
vec3 rayleigh_density(vec3 base, float height)
{
import msp_interface;
import _sky;
-uniform sampler2D distant;
+layout(set=2) uniform sampler2D distant;
#pragma MSP stage(vertex)
void main()
import msp_interface;
import shadow;
-uniform EnvMap
+layout(set=0) uniform EnvMap
{
mat3 env_world_matrix;
};
-uniform sampler2D normal_map;
-uniform samplerCube environment_map;
-uniform samplerCube irradiance_map;
+layout(set=1) uniform sampler2D normal_map;
+layout(set=0) uniform samplerCube environment_map;
+layout(set=0) uniform samplerCube irradiance_map;
layout(constant_id=auto) const bool use_normal_map = false;
float roughness;
};
-uniform PbrMaterial
+layout(set=1) uniform PbrMaterial
{
PbrMaterialParameters pbr_material;
float alpha_cutoff;
};
-uniform sampler2D base_color_map;
-uniform sampler2D metalness_map;
-uniform sampler2D roughness_map;
-uniform sampler2D occlusion_map;
-uniform sampler2D emission_map;
-uniform sampler2D fresnel_lookup;
+layout(set=1) uniform sampler2D base_color_map;
+layout(set=1) uniform sampler2D metalness_map;
+layout(set=1) uniform sampler2D roughness_map;
+layout(set=1) uniform sampler2D occlusion_map;
+layout(set=1) uniform sampler2D emission_map;
+layout(set=1) uniform sampler2D fresnel_lookup;
layout(constant_id=auto) const bool use_base_color_map = false;
layout(constant_id=auto) const bool use_metalness_map = false;
mat4 world_obj_matrix;
mat3 world_obj_normal_matrix;
};
-uniform CameraTransform
+layout(set=0) uniform CameraTransform
{
mat4 eye_world_matrix;
mat4 world_eye_matrix;
};
const int max_lights = 6;
-uniform Lighting
+layout(set=0) uniform Lighting
{
LightSourceParameters light_sources[max_lights];
vec4 ambient_color;
import msp_interface;
-uniform AlphaCutoff
+layout(set=1) uniform AlphaCutoff
{
float alpha_cutoff;
};
-uniform sampler2D alpha_map;
+layout(set=1) uniform sampler2D alpha_map;
layout(constant_id=auto) const bool use_alpha_cutoff = false;
float reflectivity;
};
-uniform BasicMaterial
+layout(set=1) uniform BasicMaterial
{
BasicMaterialParameters basic_material;
float alpha_cutoff;
};
-uniform sampler2D diffuse_map;
-uniform sampler2D specular_map;
-uniform sampler2D shininess_map;
-uniform sampler2D emission_map;
-uniform sampler2D reflectivity_map;
+layout(set=1) uniform sampler2D diffuse_map;
+layout(set=1) uniform sampler2D specular_map;
+layout(set=1) uniform sampler2D shininess_map;
+layout(set=1) uniform sampler2D emission_map;
+layout(set=1) uniform sampler2D reflectivity_map;
layout(constant_id=auto) const bool use_diffuse_map = false;
layout(constant_id=auto) const bool use_specular = false;
vec2 bias;
};
-uniform ShadowMap
+layout(set=0) uniform ShadowMap
{
ShadowParameters shadows[max_lights];
mat4 shd_world_matrix[max_lights*4];
};
-uniform sampler2DShadow shadow_map;
+layout(set=0) uniform sampler2DShadow shadow_map;
layout(constant_id=auto) const bool use_shadow_map = false;
vec4 color;
};
-uniform UnlitMaterial
+layout(set=1) uniform UnlitMaterial
{
UnlitMaterialParameters unlit_material;
float alpha_cutoff;
};
-uniform sampler2D color_tex;
+layout(set=1) uniform sampler2D color_tex;
layout(constant_id=auto) const bool use_texture = false;
layout(constant_id=auto) const bool use_vertex_color = false;