xtk / X

The X Toolkit
http://www.goXTK.com
Other
786 stars 263 forks source link

Picking from framebuffer failing #173

Open cbaldassano opened 9 years ago

cbaldassano commented 9 years ago

On my machine (OSX 10.9.5, Chrome 40.0.2214.115 64-bit) picking stopped working at some point. Digging into the code, I found that readPixels was always returning (255,255,255) rather than the id in the framebuffer.

My current workaround is to not use the framebuffer at all, and just use the canvas for drawing the picking id-image. This required two changes: Old: renderer.js:685 var _context = _canvas.getContext(_contextName); renderer3d.js:1481 this._context.bindFramebuffer(this._context.FRAMEBUFFER, this._pickFrameBuffer);

New: renderer.js:685 var _context = _canvas.getContext(_contextName, {preserveDrawingBuffer: true}); renderer3d.js:1481 this._context.bindFramebuffer(this._context.FRAMEBUFFER, null);

This actually looks fine to me (there's no perceptible "flash" on the canvas) but I'm confused about why this became an issue. Maybe a Chome update stopped access to the framebuffer in some way? Has anyone else had this issue?