Skip to content

Commit

Permalink
fix: cubemap shimmer
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum committed Jan 29, 2024
1 parent 3171164 commit ace5235
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ float3 InverseProjectUVZ(float2 uv, float z)
if (linearDepth > 16.5) { // First person
float3 color = ColorTexture[round(uv * textureDims)];
float4 output = float4(sRGB2Lin(color), 1.0);
DynamicCubemapRaw[ThreadID] = output;
DynamicCubemap[ThreadID] = output;
float lerpFactor = 0.1;

DynamicCubemapRaw[ThreadID] = lerp(DynamicCubemapRaw[ThreadID], output, lerpFactor);
DynamicCubemap[ThreadID] = lerp(DynamicCubemap[ThreadID], output, lerpFactor);

float3 position = InverseProjectUVZ(uv, depth);
DynamicCubemapPosition[ThreadID] = float4(position * 0.001, 1.0);
DynamicCubemapPosition[ThreadID] = lerp(DynamicCubemapPosition[ThreadID], float4(position * 0.001, 1.0), lerpFactor);
return;
}
}
Expand Down

0 comments on commit ace5235

Please sign in to comment.