Hi everyone,
I' ve got a problem, I use in one project the sentence "renderer.domElement.toDataURL" to export an image and save in server, but in chrome doesn't works. Sometimes work and sometimes don't work, it's very crazy, and Chrome doesn't show me any error, only show OH NO page (typical error, http://twitpic.com/8tnu4e), and sometimes show me and ERROR ALERT but without error text (http://twitpic.com/8tntuw).
I'm looking up in google and in three.js issues and I look this issue #264 and I'll try with the site felixturner named in the issue (http://airtightinteractive.com/demos/js/ruttetra/), and I have the same problem that in my page.
Any idea? The error only happens in Chrome, in Firefox runs perfect.
Thanks a lot.
add "preserveDrawingBuffer: true" to your new renderer call:
renderer = new THREE.WebGLRenderer( { antialias: true, preserveDrawingBuffer: true});
that solved that same problem for me
Hi danjres, thanks for your quickly reply, but this not solve my problem, I have in my renderer call the preserveDrawingBuffer, my site is www.saveceramics.com, in the first page you can try to draw in a canvas, and click in PREVIEW 3D, and in this moment the error appears.
I'm testing now, I'm putting preserveDrawingBuffer to false, antialias to true and false, and there is no solution. I have tested with CanvasRenderer, it's slowly, and there are no problems, errors only appear with WebGLRenderer.
sorry SirMartin, it's beyond me then...
Hi danjres, thanks for your quickly reply, but this not solve my problem, I have in my renderer call the preserveDrawingBuffer, my site is www.saveceramics.com, in the first page you can try to draw in a canvas, and click in PREVIEW 3D, and in this moment the error appears.
I've tried that and I didn't see any error.
For me it crashes Chrome tab. Firefox seems ok.
But you have there some errors and warnings in JS console. Try fixing these first.
Uncaught TypeError: Object [object Object] has no method 'chosen'
2Unsafe JavaScript attempt to access frame with URL http://www.saveceramics.com/Home/DibujarNormal from frame with URL http://player.vimeo.com/video/35596335?title=0&byline=0&portrait=0. Domains, protocols and ports must match.
600event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
40Three.js:128DEPRECATED: Mesh material can no longer be an Array. Using material at index 0...
Three.js:274Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11 | WebGL 1.0 (OpenGL ES 2.0 Chromium) | WebKit | WebKit WebGL | WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Three.js:285DEPRECATED: Camera hasn't been added to a Scene. Adding it...
I'm trying to fix any warnings and errors, but the errors it's not relationed with this fail, or threejs.
I have another question, it's possible the error occurred when buffer is full, because if you try to draw a simple and quickly draft, the error doesn't appears, but if you draw and clean, and draw again, the second draft it's more easy to generate the error. And if in the first draft you draw slowly and very detailed it's easy too that the error appears.
It's possible increase the buffer size, or any instruction to clean the buffer after any 3D execution?
Thanks again.
Any more ideas? can I clean the buffer? or it's possible the buffer length cause my error.
Thanks.
Try updating to the latest build.
Hi mrdoob, I'm try to update to the latest version, I'm my site I used the version 46, but with this version 48, don't run the 3D, only I put the new file, I don't try anymore, but if I put latest build, the 3D render not appear.
The new version need any change? I'm try to discover where is the error.
Sorry for answering so late, but I move to another country and I have a lot of time lately.
Thanks.
Take a look at the change log down the page:
https://github.com/mrdoob/three.js/
Great, I discover my error. It's about my sentence in material.
I replaced:
var material = [ new THREE.MeshLambertMaterial({ color: selectedColor, shading: THREE.FlatShading }) ];
for this
var material = new THREE.MeshLambertMaterial({ color: selectedColor, shading: THREE.FlatShading });
Now, I'm trying the draw in chrome, to look it's the problem is solved or the error persists.
Run perfect. Thanks a lot.
I close the issue.