Menu

photonmap bug?

Help
jerry chan
2009-01-09
2013-04-25
  • jerry chan

    jerry chan - 2009-01-09

    when rendering dispersion example, pixie always cashed with stack overflow. I had tried all version after 2.0,but all is the same. So I had to debug it, and find it crashed in following function:
    void    CPhotonMap::lookup(float *Cl,const float *Pl,int maxFound) {

    maxFound is a huge number, then memory overflowed in :
    const CPhoton    **indices    =    (const CPhoton **)    alloca((maxFound+1)*sizeof(CPhoton *));

    after a long time debuging (because a lots of macros) , I found bug is in this declare:
    struct {
            int                estimator;        }            photonmapParams;
    estimator is integer ,but number read from shader is float, and then memcpy to this integer.
    after changed int to float,all is OK.
       But I'm not sure about this correction, because nobody report this bug online.

     
    • Okan Arikan

      Okan Arikan - 2009-04-07

         Hi Jerry,

         This problem is resolved in the SVN. Can you verify that you do not have this crash anymore?

         Thank you,

         Okan

       
  • jerry chan

    jerry chan - 2009-10-22

    thanks Okan ,this bug is fixed. 
    but I found another bug in texmake.cpp.
    from line 424:
    for (i=0;i<newHeight*newHeight;i++) {
    normalizer_ = 0;
    filteredData = 0;
    }

    for (;i<newHeight*newHeight*numSamples;i++) {
    filteredData = 0;
    }
       should be:
    for (i=0;i<newHeight*newWidth;i++) {
    normalizer = 0;
    filteredData = 0;
    }

    for (;i<newHeight*newWidth*numSamples;i++) {
    filteredData = 0;
    }
        this bug can make some texture incorrect_

     

Log in to post a comment.