Last active
August 29, 2015 14:17
-
-
Save paulklemm/245750a68249c8a63b18 to your computer and use it in GitHub Desktop.
WebGL Shader Fehler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THREE.WebGLShader: gl.getShaderInfoLog() ERROR: 0:55: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type 'highp float' and a right operand of type 'const int' (or there is no acceptable conversion) | |
three.min.js:581 1: precision highp float; | |
2: precision highp int; | |
3: | |
4: | |
5: #define MAX_DIR_LIGHTS 0 | |
6: #define MAX_POINT_LIGHTS 0 | |
7: #define MAX_SPOT_LIGHTS 0 | |
8: #define MAX_HEMI_LIGHTS 0 | |
9: #define MAX_SHADOWS 0 | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | |
24: | |
25: #define USE_COLOR | |
26: | |
27: | |
28: | |
29: | |
30: | |
31: | |
32: | |
33: | |
34: | |
35: uniform mat4 viewMatrix; | |
36: uniform vec3 cameraPosition; | |
37: | |
38: // attribute float near; | |
39: // attribute float far; | |
40: float near = 1.0; | |
41: float far = 100000.0; | |
42: varying float vAlpha; | |
43: varying vec3 vColor; | |
44: varying float vDepth; | |
45: float zNear = near; | |
46: float zFar = far; | |
47: | |
48: void main() { | |
49: float z_b = vDepth; | |
50: float z_norm = (z_b - zNear) / (zFar - zNear); | |
51: float attenB = 0.45; | |
52: vec3 depthA=vec3(0); | |
53: if (z_norm > attenB) | |
54: { | |
55: float dA = (z_norm - attenB)*5; | |
56: depthA = vec3(dA); | |
57: } | |
58: gl_FragColor = vec4(vColor.rgb+depthA, 1); | |
59: gl_FragColor.a *= vAlpha; | |
60: } | |
61: | |
three.min.js:578 THREE.WebGLProgram: Could not initialise shader. | |
three.min.js:578 gl.VALIDATE_STATUS false | |
three.min.js:578 gl.getError() 0 | |
three.min.js:578 THREE.WebGLProgram: gl.getProgramInfoLog() missing shaders |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment