claygl-next
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
@@ -34,6 +34,6 @@ "use strict"; | ||
var prevGeometry; | ||
scene.traverse(function (renderable) { | ||
if (renderable.isRenderable()) { | ||
var geometry = renderable.geometry; | ||
var material = renderable.material; | ||
scene.traverse(function (node) { | ||
var geometry = node.geometry; | ||
var material = node.material; | ||
if (geometry && material) { | ||
// TODO optimize!! | ||
@@ -40,0 +40,0 @@ if (material !== prevMaterial) { |
@@ -120,3 +120,2 @@ "use strict"; | ||
var currentEnabledAttributes = []; | ||
var maxLocation = 0; | ||
// Always bind attribute location | ||
@@ -139,5 +138,2 @@ for (var i = 0; i < attributeBuffersLen; i++) { | ||
} | ||
if (location_1 > maxLocation) { | ||
maxLocation = location_1; | ||
} | ||
} | ||
@@ -144,0 +140,0 @@ // Disable unused attribute |
@@ -161,3 +161,4 @@ import { GLEnum } from '../core/type'; | ||
disposeInstancedMesh(mesh: InstancedMesh): void; | ||
private _disposeResource; | ||
} | ||
export default GLRenderer; |
@@ -101,3 +101,4 @@ "use strict"; | ||
// Unbind if there is no new framebuffer. Else only update mipmap | ||
prevFrameBuffer && glFrameBufferMap.get(prevFrameBuffer).unbind(gl, glFrameBuffer); | ||
var prevGLFrameBuffer = prevFrameBuffer && glFrameBufferMap.get(prevFrameBuffer); | ||
prevGLFrameBuffer && prevGLFrameBuffer.unbind(gl, glFrameBuffer); | ||
if (glFrameBuffer) { | ||
@@ -516,4 +517,3 @@ glFrameBuffer.bind(gl, { | ||
GLRenderer.prototype.disposeGeometry = function (geometry) { | ||
var glBuffers = this._glBuffersMap.get(geometry); | ||
glBuffers && glBuffers.dispose(this.gl); | ||
this._disposeResource(this._glBuffersMap, geometry); | ||
}; | ||
@@ -525,4 +525,3 @@ /** | ||
GLRenderer.prototype.disposeTexture = function (texture) { | ||
var glTexture = this._glTextureMap.get(texture); | ||
glTexture && glTexture.dispose(this.gl); | ||
this._disposeResource(this._glTextureMap, texture); | ||
}; | ||
@@ -534,4 +533,4 @@ /** | ||
GLRenderer.prototype.disposeFrameBuffer = function (frameBuffer) { | ||
var glFramebuffer = this._glFrameBufferMap.get(frameBuffer); | ||
glFramebuffer && glFramebuffer.dispose(this.gl); | ||
// TODO unbind if framebuffer is in usage? | ||
this._disposeResource(this._glFrameBufferMap, frameBuffer); | ||
}; | ||
@@ -542,5 +541,11 @@ /** | ||
GLRenderer.prototype.disposeInstancedMesh = function (mesh) { | ||
var buffers = this._glInstancedBufferMap.get(mesh); | ||
if (buffers) { | ||
buffers.dispose(this.gl); | ||
this._disposeResource(this._glInstancedBufferMap, mesh); | ||
}; | ||
GLRenderer.prototype._disposeResource = function ( | ||
// TODO provide disposable | ||
storage, resource) { | ||
var obj = storage.get(resource); | ||
if (obj) { | ||
obj.dispose(this.gl); | ||
storage.delete(resource); | ||
} | ||
@@ -547,0 +552,0 @@ }; |
{ | ||
"name": "claygl-next", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"description": "A 3D graphic library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6986184
101950
553