meat/engine/render/Material.ts
2026-08-07 16:58:24 +02:00

12 lines
646 B
TypeScript

import type { Texture } from "./Texture"
import type { Mesh } from "../scene/Mesh"
/** How a surface is drawn: which texture, and whether back-faces are culled.
* (Alpha-cutout is global in the `Rasterizer`.) A `Material` is shared by every
* draw that uses it, so the renderer no longer needs to know content by name. */
export type Material = { texture: Texture; cull: boolean }
/** A baked mesh paired with the material it draws with. A chunk (or any baked
* batch) is just a list of these, so adding a new surface/texture is data, not a
* new branch in the render loop. */
export type DrawGroup = { mesh: Mesh; material: Material }