#135 environment() segv when called with vector (0,0,1)

open
nobody
None
5
2011-06-21
2011-06-21
Karl Stiefvater
No

pixie crashes when calling sl environment() with reflection vector (0,0,1)

tracked it to texture.cpp line 1762. variable c is computed to be 0, and then used for division, resulting in NaNs and a crash:

c = (D[COMP_X]*D[COMP_X]+D[COMP_Y]*D[COMP_Y])*2.0*C_PI;

Discussion

  • can be fixed by adding "+ C_EPSILON" to computation above.