Skip to content

Commit d756284

Browse files
committed
Fresh up deps and fix zero render count
1 parent 2b6c840 commit d756284

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

errorbars.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ proto.drawTransparent = proto.draw = function(cameraParams) {
5454
var cw = view[15]
5555
var pixelScaleF = this.pixelRatio * (projection[3]*cx + projection[7]*cy + projection[11]*cz + projection[15]*cw) / gl.drawingBufferHeight
5656

57-
5857
this.vao.bind()
5958
for(var i=0; i<3; ++i) {
6059
gl.lineWidth(this.lineWidth[i])
6160
uniforms.capSize = this.capSize[i] * pixelScaleF
62-
gl.drawArrays(gl.LINES, this.lineOffset[i], this.lineCount[i])
61+
if (this.lineOffset[i] != this.lineCount[i]) {
62+
gl.drawArrays(gl.LINES, this.lineOffset[i], this.lineCount[i])
63+
}
6364
}
6465
this.vao.unbind()
6566
}

example/example.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var shell = require("gl-now")({ clearColor: [0,0,0,0] })
22
var camera = require("game-shell-orbit-camera")(shell)
3-
var createAxes = require("gl-axes")
3+
var createAxes = require("gl-axes3d")
44
var createErrorBars = require('../errorbars')
55
var mat4 = require("gl-matrix").mat4
66

7+
78
var bounds = [[-5,-5,-5], [5,5,5]]
89

910
var errorbars, axes
@@ -17,7 +18,8 @@ shell.on("gl-init", function() {
1718
bounds: bounds
1819
})
1920

20-
errorbars = createErrorBars(gl, {
21+
errorbars = createErrorBars({
22+
gl: gl,
2123
position: [
2224
[0,0,0],
2325
[0,2,0],
@@ -53,5 +55,6 @@ shell.on("gl-render", function() {
5355
}
5456

5557
axes.draw(cameraParameters)
58+
5659
errorbars.draw(cameraParameters)
57-
})
60+
})

package.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"example": "example"
88
},
99
"scripts": {
10-
"test": "echo \"Error: no test specified\" && exit 1"
10+
"test": "budo example/example"
1111
},
1212
"repository": {
1313
"type": "git",
@@ -25,12 +25,17 @@
2525
},
2626
"homepage": "https://github.com/mikolalysenko/gl-error3d",
2727
"dependencies": {
28-
"gl-buffer": "^2.0.8",
29-
"gl-shader": "^4.0.4",
30-
"gl-vao": "^1.1.3",
31-
"glslify": "^2.1.2"
28+
"gl-buffer": "^2.1.2",
29+
"gl-shader": "^4.2.1",
30+
"gl-vao": "^1.3.0",
31+
"glslify": "^6.0.2"
32+
},
33+
"devDependencies": {
34+
"game-shell-orbit-camera": "^1.0.0",
35+
"gl-axes3d": "^1.2.5",
36+
"gl-matrix": "^2.3.2",
37+
"gl-now": "^1.4.0"
3238
},
33-
"devDependencies": {},
3439
"browserify": {
3540
"transform": [
3641
"glslify"

shaders/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var fragSrc = glslify('./fragment.glsl')
99
module.exports = function(gl) {
1010
return createShader(gl, vertSrc, fragSrc, null, [
1111
{name: 'position', type: 'vec3'},
12-
{name: 'offset', type: 'vec3'},
13-
{name: 'color', type: 'vec4'}
12+
{name: 'color', type: 'vec4'},
13+
{name: 'offset', type: 'vec3'}
1414
])
1515
}

0 commit comments

Comments
 (0)