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.

OGLSurfaceOverlayShader OGLSurfaceOverlayShader OGLSurfaceOverlayShader OGLSurfaceShader OGLSurfaceShader OGLSurfaceOverlayShader->OGLSurfaceShader OGLInlineShader OGLInlineShader OGLSurfaceShader->OGLInlineShader InlineEntityBase InlineEntityBase OGLInlineShader->InlineEntityBase InlineShader InlineShader OGLInlineShader->InlineShader InlineEntity InlineEntity InlineEntityBase->InlineEntity OGLVertexColorOverlayShader OGLVertexColorOverlayShader OGLVertexColorOverlayShader->OGLSurfaceOverlayShader

/*
** 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 )

Methods in detail

OGLSurfaceOverlayShader ( in OGLSurfaceOverlayShader other )

copy constructor


OGLSurfaceOverlayShader ( in String name )

default constructor taking a name


OGLSurfaceOverlayShader ( in String name, in String weightMapName )

default constructor taking a name and weightmap name.


OGLSurfaceOverlayShader ()

default constructor


OGLSurfaceOverlayShader OGLSurfaceOverlayShader.clone? ()

clone method


OGLSurfaceOverlayShader.init! ( in String name, in String weightMapName )

Initialize the shader using a name and weightmap name.