AdamKruschwitz / Normal-Map-Generation-Example

2 stars 0 forks source link

tested #1

Open tgoeminne opened 8 months ago

tgoeminne commented 8 months ago

hi,

i have tested this code. but when rendering the image it seems that the normal map is off.

greets, Thomas

tgoeminne commented 8 months ago

normal

In the image you can see the original image, and under it is the normal map. It is almost right but the pixels do not match up.

tgoeminne commented 8 months ago

function reduceHeightMap( image, width ) { ... if(i/4 % width === 0) { // divide by 4 here

I have found you need to add divide by 4 to reduceHeightMap like so...