Im reading up on some baking guides and was confused on where the rays come from and where they go because some guides say the rays start at the low poly and go out until it passes through the high poly getting the details. Others say it comes down and hits both the high and low getting the detail from the high.
I read the guide from here too https://substance3d.adobe.com/tutorials/courses/Substance-3D-Painter-Baking-Parameters
I think the rays start from the point where the front distance from the low and will go through until the rear distance is met.
With cages does it work the same way? The rays start from the outer part and go until it hits the end of the geometry?
My final question is if the rays hit the high poly first then the low and I don't know if it matters in the order because Ive read that the high or low can be on top or pushing a bit one way or the other. When the rays hit the high and keep going to the low does it know to capture that detail from the high based on what area the ray hits on the low and where those faces are on the UV map?
Thank you! :)
Replies
The Ray comes from the normal of the low poly. In the case of a cage, the direction is between the low and the corresponding vertex on the cage. It travels a distance in both directions (depending on start and rear distance settings, and/or the cage) until it hits the high.
The low poly won't bake to itself unless specified to do so.
The rays start from the low poly vertex and go from there in the direction of the normal or the direction of the corresponding cages vert, the distance traveled is either a distance parameter or cage bounds
A rear distance is minus that until the high poly is hit with the ray or is clipped by the distance. I assume it's a edge case thing where you might have holes in high poly and don't want to write normal map pixels on those bits to be a weird scramble of nonsense stuff thats halfway across the model, so you stop the rays a bit early before hitting another part of the high poly, I guess it would fill in a nuetral or specific normal color where it clips.
Thank you! So my confusion happens because when I make a retopo on my high poly the low is slightly above the high but always bakes fine. If the rays go from the low normals and out wouldn't it miss the high poly in this way?
correct but... its sampled per pixel (usually at final bake resolution) rather than per vertex for most baking types
as said above - bakers will usually project both sides of the target mesh by a specified distance
The ray is going in both directions. If you want to test what is happening, try baking something without a cage and playing with the distance values.
Doesnt Painter have a baking option to compute per fragment which does pixel instead of vertex? I think I seen it in marmoset too?
So the both sides is for the front and rear? Or is the front going two ways?
compute tangent space per fragment isn't relevant here - it affects how data is encoded into the final bake, not how the bake is executed.
To try and illustrate how baking works, imagine it does something like this...
wraps a texture to the target object, projects a ray out from the mesh for every pixel of that texture, grabs whatever data it needs from the target mesh when it hits it, paints the pixel the right color
You can't bake to a backface so I guess the front goes both ways?
Okay! That makes more sense. I was just really confuses on the ray direction and the front and rear part.