More correctly divide alpha by 8 for mipmaps, fixes voxel overocclusion.
This commit is contained in:
parent
f4c5e88ef2
commit
d6e4b45994
@ -1948,7 +1948,7 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
|
|||||||
push_constant.prev_rect_ofs[1] = 0;
|
push_constant.prev_rect_ofs[1] = 0;
|
||||||
push_constant.prev_rect_size[0] = 0;
|
push_constant.prev_rect_size[0] = 0;
|
||||||
push_constant.prev_rect_size[1] = 0;
|
push_constant.prev_rect_size[1] = 0;
|
||||||
push_constant.keep_downsample_color = true;
|
push_constant.on_mipmap = false;
|
||||||
|
|
||||||
//process lighting
|
//process lighting
|
||||||
RD::ComputeListID compute_list = RD::get_singleton()->compute_list_begin();
|
RD::ComputeListID compute_list = RD::get_singleton()->compute_list_begin();
|
||||||
@ -2005,7 +2005,7 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
|
|||||||
push_constant.prev_rect_size[1] = push_constant.rect_size[1];
|
push_constant.prev_rect_size[1] = push_constant.rect_size[1];
|
||||||
push_constant.rect_size[0] = rect.size[0];
|
push_constant.rect_size[0] = rect.size[0];
|
||||||
push_constant.rect_size[1] = rect.size[1];
|
push_constant.rect_size[1] = rect.size[1];
|
||||||
push_constant.keep_downsample_color = gi_probe->dynamic_maps[k].mipmap <= 0;
|
push_constant.on_mipmap = gi_probe->dynamic_maps[k].mipmap > 0;
|
||||||
|
|
||||||
RD::get_singleton()->compute_list_add_barrier(compute_list);
|
RD::get_singleton()->compute_list_add_barrier(compute_list);
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ private:
|
|||||||
uint32_t flip_x;
|
uint32_t flip_x;
|
||||||
uint32_t flip_y;
|
uint32_t flip_y;
|
||||||
float dynamic_range;
|
float dynamic_range;
|
||||||
uint32_t keep_downsample_color;
|
uint32_t on_mipmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GIProbeInstance {
|
struct GIProbeInstance {
|
||||||
|
@ -134,7 +134,7 @@ layout (r16ui,set=0,binding=7) uniform restrict writeonly uimage3D aniso_neg_tex
|
|||||||
layout(push_constant, binding = 0, std430) uniform Params {
|
layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
|
|
||||||
ivec3 limits;
|
ivec3 limits;
|
||||||
uint light_count;
|
uint light_count; //when not lighting
|
||||||
ivec3 x_dir;
|
ivec3 x_dir;
|
||||||
float z_base;
|
float z_base;
|
||||||
ivec3 y_dir;
|
ivec3 y_dir;
|
||||||
@ -148,7 +148,7 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
|||||||
bool flip_x;
|
bool flip_x;
|
||||||
bool flip_y;
|
bool flip_y;
|
||||||
float dynamic_range;
|
float dynamic_range;
|
||||||
bool keep_downsample_color;
|
bool on_mipmap;
|
||||||
|
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
accum/=4.0;
|
accum/=params.on_mipmap ? 8.0 : 4.0;
|
||||||
|
|
||||||
if (count==0.0) {
|
if (count==0.0) {
|
||||||
accum_z=0.0; //avoid nan
|
accum_z=0.0; //avoid nan
|
||||||
|
Loading…
Reference in New Issue
Block a user