OGLFlatTextureShader (object)
The OGLFlatTextureShader inherits the OGLInlineShader. It extends the OGLInlineShader for shading a texture.
Attributes
Name |
Type |
Description |
positions |
Vec3 |
Geometry positions |
uvs0 |
Vec2 |
UV set, encoding U and V in X and Y |
/*
** Example: OGLFlatTextureShader
*/
require InlineDrawing;
operator entry() {
InlineDrawing draw = OGLInlineDrawing();
InlineShader shader = draw.registerShader(OGLFlatTextureShader);
InlineMaterial mat = shader.getOrCreateMaterial('texturedMat');
InlineTexture texture = draw.registerTexture(InlineFileBasedTexture('texture.png'));
mat.setUniform('u_texture', texture);
mat.setUniform('u_mirrorU', 1);
}
/*
** Output:
*/