Deferred renderer: don't fill pixels with no geometry unless clear color was set
This commit is contained in:
parent
ac3ab3b0c6
commit
f3184a0f62
1 changed files with 5 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ void main()
|
|||
}
|
||||
|
||||
out0 = position;
|
||||
out1 = vec4(albedo.rgb / u_max_intensity, (u_flag_mask & O_LIT) != 0u ? 1.f : 0.f);
|
||||
out1 = vec4(albedo.rgb / u_max_intensity, (u_flag_mask & O_LIT) != 0u ? 1.f : 0.5f);
|
||||
out2 = pack_normal(normalize(n));
|
||||
out3 = u_material;
|
||||
}
|
||||
|
|
@ -378,7 +378,9 @@ void main()
|
|||
|
||||
vec3 color;
|
||||
|
||||
if (albedo.a < 0.5)
|
||||
if (albedo.a < 0.25)
|
||||
discard;
|
||||
else if (albedo.a < 0.75)
|
||||
color = albedo.rgb;
|
||||
else if (u_use_ssao == 1)
|
||||
color = albedo.rgb * u_ambient * texture(u_ssao_texture, texcoord).r;
|
||||
|
|
@ -1300,6 +1302,7 @@ void main()
|
|||
buffer_1_clear[0] = (*opts.clear_color)[0] / opts.max_intensity;
|
||||
buffer_1_clear[1] = (*opts.clear_color)[1] / opts.max_intensity;
|
||||
buffer_1_clear[2] = (*opts.clear_color)[2] / opts.max_intensity;
|
||||
buffer_1_clear[3] = 0.5f;
|
||||
}
|
||||
|
||||
gl::ClearBufferfv(gl::COLOR, 1, buffer_1_clear);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue