2
$\begingroup$

I've gone into some trouble understanding how the ray shoot out and the size relationship between the high and low poly mesh, below is my understanding,

enter image description here

But which one is right? From the menual it says the ray is generated from the low poly inwards to the high poly, then I suppose the first illustration is not right, because it points outwards.

The second illustration, the middle section should been working properly, but the left and right section has no high poly surfaces to point to, because it is starting point is inside the high poly, I searched and found someone says I can set the ray distance, then setting the distance won't change where the starting point the ray started, am I right?

The last one is I think how it should work, by having the low poly encapsulating the high poly, but I still needs some basic understanding how blender works with Normal map baking, thanks!

Edit:It turns out the ray will travel in both direction as opposed to what the Doc. says towards inwards.

enter image description here

The above shows the low poly has a cube inside and sphere outside, both have been reflected on the low poly cube.

$\endgroup$
3
$\begingroup$

So first, let's make sure we define what "inwards" means. I'm going to say it means in the opposite direction of your low poly's normals. So if we were to draw your low poly's normals on your graphs above, the normals would be pointing upwards.

As of 2.91.0-ish, rays are shot in the opposite direction of the low poly's normals-- that is, inward. Rays that fail to intersect cause 0.5,0.5,1.0 to be written (which is the same thing as saying, using the low poly's own normals.)

My memory of this in earlier versions (like 2.79, 2.80) was that rays were shot in both directions, but you would still want an enclosed high poly, because rays shot in the direction of the low poly's normals would hit the backfaces of the high poly rather than the front faces, and you'd get screwed up normals.

"Ray distance", just a version or two ago, referred to what is now "Extrusion." This means to start the rays offset in the direction of the low poly's normals. It is exactly the same as baking from a displaced low poly, or baking from a cage with a numeric shrink/fatten operation applied to all vertices. To be explict, this does change the origin of the rays.

"Max ray distance", as implemented a version or two ago, means that Blender will just discard results that arise from intersections greater than a certain distance. I'm not really sure what the intended use for this is, although it can be useful for some texture baking situations that are selected-to-active bakes but couldn't reasonably be described as high-to-low bakes, like baking text objects to a texture or something. This does not change the origin of the rays.

$\endgroup$
6
  • $\begingroup$ As the Doc. said,"The rays are cast from the low-poly object inwards towards the high-poly object", at least for version 2.9, it should only shoots towards inwards, but I need to have a try. As for ray distance, it changes the origin of the ray, could you elaborate when to use this feasure? $\endgroup$ Feb 4 at 5:21
  • $\begingroup$ @user3505400 On testing in 2.91.0, high poly in the direction of the low poly normal is now ignored; it just writes 0.5,0.5,1. I'll update the answer. As mentioned, "max ray distance" does not change the origin of the ray; "extrusion" changes the origin of the ray. You can use this to virtually enclose your high poly, by offsetting the origin of the ray in the direction of the low poly normals. $\endgroup$
    – Nathan
    Feb 4 at 5:33
  • $\begingroup$ Doc. says "If the high-poly object is not entirely involved by the low-poly object, you can tweak the rays start point with Ray Distance", while I need to have some trials. $\endgroup$ Feb 4 at 5:40
  • $\begingroup$ @user3505400 Do some tests. Docs are not always right. It is probably referring to the "ray distance" used by earlier versions, which is now called "extrusion". It is not referring to "max ray distance", which is something else, and does not change the ray origin. $\endgroup$
    – Nathan
    Feb 4 at 5:42
  • 1
    $\begingroup$ Good point, I'll do some test after $\endgroup$ Feb 4 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.