small per improvements

This commit is contained in:
Tuomas Katajisto 2025-10-25 12:36:46 +03:00
parent b77b5d2995
commit 429a869932
11 changed files with 1868 additions and 1792 deletions

View File

@ -170,6 +170,10 @@ backend_draw_trile_positions_main :: (trile : string, amount : s32, worldConf: *
fs_params : Trile_Fs_Params;
fs_params.mvp_shadow = shadow_mvp.floats;
fs_params.is_reflection = ifx in_reflection_pass then cast(s32)1 else cast(s32)0;
w, h := get_render_size();
fs_params.screen_w = w;
fs_params.screen_h = h;
sg_apply_bindings(*bindings);
sg_apply_uniforms(UB_trile_fs_params, *(sg_range.{ ptr = *fs_params, size = size_of(type_of(fs_params)) }));
sg_apply_uniforms(UB_trile_vs_params, *(sg_range.{ ptr = *vs_params, size = size_of(type_of(vs_params))}));
@ -301,7 +305,7 @@ backend_process_command_buckets :: () {
sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_ssao_attachments }));
sg_apply_pipeline(gPipelines.op.pipeline);
op_uniform : Op_Fs_Params;
op_uniform.blur_size = 1;
op_uniform.blur_size = current_post_process.ssao_size;
op_uniform.op = 0;
gPipelines.op.bind.images[0] = g_postprocess_a;
sg_apply_uniforms(UB_op_fs_params, *(sg_range.{ ptr = *op_uniform, size = size_of(type_of(op_uniform)) }));

View File

