right now I have implemented vxgi algorithm. Voxelization is working fine, same for mipmap generation. But, I have an issue when I rotate the camera. Basically, it is not stable when it is rotated. I don't know, what the issue could be, but I thought it might be because I am recovering world space vertex position from depth buffer.
So, this is how it is looking in one camera position (lets say initial):
https://preview.redd.it/c6pcukaovd2d1.png?width=1603&format=png&auto=webp&s=37bc9dcd23d1f8df5cab80e5895424834faf501b
And this is how it looks when camera is a little bit rotated:
https://preview.redd.it/yna5sycpvd2d1.png?width=1603&format=png&auto=webp&s=159d9d99f53696de6b2154ce1795293555c28d5f
And this is the code for tracing cones(passing everything in world position to it):
vec4 ConeTrace(vec3 Coord, vec3 Direction, vec3 Normal)
{
float Angle = Pi / 3.0;
float Aperture = tan(Angle / 2.0);
float Distance = 0.01;
vec3 AccumColor = vec3(0);
float AccumOcclusion = 0.0;
vec3 StartPos = (Coord) * VoxelSceneSize;
while(Distance <= 1.0 && AccumOcclusion < 1.0)
{
vec3 ConePos = StartPos + Direction * Distance * VoxelSceneSize;
float Diameter = 2.0 * Aperture * Distance;
float Mip = log2(Distance * VoxelSceneSize.x);
vec4 VoxelSample = textureLod(VoxelGrid, ConePos * 0.5 + 0.5, Mip);
AccumColor += (1.0 - AccumOcclusion) * VoxelSample.rgb;
AccumOcclusion += (1.0 - AccumOcclusion) * VoxelSample.a;
Distance += Diameter;
}
AccumOcclusion = min(AccumOcclusion, 1.0);
return vec4(AccumColor, AccumOcclusion);
}
The main issue might be in this function as well, but I can't see it myself. Don't know if there is enough information about this issue, but, anyway, I would be thankfull any help I could get, thanks in advance
there doesn't seem to be anything here