feat: actors stage 1
This commit is contained in:
parent
bd88d3cbd6
commit
4869db01e5
5 changed files with 112 additions and 60 deletions
12
engine/render/Material.ts
Normal file
12
engine/render/Material.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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 }
|
||||
Loading…
Add table
Add a link
Reference in a new issue