learn-raytracing
learn-raytracing copied to clipboard
float random( vec2 p )
// Input: It uses texture coords as the random number seed.
// Output: Random number: [0,1), that is between 0.0 and 0.999999... inclusive.
// Author: Michael Pohoreski
// Copyright: Copyleft 2012 :-)
float random( vec2 p )
{
// We need irrationals for pseudo randomness.
// Most (all?) known transcendental numbers will (generally) work.
const vec2 r = vec2(
23.1406926327792690, // e^pi (Gelfond's constant)
2.6651441426902251); // 2^sqrt(2) (Gelfond–Schneider constant)
return fract( cos( mod( 123456789., 1e-7 + 256. * dot(p,r) ) ) );
}
Hi, I find your repository interesting and would love to learn how you code it. Please try not to kill me if I ask any stupid questions. Haha.. :-) Here is one: The project uses OpenMP, however, I have not experience with that, should I read some tutorials of OpenMP and understand it before beginning to read your code, or I can just install OpenMP and let it go? Thanks.
OpenMP is a built-in feature of compiler, both gcc and msvc supports it. It's just an optional acceleration technique, you could just omit it.
Have fun. -Vinjn
Guess I should download a VCOMP90.DLL file first, or the executable cannot run.
Thanks,
-Yinan
I have uploaded the dll now, pls sync again.