MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/HBAOPlus / RandomTexture

Method RandomTexture

src/RandomTexture.cpp:90–106  ·  view source on GitHub ↗

--------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

88
89//--------------------------------------------------------------------------------
90GFSDK::SSAO::RandomTexture::RandomTexture()
91{
92 UINT k = 0;
93 for (UINT i = 0; i < SIZEOF_ARRAY(m_Jitters); ++i)
94 {
95 float r1 = GetRandomNumber(k++);
96 float r2 = GetRandomNumber(k++);
97 float r3 = GetRandomNumber(k++);
98
99 // Use random rotation angles in [0,2PI/NUM_DIRECTIONS).
100 float angle = 2.0f * D3DX_PI * r1 / NUM_DIRECTIONS;
101 m_Jitters[i].X = cosf(angle);
102 m_Jitters[i].Y = sinf(angle);
103 m_Jitters[i].Z = r2;
104 m_Jitters[i].W = r3;
105 }
106}
107
108#if ENABLE_DEBUG_MODES && SUPPORT_D3D11
109

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected