MCPcopy Create free account
hub / github.com/aliasIsolation/aliasIsolation / getFrameJitter

Function getFrameJitter

src/dll/taa.cpp:247–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247static glm::vec2 getFrameJitter()
248{
249 ZoneScopedN(__FUNCTION__);
250
251 if (g_frameConstants.taaRanThisFrame)
252 {
253 // We're post TAA in the frame. Must not add jitter or stuff will shake.
254 return glm::vec2(0, 0);
255 }
256
257 glm::vec2 sampleOffset = hammersley2d((g_frameConstants.taaSampleIdx * 7u) % 16u, 16, 238308531);
258 sampleOffset -= 0.5f;
259 sampleOffset.x *= 2.0f / g_frameConstants.screenWidth;
260 sampleOffset.y *= 2.0f / g_frameConstants.screenHeight;
261 return sampleOffset;
262}
263
264// Cache of jittered projection matrices calculated for the shared pixel and vertex constant buffers.
265// The math to calculate them is quite expensive, so we cache them and only update when needed.

Callers 1

Unmap_hookFunction · 0.85

Calls 1

hammersley2dFunction · 0.85

Tested by

no test coverage detected