layer-textures

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Layer Textures

Layer 纹理

Overview

概述

A texture is not an image of a surface. It is an image whose left edge continues into its right edge and whose top continues into its bottom, so that a plane tiled with it shows no seam. A model will not do this unless the run asks for it.
The mandatory step is the capability filter:
list_base_models
with
filter.capabilities: {tileability: true}
. Note the shape:
capabilities
is an object of booleans, not a list of names. A model without it produces a picture of stone that seams visibly the moment it repeats, and no editing pass fixes that afterwards. Everything else on this page is secondary to getting that filter right.
Generation mechanics are in the
layer
skill. If a sibling skill named here is missing from your available skills, ask the user to install it (
npx skills add layerai/skills --skill <name>
); unattended, proceed from tool schemas and flag the gap.
纹理并不是某个表面的普通图像。它是一张左侧边缘能够衔接右侧边缘、顶部能够衔接底部的图像,因此用它平铺出的平面不会出现接缝。除非在生成时明确提出要求,否则模型不会自动做到这一点。
强制步骤是使用能力过滤器:调用
list_base_models
,并设置
filter.capabilities: {tileability: true}
。注意其结构:
capabilities
是一个由布尔值组成的对象,而不是名称列表。如果模型不具备该能力,生成的石块图片一旦重复就会出现明显接缝,事后任何编辑都无法修复。本页中的其他所有内容,都排在正确设置此过滤器之后。
生成机制的相关内容见
layer
skill。如果这里提到的某个同级 skill 未包含在你的可用 skills 中,请让用户安装(
npx skills add layerai/skills --skill <name>
);如果处于无人值守状态,则根据 tool schemas 继续执行,并报告这一缺失项。

State the scale

明确尺度

Scale is what separates a usable texture from an unusable one, and it is the most commonly omitted field. Say how much real-world surface the tile covers: "a 2-metre square of cobblestone, roughly twenty stones across" is a texture. "Cobblestone" could be one boulder or a city square, and the model will pick.
Anchor it to the feature rather than the tile: "individual planks about 15cm wide", "grass blades roughly 5cm", "brick courses at standard size". The engine will scale the material, but only if the density inside the tile is right to begin with.
尺度是可用纹理与不可用纹理之间的区别,也是最常被省略的字段。说明一个平铺单元覆盖多大的真实世界表面:“一块约 2 米见方的鹅卵石区域,横向大约有二十块石头”,这才是一张纹理的完整描述。“鹅卵石”可能指一块巨石,也可能指一个城市广场,模型会自行判断。
将尺度锚定到具体特征,而不是整个平铺单元:“单块木板宽约 15cm”,“草叶高约 5cm”,“砖砌层采用标准尺寸”。引擎会对材质进行缩放,但前提是平铺单元内部的密度一开始就正确。

Flat light, no hero features

均匀平光,不要醒目的主特征

Two prompt clauses do most of the remaining work:
  • Even, diffuse, flat lighting, no directional shadows. Baked-in shadow is the second-biggest defect after seams. A texture lit from the upper left looks wrong everywhere the engine's light is not upper left, and it cannot be removed later.
  • Uniform distribution, no focal point, no single distinguishing feature. Generative models like to compose, so they will place one dramatic cracked stone in the middle. Tiled across a floor, that crack becomes a grid of identical cracks and is the thing every player notices.
Ask for consistent variation instead: "evenly distributed wear and colour variation across the whole tile, no single dominant feature."
以下两个提示词分句可以完成剩余的大部分工作:
  • 均匀、漫射、平坦的光照,不要方向性阴影。 烘焙阴影是仅次于接缝的第二大缺陷。从左上方打光的纹理,在引擎光照并非来自左上方的地方就会显得不对,而且之后无法移除。
  • 均匀分布,不要视觉焦点,不要单一显著特征。 生成式模型喜欢进行构图,因此会把一块带裂痕的醒目石头放在中央。将其平铺在地面上后,这条裂缝会变成一格格相同的裂缝,也正是每位玩家都会注意到的元素。
改为要求一致且均匀的变化:“整块平铺单元上的磨损和颜色变化均匀分布,不要单一主导特征。”

Judging the result

判断结果

