
The Alpha channel will be a bump map generated from the normals, while the Red, Green and Blue channels are each a Curvature map - one with a radius of 1 pixels (Red channel), one with a radius of 5 pixels (Green channel) and one with a radius of 25 pixels. Each generated image will consist of 4 channels (RGBA). The script will look for all images with '_nmp' or '.nmp' in the name and will generate an image of the same name, but with 'nmp' replaced with 'bump'. New_img_name = new_img_name.replace('nmp', 'bump') If "_nmp" in img.name or ".nmp" in img.name: New_image = (new_image_name, width=width, height=height)


Pixels = curvinessĬurviness = generate_curviness(heights, width, height, 5)Ĭurviness = generate_curviness(heights, width, height, 25) Pixels = heightsĬurviness = generate_curviness(heights, width, height, 1) Heights = (height_this + (height_top + gradient_u) + (height_bottom + gradient_d) + (height_left + gradient_l) + (height_right + gradient_r)) / 5 Print("max = %f, min = %f" % (max_depth, min_depth))

# Filter out the extremes to avoid infinities Return (rgba/dist, rgba/dist, rgba/dist, rgba)
CURVATURE MAP POSTVIEW 2.2 CODE
Here's the code to run - simply paste this into a Text Editor window, load your image into the Image Editor, ensure it has '_nmp' or '.nmp' somewhere in the filename and click 'Run Script'. Python can be used to analyse your normal map and reconstruct the bump map and this can then be used to generate a curvature map.
