Open luan opened 7 months ago
Hi, I have identical issue. Changing reservoir_size made it less visible for me, but it introduced a weird flicker on the edges of the window. Its not that bad, since there is not much to see anyway. Proper solution would be appreciated.
app.insert_resource(BevyMagicLight2DSettings {
light_pass_params: LightPassParams {
reservoir_size: 4,
..default()
},
..default()
});
I resolved this issue for me by changing these lines: https://github.com/zaycev/bevy-magic-light-2d/blob/main/src/gi/util.rs#L28,L32
// Old
pub fn align_to_work_group_grid(size: IVec2) -> IVec2
{
let wg_size = WORKGROUP_SIZE as i32;
size + IVec2::new(wg_size - size.x % wg_size, wg_size - size.y % wg_size)
}
// New
pub fn align_to_work_group_grid(size: IVec2) -> IVec2 {
let wg_size = WORKGROUP_SIZE as i32;
// Only add padding if necessary
IVec2::new(
if size.x % wg_size == 0 {
size.x
} else {
size.x + wg_size - size.x % wg_size
},
if size.y % wg_size == 0 {
size.y
} else {
size.y + wg_size - size.y % wg_size
},
)
}
Great, @twct solution works better than the reservoir_size for me. There is still a flicker around the window borders, but its less noticeable, anyone else is having issues with that? It also causes the lightsource in minimal to deform.
@twct thanks for looking into this! @GlummixX let me check what else is missing, we are probably still sampling light out of bounds somewhere
I spent a few hours on this but I am very new to shader programming and vfx in general, ended up getting stuck trying to figure out why this happens.
The screenshots show what i'm seeing here, but basically, there's a darkening that happens at around 400px into the camera from right to left and 24x top to bottom.
Any idea why this is the case? Is it an intentional effect?
You can also see this issue on the
movement
example:both an omni source and skylight:
just the skylight:
just the omni source: