MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / CMJRandFloat

Function CMJRandFloat

SampleFramework12/v1.00/Graphics/Sampling.cpp:359–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359static float CMJRandFloat(uint32 i, uint32 p)
360{
361 i ^= p;
362 i ^= i >> 17;
363 i ^= i >> 10; i *= 0xb36534e5;
364 i ^= i >> 12;
365 i ^= i >> 21; i *= 0x93fc4795;
366 i ^= 0xdf6e307f;
367 i ^= i >> 17; i *= 1 | p >> 18;
368 return i * (1.0f / 4294967808.0f);
369}
370
371 // Returns a 2D sample from a particular pattern using correlated multi-jittered sampling [Kensler 2013]
372Float2 SampleCMJ2D(int32 sampleIdx, int32 numSamplesX, int32 numSamplesY, int32 pattern)

Callers 1

SampleCMJ2DFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected