Open Navash914 opened 4 years ago
Try plotting your bump heights as colours on the spheres. This looks like a problem with either your use of Perlin noise or the data you're passing to the Perlin noise function.
Also, make sure you're doing bump mapping calculations in model space (i.e., before any transformations). In your current code, it's being done in camera space. If the sphere coordinates aren't in model space, you can't use position and normal interchangeably.
same problem. have u fixed it?
When I try to apply bump mapping, my planet and moon seem to get divided into clearly defined partitions:
What could be causing this?
For reference, the way I'm trying to bump is:
// Get Tangent and Bitangent Vectors vec3 T, B; tangent(normalize(normal_fs_in), T, B); float eps = 0.0001;
// Get the two vectors to cross vec3 v1 = (bump_position(is_moon, normal_fs_in + eps T) - bump_position(is_moon, normal_fs_in)) / eps; vec3 v2 = (bump_position(is_moon, normal_fs_in + eps B) - bump_position(is_moon, normal_fs_in)) / eps;
// Get normal n = normalize(cross(v1, v2));
And n is passed as the normal to blinn phong shading (I changed nothing else from procedural_color, which is working).