material-maker icon indicating copy to clipboard operation
material-maker copied to clipboard

Add high poly to low poly map bakers

Open wojtekpil opened this issue 4 years ago • 0 comments

This a high poly to low poly normal & world normal & depth map & AO baking PR. This is using bvh & raytracing. How to use (UI is temporary):

  1. Select your low poly mesh in 3d preview window
  2. In 3d preview window: Model -> Generate Map -> HP->LP normals
  3. First popup window asks about destination file for normalmap image
  4. Second popup asks about high poly obj file

BVH is generated only once per hp mesh & creates a cache file -> *.bvh_cache alongside original hp mesh so second bake should be almost instant. Remove this cache file, in case the source hp mesh changes. Parameters used during hp -> lp normals baking are temporarily inside preferences -> bake window Used parameters:

  1. Cage front distance - the distance in the normal direction of baking cage from low poly model vertices
  2. Cage rear distance - the max length of ray started from cage. Intersections above this distance will result in black normalmap (as no hit was detected)
  3. Smooth cage - generate a smooth normals for baking cage. Use with hard edges lp mesh for eliminating discontinuities on mesh edges.
  4. Ray length - AO maximum ray length. Above this distance occlusion of point is not checked
  5. Ray count - number of rays used during AO calculation
  6. Denoise radius - radius of denoiser for AO baker
  7. Cos distribution - Use cosine hemisphere distribution to sample the AO. This option requires less samples for more accurate result but may produce some artifacts.
  8. Ray bias - Offset from hp vertex in the normal direction. Eliminates some numerical calculation errors due to precision loss.
  9. Norm bent normals - normalise bent normals

wojtekpil avatar Jan 03 '22 20:01 wojtekpil