Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/wellbores/Shader"

Index

Type aliases

vec3

vec3: [number, number, number]

Variables

Const wellboreFragmentShader

wellboreFragmentShader: "precision mediump float;varying vec4 vCol;varying float type;uniform vec3 wellboreColor1;uniform vec3 wellboreColor2;uniform bool completionVisible;uniform bool active;uniform bool ghost;uniform float dashSize;void main() {if (!active) {if (!ghost) discard;gl_FragColor = vec4(0.0, 0.0, 0.0, 0.025);return;}if (completionVisible && type == 1.0) {if(mod(vCol.x, dashSize * 2.0) > dashSize) discard;}if (!completionVisible && type == 2.0) discard;float dist = clamp(vCol.z * vCol.z + vCol.w * vCol.w, 0.0, 1.0);vec3 dir3D = vec3(vCol.zw, sqrt(1.0 - dist * dist));vec3 sunDir = normalize(vec3(1.0, -1.0, 0.75));float light = dot(dir3D, sunDir);light = 0.4 + light * 0.6;vec3 col = mix(wellboreColor2, wellboreColor1, clamp(light, 0.0, 1.0));gl_FragColor = vec4(col, 1.0);}" = `precision mediump float;varying vec4 vCol;varying float type;uniform vec3 wellboreColor1;uniform vec3 wellboreColor2;uniform bool completionVisible;uniform bool active;uniform bool ghost;uniform float dashSize;void main() {if (!active) {if (!ghost) discard;gl_FragColor = vec4(0.0, 0.0, 0.0, 0.025);return;}if (completionVisible && type == 1.0) {if(mod(vCol.x, dashSize * 2.0) > dashSize) discard;}if (!completionVisible && type == 2.0) discard;float dist = clamp(vCol.z * vCol.z + vCol.w * vCol.w, 0.0, 1.0);vec3 dir3D = vec3(vCol.zw, sqrt(1.0 - dist * dist));vec3 sunDir = normalize(vec3(1.0, -1.0, 0.75));float light = dot(dir3D, sunDir);light = 0.4 + light * 0.6;vec3 col = mix(wellboreColor2, wellboreColor1, clamp(light, 0.0, 1.0));gl_FragColor = vec4(col, 1.0);}`

Const wellboreVertexShader

wellboreVertexShader: "attribute vec2 verts;attribute vec4 vertCol;attribute float typeData;uniform mat3 translationMatrix;uniform mat3 projectionMatrix;varying vec4 vCol;varying float type;void main() {vCol = vertCol;type = typeData;gl_Position = vec4((projectionMatrix * translationMatrix * vec3(verts, 1.0)).xy, 0.0, 1.0);}" = `attribute vec2 verts;attribute vec4 vertCol;attribute float typeData;uniform mat3 translationMatrix;uniform mat3 projectionMatrix;varying vec4 vCol;varying float type;void main() {vCol = vertCol;type = typeData;gl_Position = vec4((projectionMatrix * translationMatrix * vec3(verts, 1.0)).xy, 0.0, 1.0);}`

Functions

getCircleShader

  • getCircleShader(): Shader

getWellboreShader

  • getWellboreShader(color: Color, completionVisible: boolean, wellboreWidth: number): Shader
  • Get shader for wellbore.

    Parameters

    • color: Color

      Color used for wellbore

    • completionVisible: boolean
    • wellboreWidth: number

      Width of wellbore

    Returns Shader

    PIXI shader

toShader

  • toShader(n: number): string
  • Stringify number for shader. If whole number, ensure one decimal slot.

    Parameters

    • n: number

    Returns string

Generated using TypeDoc