OGLFlatShader (object)

バージョン 1.12.0 で追加.

The OGLFlatShader inherits the OGLInlineShader. It extends the OGLInlineShader for shading with flat colors.

Uniforms

Name Type Description Default
u_color Color The diffuse color Color(1.0, 0.0, 0.0)

Attributes

Name Type Description
positions Vec3 Geometry positions

OGLFlatShader OGLFlatShader OGLFlatShader OGLInlineShader OGLInlineShader OGLFlatShader->OGLInlineShader InlineEntityBase InlineEntityBase OGLInlineShader->InlineEntityBase InlineShader InlineShader OGLInlineShader->InlineShader InlineEntity InlineEntity InlineEntityBase->InlineEntity

/*
** Example: OGLFlatShader
*/

require InlineDrawing;
  
operator entry() {

  InlineDrawing draw = OGLInlineDrawing();
  InlineShader shader = draw.registerShader(OGLFlatShader);
  InlineMaterial mat = shader.getOrCreateMaterial('green');
  mat.setUniform('u_color', Color(0.0, 1.0, 0.0));
  
}

/*
** Output:


*/

Methods

  OGLFlatShader ( in OGLFlatShader other )
  OGLFlatShader ( in String name )
  OGLFlatShader ()
OGLFlatShader clone ? ()

Methods in detail

OGLFlatShader ( in OGLFlatShader other )

copy constructor


OGLFlatShader ( in String name )

default constructor taking a name


OGLFlatShader ()

default constructor


OGLFlatShader OGLFlatShader.clone? ()

clone method