Skip to content

'isPerspectiveMatrix' : no matching overloaded function found #123

@l2060

Description

@l2060

THREE.WebGLProgram: shader error: 1286 35715 false gl.getProgramInfoLog No compiled vertex shader when at least one graphics shader is attached.
THREE.WebGLShader: gl.getShaderInfoLog() vertex
ERROR: 0:144: 'isPerspectiveMatrix' : no matching overloaded function found
1: #version 300 es
2:
3: #define attribute in
4: #define varying out
5: #define texture2D texture
6: precision highp float;
7: precision highp int;
8: #define HIGH_PRECISION
9: #define SHADER_NAME MeshLineMaterial
10: #define VERTEX_TEXTURES
11: #define GAMMA_FACTOR 2
12: #define MAX_BONES 0
13: #define BONE_TEXTURE
14: #define DOUBLE_SIDED
15: #define USE_LOGDEPTHBUF
16: #define USE_LOGDEPTHBUF_EXT
17: uniform mat4 modelMatrix;
18: uniform mat4 modelViewMatrix;
19: uniform mat4 projectionMatrix;
20: uniform mat4 viewMatrix;
21: uniform mat3 normalMatrix;
22: uniform vec3 cameraPosition;
23: uniform bool isOrthographic;
24: #ifdef USE_INSTANCING
25: attribute mat4 instanceMatrix;
26: #endif
27: attribute vec3 position;
28: attribute vec3 normal;
29: attribute vec2 uv;
30: #ifdef USE_TANGENT
31: attribute vec4 tangent;
32: #endif
33: #ifdef USE_COLOR
34: attribute vec3 color;
35: #endif
36: #ifdef USE_MORPHTARGETS
37: attribute vec3 morphTarget0;
38: attribute vec3 morphTarget1;
39: attribute vec3 morphTarget2;
40: attribute vec3 morphTarget3;
41: #ifdef USE_MORPHNORMALS
42: attribute vec3 morphNormal0;
43: attribute vec3 morphNormal1;
44: attribute vec3 morphNormal2;
45: attribute vec3 morphNormal3;
46: #else
47: attribute vec3 morphTarget4;
48: attribute vec3 morphTarget5;
49: attribute vec3 morphTarget6;
50: attribute vec3 morphTarget7;
51: #endif
52: #endif
53: #ifdef USE_SKINNING
54: attribute vec4 skinIndex;
55: attribute vec4 skinWeight;
56: #endif
57:
58:
59: #ifdef USE_LOGDEPTHBUF
60: #ifdef USE_LOGDEPTHBUF_EXT
61: varying float vFragDepth;
62: varying float vIsPerspective;
63: #else
64: uniform float logDepthBufFC;
65: #endif
66: #endif
67: #ifdef USE_FOG
68: varying float fogDepth;
69: #endif
70:
71: attribute vec3 previous;
72: attribute vec3 next;
73: attribute float side;
74: attribute float width;
75: attribute float counters;
76:
77: uniform vec2 resolution;
78: uniform float lineWidth;
79: uniform vec3 color;
80: uniform float opacity;
81: uniform float sizeAttenuation;
82:
83: varying vec2 vUV;
84: varying vec4 vColor;
85: varying float vCounters;
86:
87: vec2 fix( vec4 i, float aspect ) {
88:
89: vec2 res = i.xy / i.w;
90: res.x *= aspect;
91: vCounters = counters;
92: return res;
93:
94: }
95:
96: void main() {
97:
98: float aspect = resolution.x / resolution.y;
99:
100: vColor = vec4( color, opacity );
101: vUV = uv;
102:
103: mat4 m = projectionMatrix * modelViewMatrix;
104: vec4 finalPosition = m * vec4( position, 1.0 );
105: vec4 prevPos = m * vec4( previous, 1.0 );
106: vec4 nextPos = m * vec4( next, 1.0 );
107:
108: vec2 currentP = fix( finalPosition, aspect );
109: vec2 prevP = fix( prevPos, aspect );
110: vec2 nextP = fix( nextPos, aspect );
111:
112: float w = lineWidth * width;
113:
114: vec2 dir;
115: if( nextP == currentP ) dir = normalize( currentP - prevP );
116: else if( prevP == currentP ) dir = normalize( nextP - currentP );
117: else {
118: vec2 dir1 = normalize( currentP - prevP );
119: vec2 dir2 = normalize( nextP - currentP );
120: dir = normalize( dir1 + dir2 );
121:
122: vec2 perp = vec2( -dir1.y, dir1.x );
123: vec2 miter = vec2( -dir.y, dir.x );
124: //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );
125:
126: }
127:
128: //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;
129: vec4 normal = vec4( -dir.y, dir.x, 0., 1. );
130: normal.xy *= .5 * w;
131: normal *= projectionMatrix;
132: if( sizeAttenuation == 0. ) {
133: normal.xy *= finalPosition.w;
134: normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;
135: }
136:
137: finalPosition.xy += normal.xy * side;
138:
139: gl_Position = finalPosition;
140:
141: #ifdef USE_LOGDEPTHBUF
142: #ifdef USE_LOGDEPTHBUF_EXT
143: vFragDepth = 1.0 + gl_Position.w;
144: vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
145: #else
146: if ( isPerspectiveMatrix( projectionMatrix ) ) {
147: gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
148: gl_Position.z *= gl_Position.w;
149: }
150: #endif
151: #endif
152: vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
153: #ifdef USE_FOG
154: fogDepth = - mvPosition.z;
155: #endif
156: }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions