I have generated a 1024 X 1024 heightmap using Open simplex noise. Now i want to zoom into a 64X64 area. Every pixel in the 64X64 is not 16X16 on the larger scale.
I tried just generating the area, but problem is, that I want to also calculate normals from it, and the normals are different for the zoomed in area from the big map. The difference comes from the fact that on the big map the height difference between 2 pixels can be quite large, but when zoomed in, new pixels are place between the original 2 so if now normals are calculated, they are totally different.
How can I zoom into an area of a generated heightmap but retain the normals? On the left is the large scale map and on the right is the zoomed in area. Zoomed in area is the upper left corner of the large scale map. As you can see the normals are completely different. Both of these images are textures. There are no meshes or anything only textures, and there will not be any meshes in future either.
This is how I calculate normals from heightMap.
u = noiseValues[x + (y - 1) * width]; r = noiseValues[x + 1 + y * width]; } Vector3 up = new Vector3(0, 1, (noiseValues[index] - u)*100); Vector3 across = new Vector3(1, 0, (r - noiseValues[index])*100); normal = across.Cross(up).Normalized(); normal = (normal + new Vector3(1, 1, 1)) / 2.0f;
After updating these lines in normal calculation:
Vector3 up = new Vector3(0, 1/zoomFactor, (noiseValues[index] - u)*100); Vector3 across = new Vector3(1/zoomFactor, 0, (r - noiseValues[index])*100);
This is the result after adjusting normal calculation: