stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.76k stars 170 forks source link

npm test returns a few failures #28

Closed bchevalier closed 8 years ago

bchevalier commented 9 years ago

Hi,

I plan on using headless-gl to generate, on the server, avatars of MMORPG players (these avatars are meant to be used on a forum that do not have a WebGL rendering engine).

To test the feasibility of using headless-gl, I ran npm test and got a few fails:

  total:     13759
  passing:   13330
  failing:   429
  duration:  9.2s

Among the errors I get:

    context_context-attributes-alpha-depth-stencil-antialias

      ✖ should be 255,0,0,255
      ✖ pixel[0] != 255 && pixel[0] != 0 should be true. Was false.

    extensions_oes-standard-derivatives

      ✖ getError expected: INVALID_ENUM. Was NO_ERROR : hint should not accept FRAGMENT_SHADER_DERIVATIVE_HINT_OES if extension is disabled
      ✖ GL_OES_standard_derivatives defined in shaders when extension is disabled
      ✖ Shader built-ins compiled successfully when extension disabled

And a lot of these:

      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 8, 4) should succeed 
      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 8) should succeed 
      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 4, 8) should succeed 
      ✖ getError expected: NO_ERROR. Was INVALID_VALUE : gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 8, 8) should succeed 
      ...

I run headless-gl on Mac OSX, is it supposed to be well supported?

mikolalysenko commented 9 years ago

The test cases aren't perfect yet, but it is slowly getting better. Regarding test failures, those aren't too bad right now. Basically in a few edge cases headless-gl returns the wrong error code for some weird input parameters. For most sane webgl applications that wouldn't even generate errors anyway, headless-gl should be totally fine.

bchevalier commented 9 years ago

Thank you for the reactivity. I tried to run my rendering engine using headless-gl and although it executes without any error or warning I do not seem to get anything renderer so I wondered if it was related to any of those tests falling. But since you say that headless-gl should be fine, the problem probably comes from my side. I will keep investigating.

mikolalysenko commented 9 years ago

If your server is running linux, the issue could be due to the xcreatepixmap bug. This will get fixed in the next iteration of headless-gl, which should be available once nan v2.1 comes out.

springmeyer commented 8 years ago

I see that https://github.com/stackgl/headless-gl/commit/7690a048fd303aa9cbf7b720efc31da678dc701c brought in nan v2.1. Does this mean that this issue may be fixed now?

mikolalysenko commented 8 years ago

Fixed