@ -481,14 +481,14 @@ create_plane_pipeline_reflection_images :: () {
w, h := get_render_size();
img_desc := sg_image_desc.{
width = w,
height = h,
width = w/2,
height = h/2,
pixel_format = .RGBA32F,
render_target = true,
};
depth_desc := sg_image_desc.{
width = w,
height = h,
width = w/2,
height = h/2,
pixel_format = .DEPTH,
render_target = true,
};
@ -565,8 +565,8 @@ create_plane_pipeline :: () {
gPipelines.plane.bind.samplers[0] = sg_make_sampler(*(sg_sampler_desc.{
wrap_u = .CLAMP_TO_EDGE,
wrap_v = .CLAMP_TO_EDGE,
min_filter = .NEAREST,
mag_filter = .NEAREST,
min_filter = .LINEAR,
mag_filter = .LINEAR,
}));
g_shadowmap_sampler = sg_make_sampler(*(sg_sampler_desc.{
@ -825,23 +825,25 @@ create_ssao_images :: () {
if g_postprocess_b_depth.id != INVALID_ID then sg_destroy_image(g_postprocess_b_depth);
w,h := get_render_size();
img_desc := sg_image_desc.{
width = w,
height = h,
width = w/2,
height = h/2,
render_target = true,
pixel_format = .RGBA32F
};
img_desc.sample_count = 1;
g_ssaobuf = sg_make_image(*img_desc);
img_desc.width *= 2; img_desc.height *= 2;
g_postprocess_a = sg_make_image(*img_desc);
g_postprocess_b = sg_make_image(*img_desc);
img_desc = sg_image_desc.{
width = w,
height = h,
width = w/2,
height = h/2,
pixel_format = .DEPTH,
render_target = true,
};
img_desc.sample_count = 1;
g_ssaobuf_depth = sg_make_image(*img_desc);
img_desc.width *= 2; img_desc.height *= 2;
g_postprocess_a_depth = sg_make_image(*img_desc);
g_postprocess_b_depth = sg_make_image(*img_desc);

View File

@ -5,6 +5,7 @@ Post_Process :: struct {
gamma : float = 1.0; @Slider,0.3,3.0,0.1;
tonemap : float = 1.0; @Slider,0,1,1;
ssao : float = 1.0; @Slider,0,5,0.1;
ssao_size : s32 = 1; @Slider,0,5,1;
dilate_separation : float = 1.0; @Slider,0,6,0.1;
dilate_size : s32 = 2; @Slider,0,10,1;
dilate_min : float = 0.1; @Slider,0,1,0.1;

View File

@ -261,7 +261,7 @@ vs_plane_source_glsl430 := u8.[
vec3 param_1 = normalize(pos.xyz);
vec3 param_2 = _146.sunPosition;
float _421 = smoothstep(750.0, 1000.0, length(pos.xz));
frag_color = vec4(mix((mix(((_146.waterColor * (dot(_274, _290) + ((9.9999999747524270787835121154785e-07 * float(_309.is_reflection)) * _278.shininess))) * _146.sunLightColor) * _146.sunIntensity, texture(reftex_refsmp, _367).xyz, vec3(min(1.0, _335 * 3.0))) + ((_146.sunLightColor * _146.sunIntensity) * pow(max(0.0, dot(normalize(_290 + _285), _274)), 32.0))) * 1.0, sky(param_1, param_2) * _146.skyIntensity, vec3(_421)), mix(mix(0.300000011920928955078125, 0.5, _335), 1.0, _421));
frag_color = vec4(mix((mix(((_146.waterColor * (dot(_274, _290) + ((9.9999999747524270787835121154785e-07 * float(_309.is_reflection)) * _278.shininess))) * _146.sunLightColor) * _146.sunIntensity, texture(reftex_refsmp, _367).xyz, vec3(min(1.0, _335 * 1.5))) + ((_146.sunLightColor * _146.sunIntensity) * pow(max(0.0, dot(normalize(_290 + _285), _274)), 32.0))) * 1.0, sky(param_1, param_2) * _146.skyIntensity, vec3(_421)), mix(mix(0.300000011920928955078125, 0.5, _335), 1.0, _421));
}
else
{
@ -488,7 +488,7 @@ fs_plane_source_glsl430 := u8.[
0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x72,0x65,0x66,0x74,0x65,0x78,
0x5f,0x72,0x65,0x66,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x36,0x37,0x29,0x2e,0x78,
0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,
0x2c,0x20,0x5f,0x33,0x33,0x35,0x20,0x2a,0x20,0x33,0x2e,0x30,0x29,0x29,0x29,0x20,
0x2c,0x20,0x5f,0x33,0x33,0x35,0x20,0x2a,0x20,0x31,0x2e,0x35,0x29,0x29,0x29,0x20,
0x2b,0x20,0x28,0x28,0x5f,0x31,0x34,0x36,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,
0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x31,0x34,0x36,0x2e,0x73,0x75,
0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20,0x70,0x6f,
@ -686,7 +686,7 @@ vs_plane_source_glsl300es := u8.[
highp vec3 param_1 = normalize(pos.xyz);
highp vec3 param_2 = _146.sunPosition;
highp float _421 = smoothstep(750.0, 1000.0, length(pos.xz));
frag_color = vec4(mix((mix(((_146.waterColor * (dot(_274, _290) + ((9.9999999747524270787835121154785e-07 * float(_309.is_reflection)) * _278.shininess))) * _146.sunLightColor) * _146.sunIntensity, texture(reftex_refsmp, _367).xyz, vec3(min(1.0, _335 * 3.0))) + ((_146.sunLightColor * _146.sunIntensity) * pow(max(0.0, dot(normalize(_290 + _285), _274)), 32.0))) * 1.0, sky(param_1, param_2) * _146.skyIntensity, vec3(_421)), mix(mix(0.300000011920928955078125, 0.5, _335), 1.0, _421));
frag_color = vec4(mix((mix(((_146.waterColor * (dot(_274, _290) + ((9.9999999747524270787835121154785e-07 * float(_309.is_reflection)) * _278.shininess))) * _146.sunLightColor) * _146.sunIntensity, texture(reftex_refsmp, _367).xyz, vec3(min(1.0, _335 * 1.5))) + ((_146.sunLightColor * _146.sunIntensity) * pow(max(0.0, dot(normalize(_290 + _285), _274)), 32.0))) * 1.0, sky(param_1, param_2) * _146.skyIntensity, vec3(_421)), mix(mix(0.300000011920928955078125, 0.5, _335), 1.0, _421));
}
else
{
@ -930,7 +930,7 @@ fs_plane_source_glsl300es := u8.[
0x78,0x74,0x75,0x72,0x65,0x28,0x72,0x65,0x66,0x74,0x65,0x78,0x5f,0x72,0x65,0x66,
0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x36,0x37,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,
0x76,0x65,0x63,0x33,0x28,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x33,
0x33,0x35,0x20,0x2a,0x20,0x33,0x2e,0x30,0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,
0x33,0x35,0x20,0x2a,0x20,0x31,0x2e,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,
0x5f,0x31,0x34,0x36,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,
0x6f,0x72,0x20,0x2a,0x20,0x5f,0x31,0x34,0x36,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,
0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x6d,0x61,
@ -1175,7 +1175,7 @@ vs_plane_source_metal_macos := u8.[
float3 param_1 = fast::normalize(in.pos.xyz);
float3 param_2 = float3(_146.sunPosition);
float _421 = smoothstep(750.0, 1000.0, length(in.pos.xz));
out.frag_color = float4(mix((mix(((_146.waterColor * (dot(_274, _290) + ((9.9999999747524270787835121154785e-07 * float(_309.is_reflection)) * _278.shininess))) * _146.sunLightColor) * _146.sunIntensity, reftex.sample(refsmp, _367).xyz, float3(fast::min(1.0, _335 * 3.0))) + ((_146.sunLightColor * _146.sunIntensity) * powr(fast::max(0.0, dot(fast::normalize(_290 + _285), _274)), 32.0))) * 1.0, sky(param_1, param_2, _146) * _146.skyIntensity, float3(_421)), mix(mix(0.300000011920928955078125, 0.5, _335), 1.0, _421));
out.frag_color = float4(mix((mix(((_146.waterColor * (dot(_274, _290) + ((9.9999999747524270787835121154785e-07 * float(_309.is_reflection)) * _278.shininess))) * _146.sunLightColor) * _146.sunIntensity, reftex.sample(refsmp, _367).xyz, float3(fast::min(1.0, _335 * 1.5))) + ((_146.sunLightColor * _146.sunIntensity) * powr(fast::max(0.0, dot(fast::normalize(_290 + _285), _274)), 32.0))) * 1.0, sky(param_1, param_2, _146) * _146.skyIntensity, float3(_421)), mix(mix(0.300000011920928955078125, 0.5, _335), 1.0, _421));
}
else
{
@ -1456,7 +1456,7 @@ fs_plane_source_metal_macos := u8.[
0x65,0x66,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x72,0x65,0x66,
0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x36,0x37,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,
0x28,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x33,0x33,0x35,0x20,0x2a,0x20,0x33,0x2e,0x30,
0x28,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x33,0x33,0x35,0x20,0x2a,0x20,0x31,0x2e,0x35,
0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x31,0x34,0x36,0x2e,0x73,0x75,0x6e,
0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x31,0x34,
0x36,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,

View File

@ -165,15 +165,15 @@ vs_sky_source_glsl430 := u8.[
vec3 final = mix(_178.skyBase, _178.skyTop, vec3(clamp(skypos.y * 2.0, 0.0, 0.699999988079071044921875))) + ((_178.sunHalo * clamp((_196 - 0.9700000286102294921875) * 10.0, 0.0, 0.800000011920928955078125)) * 1.0);
if (_196 > 0.999499976634979248046875)
{
final = _178.sunDisk * 10.0;
final = _178.sunDisk * 3.0;
}
float _240 = _199.y;
final += (mix(_178.horizonHalo, vec3(0.0), vec3(clamp(abs(_240) * 80.0, 0.0, 1.0))) * 0.100000001490116119384765625);
float _241 = _199.y;
final += (mix(_178.horizonHalo, vec3(0.0), vec3(clamp(abs(_241) * 80.0, 0.0, 1.0))) * 0.100000001490116119384765625);
if (_178.hasClouds == 1)
{
vec3 param = ((_199 / vec3(_240)) * 2.0) + vec3(_178.time * 0.0500000007450580596923828125);
float _276 = fbm(param);
final = mix(final, vec3(1.0), vec3((max(0.0, _240) * (smoothstep(0.5, 1.0, _276) * 0.300000011920928955078125)) * 2.0));
vec3 param = ((_199 / vec3(_241)) * 2.0) + vec3(_178.time * 0.0500000007450580596923828125);
float _277 = fbm(param);
final = mix(final, vec3(1.0), vec3((max(0.0, _241) * (smoothstep(0.5, 1.0, _277) * 0.300000011920928955078125)) * 2.0));
}
return final;
}
@ -386,47 +386,47 @@ fs_sky_source_glsl430 := u8.[
0x32,0x34,0x38,0x30,0x34,0x36,0x38,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x3d,
0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,0x75,0x6e,0x44,0x69,0x73,0x6b,0x20,0x2a,0x20,
0x31,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x5f,0x31,0x39,
0x39,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x2b,
0x3d,0x20,0x28,0x6d,0x69,0x78,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x6f,0x72,0x69,
0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,
0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,
0x62,0x73,0x28,0x5f,0x32,0x34,0x30,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,
0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,
0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,
0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x61,0x73,0x43,
0x6c,0x6f,0x75,0x64,0x73,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x39,0x39,0x20,0x2f,0x20,
0x76,0x65,0x63,0x33,0x28,0x5f,0x32,0x34,0x30,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,
0x30,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x37,0x38,0x2e,0x74,
0x69,0x6d,0x65,0x20,0x2a,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,
0x30,0x37,0x34,0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,
0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x36,0x20,0x3d,0x20,0x66,0x62,0x6d,0x28,
0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x66,0x69,0x6e,0x61,0x6c,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x66,0x69,0x6e,0x61,
0x6c,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,
0x63,0x33,0x28,0x28,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x34,
0x30,0x29,0x20,0x2a,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,
0x28,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x37,0x36,0x29,
0x20,0x2a,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,
0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x20,
0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x69,0x6e,0x61,0x6c,0x3b,
0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,
0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x70,0x6f,0x73,
0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,
0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,
0x34,0x28,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,0x6b,0x79,
0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,
0x0a,0x7d,0x0a,0x0a,0x00,
0x33,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x31,0x20,0x3d,0x20,0x5f,0x31,0x39,0x39,
0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x2b,0x3d,
0x20,0x28,0x6d,0x69,0x78,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x6f,0x72,0x69,0x7a,
0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,
0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x62,
0x73,0x28,0x5f,0x32,0x34,0x31,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20,
0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,
0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,
0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x61,0x73,0x43,0x6c,
0x6f,0x75,0x64,0x73,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,
0x72,0x61,0x6d,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x39,0x39,0x20,0x2f,0x20,0x76,
0x65,0x63,0x33,0x28,0x5f,0x32,0x34,0x31,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,
0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x37,0x38,0x2e,0x74,0x69,
0x6d,0x65,0x20,0x2a,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
0x37,0x34,0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,
0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x37,0x20,0x3d,0x20,0x66,0x62,0x6d,0x28,0x70,
0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,
0x69,0x6e,0x61,0x6c,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x66,0x69,0x6e,0x61,0x6c,
0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,
0x33,0x28,0x28,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x34,0x31,
0x29,0x20,0x2a,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,
0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x37,0x37,0x29,0x20,
0x2a,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,
0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x20,0x2a,
0x20,0x32,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x69,0x6e,0x61,0x6c,0x3b,0x0a,
0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,
0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x70,0x6f,0x73,0x2e,
0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,0x75,
0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,
0x28,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,0x6b,0x79,0x49,
0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x00,
];
/*
#version 300 es
@ -541,15 +541,15 @@ vs_sky_source_glsl300es := u8.[
highp vec3 final = mix(_178.skyBase, _178.skyTop, vec3(clamp(skypos.y * 2.0, 0.0, 0.699999988079071044921875))) + ((_178.sunHalo * clamp((_196 - 0.9700000286102294921875) * 10.0, 0.0, 0.800000011920928955078125)) * 1.0);
if (_196 > 0.999499976634979248046875)
{
final = _178.sunDisk * 10.0;
final = _178.sunDisk * 3.0;
}
highp float _240 = _199.y;
final += (mix(_178.horizonHalo, vec3(0.0), vec3(clamp(abs(_240) * 80.0, 0.0, 1.0))) * 0.100000001490116119384765625);
highp float _241 = _199.y;
final += (mix(_178.horizonHalo, vec3(0.0), vec3(clamp(abs(_241) * 80.0, 0.0, 1.0))) * 0.100000001490116119384765625);
if (_178.hasClouds == 1)
{
highp vec3 param = ((_199 / vec3(_240)) * 2.0) + vec3(_178.time * 0.0500000007450580596923828125);
highp float _276 = fbm(param);
final = mix(final, vec3(1.0), vec3((max(0.0, _240) * (smoothstep(0.5, 1.0, _276) * 0.300000011920928955078125)) * 2.0));
highp vec3 param = ((_199 / vec3(_241)) * 2.0) + vec3(_178.time * 0.0500000007450580596923828125);
highp float _277 = fbm(param);
final = mix(final, vec3(1.0), vec3((max(0.0, _241) * (smoothstep(0.5, 1.0, _277) * 0.300000011920928955078125)) * 2.0));
}
return final;
}
@ -781,49 +781,49 @@ fs_sky_source_glsl300es := u8.[
0x36,0x33,0x34,0x39,0x37,0x39,0x32,0x34,0x38,0x30,0x34,0x36,0x38,0x37,0x35,0x29,
0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,
0x69,0x6e,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,0x75,0x6e,0x44,
0x69,0x73,0x6b,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x79,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,
0x69,0x78,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,
0x61,0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,
0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x62,0x73,0x28,0x5f,
0x32,0x34,0x30,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,
0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,
0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,
0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,
0x66,0x20,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x61,0x73,0x43,0x6c,0x6f,0x75,0x64,
0x73,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x39,0x39,0x20,
0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x32,0x34,0x30,0x29,0x29,0x20,0x2a,0x20,
0x32,0x2e,0x30,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x37,0x38,
0x2e,0x74,0x69,0x6d,0x65,0x20,0x2a,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,
0x30,0x30,0x30,0x37,0x34,0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,
0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,
0x36,0x20,0x3d,0x20,0x66,0x62,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x3d,0x20,
0x6d,0x69,0x78,0x28,0x66,0x69,0x6e,0x61,0x6c,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,
0x31,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x6d,0x61,0x78,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x34,0x30,0x29,0x20,0x2a,0x20,0x28,0x73,0x6d,
0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,
0x30,0x2c,0x20,0x5f,0x32,0x37,0x36,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x30,0x30,
0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,
0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,
0x6e,0x20,0x66,0x69,0x6e,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,
0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,
0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x70,0x6f,0x73,0x2e,0x78,
0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,
0x37,0x38,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x38,
0x2e,0x73,0x6b,0x79,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x31,
0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x69,0x73,0x6b,0x20,0x2a,0x20,0x33,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x32,0x34,0x31,0x20,0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x79,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x69,
0x78,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,0x61,
0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,
0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x32,
0x34,0x31,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,
0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,
0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,
0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,
0x20,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x61,0x73,0x43,0x6c,0x6f,0x75,0x64,0x73,
0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,
0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x39,0x39,0x20,0x2f,
0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x32,0x34,0x31,0x29,0x29,0x20,0x2a,0x20,0x32,
0x2e,0x30,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x37,0x38,0x2e,
0x74,0x69,0x6d,0x65,0x20,0x2a,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,
0x30,0x30,0x37,0x34,0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,
0x32,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x37,
0x20,0x3d,0x20,0x66,0x62,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x3d,0x20,0x6d,
0x69,0x78,0x28,0x66,0x69,0x6e,0x61,0x6c,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,
0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x6d,0x61,0x78,0x28,0x30,
0x2e,0x30,0x2c,0x20,0x5f,0x32,0x34,0x31,0x29,0x20,0x2a,0x20,0x28,0x73,0x6d,0x6f,
0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,
0x2c,0x20,0x5f,0x32,0x37,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,
0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,
0x38,0x31,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x20,0x66,0x69,0x6e,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,
0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,
0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x70,0x6f,0x73,0x2e,0x78,0x79,
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,0x37,
0x38,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,
0x76,0x65,0x63,0x34,0x28,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x38,0x2e,
0x73,0x6b,0x79,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x31,0x2e,
0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
/*
#include <metal_stdlib>
@ -982,15 +982,15 @@ vs_sky_source_metal_macos := u8.[
float3 final = mix(_178.skyBase, _178.skyTop, float3(fast::clamp(skypos.y * 2.0, 0.0, 0.699999988079071044921875))) + ((_178.sunHalo * fast::clamp((_196 - 0.9700000286102294921875) * 10.0, 0.0, 0.800000011920928955078125)) * 1.0);
if (_196 > 0.999499976634979248046875)
{
final = _178.sunDisk * 10.0;
final = _178.sunDisk * 3.0;
}
float _240 = _199.y;
final += (mix(_178.horizonHalo, float3(0.0), float3(fast::clamp(abs(_240) * 80.0, 0.0, 1.0))) * 0.100000001490116119384765625);
float _241 = _199.y;
final += (mix(_178.horizonHalo, float3(0.0), float3(fast::clamp(abs(_241) * 80.0, 0.0, 1.0))) * 0.100000001490116119384765625);
if (_178.hasClouds == 1)
{
float3 param = ((_199 / float3(_240)) * 2.0) + float3(_178.time * 0.0500000007450580596923828125);
float _276 = fbm(param);
final = mix(final, float3(1.0), float3((fast::max(0.0, _240) * (smoothstep(0.5, 1.0, _276) * 0.300000011920928955078125)) * 2.0));
float3 param = ((_199 / float3(_241)) * 2.0) + float3(_178.time * 0.0500000007450580596923828125);
float _277 = fbm(param);
final = mix(final, float3(1.0), float3((fast::max(0.0, _241) * (smoothstep(0.5, 1.0, _277) * 0.300000011920928955078125)) * 2.0));
}
return final;
}
@ -1237,59 +1237,59 @@ fs_sky_source_metal_macos := u8.[
0x39,0x39,0x37,0x36,0x36,0x33,0x34,0x39,0x37,0x39,0x32,0x34,0x38,0x30,0x34,0x36,
0x38,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x31,0x37,0x38,0x2e,
0x73,0x75,0x6e,0x44,0x69,0x73,0x6b,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
0x5f,0x32,0x34,0x30,0x20,0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x79,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x69,0x78,
0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,0x61,0x6c,
0x6f,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,
0x6d,0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x32,0x34,0x30,0x29,0x20,0x2a,0x20,0x38,
0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,
0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,
0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x38,0x2e,
0x68,0x61,0x73,0x43,0x6c,0x6f,0x75,0x64,0x73,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x28,0x28,0x5f,
0x31,0x39,0x39,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x34,
0x30,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x5f,0x31,0x37,0x38,0x2e,0x74,0x69,0x6d,0x65,0x20,0x2a,0x20,
0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x34,0x35,0x30,0x35,
0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x32,0x37,0x36,0x20,0x3d,0x20,0x66,0x62,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,
0x3d,0x20,0x6d,0x69,0x78,0x28,0x66,0x69,0x6e,0x61,0x6c,0x2c,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x2c,
0x20,0x5f,0x32,0x34,0x30,0x29,0x20,0x2a,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,
0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x5f,
0x32,0x37,0x36,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,
0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,
0x35,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x69,
0x6e,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,
0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,
0x61,0x6e,0x74,0x20,0x73,0x6b,0x79,0x5f,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,
0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x31,0x37,0x38,0x20,0x5b,0x5b,0x62,0x75,0x66,
0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,
0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,
0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x2e,0x78,0x79,
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,
0x5f,0x31,0x37,0x38,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x73,
0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x2c,0x20,0x5f,0x31,0x37,0x38,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x38,0x2e,
0x73,0x6b,0x79,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x31,0x2e,
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,
0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x73,0x75,0x6e,0x44,0x69,0x73,0x6b,0x20,0x2a,0x20,0x33,0x2e,0x30,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x32,0x34,0x31,0x20,0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x79,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x2b,0x3d,0x20,0x28,0x6d,0x69,0x78,0x28,
0x5f,0x31,0x37,0x38,0x2e,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f,
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,
0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x32,0x34,0x31,0x29,0x20,0x2a,0x20,0x38,0x30,
0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,
0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,
0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x38,0x2e,0x68,
0x61,0x73,0x43,0x6c,0x6f,0x75,0x64,0x73,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,
0x39,0x39,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x34,0x31,
0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x28,0x5f,0x31,0x37,0x38,0x2e,0x74,0x69,0x6d,0x65,0x20,0x2a,0x20,0x30,
0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x34,0x35,0x30,0x35,0x38,
0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,
0x37,0x37,0x20,0x3d,0x20,0x66,0x62,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x69,0x6e,0x61,0x6c,0x20,0x3d,
0x20,0x6d,0x69,0x78,0x28,0x66,0x69,0x6e,0x61,0x6c,0x2c,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,
0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,
0x5f,0x32,0x34,0x31,0x29,0x20,0x2a,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,
0x74,0x65,0x70,0x28,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x32,
0x37,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,
0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,
0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x69,0x6e,
0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,
0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,
0x6e,0x74,0x20,0x73,0x6b,0x79,0x5f,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,
0x66,0x69,0x67,0x26,0x20,0x5f,0x31,0x37,0x38,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,
0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,
0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,
0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,
0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,
0x61,0x6c,0x69,0x7a,0x65,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x2e,0x78,0x79,0x7a,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,
0x31,0x37,0x38,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x73,0x6b,
0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x2c,0x20,0x5f,0x31,0x37,0x38,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x38,0x2e,0x73,
0x6b,0x79,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x31,0x2e,0x30,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,
0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
sky_shader_desc :: (backend: sg_backend) -> sg_shader_desc {
desc: sg_shader_desc;

View File

@ -83,7 +83,7 @@ vs_ssao_source_glsl430 := u8.[
/*
#version 430
vec4 _220;
vec4 _222;
uniform vec4 ssao_fs_params[69];
layout(binding = 16) uniform sampler2D g_position_ssao_smp;
@ -106,30 +106,35 @@ vs_ssao_source_glsl430 := u8.[
vec3 _121 = _26 + ((_85 * ssao_fs_params[i * 1 + 4].xyz) * 0.5);
vec4 _133 = mat4(ssao_fs_params[0], ssao_fs_params[1], ssao_fs_params[2], ssao_fs_params[3]) * vec4(_121, 1.0);
vec3 _140 = _133.xyz / vec3(_133.w);
vec4 _204;
_204.x = _140.x;
_204.y = _140.y;
vec3 _154 = (_204.xyz * 0.5) + vec3(0.5);
vec4 _210;
_210.x = _154.x;
_210.y = _154.y;
vec4 _167 = texture(g_position_ssao_smp, _210.xy);
if (length(_167.xyz) > 0.00999999977648258209228515625)
vec4 _206;
_206.x = _140.x;
_206.y = _140.y;
vec3 _154 = (_206.xyz * 0.5) + vec3(0.5);
vec4 _212;
_212.x = _154.x;
_212.y = _154.y;
float occluded = 0.0;
if ((_121.z + 0.00999999977648258209228515625) <= texture(g_position_ssao_smp, _212.xy).z)
{
occlusion += float(_167.z >= _121.z);
occluded = 1.0;
}
else
{
occluded = 0.0;
}
occlusion += occluded;
}
float _185 = occlusion;
float _188 = 1.0 - (_185 * 0.015625);
occlusion = _188;
float _196 = pow(_188, ssao_fs_params[68].x);
out_color = vec4(_196, _196, _196, 1.0);
float _187 = occlusion;
float _190 = 1.0 - (_187 * 0.015625);
occlusion = _190;
float _198 = pow(_190, ssao_fs_params[68].x);
out_color = vec4(_198, _198, _198, 1.0);
}
*/
fs_ssao_source_glsl430 := u8.[
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x76,0x65,
0x63,0x34,0x20,0x5f,0x32,0x32,0x30,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,
0x63,0x34,0x20,0x5f,0x32,0x32,0x32,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,
0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x73,0x61,0x6f,0x5f,0x66,0x73,0x5f,0x70,
0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x39,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x31,0x36,0x29,0x20,
@ -188,42 +193,47 @@ fs_ssao_source_glsl430 := u8.[
0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x34,0x30,0x20,0x3d,0x20,0x5f,
0x31,0x33,0x33,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,
0x31,0x33,0x33,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x30,
0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x34,
0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x30,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x5f,0x32,0x30,0x36,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x30,
0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x36,
0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,0x34,0x30,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x35,0x34,0x20,0x3d,
0x20,0x28,0x5f,0x32,0x30,0x34,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x30,0x2e,0x35,
0x20,0x28,0x5f,0x32,0x30,0x36,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x30,0x2e,0x35,
0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x31,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x30,0x2e,0x78,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x31,0x32,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x32,0x2e,0x78,
0x20,0x3d,0x20,0x5f,0x31,0x35,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x5f,0x32,0x31,0x30,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,0x35,0x34,
0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,
0x20,0x5f,0x31,0x36,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,
0x67,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x73,0x73,0x61,0x6f,0x5f,
0x73,0x6d,0x70,0x2c,0x20,0x5f,0x32,0x31,0x30,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,
0x68,0x28,0x5f,0x31,0x36,0x37,0x2e,0x78,0x79,0x7a,0x29,0x20,0x3e,0x20,0x30,0x2e,
0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,
0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x2b,
0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x31,0x36,0x37,0x2e,0x7a,0x20,0x3e,
0x3d,0x20,0x5f,0x31,0x32,0x31,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x35,0x20,0x3d,0x20,0x6f,0x63,0x63,0x6c,
0x75,0x73,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x31,0x38,0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x5f,
0x31,0x38,0x35,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x3d,
0x20,0x5f,0x31,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x31,0x39,0x36,0x20,0x3d,0x20,0x70,0x6f,0x77,0x28,0x5f,0x31,0x38,0x38,
0x2c,0x20,0x73,0x73,0x61,0x6f,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x5b,0x36,0x38,0x5d,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,
0x39,0x36,0x2c,0x20,0x5f,0x31,0x39,0x36,0x2c,0x20,0x5f,0x31,0x39,0x36,0x2c,0x20,
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x20,0x20,0x20,0x5f,0x32,0x31,0x32,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,0x35,0x34,
0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x20,0x3d,0x20,0x30,0x2e,0x30,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x5f,
0x31,0x32,0x31,0x2e,0x7a,0x20,0x2b,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,
0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,
0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x20,0x3c,0x3d,0x20,0x74,0x65,0x78,0x74,
0x75,0x72,0x65,0x28,0x67,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x73,
0x73,0x61,0x6f,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x32,0x31,0x32,0x2e,0x78,0x79,
0x29,0x2e,0x7a,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,
0x64,0x65,0x64,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,
0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,
0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,
0x69,0x6f,0x6e,0x20,0x2b,0x3d,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x31,0x38,0x37,0x20,0x3d,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,
0x30,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x5f,0x31,0x38,0x37,0x20,
0x2a,0x20,0x30,0x2e,0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,
0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,
0x38,0x20,0x3d,0x20,0x70,0x6f,0x77,0x28,0x5f,0x31,0x39,0x30,0x2c,0x20,0x73,0x73,
0x61,0x6f,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x38,0x5d,
0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,
0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x39,0x38,0x2c,0x20,
0x5f,0x31,0x39,0x38,0x2c,0x20,0x5f,0x31,0x39,0x38,0x2c,0x20,0x31,0x2e,0x30,0x29,
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
/*
#version 300 es
@ -258,7 +268,7 @@ vs_ssao_source_glsl300es := u8.[
precision mediump float;
precision highp int;
vec4 _220;
vec4 _222;
uniform highp vec4 ssao_fs_params[69];
uniform highp sampler2D g_position_ssao_smp;
@ -281,24 +291,29 @@ vs_ssao_source_glsl300es := u8.[
highp vec3 _121 = _26 + ((_85 * ssao_fs_params[i * 1 + 4].xyz) * 0.5);
highp vec4 _133 = mat4(ssao_fs_params[0], ssao_fs_params[1], ssao_fs_params[2], ssao_fs_params[3]) * vec4(_121, 1.0);
highp vec3 _140 = _133.xyz / vec3(_133.w);
highp vec4 _204;
_204.x = _140.x;
_204.y = _140.y;
highp vec3 _154 = (_204.xyz * 0.5) + vec3(0.5);
highp vec4 _210;
_210.x = _154.x;
_210.y = _154.y;
highp vec4 _167 = texture(g_position_ssao_smp, _210.xy);
if (length(_167.xyz) > 0.00999999977648258209228515625)
highp vec4 _206;
_206.x = _140.x;
_206.y = _140.y;
highp vec3 _154 = (_206.xyz * 0.5) + vec3(0.5);
highp vec4 _212;
_212.x = _154.x;
_212.y = _154.y;
highp float occluded = 0.0;
if ((_121.z + 0.00999999977648258209228515625) <= texture(g_position_ssao_smp, _212.xy).z)
{
occlusion += float(_167.z >= _121.z);
occluded = 1.0;
}
else
{
occluded = 0.0;
}
occlusion += occluded;
}
highp float _185 = occlusion;
highp float _188 = 1.0 - (_185 * 0.015625);
occlusion = _188;
highp float _196 = pow(_188, ssao_fs_params[68].x);
out_color = vec4(_196, _196, _196, 1.0);
highp float _187 = occlusion;
highp float _190 = 1.0 - (_187 * 0.015625);
occlusion = _190;
highp float _198 = pow(_190, ssao_fs_params[68].x);
out_color = vec4(_198, _198, _198, 1.0);
}
*/
@ -307,7 +322,7 @@ fs_ssao_source_glsl300es := u8.[
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x76,
0x65,0x63,0x34,0x20,0x5f,0x32,0x32,0x30,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,
0x65,0x63,0x34,0x20,0x5f,0x32,0x32,0x32,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,
0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x73,
0x61,0x6f,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x39,0x5d,
0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
@ -367,44 +382,49 @@ fs_ssao_source_glsl300es := u8.[
0x31,0x34,0x30,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x2e,0x78,0x79,0x7a,0x20,0x2f,
0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x33,0x33,0x2e,0x77,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x34,0x20,0x5f,0x32,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x5f,0x32,0x30,0x34,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x30,0x2e,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x34,0x2e,0x79,0x20,
0x34,0x20,0x5f,0x32,0x30,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x5f,0x32,0x30,0x36,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x30,0x2e,0x78,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x36,0x2e,0x79,0x20,
0x3d,0x20,0x5f,0x31,0x34,0x30,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x35,
0x34,0x20,0x3d,0x20,0x28,0x5f,0x32,0x30,0x34,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,
0x34,0x20,0x3d,0x20,0x28,0x5f,0x32,0x30,0x36,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,
0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x5f,0x32,0x31,0x30,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x35,0x34,
0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x30,
0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x5f,0x32,0x31,0x32,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x35,0x34,
0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x32,
0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,0x35,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,
0x5f,0x31,0x36,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x67,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x73,0x73,0x61,0x6f,0x5f,0x73,
0x6d,0x70,0x2c,0x20,0x5f,0x32,0x31,0x30,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,
0x28,0x5f,0x31,0x36,0x37,0x2e,0x78,0x79,0x7a,0x29,0x20,0x3e,0x20,0x30,0x2e,0x30,
0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,
0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x2b,0x3d,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x31,0x36,0x37,0x2e,0x7a,0x20,0x3e,0x3d,
0x20,0x5f,0x31,0x32,0x31,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,
0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x35,0x20,0x3d,
0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x38,
0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x5f,0x31,0x38,0x35,0x20,0x2a,
0x20,0x30,0x2e,0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x38,0x38,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x20,0x5f,0x31,0x39,0x36,0x20,0x3d,0x20,0x70,0x6f,0x77,0x28,0x5f,0x31,0x38,
0x38,0x2c,0x20,0x73,0x73,0x61,0x6f,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x73,0x5b,0x36,0x38,0x5d,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,
0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,
0x31,0x39,0x36,0x2c,0x20,0x5f,0x31,0x39,0x36,0x2c,0x20,0x5f,0x31,0x39,0x36,0x2c,
0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x5f,0x31,
0x32,0x31,0x2e,0x7a,0x20,0x2b,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,
0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,
0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x20,0x3c,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x28,0x67,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x73,0x73,
0x61,0x6f,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x32,0x31,0x32,0x2e,0x78,0x79,0x29,
0x2e,0x7a,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,
0x65,0x64,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x20,
0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,
0x6f,0x6e,0x20,0x2b,0x3d,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x37,0x20,0x3d,0x20,0x6f,0x63,0x63,
0x6c,0x75,0x73,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,0x30,0x20,0x3d,0x20,0x31,
0x2e,0x30,0x20,0x2d,0x20,0x28,0x5f,0x31,0x38,0x37,0x20,0x2a,0x20,0x30,0x2e,0x30,
0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,
0x75,0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x30,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,
0x39,0x38,0x20,0x3d,0x20,0x70,0x6f,0x77,0x28,0x5f,0x31,0x39,0x30,0x2c,0x20,0x73,
0x73,0x61,0x6f,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x38,
0x5d,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,
0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x39,0x38,0x2c,
0x20,0x5f,0x31,0x39,0x38,0x2c,0x20,0x5f,0x31,0x39,0x38,0x2c,0x20,0x31,0x2e,0x30,
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
/*
#include <metal_stdlib>
@ -476,7 +496,7 @@ vs_ssao_source_metal_macos := u8.[
float ssao_power;
};
constant float4 _227 = {};
constant float4 _229 = {};
struct main0_out
{
@ -502,24 +522,29 @@ vs_ssao_source_metal_macos := u8.[
float3 _121 = _26 + ((_85 * _109.samples[i].xyz) * 0.5);
float4 _133 = _109.projection * float4(_121, 1.0);
float3 _140 = _133.xyz / float3(_133.w);
float4 _208;
_208.x = _140.x;
_208.y = _140.y;
float3 _154 = (_208.xyz * 0.5) + float3(0.5);
float4 _214;
_214.x = _154.x;
_214.y = 1.0 - _154.y;
float4 _171 = g_position.sample(ssao_smp, _214.xy);
if (length(_171.xyz) > 0.00999999977648258209228515625)
float4 _210;
_210.x = _140.x;
_210.y = _140.y;
float3 _154 = (_210.xyz * 0.5) + float3(0.5);
float4 _216;
_216.x = _154.x;
_216.y = 1.0 - _154.y;
float occluded = 0.0;
if ((_121.z + 0.00999999977648258209228515625) <= g_position.sample(ssao_smp, _216.xy).z)
{
occlusion += float(_171.z >= _121.z);
occluded = 1.0;
}
else
{
occluded = 0.0;
}
occlusion += occluded;
}
float _189 = occlusion;
float _192 = 1.0 - (_189 * 0.015625);
occlusion = _192;
float _200 = powr(_192, _109.ssao_power);
out.out_color = float4(_200, _200, _200, 1.0);
float _191 = occlusion;
float _194 = 1.0 - (_191 * 0.015625);
occlusion = _194;
float _202 = powr(_194, _109.ssao_power);
out.out_color = float4(_202, _202, _202, 1.0);
return out;
}
@ -536,7 +561,7 @@ fs_ssao_source_metal_macos := u8.[
0x61,0x74,0x34,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x73,0x5b,0x36,0x34,0x5d,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x73,0x61,0x6f,0x5f,
0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x63,0x6f,0x6e,0x73,0x74,
0x61,0x6e,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x32,0x37,0x20,
0x61,0x6e,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x32,0x39,0x20,
0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,
0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,
@ -601,44 +626,48 @@ fs_ssao_source_metal_macos := u8.[
0x30,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x33,0x33,0x2e,0x77,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,
0x30,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x38,
0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x30,
0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x30,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x38,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,
0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x30,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,
0x34,0x30,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x35,0x34,0x20,0x3d,0x20,0x28,0x5f,0x32,0x30,
0x38,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,
0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x35,0x34,0x20,0x3d,0x20,0x28,0x5f,0x32,0x31,
0x30,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x31,0x34,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x34,0x2e,0x78,0x20,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x31,0x36,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x31,0x36,0x2e,0x78,0x20,
0x3d,0x20,0x5f,0x31,0x35,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x5f,0x32,0x31,0x34,0x2e,0x79,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,
0x20,0x20,0x5f,0x32,0x31,0x36,0x2e,0x79,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,
0x20,0x5f,0x31,0x35,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x37,0x31,0x20,0x3d,0x20,0x67,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x28,0x73,0x73,0x61,0x6f,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x32,0x31,0x34,0x2e,
0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x31,0x37,0x31,0x2e,0x78,0x79,0x7a,
0x29,0x20,0x3e,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,
0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,
0x36,0x32,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,
0x73,0x69,0x6f,0x6e,0x20,0x2b,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x31,
0x37,0x31,0x2e,0x7a,0x20,0x3e,0x3d,0x20,0x5f,0x31,0x32,0x31,0x2e,0x7a,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x39,0x20,
0x3d,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,0x32,0x20,0x3d,0x20,0x31,0x2e,
0x30,0x20,0x2d,0x20,0x28,0x5f,0x31,0x38,0x39,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,
0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,
0x73,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x32,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x70,0x6f,
0x77,0x72,0x28,0x5f,0x31,0x39,0x32,0x2c,0x20,0x5f,0x31,0x30,0x39,0x2e,0x73,0x73,
0x61,0x6f,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
0x75,0x74,0x2e,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x32,0x30,0x30,0x2c,0x20,0x5f,0x32,0x30,0x30,
0x2c,0x20,0x5f,0x32,0x30,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
0x0a,0x00,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6f,0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x20,
0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,
0x66,0x20,0x28,0x28,0x5f,0x31,0x32,0x31,0x2e,0x7a,0x20,0x2b,0x20,0x30,0x2e,0x30,
0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,
0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x20,0x3c,0x3d,
0x20,0x67,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x73,0x61,0x6d,0x70,
0x6c,0x65,0x28,0x73,0x73,0x61,0x6f,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x32,0x31,
0x36,0x2e,0x78,0x79,0x29,0x2e,0x7a,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,
0x63,0x63,0x6c,0x75,0x64,0x65,0x64,0x20,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,
0x75,0x64,0x65,0x64,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x63,
0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x2b,0x3d,0x20,0x6f,0x63,0x63,0x6c,0x75,
0x64,0x65,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,0x31,0x20,0x3d,0x20,0x6f,0x63,0x63,0x6c,
0x75,0x73,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x31,0x39,0x34,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x5f,
0x31,0x39,0x31,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x6f,0x63,0x63,0x6c,0x75,0x73,0x69,0x6f,0x6e,0x20,0x3d,
0x20,0x5f,0x31,0x39,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x20,0x5f,0x32,0x30,0x32,0x20,0x3d,0x20,0x70,0x6f,0x77,0x72,0x28,0x5f,0x31,0x39,
0x34,0x2c,0x20,0x5f,0x31,0x30,0x39,0x2e,0x73,0x73,0x61,0x6f,0x5f,0x70,0x6f,0x77,
0x65,0x72,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6f,0x75,0x74,
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,
0x5f,0x32,0x30,0x32,0x2c,0x20,0x5f,0x32,0x30,0x32,0x2c,0x20,0x5f,0x32,0x30,0x32,
0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,
0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
ssao_shader_desc :: (backend: sg_backend) -> sg_shader_desc {
desc: sg_shader_desc;

File diff suppressed because it is too large Load Diff

View File

@ -141,7 +141,7 @@ void main() {
screen_uv.y = 1.0 - screen_uv.y;
vec3 reflected_color = texture(sampler2D(reftex, refsmp), screen_uv).rgb;
vec3 surface_color = mix(refracted_color, reflected_color, min(1.0, fresnel * 3));
vec3 surface_color = mix(refracted_color, reflected_color, min(1.0, fresnel * 1.5));
vec3 final_color = (surface_color + specular_highlight) * shadow_factor;
float refraction_alpha = 0.3;
float reflection_alpha = 0.5;

View File

@ -92,7 +92,7 @@ vec3 sky(vec3 skypos, vec3 sunpos) {
// Sun disk
if(sDist > 0.9995) {
final = sunDisk.xyz * 10.0;
final = sunDisk.xyz * 3.0;
}
// Horizon halo

View File

@ -51,10 +51,15 @@ void main() {
offset.y = 1.0 - offset.y;
#endif
float bias = 0.01;
vec3 psample = texture(sampler2D(g_position, ssao_smp), offset.xy).xyz;
if (length(psample) > 0.01) {
occlusion += (psample.z >= sample_pos.z ? 1.0 : 0.0);
}
float occluded = 0.0;
if(sample_pos.z + bias <= psample.z) { occluded = 1; } else { occluded = 0; }
// float intensity = smoothstep(0.0, 1.0, 0.5 / abs(frag_pos.z - offset.z));
// occluded *= intensity;
occlusion += occluded;
}
occlusion = 1.0 - (occlusion / 64.0);
out_color = vec4(vec3(pow(occlusion, ssao_power)), 1.0);

View File

@ -59,6 +59,8 @@ out vec4 frag_color;
layout(binding=3) uniform trile_fs_params {
mat4 mvp_shadow;
int is_reflection;
int screen_h;
int screen_w;
};
layout(binding = 0) uniform texture2D triletex;
@ -211,7 +213,7 @@ void main() {
float metallic = float((packedMaterial >> 3) & 0x3) / 3.0;
// Ambient light.
float ssao_sample = texelFetch(sampler2D(ssaotex, trilesmp), ivec2(gl_FragCoord.x, gl_FragCoord.y), 0).r;
float ssao_sample = texture(sampler2D(ssaotex, trilesmp), vec2(gl_FragCoord.x/screen_w, gl_FragCoord.y/screen_h), 0).r;
vec3 light = 0.2 * albedo * ssao_sample;
vec3 N = normalize(fnormal.xyz);