OGLSurfaceOverlayShader.kl

Types

OGLSurfaceOverlayShader (object)

バージョン 1.12.0 で追加.

The OGLSurfaceOverlayShader 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 paintable weightmaps over the top of geometry in the viewport.

Uniforms

Name Type Description Default
u_color Color Color of the map drawn Color(1.0, 0.0, 0.0)
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_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
weightMap Scalar Geometry attribute being used to color the surface.
/*
** Example: OGLSurfaceOverlayShader
*/

require InlineDrawing;
  
operator entry() {

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

/*
** Output:


*/

Methods

  OGLSurfaceOverlayShader ( in OGLSurfaceOverlayShader other )
  OGLSurfaceOverlayShader ( in String name )
  OGLSurfaceOverlayShader ( in String name, in String weightMapName )
  OGLSurfaceOverlayShader ()
OGLSurfaceOverlayShader clone ? ()
  init ! ( in String name, in String weightMapName )