Fixed normalMap() method so that it doesn't produce inverted bump maps.
This commit is contained in:
parent
85bfc2d23c
commit
e6142070de
|
@ -316,10 +316,8 @@ void CTexture::normalMap(float scale, bool wrap)
|
|||
float rmag = 1.0f / mag;
|
||||
|
||||
int n = (i * width + j) * 4;
|
||||
// npixels[n] = (unsigned char) (128 + 127 * dy * rmag);
|
||||
// npixels[n + 1] = (unsigned char) (128 - 127 * dx * rmag);
|
||||
npixels[n] = (unsigned char) (128 - 127 * dx * rmag);
|
||||
npixels[n + 1] = (unsigned char) (128 + 127 * dy * rmag);
|
||||
npixels[n] = (unsigned char) (128 + 127 * dy * rmag);
|
||||
npixels[n + 1] = (unsigned char) (128 - 127 * dx * rmag);
|
||||
npixels[n + 2] = (unsigned char) (128 + 127 * rmag);
|
||||
npixels[n + 3] = 255;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue