y2jinc / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

Bug in Kernel2::initBlendedSobel #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Kernel2::initBlendedSobel has an addressing bug where it attempts to blend
the different kernels.  When blending in the kernels of successively
smaller sizes the x offset has been accounted for but the y offset has not.
 For example,

for (int i = 0; i < 7; i++) {
  for (int e = 0; e < 7; e++) {
    // EXISTING LINE
    //m_data[i * 9 + e + 1] += elements[i * 7 + e] * scale.z();

    // SHOULD BE CHANGED TO SOMETHING LIKE THIS TO SKIP ONE ROW IN Y 
    m_data[(i + 1) * 9 + e + 1] += elements[i * 7 + e] * scale.z();
  }
}

Similar fixes are needed for blending the 5x5 and 3x3 kernels.  

This was causing problems when trying to generate a normal map from a
height map.

Original issue reported on code.google.com by jbras...@gmail.com on 18 Jan 2009 at 9:08

GoogleCodeExporter commented 9 years ago

Original comment by cast...@gmail.com on 20 Jan 2009 at 10:55

GoogleCodeExporter commented 9 years ago
Thanks for the bug report! This is now fixes after revision 822:

http://code.google.com/p/nvidia-texture-tools/source/detail?r=822
http://code.google.com/p/nvidia-texture-tools/source/detail?r=823

Original comment by cast...@gmail.com on 28 Jan 2009 at 12:56