Commit c44b9ab5 authored by Florian Oetke's avatar Florian Oetke
Browse files

small graphic tweaks from sea++

parent 56f3c519
Pipeline #3146 passed with stage
in 13 minutes and 56 seconds
......@@ -48,8 +48,8 @@ namespace mirrage::renderer {
float scene_luminance_override = -1.f;
float exposure_luminance_override = -1.f;
float scotopic_sim_weight = 1.f;
float min_display_luminance = 2.f;
float max_display_luminance = 150.0f;
float min_display_luminance = 40.f;
float max_display_luminance = 200.0f;
float amient_light_intensity = 0.1f;
int transparent_particle_mip_level = 0;
......
......@@ -15,7 +15,7 @@ layout(location = 0) out vec4 out_color;
layout(set=1, binding = 0) uniform sampler2D color_sampler;
layout (constant_id = 0) const float MAX_RADIUS = 15;
layout (constant_id = 1) const float RAD_SCALE = 0.8;
layout (constant_id = 1) const float RAD_SCALE = 0.7;
layout(push_constant) uniform Push_constants {
// focus_distance, range, radius
......
......@@ -28,7 +28,11 @@ float calc_coc(float dist) {
const float range = pcs.parameters[1];
const float radius = pcs.parameters[2];
return MAX_RADIUS * radius * clamp((dist - focus_distance) / dist / range, -1.0, 1.0);
float coc = (dist - focus_distance) / dist / range;
if(coc<0)
coc *= 2.0;
return MAX_RADIUS * radius * clamp(coc, -1.0, 1.0);
}
void main() {
......
......@@ -203,7 +203,7 @@ vec3 calc_illumination_from(int lod, vec2 tex_size, ivec2 src_uv, vec2 shaded_uv
// calculate the size of the differential area
float cos_alpha = Pn.z;
float cos_beta = dot(Pn, N);
float ds = pcs.prev_projection[2][3] * depth*depth * clamp(cos_alpha / cos_beta, 0.001, 1000.0);
float ds = pcs.prev_projection[2][3] * depth*depth * clamp(cos_alpha / cos_beta, 0.005, 1000.0);
// multiply all factors, that modulate the light transfer
float weight = visibility * NdotL_dst * NdotL_src * ds / (0.01+r2);
......
......@@ -117,11 +117,11 @@ void main() {
float depth = texelFetch(depth_sampler, center_px, MIN_MIP).r;
vec3 P = position_from_ldepth(vertex_out.tex_coords, depth);
vec3 N = decode_normal(texelFetch(mat_data_sampler, center_px_normal, 0).rg);
P += N*0.05;
packKey(CSZToKey(P.z), out_color.gb);
vec3 N = decode_normal(texelFetch(mat_data_sampler, center_px_normal, 0).rg);
float random_pattern_rotation_angle = random(vec4(center_px.x, center_px.y, global_uniforms.time.x, 0));
// Choose the screen-space sample radius
......
......@@ -200,6 +200,9 @@ namespace mirrage::renderer {
ImGui::SliderFloat("Exposure", &renderer_settings.exposure_override, 0.f, 50.f);
ImGui::SliderFloat("Min Disp. Lum.", &renderer_settings.min_display_luminance, 1.f, 100.f);
ImGui::SliderFloat("Max Disp. Lum.", &renderer_settings.max_display_luminance, 1.f, 1000.f);
ImGui::SliderFloat(
"Background Brightness", &renderer_settings.background_intensity, 0.f, 10.f);
......
......@@ -87,7 +87,7 @@ namespace mirrage::renderer {
*_descriptor_set_layout,
_coc_framebuffer))
, _dof_descriptor_set(_descriptor_set_layout.create_set(renderer.descriptor_pool(), {src.view(1)}))
, _dof_descriptor_set(_descriptor_set_layout.create_set(renderer.descriptor_pool(), {src.view(2)}))
, _dof_renderpass(build_render_pass(renderer,
target,
2,
......@@ -142,6 +142,16 @@ namespace mirrage::renderer {
_coc_renderpass.push_constant("pcs"_strid, pcs);
frame.main_command_buffer.draw(3, 1, 0, 0);
});
graphic::blit_texture(frame.main_command_buffer,
_src,
vk::ImageLayout::eShaderReadOnlyOptimal,
vk::ImageLayout::eShaderReadOnlyOptimal,
_src,
vk::ImageLayout::eUndefined,
vk::ImageLayout::eShaderReadOnlyOptimal,
1,
2);
}
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment