Dynamic objects in GIProbes are now affected by propagation parameter.
This commit is contained in:
parent
d6e4b45994
commit
4949d578f2
3 changed files with 14 additions and 2 deletions
|
@ -1949,6 +1949,10 @@ void RasterizerSceneRD::gi_probe_update(RID p_probe, bool p_update_light_instanc
|
||||||
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.on_mipmap = false;
|
push_constant.on_mipmap = false;
|
||||||
|
push_constant.propagation = storage->gi_probe_get_propagation(gi_probe->probe);
|
||||||
|
push_constant.pad[0]=0;
|
||||||
|
push_constant.pad[1]=0;
|
||||||
|
push_constant.pad[2]=0;
|
||||||
|
|
||||||
//process lighting
|
//process lighting
|
||||||
RD::ComputeListID compute_list = RD::get_singleton()->compute_list_begin();
|
RD::ComputeListID compute_list = RD::get_singleton()->compute_list_begin();
|
||||||
|
|
|
@ -174,6 +174,8 @@ private:
|
||||||
uint32_t flip_y;
|
uint32_t flip_y;
|
||||||
float dynamic_range;
|
float dynamic_range;
|
||||||
uint32_t on_mipmap;
|
uint32_t on_mipmap;
|
||||||
|
float propagation;
|
||||||
|
float pad[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GIProbeInstance {
|
struct GIProbeInstance {
|
||||||
|
|
|
@ -149,7 +149,8 @@ layout(push_constant, binding = 0, std430) uniform Params {
|
||||||
bool flip_y;
|
bool flip_y;
|
||||||
float dynamic_range;
|
float dynamic_range;
|
||||||
bool on_mipmap;
|
bool on_mipmap;
|
||||||
|
float propagation;
|
||||||
|
float pad[3];
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
#ifdef MODE_DYNAMIC_LIGHTING
|
#ifdef MODE_DYNAMIC_LIGHTING
|
||||||
|
@ -753,7 +754,12 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
accum/=params.on_mipmap ? 8.0 : 4.0;
|
if (params.on_mipmap) {
|
||||||
|
accum.rgb /= mix(8.0,count,params.propagation);
|
||||||
|
accum.a /= 8.0;
|
||||||
|
} else {
|
||||||
|
accum/=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 a new issue