LoadShader

Family: 3D · 2 forms

What it does

LoadShader writes to a 3D object: it loads rather than reads. It takes vertexFile (a string) and pixelFile (a string), and answers an integer. That is the first of 2 forms.

Syntax

1
LoadShader(vertexFile string, pixelFile string) → integer
2
LoadShader(shaderID integer, vertexFile string, pixelFile string)

Parameters

NameTypeIn forms
vertexFilestringall
pixelFilestringall
shaderIDinteger2

What each form returns

1shader = LoadShader("assets/model.obj", "assets/model.obj")integer
2LoadShader(1, "assets/model.obj", "assets/model.obj")nothing

Example · generated

Form 1, the command hands back the id

shader = LoadShader("assets/model.obj", "assets/model.obj")DO  Sync()LOOP

Form 2, you choose the id yourself

LoadShader(1, "assets/model.obj", "assets/model.obj")DO  Sync()LOOP

LoadShader is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

286 commands in 3D