OGLFlatTextureShader.kl

Types

OGLFlatTextureShader (object)

バージョン 1.12.0 で追加.

The OGLFlatTextureShader inherits the OGLInlineShader. It extends the OGLInlineShader for shading a texture.

Uniforms

Name Type Description Default
u_texture Texture Texture used for diffuse color null
u_mirrorU Integer Flag for flipping the image along U 0
u_mirrorV Integer Flag for flipping the image along V 1
u_discardAlpha Integer Flag to discard 0.0 alpha pixels 0
u_postMultiply Integer Flag to compensate for premultiplied alpha 0

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:


*/