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) → integer2
LoadShader(shaderID integer, vertexFile string, pixelFile string)Parameters
| Name | Type | In forms |
|---|---|---|
| vertexFile | string | all |
| pixelFile | string | all |
| shaderID | integer | 2 |
What each form returns
| 1 | shader = LoadShader("assets/model.obj", "assets/model.obj") | integer |
| 2 | LoadShader(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()LOOPForm 2, you choose the id yourself
LoadShader(1, "assets/model.obj", "assets/model.obj")DO Sync()LOOPLoadShader 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.