blender-texturing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTexturing
纹理制作
The execution model is in . Material wiring and measured values are in , and bakes are in . This skill authors the surface story: where paint chips, where dirt collects, what's printed on it.
blender-coreblender-pbr-materialsblender-texture-baking执行模型位于 。材质节点连接和测量值位于 ,烘焙流程位于 。本技能用于构建表面叙事:漆面在哪里剥落、污垢在哪里积聚,以及表面印有什么。
blender-coreblender-pbr-materialsblender-texture-bakingOne call each
每次调用示例
scripts/smart_material.py -- --objects Crate --wear 0.5 --grime 0.4 --dust 0.3
scripts/smart_material.py -- --objects Crate --rust 0.6 --under-color 0.3 0.29 0.28 # rusty iron
scripts/smart_material.py -- --objects SM_Crate --wear 0.5 --curvature-map //tex/T_Crate_CURV.png --ao-map //tex/T_Crate_AO.png
scripts/decal.py -- --target Wall --at 0 -0.1 1.5 --image //decals/hazard.png --size 0.4
scripts/smart_material.py -- --objects Crate --remove # exact restorescripts/smart_material.py -- --objects Crate --wear 0.5 --grime 0.4 --dust 0.3
scripts/smart_material.py -- --objects Crate --rust 0.6 --under-color 0.3 0.29 0.28 # rusty iron
scripts/smart_material.py -- --objects SM_Crate --wear 0.5 --curvature-map //tex/T_Crate_CURV.png --ao-map //tex/T_Crate_AO.png
scripts/decal.py -- --target Wall --at 0 -0.1 1.5 --image //decals/hazard.png --size 0.4
scripts/smart_material.py -- --objects Crate --remove # exact restoreHow pros layer a material
专业人员如何叠加材质层
Start with a clean base (correct albedo/roughness, ), then stack from the inside out: base → edge wear → rust → grime → dust. Each layer has a physical cause:
blender-pbr-materials| Layer | Mask (cause) | Look |
|---|---|---|
| Edge wear | convex curvature (edges get hit) + chip noise | reveals the under-material: bare metal, primer, raw wood |
| Rust | cavities and worn edges + blotch noise | orange-brown, metallic 0, roughness ~0.85 |
| Grime | concave curvature + (1 − AO) (dirt collects where it can't be wiped) | dark, rougher, not metallic |
| Dust | world up-facing normal × patch noise (it settles from above) | light, roughness ~0.9 |
| Breakup | fine noise on roughness (±25%) | the cheapest realism win; never ship a flat roughness value |
| Pure curvature looks procedural and even. Always multiply in noise so wear is heavy in some places and absent in others. Less is more: wear 0.2–0.4 reads as "used", and 0.7+ reads as "abandoned". |
从干净的基础层开始(正确的 albedo/roughness,使用 ),然后由内向外依次叠加:基础层 → 边缘磨损 → 锈迹 → 污垢 → 灰尘。每一层都有对应的物理成因:
blender-pbr-materials| 层 | 遮罩(成因) | 外观 |
|---|---|---|
| 边缘磨损 | 凸面曲率(边缘容易受到碰撞)+ 碎屑噪声 | 显露底材:裸金属、底漆、原木 |
| 锈迹 | 凹陷和磨损边缘 + 斑块噪声 | 橙棕色,metallic 0,roughness ~0.85 |
| 污垢 | 凹面曲率 + (1 − AO)(无法擦到的位置会积聚污垢) | 深色、更粗糙、非金属 |
| 灰尘 | 朝上的世界空间法线 × 斑块噪声(灰尘从上方沉降) | 浅色,roughness ~0.9 |
| 打散效果 | 对 roughness 叠加细噪声(±25%) | 最廉价却最有效的真实感提升;绝不要交付完全平坦的 roughness 数值 |
| 纯曲率遮罩看起来程序化且均匀。始终乘入噪声,让磨损在某些位置较重,在另一些位置完全不存在。适可而止:磨损值 0.2–0.4 看起来像“已使用”,而 0.7 以上则像“已废弃”。 |
smart_material.py
smart_material.py
- Inserts one group in front of every Principled BSDF (Base Color, Roughness, Metallic) and records the originals, so
TX_Layersrestores links and values exactly. Re-running updates values in place. All layer amounts stay inputs on the group node, so you can tweak them there.--remove - Curvature, live and portable (Cycles + EEVEE, no bake): the point attribute is the mean elevation of the neighbours within
TX_Curvature(m, default 0.02). It's density-independent: band ≈ edge width. Set the width to roughly the bevel width (1–3 cm on props, 5–10 cm on buildings). Cost: ~1.5 s per 30k verts.--edge-width - It needs mid-poly density (bevels/supports). When the median edge is > 4× the edge width, the result carries a : wear would smear across whole faces. On low-poly game meshes, bake from the high (
note) and passbake_maps.py --high ... --maps normal ao curvature/--curvature-map(loaded as Non-Color, read through--ao-map).--uv - Noise is in object space (= feature size in m), so masks stick to the asset when it moves. Mirrored/linked duplicates share the pattern, so vary
--scaleor the object if that shows.--scale - Colors are sRGB 0–1. Defaults: steel under paint (0.56, 0.57, 0.58, metallic 1, roughness 0.35). For wood under paint, use .
--under-color 0.45 0.32 0.2 --under-metallic 0 --under-roughness 0.7
- 会在每个 Principled BSDF(Base Color、Roughness、Metallic)前插入一个 组,并记录原始设置,因此
TX_Layers可以精确恢复节点连接和数值。重新运行会就地更新数值。所有图层强度都保留为组节点上的输入,可直接在此进行调整。--remove - 曲率实时且可移植(Cycles + EEVEE,无需烘焙):点属性是
TX_Curvature(单位为 m,默认 0.02)范围内相邻顶点的平均高度。它与网格密度无关:过渡带宽度 ≈ edge width。该宽度应大致设为倒角宽度(道具通常为 1–3 cm,建筑通常为 5–10 cm)。成本约为每 3 万个顶点 1.5 秒。--edge-width - 它需要中等面数密度(包含倒角/支撑结构)。当边缘长度中位数 > 4× edge width 时,结果会附带一条 :磨损会扩散并覆盖整个面。对于低多边形游戏网格,应从高模烘焙(
note),然后传入bake_maps.py --high ... --maps normal ao curvature/--curvature-map(以 Non-Color 加载,并通过--ao-map读取)。--uv - 噪声位于对象空间(= 以 m 为单位的特征尺寸),因此资产移动时遮罩会跟随资产。镜像或链接的副本会共享图案;若出现这种情况,请调整
--scale或对象本身。--scale - 颜色采用 sRGB 0–1。默认值:漆面下的钢材(0.56, 0.57, 0.58,metallic 1,roughness 0.35)。对于漆面下的木材,使用 。
--under-color 0.45 0.32 0.2 --under-metallic 0 --under-roughness 0.7
To game engines
导出到游戏引擎
Engines don't run Blender node trees. Bake the result into a texture set: (self-bake, no ). Then and export. Check the result with and a lit .
bake_maps.py -- --low SM_Crate --maps basecolor roughness metallic normal --pack-orm--highbuild_pbr_material.py --texturesblender-asset-qalook游戏引擎不会执行 Blender 节点树。将结果烘焙为纹理集:(自行烘焙,不使用 )。然后运行 并导出。使用 和带光照的 检查结果。
bake_maps.py -- --low SM_Crate --maps basecolor roughness metallic normal --pack-orm--highbuild_pbr_material.py --texturesblender-asset-qalookDecals (decal.py)
贴花(decal.py)
- Places a subdivided plane at the closest surface point to , oriented to the normal and spun by
--at. A Shrinkwrap (project, above surface) keeps it--rotation(2 mm) off the surface. It's parented, has no shadow, uses Dithered alpha, and its height follows the image aspect.--offset - It measures the gap at every triangle like does, and doubles
blender-asset-qa(to 128) until flat triangles stop dipping over convex creases. The result reports--subdiv/gap_min_m. Never place decals at 0 offset: that's guaranteed z-fighting.gap_max_m - Games: mesh decals cost a draw call each and need alpha sorting. Merge decals that share an atlas into one mesh, use engine projectors (UE Decal Actor, Unity URP Decal Projector, Godot ) for dynamic ones, or bake them into the base texture.
Decal
- 在距离 最近的表面点放置一个细分平面,使其朝向法线,并通过
--at旋转。Shrinkwrap(投射模式,位于表面上侧)会使其与表面保持--rotation(2 mm)的间距。它会设置父级、不投射阴影、使用 Dithered alpha,且高度遵循图像宽高比。--offset - 与 一样测量每个三角形处的间隙,并将
blender-asset-qa逐次加倍(最高达到 128),直到平面三角形不再在凸起折痕处向下陷入。结果会报告--subdiv/gap_min_m。切勿以 0 偏移放置贴花:这必然会导致 z-fighting。gap_max_m - 游戏方面:每个网格贴花都会占用一个 draw call,并需要 alpha 排序。将共用同一 atlas 的贴花合并为一个网格;动态贴花可使用引擎投射器(UE Decal Actor、Unity URP Decal Projector、Godot ),也可将其烘焙到基础纹理中。
Decal
Trim sheets, tiling, painting
Trim Sheet、平铺与绘制
Trim sheets, tiling with vertex-color blends, hand/texture painting (5.2 brush assets) and headless pixel writes: references/trims-tiling-painting.md.
Trim Sheet、使用顶点色混合的平铺、手绘/纹理绘制(5.2 笔刷资产)以及无头像素写入:references/trims-tiling-painting.md。
Gotchas
注意事项
- Mask textures (curvature, AO, roughness, ID) must be Non-Color. The script forces it, but hand-made nodes often don't.
- Apply scale before computing curvature or setting . Both are world-sized.
--scale - is mesh data. Applying modifiers or remeshing afterward invalidates it, so re-run after topology changes.
TX_Curvature - Viewport EEVEE vs Cycles: identical masks (no Bevel/Pointiness/AO shader nodes are used, because those are Cycles-only or screen-space).
- 遮罩纹理(曲率、AO、roughness、ID)必须设为 Non-Color。脚本会强制进行此设置,但手工创建的节点通常不会。
- 在计算曲率或设置 前应用缩放。二者都采用世界尺寸。
--scale - 是网格数据。之后应用修改器或重新网格化会使其失效,因此拓扑变化后需要重新运行。
TX_Curvature - 视口 EEVEE 与 Cycles:遮罩完全相同(未使用 Bevel/Pointiness/AO 着色节点,因为它们仅适用于 Cycles 或依赖屏幕空间)。