blender-rendering

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rendering

渲染

The execution model is in
blender-core
. Scene lighting and cameras are in
blender-lighting-lookdev
.
执行模型位于
blender-core
。场景 lighting 和 cameras 位于
blender-lighting-lookdev
。

One call

一键调用

scripts/render_batch.py -- --engine CYCLES --preset final --res 1920 1080 --out //render/hero_#### --frames 1
scripts/render_batch.py -- --preset preview --frames 1-120 --format MP4 --out //render/turntable
scripts/render_batch.py -- --cameras CamA CamB CamC --format EXR_MULTI --out //render/shots/
Presets:
preview
(Cycles 64 spp, threshold 0.05, 50% res; EEVEE 16),
final
(512 spp, 0.01; EEVEE 128 + raytracing),
product
(1024 spp, transparent background). GPU is picked automatically (OptiX > CUDA > HIP > Metal > oneAPI), and the denoiser matches (OptiX or OpenImageDenoise).
scripts/render_batch.py -- --engine CYCLES --preset final --res 1920 1080 --out //render/hero_#### --frames 1
scripts/render_batch.py -- --preset preview --frames 1-120 --format MP4 --out //render/turntable
scripts/render_batch.py -- --cameras CamA CamB CamC --format EXR_MULTI --out //render/shots/
预设:
preview
(Cycles 64 spp、threshold 0.05、50% resolution;EEVEE 16)、
final
(512 spp、0.01;EEVEE 128 + raytracing)、
product
(1024 spp、transparent background)。GPU 会自动选择(OptiX > CUDA > HIP > Metal > oneAPI),denoiser 也会与之匹配(OptiX 或 OpenImageDenoise)。

Engine choice

引擎选择

EngineUseNotes
Cyclesfinal quality, product, archviz, glass/SSS/caustics, bakingpath tracer; set the GPU; adaptive sampling + denoise
EEVEE (5.x, ex-"Next")fast look-dev, stylized, motion graphics, previewsray-traced reflections/GI (
use_raytracing
), virtual shadow maps; needs a GPU even headless
Workbenchplayblasts, clay/matcap reviews, QA sheetsinstant, no lighting accuracy
Engine ids:
CYCLES
,
BLENDER_EEVEE
,
BLENDER_WORKBENCH
.
引擎用途备注
Cycles最终质量、产品渲染、archviz、玻璃/SSS/caustics、bakingpath tracer;设置 GPU;adaptive sampling + denoise
EEVEE(5.x,原名为“Next”)快速 look-dev、stylized、motion graphics、previewsray-traced reflections/GI(
use_raytracing
)、virtual shadow maps;即使在 headless 模式下也需要 GPU
Workbenchplayblasts、clay/matcap reviews、QA sheets即时渲染,不保证 lighting accuracy
引擎 ID:
CYCLES
、
BLENDER_EEVEE
、
BLENDER_WORKBENCH
。

Cycles quality levers (ordered by impact)

Cycles 质量控制项(按影响大小排序)

  1. Adaptive sampling (
    adaptive_threshold
    0.01 final / 0.05 preview) + denoise (OIDN with albedo+normal passes,
    denoising_input_passes="RGB_ALBEDO_NORMAL"
    ). Raising samples alone is the least efficient fix.
  2. Light paths: interiors need diffuse bounces ≥ 4. Product shots: total 12, glossy 4, transmission 8–12 for glass. Clamp indirect 5–10 kills fireflies at a small energy cost.
  3. Light tree (
    use_light_tree
    , on) for many lights. Path guiding (CPU only) for difficult indirect light.
  4. Fewer, larger lights beat many small ones. Emissive meshes are noisier than area lights.
  5. Persistent data (
    render.use_persistent_data
    ) speeds up animations and turntables. Use
    simplify
    (max subdivision, texture limit) for previews.
  6. 5.2: texture cache (
    render.use_texture_cache
    ,
    use_auto_generate_texture_cache
    ) cuts memory in texture-heavy scenes by generating
    .tx
    mip tiles.
  1. Adaptive sampling(
    adaptive_threshold
    final 为 0.01 / preview 为 0.05)+ denoise(OIDN,使用 albedo+normal passes,
    denoising_input_passes="RGB_ALBEDO_NORMAL"
    )。仅提高 samples 是效率最低的修复方式。
  2. Light paths:室内场景需要 diffuse bounces ≥ 4。产品镜头:total 12、glossy 4,glass 使用 transmission 8–12。Clamp Indirect 设为 5–10,可消除 fireflies,且只需付出少量 energy cost。
  3. Light tree(
    use_light_tree
    ,on)适用于大量 lights。Path guiding(仅 CPU)适用于难以处理的 indirect light。
  4. 少量但更大的 lights 优于许多小型 lights。Emissive meshes 比 area lights 产生的 noise 更多。
  5. Persistent data(
    render.use_persistent_data
    )可加快 animations 和 turntables 的渲染。previews 使用
    simplify
    (max subdivision、texture limit)。
  6. 5.2:texture cache(
    render.use_texture_cache
    、
    use_auto_generate_texture_cache
    )可通过生成
    .tx
    mip tiles,降低 texture-heavy scenes 的内存占用。

