Project

General

Profile

« Previous | Next » 

Revision 9f5eba09

Added by Leszek Koltunski over 7 years ago

Correct an important bug in the vertex shader.

b = 1/a if a!=0, 1 otherwise was incorrectly computed as b = 1.0 / (a+1.0-sign(a)). This, when 0<a<2^-24, suffers from 'round-off error': then a+1.0 = 1.0 (sic!) thus b = 1/0 !.

Correct way: b = 1.0 / ( a - (sign(a)-1.0) )

  • added
  • modified
  • copied
  • renamed
  • deleted