regl
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -9,2 +9,3 @@ var fs = require('fs') | ||
var mkdirp = require('mkdirp') | ||
var es2020 = require('es2020') | ||
var ClosureCompiler = require('google-closure-compiler').compiler | ||
@@ -92,2 +93,3 @@ | ||
b.transform(removeCheck) | ||
b.transform(es2020) | ||
} | ||
@@ -94,0 +96,0 @@ b.bundle(function (err, bundle) { |
@@ -7,2 +7,3 @@ var fs = require('fs') | ||
var mkdirp = require('mkdirp') | ||
var es2020 = require('es2020') | ||
var ClosureCompiler = require('google-closure-compiler').compiler | ||
@@ -360,2 +361,3 @@ | ||
b.transform(removeCheck) | ||
b.transform(es2020) | ||
b.bundle(function (err, bundle) { | ||
@@ -362,0 +364,0 @@ if (err) { |
@@ -13,3 +13,6 @@ var path = require('path') | ||
browserify(INPUT_FILE, { standalone: 'createREGL' }) | ||
browserify(INPUT_FILE, { | ||
standalone: 'createREGL', | ||
debug: true | ||
}) | ||
.transform(require('./remove-check')) | ||
@@ -16,0 +19,0 @@ .bundle() |
# Release notes | ||
## Planned | ||
## 1.2.1 | ||
* Write comparison suite | ||
* Fixed bug with depth and stencil attachments being cleared | ||
* `regl.elements` now correctly infers count from length and vice-versa | ||
* Comments for all core modules | ||
* Add a mechanism for users to specify minimum resource requirements (texture size, varying units, etc.) | ||
* Benchmark suite | ||
* Dashboard for test cases and benchmarks | ||
* Create some more typical drawing examples | ||
* A pretty printer for the generated code | ||
* Documentation | ||
* All interface methods must be documented | ||
* Examples for all major features | ||
* Set up/quick start guides | ||
* Live coding videos on youtube | ||
* Talks? (what conferences can we present these results at?) | ||
* Core library modules need better comments | ||
* Work flow for development and testing needs documentation | ||
* Helper modules | ||
* Debugging tools for inspecting the state of framebuffers, textures, buffers | ||
* Recipe book/example set | ||
* Globe | ||
* Turing patterns | ||
* Asset loading (obj, ply, etc.) | ||
* Water Reflection(though cubic-framebuffers) | ||
## 1.2.0 | ||
@@ -40,0 +9,0 @@ |
@@ -83,3 +83,3 @@ /* | ||
type: 'image', | ||
src: 'assets/lena.png', | ||
src: 'assets/peppers.png', | ||
parser: (data) => regl.texture({ | ||
@@ -86,0 +86,0 @@ data: data, |
@@ -78,17 +78,25 @@ var check = require('./util/check') | ||
type) { | ||
var predictedType = type | ||
if (!type && ( | ||
!isTypedArray(data) || | ||
(isNDArrayLike(data) && !isTypedArray(data.data)))) { | ||
predictedType = extensions.oes_element_index_uint | ||
? GL_UNSIGNED_INT | ||
: GL_UNSIGNED_SHORT | ||
elements.buffer.bind() | ||
if (data) { | ||
var predictedType = type | ||
if (!type && ( | ||
!isTypedArray(data) || | ||
(isNDArrayLike(data) && !isTypedArray(data.data)))) { | ||
predictedType = extensions.oes_element_index_uint | ||
? GL_UNSIGNED_INT | ||
: GL_UNSIGNED_SHORT | ||
} | ||
bufferState._initBuffer( | ||
elements.buffer, | ||
data, | ||
usage, | ||
predictedType, | ||
3) | ||
} else { | ||
gl.bufferData(GL_ELEMENT_ARRAY_BUFFER, byteLength, usage) | ||
elements.buffer.dtype = dtype || GL_UNSIGNED_BYTE | ||
elements.buffer.usage = usage | ||
elements.buffer.dimension = 3 | ||
elements.buffer.byteLength = byteLength | ||
} | ||
elements.buffer.bind() | ||
bufferState._initBuffer( | ||
elements.buffer, | ||
data, | ||
usage, | ||
predictedType, | ||
3) | ||
@@ -216,5 +224,2 @@ var dtype = type | ||
} | ||
if ('length' in options) { | ||
byteLength = options.length | 0 | ||
} | ||
if ('type' in options) { | ||
@@ -227,24 +232,21 @@ check.parameter( | ||
} | ||
if ('length' in options) { | ||
byteLength = options.length | 0 | ||
} else { | ||
byteLength = vertCount | ||
if (dtype === GL_UNSIGNED_SHORT || dtype === GL_SHORT) { | ||
byteLength *= 2 | ||
} else if (dtype === GL_UNSIGNED_INT || dtype === GL_INT) { | ||
byteLength *= 4 | ||
} | ||
} | ||
} | ||
if (data) { | ||
initElements( | ||
elements, | ||
data, | ||
usage, | ||
primType, | ||
vertCount, | ||
byteLength, | ||
dtype) | ||
} else { | ||
var _buffer = elements.buffer | ||
_buffer.bind() | ||
gl.bufferData(GL_ELEMENT_ARRAY_BUFFER, byteLength, usage) | ||
_buffer.dtype = dtype || GL_UNSIGNED_BYTE | ||
_buffer.usage = usage | ||
_buffer.dimension = 3 | ||
_buffer.byteLength = byteLength | ||
elements.primType = primType < 0 ? GL_TRIANGLES : primType | ||
elements.vertCount = vertCount < 0 ? 0 : vertCount | ||
elements.type = _buffer.dtype | ||
} | ||
initElements( | ||
elements, | ||
data, | ||
usage, | ||
primType, | ||
vertCount, | ||
byteLength, | ||
dtype) | ||
} | ||
@@ -251,0 +253,0 @@ |
@@ -179,9 +179,2 @@ var check = require('./util/check') | ||
} | ||
} else { | ||
gl.framebufferTexture2D( | ||
GL_FRAMEBUFFER, | ||
location, | ||
GL_TEXTURE_2D, | ||
null, | ||
0) | ||
} | ||
@@ -307,4 +300,29 @@ } | ||
for (i = colorAttachments.length; i < limits.maxColorAttachments; ++i) { | ||
attach(GL_COLOR_ATTACHMENT0 + i, null) | ||
gl.framebufferTexture2D( | ||
GL_FRAMEBUFFER, | ||
GL_COLOR_ATTACHMENT0 + i, | ||
GL_TEXTURE_2D, | ||
null, | ||
0) | ||
} | ||
gl.framebufferTexture2D( | ||
GL_FRAMEBUFFER, | ||
GL_DEPTH_STENCIL_ATTACHMENT, | ||
GL_TEXTURE_2D, | ||
null, | ||
0) | ||
gl.framebufferTexture2D( | ||
GL_FRAMEBUFFER, | ||
GL_DEPTH_ATTACHMENT, | ||
GL_TEXTURE_2D, | ||
null, | ||
0) | ||
gl.framebufferTexture2D( | ||
GL_FRAMEBUFFER, | ||
GL_STENCIL_ATTACHMENT, | ||
GL_TEXTURE_2D, | ||
null, | ||
0) | ||
attach(GL_DEPTH_ATTACHMENT, framebuffer.depthAttachment) | ||
@@ -311,0 +329,0 @@ attach(GL_STENCIL_ATTACHMENT, framebuffer.stencilAttachment) |
{ | ||
"name": "regl", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "regl is a fast functional WebGL framework.", | ||
@@ -9,2 +9,5 @@ "main": "regl.js", | ||
}, | ||
"browserify": { | ||
"transform": "./lib/transform" | ||
}, | ||
"dependencies": {}, | ||
@@ -25,2 +28,3 @@ "devDependencies": { | ||
"disc": "^1.3.2", | ||
"es2020": "^1.1.9", | ||
"falafel": "^1.2.0", | ||
@@ -27,0 +31,0 @@ "faucet": "0.0.1", |
@@ -133,6 +133,6 @@ var createContext = require('./util/create-context') | ||
}, [ | ||
1, 1, 1, 1, 2, 0, 0, 0, | ||
0, 1, 1, 1, 2, 0, 0, 0, | ||
0, 0, 1, 1, 2, 0, 0, 0, | ||
0, 0, 0, 1, 2, 0, 0, 0, | ||
2, 2, 2, 2, 2, 0, 0, 0, | ||
0, 2, 1, 1, 2, 0, 0, 0, | ||
0, 0, 2, 1, 2, 0, 0, 0, | ||
0, 0, 0, 2, 2, 0, 0, 0, | ||
0, 0, 0, 0, 2, 0, 0, 0, | ||
@@ -149,7 +149,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, | ||
}, [ | ||
1, 1, 1, 1, 2, 0, 0, 0, | ||
0, 1, 1, 1, 2, 0, 0, 0, | ||
0, 0, 1, 1, 2, 0, 0, 0, | ||
0, 1, 1, 1, 2, 0, 0, 0, | ||
2, 2, 2, 2, 2, 0, 0, 0, | ||
0, 2, 1, 1, 2, 0, 0, 0, | ||
0, 0, 2, 1, 2, 0, 0, 0, | ||
0, 2, 1, 1, 2, 0, 0, 0, | ||
2, 2, 2, 2, 2, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, | ||
@@ -165,7 +165,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, | ||
}, [ | ||
1, 1, 1, 1, 2, 0, 0, 0, | ||
1, 1, 1, 1, 2, 0, 0, 0, | ||
1, 1, 1, 1, 2, 0, 0, 0, | ||
1, 1, 1, 1, 2, 0, 0, 0, | ||
2, 2, 2, 2, 2, 0, 0, 0, | ||
2, 1, 1, 1, 2, 0, 0, 0, | ||
2, 1, 1, 1, 2, 0, 0, 0, | ||
2, 1, 1, 1, 2, 0, 0, 0, | ||
2, 2, 2, 2, 2, 0, 0, 0, | ||
0, 0, 0, 0, 0, 0, 0, 0, | ||
@@ -172,0 +172,0 @@ 0, 0, 0, 0, 0, 0, 0, 0, |
@@ -174,6 +174,3 @@ var createContext = require('./util/create-context') | ||
false, false) | ||
} | ||
/* | ||
if (typeof document === 'undefined') { | ||
testFBO('depth renderbuffer - implicit', | ||
@@ -205,13 +202,10 @@ regl.framebuffer({ | ||
false, true) | ||
} | ||
*/ | ||
testFBO('depth-stencil renderbuffer - implicit', | ||
regl.framebuffer({ | ||
radius: N, | ||
depthStencil: true | ||
}), | ||
true, true) | ||
testFBO('depth-stencil renderbuffer - implicit', | ||
regl.framebuffer({ | ||
radius: N, | ||
depthStencil: true | ||
}), | ||
true, true) | ||
if (typeof document !== 'undefined') { | ||
testFBOCube('depth-stencil renderbuffer - implicit, cube fbo, ', | ||
@@ -223,15 +217,13 @@ regl.framebufferCube({ | ||
true, true) | ||
} | ||
testFBO('depth-stencil renderbuffer', | ||
regl.framebuffer({ | ||
radius: N, | ||
depthStencil: regl.renderbuffer({ | ||
testFBO('depth-stencil renderbuffer', | ||
regl.framebuffer({ | ||
radius: N, | ||
format: 'depth stencil' | ||
}) | ||
}), | ||
true, true) | ||
depthStencil: regl.renderbuffer({ | ||
radius: N, | ||
format: 'depth stencil' | ||
}) | ||
}), | ||
true, true) | ||
if (typeof document !== 'undefined') { | ||
testFBOCube('depth-stencil renderbuffer, cube fbo, ', | ||
@@ -238,0 +230,0 @@ regl.framebufferCube({ |
@@ -63,1 +63,2 @@ require('../flatten') | ||
require('../elements-update') | ||
require('../elements-length') |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
17528696
251
60
48735
3
14