texture operation

Synopsis

  • texture (texturePath)

Parameters

  1. texturePath—string
    Name of the texture file to insert. See asset search for information about search locations and built-in assets for a list of built-in textures. Supported image formats are listed in texturing essentials.

Description

The texture operation uses the file specified in the texturePath to texture the current shape (colormap channel). The "texture" command is the simplified version of "set(material.colormap,..)". The "texture" command does not create texture coordinates.

Related

Examples

brickMap = "assets/bricks.jpg"
randBuildingHeight = rand(3,20)

Lot -->
s('.75,'1,'.75)
center(xz)
extrude(world.up, randBuildingHeight)
comp(f) {side : Facade 
        | top : set(material.color.a, .3) 
                Roof.}

Facade -->
	# color, uv set 0
	setupProjection(0, scope.xy, 5, 5)
	texture(brickMap)
	// = set(material.colormap,brickMap)
	projectUV(0)
Shapes with brick texture

In this topic