cnr-isti-vclab / meshlabjs

A javascript client based mesh processing tool. Built using vcg library, emscripten and webgl
http://www.meshlabjs.net
GNU Affero General Public License v3.0
229 stars 51 forks source link

Ambient Occlusion Resize Buffer #87

Open cignoni opened 8 years ago

cignoni commented 8 years ago

If you resize the window after you started Ambient occlusion it messes up!

maggio-a commented 8 years ago

Apologies for the late reply but I only saw the issue today.

This is due to a bug in the ThreeJS version in use where resizing a render target only updates the size properties of the object without modifying the actual buffers.

I corrected it when I was working on Radiance scaling, but only in the non-minified library file (see https://github.com/cnr-isti-vclab/meshlabjs/commits/master/js/include/three.js and commit a49c5a973efd6f0b41b7eecfa6694c36797ffe2b).

Substituting the current minified file with a minified version of the patched one should fix the issue.

cignoni commented 8 years ago

I do not think that this is a reasonable solution. Nobody should modify base libraries as a workaround: this would fail in the inevitable moment someone replace the library with a more recent one.

maggio-a commented 8 years ago

I have checked out the threejs-update branch and the effects are working there (the change I made to the library was the same they added in later versions). A less invasive way to have the effects working in ThreeJS r71 is to manually recreate the WebGLRenderTarget objects when they are resized; this is trivial but would become redundant once a new version of the library is used.

I can push the workaround and revert it later, or we wait for the update to fix the issue (this would be reasonable only if the update is happening soon).