0
$\begingroup$

I've been playing around with an idea, but I'm struggling with some of the math involved.

Now, each face of a mesh has a normal vector, and that the normal map fragment shader modifies that face normal, based on the RBG pixel of the normal map. This, in turn modifies the brightness of a rendered mesh, giving the impression of height and depth. Correct me if I'm mistaken, of course.

So, based on this, if you managed to split up a mesh, to add extra edges that correspond to individual pixel boundaries - with each boundary containing portions of one or more of the original faces, you could then apply the normal modification of the corresponding normal map's pixel, as rotation.

Then, it would simply be a matter of reconnecting the vertices, to make the mesh cohesive again

While I can find plenty of sources on how normal maps affect the normal vectors of a mesh, I'm a bit lost on how to take that effect, and apply it to physically rotating the face, so the original normal vector matches its modified vector.

$\endgroup$
4
  • $\begingroup$ Some food for thought: Would you expect the tessellated mesh to be free of "cracks"? If not would you add triangles to fill those cracks? Otherwise the new mesh effectively becomes a heightfield which limits how far individual triangles can be "rotated". The points in a triangle all lie in a common plane, a plane is defined by a normal and a distance from the origin. The new normal is the normal of the plane, pick a point in the triangle to compute the distance and adjust the triangle corners along the normal direction to lie in the plane.(not a solution just a thought) $\endgroup$
    – pmw1234
    Commented Feb 4, 2021 at 1:08
  • $\begingroup$ Well, lets consider a mormal map that consists of a large dome, and its applied to a mesh that's a flat plane. If this split and rotate method was done to the plane, the result should be a collection of quasi fragments all rotated appropriately, yet still sitting on the same z axis (z-up) as the original plane. The result should be the same as if you took a physical dome mesh, broke all its vertices, and moved each face down. $\endgroup$ Commented Feb 4, 2021 at 12:50
  • $\begingroup$ So, in both cases, the dome should be able to be assembled from the outside in, by moving each "fragment" up the z-axis, until its verts match up with its neighbors. The same basic technique should hold true for more complex meshes/normal maps $\endgroup$ Commented Feb 4, 2021 at 13:00
  • $\begingroup$ I suggest looking up "tessellation shading" on a search engine. That should point you at mountains of info for what you are describing. $\endgroup$
    – pmw1234
    Commented Feb 4, 2021 at 14:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.