From: Mikko Rasa Date: Fri, 6 Jan 2017 16:16:48 +0000 (+0200) Subject: Perform ambient occlusion PRNG multiplication with 64-bit integers X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b3caa9f93c865a54a5d338af1ef474ad383f8099;p=libs%2Fgl.git Perform ambient occlusion PRNG multiplication with 64-bit integers --- diff --git a/source/ambientocclusion.cpp b/source/ambientocclusion.cpp index 5edbf833..3d56f3f0 100644 --- a/source/ambientocclusion.cpp +++ b/source/ambientocclusion.cpp @@ -52,7 +52,7 @@ AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h, float): float AmbientOcclusion::random(unsigned &seed) { static const unsigned modulus = (1U<<31)-1; - seed = (seed*48271)%modulus; // minstd + seed = (static_cast(seed)*48271)%modulus; // minstd return static_cast(seed)/(modulus-1); }