Color management (decide once per project)

Color management(每个项目只需决定一次)

  • AgX (default): photographic, handles bright highlights. Looks:
    AgX - Punchy
    ,
    - Base Contrast
    ...
  • Khronos PBR Neutral: shows albedo faithfully. Use it for product/e-commerce and asset reviews, and to match three.js
    NeutralToneMapping
    .
  • Standard: graphics/UI/texture output that must match pixel values.
  • ACES 1.3 / 2.0: VFX pipelines (plates, other DCCs).
  • Use exposure (
    view_settings.exposure
    ), not light power, for global brightness tweaks. Display device sRGB, or Display P3 / Rec.2100 for HDR delivery.
  • AgX(默认):摄影级效果,可妥善处理明亮 highlights。Looks:
    AgX - Punchy
    、
    - Base Contrast
    ...
  • Khronos PBR Neutral:忠实呈现 albedo。适用于产品/电商和资产审阅,也可匹配 three.js 的
    NeutralToneMapping
    。
  • Standard:用于必须匹配 pixel values 的 graphics/UI/texture output。
  • ACES 1.3 / 2.0:适用于 VFX pipelines(plates、其他 DCCs)。
  • 全局亮度微调应使用 exposure(
    view_settings.exposure
    ),而不是 light power。显示设备使用 sRGB;交付 HDR 时使用 Display P3 / Rec.2100。

Output formats

输出格式

  • Stills: PNG 8/16-bit (RGBA when the film is transparent) or JPEG for web previews.
  • Comp/VFX: EXR multilayer (
    EXR_MULTI
    , DWAA 16-bit) with passes (Denoising Data, Cryptomatte, AO, Mist, Z). 5.0 renamed passes:
    Diffuse Color
    ,
    Depth
    , etc.
  • Video: render frames first (PNG/EXR), then encode (FFmpeg or the VSE), because a crash mid-MP4 loses everything. Direct MP4 is fine for previews. Set
    image_settings.media_type
    before
    file_format
    (5.0+).
  • Transparent:
    film_transparent=True
    + PNG/EXR. A glass-only alpha needs
    film_transparent_glass
    .
  • 静帧:PNG 8/16-bit(film 透明时使用 RGBA),或使用 JPEG 生成 web previews。
  • Comp/VFX:EXR multilayer(
    EXR_MULTI
    、DWAA 16-bit),包含 passes(Denoising Data、Cryptomatte、AO、Mist、Z)。5.0 将 passes 重命名为
    Diffuse Color
    、
    Depth
    等。
  • 视频:先渲染 frames(PNG/EXR),再进行 encode(FFmpeg 或 VSE),因为 MP4 编码中途崩溃会导致全部内容丢失。previews 可以直接输出 MP4。5.0+ 需在设置
    file_format
    之前设置
    image_settings.media_type
    。
  • 透明输出:
    film_transparent=True
    + PNG/EXR。仅含 glass 的 alpha 需要
    film_transparent_glass
    。

Compositor (5.0+ API)

合成器(Compositor,5.0+ API)

