Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

texture

Textures generated from noise and gradients, the PBR material that consumes them, and textures made on the device from a raster's layers or an author's compute shader.

texture.noise, texture.gradient and material.pbr are defined in proc.ops.textures; texture.from_raster and texture.from_shader are defined in this pack's init.luau. This pack is what puts them in the op registry, so procgen.searchNodes("", { pack = "texture" }) lists the family and procgen.describeNode("op.<id>") describes any one of them.

Ops

  • texture.noise — a noise texture (value or gradient noise) mapped between two colours.
  • texture.gradient — a two-colour gradient texture: horizontal, vertical or radial.
  • texture.from_raster — a texture of a raster's layers, made on the device: up to four layers (layers, in channel order) become the red, green, blue and alpha of one texel per cell. A channel no layer fills is 0, and alpha 1.
  • texture.from_shader — a texture an author's .computeShader draws on the device, one invocation per texel: the shader writes texel i (row-major, x = i % width) of the one buffer it declares read_write with element vec4<f32>. width, height, count (texels), time and frame are filled into its params: when it declares them.
  • material.pbr — a metallic-roughness material. albedo is the base colour, as a Vec4 param or a Texture input.

The textures texture.from_raster and texture.from_shader make stay on the device, where a material samples them with nothing read back.