OGLWireFrameShader (object)

バージョン 1.12.0 で追加.

The OGLWireFrameShader inherits the OGLInlineShader. It encapsulates any other InlineShader (interface), while setting the polygon mode to lines.

OGLWireFrameShader OGLWireFrameShader OGLWireFrameShader OGLInlineShader OGLInlineShader OGLWireFrameShader->OGLInlineShader InlineEntityBase InlineEntityBase OGLInlineShader->InlineEntityBase InlineShader InlineShader OGLInlineShader->InlineShader InlineEntity InlineEntity InlineEntityBase->InlineEntity

/*
** Example: OGLWireFrameShader
*/

require InlineDrawing;
  
operator entry() {

  InlineDrawing draw = OGLInlineDrawing();
  OGLWireFrameShader shader = draw.registerShader(OGLWireFrameShader('wireframe', OGLSurfaceShader()));
  shader.setPolygonOffset(-1.0); // draw as overlay
  InlineMaterial mat = shader.getOrCreateMaterial('blue');
  mat.setUniform('u_diffuseColor', Color(0.0, 0.0, 1.0));
  
}

/*
** Output:


*/

Methods

  OGLWireFrameShader ( in OGLInlineShader shader )
  OGLWireFrameShader ( in OGLWireFrameShader other )
  OGLWireFrameShader ( in String name, in OGLInlineShader shader )
  OGLWireFrameShader ()
Boolean bindUniformToLocation ! ( io DrawContext context, in InlineUniform uniform, in Integer location )
OGLWireFrameShader clone ? ()
  defineAttribute ! ( in String name, in String attributeType )
  defineUniform ! ( in InlineUniform uniform )
Size getAttributeCount ? ()
Integer getAttributeID ? ( in String name )
String getAttributeName ? ( in Index index )
String getAttributeType ? ( in Index index )
InlineMaterial getMaterial ? ( in Index index )
Size getMaterialCount ? ()
String getName ? ()
InlineMaterial getOrCreateMaterial ! ( in String name )
Boolean hasAttribute ? ( in String name )
Boolean hasMaterial ? ( in String name )
Boolean hasUniform ? ( in String name )
  init ! ( in String name, in OGLInlineShader shader )
  setPolygonOffset ! ( in Scalar offset )
  setUniform ! ( in InlineUniform uniform )
  setWireFrame ! ( in Boolean enabled )

Methods in detail

OGLWireFrameShader ( in OGLInlineShader shader )

default constructor


OGLWireFrameShader ( in OGLWireFrameShader other )

copy constructor


OGLWireFrameShader ( in String name, in OGLInlineShader shader )

default constructor taking a name


OGLWireFrameShader ()

default constructor


Boolean OGLWireFrameShader.bindUniformToLocation! ( io DrawContext context, in InlineUniform uniform, in Integer location )

draws a uniform for the shader, applies the value essentially. this particular method avoid the lookup of the location by name and draws the uniform directly


OGLWireFrameShader OGLWireFrameShader.clone? ()

clone method


OGLWireFrameShader.defineAttribute! ( in String name, in String attributeType )

define a surface attribute with a given name and type


OGLWireFrameShader.defineUniform! ( in InlineUniform uniform )

define a new uniform on the shader. the uniformType is auxiliary and can be used within the shader later if required.


Size OGLWireFrameShader.getAttributeCount? ()

returns the number of attributes


Integer OGLWireFrameShader.getAttributeID? ( in String name )

returns true if this shader has an attribute with a given name


String OGLWireFrameShader.getAttributeName? ( in Index index )

returns the name of an attribute


String OGLWireFrameShader.getAttributeType? ( in Index index )

returns the type of an attribute


InlineMaterial OGLWireFrameShader.getMaterial? ( in Index index )

returns an existing material by index


Size OGLWireFrameShader.getMaterialCount? ()

returns the number of materials in this shader


String OGLWireFrameShader.getName? ()

returns the name of this shader


InlineMaterial OGLWireFrameShader.getOrCreateMaterial! ( in String name )

returns (and eventually creates) a new matching material with a given name


Boolean OGLWireFrameShader.hasAttribute? ( in String name )

returns the ID / location of a given attribute inside the shader.


Boolean OGLWireFrameShader.hasMaterial? ( in String name )

returns true if this shader has a material with a given name


Boolean OGLWireFrameShader.hasUniform? ( in String name )

returns true if this shader has a uniform with a given name


OGLWireFrameShader.init! ( in String name, in OGLInlineShader shader )


OGLWireFrameShader.setPolygonOffset! ( in Scalar offset )

sets the polygonoffset (0.0 disables)


OGLWireFrameShader.setUniform! ( in InlineUniform uniform )

sets the global value of a uniform this can be changed per material, per instance or even per transform


OGLWireFrameShader.setWireFrame! ( in Boolean enabled )

sets the wireframe option on the shader