#133 ✓resolved
lindsay.kay (at xeolabs)

Picking error 1281 for readPixels with MacOSX Chromium 6.0.452.0 (51117

Reported by lindsay.kay (at xeolabs) | August 4th, 2010 @ 06:01 AM | in V0.7.7

OS: MacOSX Chromium 6.0.452.0 (51117) when testing picking with http://scenejs.org/previews/scenejs-0.7.7.0/examples/basic-picking/...

Debug log:

LOG START << s0: Creating shader: 'theCanvas;;;dirsddirsddirsd;;ttf'

Picking at (464, 67)

s0: Binding pick buffer

s0: Mapping pick index to color/node: 0 => {r:0.00390625, g:0, b:1}
spheres

s0: Registering node as "picked" event listener: SID path = {spheres}

s0: Mapping pick index to color/node: 1 => {r:0.0078125, g:0, b:1}
spheres/blue-group

s0: Mapping pick index to color/node: 2 => {r:0.01171875, g:0, b:1}
spheres/blue-group/right-blue-sphere

s0: Creating shader: 'theCanvas;picking'

s0: Mapping pick index to color/node: 3 => {r:0.015625, g:0, b:1} left-
blue-sphere

s0: Mapping pick index to color/node: 4 => {r:0.01953125, g:0, b:1}
green-group

s0: Registering node as "picked" event listener: SID path = {green-
group}

s0: Mapping pick index to color/node: 5 => {r:0.0234375, g:0, b:1}
green-group/right-green-sphere

s0: Registering node as "picked" event listener: SID path = {green-
group/right-green-sphere}

s0: Mapping pick index to color/node: 6 => {r:0.02734375, g:0, b:1}
left-green-sphere

s0: Registering node as "picked" event listener: SID path = {left-
green-sphere}

s0: Mapping pick index to color/node: 7 => {r:0.03125, g:0, b:1} red-
group

s0: Mapping pick index to color/node: 8 => {r:0.03515625, g:0, b:1}
red-group/red-group-sphere

WebGL error calling readPixels on WebGL canvas context - see console
log for details

Reading pick buffer - picked pixel(464, 67) = {r:0, g:0, b:0}

Unbinding pick buffer

Finished rendering..

No nodes picked

LOG ENDS <<

uses :

function readPickBuffer() {

   var context = boundPickBuf.canvas.context;
   /// >>> THIS WILL BLOW UP with magic error 1281 for readPixels
   var pix = context.readPixels(pickX,

boundPickBuf.canvas.canvas.height - pickY, 1, 1, context.RGBA,
context.UNSIGNED_BYTE);

   if (!pix) {  //  http://asalga.wordpress.com/2010/07/14/compensating-for-webgl-readpixels-spec-changes/
       pix = new WebGLUnsignedByteArray(4);
       context.readPixels(pickX, boundPickBuf.canvas.height -

pickY, 1, 1, context.RGBA, context.UNSIGNED_BYTE, pix);

   }
   if (debugCfg.logTrace) {
       SceneJS._loggingModule.info("Reading pick buffer - picked

pixel(" + pickX + ", " + pickY + ") = {r:" + pix[0] + ", g:" + pix[1]
+ ", b:" + pix[2] + "}");

   }
   pickedNodeIndex = (pix[0] + pix[1] * 256) - 1;

}

Comments and changes to this ticket

  • rcoenen

    rcoenen September 2nd, 2010 @ 12:33 PM

    I am getting:

    Chromium 7.0.509.0 (57813) (MaxOSX)
    Log
    s0: Creating shader: 'theCanvas;;;dirsddirsddirsd;;ttf'
    s0: Creating shader: 'theCanvas;picking'

    javascript:
    SceneJS V0.7.8 initialised
    /previews/scenejs-0.7.7.0/lib/scenejs.js:4644 SceneJS.Scene binding to canvas 'theCanvas' /previews/scenejs-0.7.7.0/lib/scenejs.js:4644 SceneJS.Scene logging to element with ID 'theLoggingDiv' - logging to browser console also /previews/scenejs-0.7.7.0/lib/scenejs.js:4644 Scene defined: s0 /previews/scenejs-0.7.7.0/lib/scenejs.js:4644 s0: Creating shader: 'theCanvas;;;dirsddirsddirsd;;ttf' /previews/scenejs-0.7.7.0/lib/scenejs.js:4644 s0: Creating shader: 'theCanvas;picking' /previews/scenejs-0.7.7.0/lib/scenejs.js:21146 Uncaught ReferenceError: WebGLUnsignedByteArray is not defined

  • rcoenen

    rcoenen September 2nd, 2010 @ 12:36 PM

    and
    Safari (WebKit nightly, MacOSX) Version 5.0.1 (6533.17.8, r66574)

    Log
    s0: Creating shader: 'theCanvas;;;dirsddirsddirsd;;ttf'
    s0: Creating shader: 'theCanvas;picking'

    Javascript:
    scenejs.js:4644SceneJS V0.7.8 initialised
    scenejs.js:4644SceneJS.Scene binding to canvas 'theCanvas'
    scenejs.js:4644SceneJS.Scene logging to element with ID 'theLoggingDiv' - logging to browser console also
    scenejs.js:4644Scene defined: s0
    scenejs.js:4644s0: Creating shader: 'theCanvas;;;dirsddirsddirsd;;ttf'
    scenejs.js:4644s0: Creating shader: 'theCanvas;picking'
    scenejs.js:21146ReferenceError: Can't find variable: WebGLUnsignedByteArray

  • lindsay.kay (at xeolabs)
  • rcoenen

    rcoenen September 5th, 2010 @ 11:25 AM

    Hi Linday- thanks for the reply. I have just tested your last fix (becf8ff3e94f9e0c196e) and it worked.
    The 2 picking demo's in /examples/ now run correctly.

  • lindsay.kay (at xeolabs)

    lindsay.kay (at xeolabs) September 5th, 2010 @ 11:36 AM

    • State changed from “open” to “resolved”
  • lindsay.kay (at xeolabs)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.

Shared Ticket Bins

People watching this ticket

Tags

Pages