[osg-users] Volume image crash on the latest version of Nvidia driver

Clement.Chu at csiro.au Clement.Chu at csiro.au
Sun Aug 16 23:33:34 PDT 2015


Hi Robert,

   I got funny volume display problem on intel card (it lost some opacity values).  I checked the shader code and I found the problem on handling NaN with using if statement.

Your code is :

                     "    if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
                     "    else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
                     "    else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"


   I checked NaN on wiki https://en.wikipedia.org/wiki/NaN.  The non-signaling value won't do standard comparison, so I changed the code as below.

                     "    if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
                     "    else if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
                     "    else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"

  Check the value whether it is NaN on first condition and it works as normal on intel card now.

  

Regards,
Clement


________________________________________
From: osg-users [osg-users-bounces at lists.openscenegraph.org] on behalf of Robert Osfield [robert.osfield at gmail.com]
Sent: Wednesday, 12 August 2015 23:58
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia     driver

On 12 August 2015 at 14:47, <Clement.Chu at csiro.au<mailto:Clement.Chu at csiro.au>> wrote:
Hi Robert,

  I have tested on both Intel and Nvidia machines.  The solution works without any issue.  Thanks.

I have applied this fix to OSG-svn/trunk, OSG-3.2.3 and OSG-3.4.0 so we should now be good to go.

Robert.





More information about the osg-users mailing list