OGLLinesShader.kl¶
Types¶
OGLLinesShader (object)¶
バージョン 1.12.0 で追加.
The OGLLinesShader inherits the OGLInlineShader. It extends the OGLInlineShader for shading with a specialized lines shading model..
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_ambientColor | Color | Ambient color component | Color(0.05, 0.05, 0.05) |
u_rootColor | Color | Color at the start of each line (ratio == 0.0) | Color(0.1, 0.1, 0.1) |
u_tipColor | Color | Color at the end of each line (ratio == 1.0) | Color(1.0, 1.0, 1.0) |
u_specularColor | Color | Specular color component | Color(0.2, 0.2, 0.2) |
u_specularFactor | Color | Specular distribution factor | 16.0 |
u_normalIsTangent | Integer | Flag defining normal type | 0 |
u_shadingAmount | Scalar | 0.0 to 1.0 defining how much shading to apply | 1.0 |
u_vertexColorAmount | Scalar | 0.0 to 1.0 defining how much to use vertexcolor | 1.0 |
Attributes¶
Name | Type | Description |
---|---|---|
positions | Vec3 | Geometry positions |
normals | Vec3 | Geometry normals |
vertexColors | Color | Color per vertex |
ratios | Scalar | 0.0 to 1.0 along each line |
/*
** Example: OGLLinesShader
*/
require InlineDrawing;
operator entry() {
InlineDrawing draw = OGLInlineDrawing();
InlineShader shader = draw.registerShader(OGLLinesShader);
InlineMaterial mat = shader.getOrCreateMaterial('blueLines');
mat.setUniform('u_rootColor', Color(0.0, 1.0, 0.0));
mat.setUniform('u_tipColor', Color(0.6, 1.0, 0.6));
}
/*
** Output:
*/
Methods¶
OGLLinesShader ( in OGLLinesShader other ) | |
OGLLinesShader ( in String name ) | |
OGLLinesShader () | |
OGLLinesShader | clone ? () |