Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

3.9 KB
Raw Blame
# Map baking (Tool > Bake): the detail of a 330k-triangle sculpt baked onto a 2,000-triangle low-poly with UVs.
# Two identical sculpted spheres side by side: the right one is the bake source, its decimated copy (with Auto UV)
# the low-poly. After baking, the source is hidden so the shots show the high-poly (left) next to the low-poly
# wearing its baked normal map (right).
run new_sphere subdivisions=5
run part_rename to=High
run part_append type=sphere size=1 name=Source
run subdivide levels=2
run part_select name=High
run subdivide levels=2
# The same strokes on both spheres (the source sits 2.2 units to the right); strokes go to the active Part.
run stroke brush=Crease points="-0.6,0.35,1 0,0.55,1 0.6,0.35,1" radius=0.07 strength=1
run stroke brush=Inflate points="-0.35,-0.3,1" radius=0.3 strength=1
run stroke brush=Clay points="0.25,-0.5,1 0.55,-0.05,1" radius=0.1 strength=1
run stroke brush=Crease invert=true points="-0.75,-0.1,1 -0.45,-0.65,1" radius=0.05 strength=1
run stroke brush=Standard points="-0.2,0.05,1 0.2,0.1,1" radius=0.06 strength=1 invert=true
run part_select name=Source
run stroke brush=Crease points="1.6,0.35,1 2.2,0.55,1 2.8,0.35,1" radius=0.07 strength=1
run stroke brush=Inflate points="1.85,-0.3,1" radius=0.3 strength=1
run stroke brush=Clay points="2.45,-0.5,1 2.75,-0.05,1" radius=0.1 strength=1
run stroke brush=Crease invert=true points="1.45,-0.1,1 1.75,-0.65,1" radius=0.05 strength=1
run stroke brush=Standard points="2.0,0.05,1 2.4,0.1,1" radius=0.06 strength=1 invert=true
# The low-poly: a decimated copy of the source with automatic UVs.
run part_duplicate
run part_rename to=Low
run decimate triangles=2000
run uv_auto resolution=2048
expect_value uvs == 1
expect_value triangles <= 2000
expect_value parts == 3
key f

# The Bake sub-palette, with the source picked and three maps ticked.
click "Bake##tool.bake"
expect "Bake/Bake"
expect_text "Onto Low"
click "Bake/##bakesource"
click "Source"
expect_text "Source"
click "Bake/Displacement"
click "Bake/Ambient Occlusion"
shot bake-palette

# Baking runs in the background with a progress bar, then the normal map shows on the low-poly.
click "Bake/Bake"
expect_value bake_running == 1
wait_idle 300
expect_value bake_running == 0
expect_status "Baked normal, displacement, ao at 2048x2048"
expect_status "mid-grey = 0"
expect_value baked_maps == 3
expect_value bake_size == 2048
expect_value bake_files == 4
expect_value normal_map_preview == 1
expect_text "Displacement: mid-grey = 0"
expect_no_text "found no surface"

# Hide the source: the high-poly (left) next to the baked low-poly (right).
run part_visibility name=Source visible=false
expect_value visible_parts == 2
expect_value normal_map_preview == 1
shot high-and-baked-low
# From an angle: the silhouette stays low-poly, the shading carries the sculpted detail.
orbit -110 50
shot baked-low-angle
orbit 110 -50
# The bare low-poly without its normal map, for comparison.
click "Bake/Preview Normal Map"
expect_value normal_map_preview == 0
shot low-without-map
click "Bake/Preview Normal Map"
expect_value normal_map_preview == 1

# Changing the low-poly's UVs retires the preview (the map no longer fits); undo brings it back.
run uv_auto resolution=1024
expect_value normal_map_preview == 0
key ctrl+z
expect_value normal_map_preview == 1

# The bake command (console / scripts) bakes with the same engine and shows its map too.
run bake source=Source maps=normal,cavity size=1024 out=ui-shots/bake/command-maps
expect_status "Baked normal, cavity at 1024x1024"
expect_value baked_maps == 2
expect_value normal_map_preview == 1

# Ctrl-hover help on the new controls, and the commands in the F3 palette.
hold ctrl
hover "Bake/Bake"
expect_help "UVs"
hover "Bake/##bakefront"
expect_help "in front of the low-poly"
hover "Bake/##bakepad"
expect_help "mipmapped"
hover "Bake/Ambient Occlusion"
expect_help "creases"
hold none
key f3
type "##Command palette" "preview normal"
expect_text "Tool > Bake"
key escape