1 /** 2 * @class shader 3 * @description 4 * Allows you to specify rendering programs usually on your GPU. 5 * 6 * Shaders are programs compiled and run during runtime to process graphics data. On 7 * backends that support them, they will usually run on dedicated hardware. 8 * Since the actual source language of the Shader depends on the Renderer backend, 9 * The rules and behavior of how the shader source will vary greatly. 10 * 11 * For the stock OpenGL backend, the shader language will be a variant of GLSL. 12 * 13 */ 14 function shader() { 15 16 /** 17 * Adds a stage to the shader program. 18 * If the stage already exists and the program has not been compiled succesfully, 19 * this call replaces the old source with this source. 20 * @param {Number} stage See {@link sandboxe.shader.stage} 21 * @param {String} shader data 22 */ 23 this.addStage = function(){}; 24 25 /** 26 * Finalizes the programs stages. After this call, 27 * the status property will either contain success, meaning the program is now usable, 28 * or invalid, meaning compilation failed. In the case of failure, 29 * the log property may contain more information as to why the compilation failed. 30 */ 31 this.compile = function(){}; 32 33 34 35 36 37 38 /** 39 * Returns any additional logging information from the shader program. 40 * If the status Invalid, typically the log will contain information on why. 41 * @type {String} 42 */ 43 this.log = ""; 44 45 /** 46 * Returns the current program status. 47 * See {@link sandboxe.shader.status} 48 * @type {Number} 49 */ 50 this.status = 0.5; 51 52 /** 53 * Returns a string containing the shader language used by shading programs. This 54 * is dependent on the parameters of the renderer used by / compiled with sandboxe. 55 * @type {String} 56 */ 57 this.shaderLanguage = ""; 58 59 60 return this; 61 }