forked from LeenkxTeam/LNXSDK
Update leenkx/Shaders/voxel_temporal/voxel_temporal.comp.glsl
This commit is contained in:
@ -74,8 +74,9 @@ void main() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mat3 TBN = mat3(1.0);
|
||||
int nor_count = 0;
|
||||
vec3 avgNormal = vec3(0.0);
|
||||
mat3 TBN = mat3(0.0);
|
||||
|
||||
for (int i = 0; i < 6 + DIFFUSE_CONE_COUNT; i++)
|
||||
{
|
||||
@ -116,10 +117,18 @@ void main() {
|
||||
N.g = float(imageLoad(voxels, src + ivec3(0, 0, voxelgiResolution.x * 8))) / 255;
|
||||
N /= count;
|
||||
N = decode_oct(N.rg * 2.0 - 1.0);
|
||||
avgNormal += N;
|
||||
|
||||
if (abs(N.x) > 0)
|
||||
avgNormal.x += N.x;
|
||||
if (abs(N.y) > 0)
|
||||
avgNormal.y += N.y;
|
||||
if (abs(N.z) > 0)
|
||||
avgNormal.z += N.z;
|
||||
if (i == 5)
|
||||
TBN = makeTangentBasis(normalize(avgNormal));
|
||||
{
|
||||
avgNormal = normalize(avgNormal);
|
||||
TBN = makeTangentBasis(avgNormal);
|
||||
}
|
||||
|
||||
vec3 envl = vec3(0.0);
|
||||
envl.r = float(imageLoad(voxels, src + ivec3(0, 0, voxelgiResolution.x * 9))) / 255;
|
||||
@ -245,4 +254,4 @@ void main() {
|
||||
imageStore(SDF, dst_sdf, vec4(sdf));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user