You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
Dynamic objects in GIProbes are now affected by propagation parameter.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user