Do not judge a texture by looking at the tile. Judge it tiled. Check the four edges continue into each other, then check a 3x3 repeat for a motif that has become a pattern. A tile that looks excellent alone and shows an obvious rhythm at 3x3 is a failed tile.
If the seam is right but a feature repeats too visibly, the fix is usually a rerun with stronger uniformity language rather than an edit, since removing the feature locally reintroduces a seam.
不要只看着单个平铺单元来判断纹理,而要在平铺状态下判断。检查四条边能否首尾衔接,然后在 3x3 重复中检查纹样是否已经形成明显的重复规律。单独看非常出色、但放到 3x3 重复后出现明显节奏感的平铺单元,就是失败。
如果接缝没有问题,但某个特征重复得过于明显,通常应使用更强烈的均匀性表述重新生成,而不是进行编辑,因为局部移除该特征会重新引入接缝。

Material maps

材质贴图

A texture for a lit engine scene usually needs more than colour. Where a model declares PBR or material outputs, take them in the same run rather than deriving normals from the colour map afterwards, which produces flat-looking surfaces.
get_base_model
is the authority on what a given model returns.
Pixel-art tiles carry these rules plus their own: see
layer-pixel-art
.
引擎场景中受光照的纹理通常不能只有颜色信息。如果模型声明支持 PBR 或提供 material outputs,应在同一次运行中一并获取,而不要事后从 colour map 推导 normal maps,否则表面会显得扁平。
get_base_model
是判断特定模型会返回哪些输出的权威依据。
Pixel-art 纹理既要遵循这些规则,也要遵循其专属规则:参见
layer-pixel-art
。

Worked example

实例

"A seamless mossy stone floor for our dungeon."
  1. list_base_models
    with
    filter.use_case: "text_to_image"
    and
    filter.capabilities: {tileability: true, square: true}
    . Take the first result. Without
    tileability
    this run is wasted.
  2. get_base_model
    , to see whether it exposes a tiling parameter that must also be set, and what material outputs it offers.
  3. Prompt: "Seamless tileable texture of worn dungeon flagstones with moss in the joints, covering roughly 2 metres square with about eight stones across. Even diffuse flat lighting, no directional shadows, no cast shadows. Uniform distribution of wear and moss across the whole tile, no focal point, no single dominant crack or feature. Top-down orthographic view."
  4. Estimate, then execute with
    batch_size: 4
    so there are options.
  5. Judge each candidate at a 3x3 repeat before choosing.
“为我们地牢设计一块无缝的长满苔藓的石质地板。”
  1. 使用
    filter.use_case: "text_to_image"
    和
    filter.capabilities: {tileability: true, square: true}
    调用
    list_base_models
    。取第一个结果。如果没有
    tileability
    ,这次运行就白费了。
  2. 调用
    get_base_model
    ,查看它是否提供必须一并设置的平铺参数,以及它提供哪些材质输出。
  3. 提示词:“用于我们地牢的无缝可平铺纹理,表现为缝隙中长有苔藓的磨损石板,覆盖约 2 米见方,横向大约有八块石板。均匀、漫射、平坦的光照,不要方向性阴影,不要投射阴影。整块平铺单元上的磨损和苔藓均匀分布,不要视觉焦点,不要单一主导裂缝或特征。俯视正交视图。”
  4. 先进行估算,然后使用
    batch_size: 4
    执行,以获得多个备选结果。
  5. 选择前,在 3x3 重复状态下逐一评估每个候选结果。

Common mistakes

常见错误

  • Skipping the
    tileability
    filter, which no later step can compensate for.
  • Omitting scale, so the tile is one enormous stone or a thousand tiny ones.
  • Accepting directional lighting baked into the tile.
  • A dramatic hero feature that becomes a visible grid when repeated.
  • Judging the tile on its own rather than tiled at 3x3.
  • Deriving normal maps from the colour map when the model could return them directly.
  • Requesting a perspective view of a surface instead of a top-down orthographic one.
  • 跳过
    tileability
    过滤器,而后续任何步骤都无法弥补这一问题。
  • 省略尺度,导致平铺单元变成一块巨大的石头或一千块微小的石头。
  • 接受烘焙在平铺纹理中的方向性光照。
  • 设置过于醒目的主特征,使其在重复后变成可见的网格。
  • 单独判断平铺单元,而不是在 3x3 重复状态下判断。
  • 在模型本可直接返回 normal maps 时,却从 colour map 推导 normal maps。
  • 请求使用透视视图呈现表面,而不是俯视正交视图。