bgfx/examples/43-denoise/shared_functions.sh
Бранимир Караџић 4581f14cd4 Happy New Year!
2022-01-15 11:59:06 -08:00

26 lines
564 B
Bash

/*
* Copyright 2021 elven cache. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef SHARED_FUNCTIONS_SH
#define SHARED_FUNCTIONS_SH
vec2 GetTexCoordPreviousNoJitter(vec2 texCoord, vec2 velocity)
{
vec2 texCoordPrev = texCoord - velocity;
return texCoordPrev;
}
vec2 GetTexCoordPrevious(vec2 texCoord, vec2 velocity)
{
vec2 texCoordPrev = texCoord - velocity;
vec2 jitterDelta = (u_jitterCurr-u_jitterPrev);
texCoordPrev += jitterDelta * u_viewTexel.xy;
return texCoordPrev;
}
#endif // SHARED_FUNCTIONS_SH