Difference between revisions of "Shader"
Line 12: | Line 12: | ||
The new shader API allows to replace the default shader used by Gideros with a custom one, on a sprite per sprite basis. As with most of Gideros API’s this one is straight-forward: create a Shader object and assign it to one or several sprites. | The new shader API allows to replace the default shader used by Gideros with a custom one, on a sprite per sprite basis. As with most of Gideros API’s this one is straight-forward: create a Shader object and assign it to one or several sprites. | ||
− | That said, since Gideros will use your shader as if it was the standard one, you will have to make sure that your custom shader is compatible with the standard one, which essentially means that it takes the same input parameters.{|- | + | That said, since Gideros will use your shader as if it was the standard one, you will have to make sure that your custom shader is compatible with the standard one, which essentially means that it takes the same input parameters. |
+ | {|- | ||
| style="width: 50%;"| | | style="width: 50%;"| | ||
=== Methods === | === Methods === |
Revision as of 10:05, 23 August 2018
Supported platforms:
Available since: Gideros 2015.06.30
Description
Gideros internally uses five distinct shaders: - the ‘Basic’ shader handle shapes with a constant color - the ‘Color’ shader handle shapes with per-vertex colors (mostly used by Mesh sprite) - the ‘Texture’ shader handle textured shapes (Bitmaps) - the ‘TextureColor’ shader handle textured and per-vertex colored shapes - and the ‘Particle’ shader deals with Box2D particle systems
The new shader API allows to replace the default shader used by Gideros with a custom one, on a sprite per sprite basis. As with most of Gideros API’s this one is straight-forward: create a Shader object and assign it to one or several sprites.
That said, since Gideros will use your shader as if it was the standard one, you will have to make sure that your custom shader is compatible with the standard one, which essentially means that it takes the same input parameters.
MethodsShader.new - create new shader |
EventsConstantsShader.CFLOAT |