python
ng = bpy.data.node_groups.new("Comp", "CompositorNodeTree"); scene.compositing_node_group = ng
ng.interface.new_socket("Image", in_out="OUTPUT", socket_type="NodeSocketColor")
rl, glare, out = ng.nodes.new("CompositorNodeRLayers"), ng.nodes.new("CompositorNodeGlare"), ng.nodes.new("NodeGroupOutput")
ng.links.new(rl.outputs["Image"], glare.inputs["Image"]); ng.links.new(glare.outputs["Image"], out.inputs[0])
There's no Composite node anymore: the group output is the final image. Many node options are now input sockets (Glare
Type
,
Threshold
,
Strength
), so
--describe
them with
blender-geometry-nodes/scripts/gn_builder.py
. File Output node:
directory
,
file_name
,
file_output_items
.
python
ng = bpy.data.node_groups.new("Comp", "CompositorNodeTree"); scene.compositing_node_group = ng
ng.interface.new_socket("Image", in_out="OUTPUT", socket_type="NodeSocketColor")
rl, glare, out = ng.nodes.new("CompositorNodeRLayers"), ng.nodes.new("CompositorNodeGlare"), ng.nodes.new("NodeGroupOutput")
ng.links.new(rl.outputs["Image"], glare.inputs["Image"]); ng.links.new(glare.outputs["Image"], out.inputs[0])
已不再有 Composite node:group output 即为最终图像。许多 node options 现在都是 input sockets(Glare 的
Type
、
Threshold
、
Strength
),因此可使用
blender-geometry-nodes/scripts/gn_builder.py
的
--describe
对其进行说明。File Output node 的参数:
directory
、
file_name
、
file_output_items
。

CLI rendering (render farms, CI)

CLI 渲染(render farms、CI)

  • blender -b scene.blend -E CYCLES -o //out/frame_#### -F PNG -s 1 -e 120 -a
    renders an animation.
    -f 10
    renders a single frame. Python args go after
    --
    .
  • -- --cycles-device OPTIX
    (or CUDA/HIP/METAL/ONEAPI) selects the device without Python.
  • Split frames across machines with
    -s/-e
    , or with Placeholders + No Overwrite (
    render.use_placeholder
    ,
    use_overwrite=False
    ) on shared storage.
  • blender -b scene.blend -E CYCLES -o //out/frame_#### -F PNG -s 1 -e 120 -a
    渲染 animation。
    -f 10
    渲染单帧。Python args 放在
    --
    之后。
  • -- --cycles-device OPTIX
    (或 CUDA/HIP/METAL/ONEAPI)可在不调用 Python 的情况下选择 device。
  • 可通过
    -s/-e
    将 frames 分配到不同机器,也可以在共享存储上使用 Placeholders + No Overwrite(
    render.use_placeholder
    、
    use_overwrite=False
    )。

Gotchas

常见陷阱

  • scene.render.engine
    enum under-reports (add-on engines). Assign in try/except (the script does).
  • EEVEE in background still needs a GPU context. In CI without a GPU, use Cycles CPU or Workbench.
  • bpy.ops.render.render(write_still=True)
    writes
    render.filepath
    . Without
    write_still
    , the result only lives in
    Render Result
    .
  • Noise in glass/caustics: enable caustics only if needed (
    caustics_refractive
    ), raise transmission bounces, or fake it with Thin Wall (5.2) for windows.
  • Fireflies: clamp indirect, a filter glossy / blur glossy (
    blur_glossy
    0.5–1), and bigger light sources.
  • scene.render.engine
    enum 的报告不完整(可能遗漏 add-on engines)。请在 try/except 中赋值(脚本已这样处理)。
  • EEVEE 在 background 模式下仍需要 GPU context。在没有 GPU 的 CI 环境中,请使用 Cycles CPU 或 Workbench。
  • bpy.ops.render.render(write_still=True)
    会写入
    render.filepath
    。不使用
    write_still
    时,结果只存在于
    Render Result
    中。
  • 玻璃/caustics 中的 noise:仅在需要时启用 caustics(
    caustics_refractive
    ),提高 transmission bounces,或在 windows 中使用 Thin Wall (5.2) 进行模拟。
  • Fireflies:使用 Clamp Indirect、filter glossy / blur glossy(
    blur_glossy
    0.5–1),并采用更大的 light sources。