OGLVertexColorOverlayShader.kl

Types

OGLVertexColorOverlayShader (object)

バージョン 1.12.0 で追加.

The OGLVertexColorOverlayShader is used for rendering surface attributes as a semitransparent colored overlay on top of existing geometry. It offsets the overlay geometry in the -Z space to ensure no z-fighting occurs between the underlying geometry and the overlay.

This shader is often used to display multi-channel maps over the top of geometry in the viewport.

Uniforms

Name Type Description Default
u_light0Position Vec3 Position of the first light Position of the camera
u_light0Color Color Color of the first light Color(1.0, 1.0, 1.0)
u_specularFactor Color Specular distribution factor 16.0
u_normalIsTangent Integer Flag defining normal type 0
u_doubleSided Integer Flag defining backface shading model 0

Attributes

Name Type Description
positions Vec3 Geometry positions
normals Vec3 Geometry normals
vertexColors Color Color per vertex
/*
** Example: OGLVertexColorOverlayShader
*/

require InlineDrawing;
  
operator entry() {

      InlineDrawing draw = OGLInlineDrawing();
      InlineShader shader = draw.registerShader(OGLVertexColorOverlayShader);
      InlineMaterial mat = shader.getOrCreateMaterial('vertexColors');
  
}

/*
** Output:


*/