POV-Ray : Newsgroups : povray.beta-test : master branch issue 29 linux compilation errors : Re: master branch issue 29 linux compilation errors Server Time
15 May 2024 08:39:03 EDT (-0400)
  Re: master branch issue 29 linux compilation errors  
From: clipka
Date: 6 Jul 2014 07:18:54
Message: <53b9309e$1@news.povray.org>
Am 02.07.2014 18:44, schrieb Le_Forgeron:

> Rendering benchmark gives the attached pictures (the icpc seems ok,
> within usual time, but gcc is bogus and too fast, far too fast)

I finally found out what's going on here.

The implementation of adaptive area lights uses an N*M cache for 
"lightlet" data it has already computed. Previously, yet-uncomputed data 
was flagged by setting the respective colour's red channel to -1. I had 
changed this to use a NaN ("Not-a-Number") value instead, to avoid 
problems when a user deliberately sets a light source's colour to 
negative red.

Now of course this NaN value has to be tested for; according to IEEE 
standard, a NaN value has the property that it is non-equal to anything, 
even itself. So I wrote the test: "if (red != red)...".

Well, it turns out that the g++ compiler optimizes this comparison away 
when in "-ffast_math" mode.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.