[scripting] Support shaders in scripted effects
The scripting API is extended to support custom fragment shaders. To support this a new method addFragmentShader is added taking ShaderTraits and fragment shader. The GLShader is not exposed, instead a uint id is provided which maps to the GLShader. This shader id can be used in the animate and set calls to specify the shader. The animation object is extended by the "fragmentShader" property. The shader sources are located in the "shaders" directory of the package contents. E.g. the scale effect extended by the shader of the invert effect will have the following layout: package/contents/ -> code/ -> main.js -> shaders/ -> invert_core.frag -> invert.frag The adjustment in code are: * in constructor to load the shader this.shader = effect.addFragmentShader(Effect.MapTexture, "invert.frag"); * in animations objects of the slots the additions fragmentShader: this.shader * using the type Effect.Shader or in full: w...
Please register or sign in to comment