-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- everything is flickering wildly. lighting pass probably needs the jitter matrix as well. consider rolling it into the viewproj matrix for those two steps.
- Loading branch information
Showing
5 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include "math.hpp" | ||
|
||
#include <glm/glm.hpp> | ||
|
||
#include <cmath> | ||
|
||
namespace nlrs | ||
{ | ||
inline glm::vec2 r2Sequence(const std::uint32_t n, const std::uint32_t sequenceLength) | ||
{ | ||
// https://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/ | ||
constexpr float G = 1.32471795f; | ||
constexpr float A1 = 1.0f / G; | ||
constexpr float A2 = 1.0f / (G * G); | ||
|
||
const float i = static_cast<float>(n % sequenceLength); | ||
const float x = fract(0.5f + A1 * i); | ||
const float y = fract(0.5f + A2 * i); | ||
return glm::vec2(x, y); | ||
} | ||
} // namespace nlrs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters