material-maker
material-maker copied to clipboard
Add high poly to low poly map bakers
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):
- Select your low poly mesh in 3d preview window
- In 3d preview window: Model -> Generate Map -> HP->LP normals
- First popup window asks about destination file for normalmap image
- 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:
- Cage front distance - the distance in the normal direction of baking cage from low poly model vertices
- 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)
- Smooth cage - generate a smooth normals for baking cage. Use with hard edges lp mesh for eliminating discontinuities on mesh edges.
- Ray length - AO maximum ray length. Above this distance occlusion of point is not checked
- Ray count - number of rays used during AO calculation
- Denoise radius - radius of denoiser for AO baker
- Cos distribution - Use cosine hemisphere distribution to sample the AO. This option requires less samples for more accurate result but may produce some artifacts.
- Ray bias - Offset from hp vertex in the normal direction. Eliminates some numerical calculation errors due to precision loss.
- Norm bent normals - normalise bent normals