Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gl-shader compiling error #3

Closed
petuhovskiy opened this issue Jul 29, 2015 · 4 comments
Closed

gl-shader compiling error #3

petuhovskiy opened this issue Jul 29, 2015 · 4 comments

Comments

@petuhovskiy
Copy link

Hello! I'm trying to use the following code,

var createEngine = require('voxel-engine-stackgl');

createEngine({
  require: require,
  pluginOpts: {
    'voxel-engine-stackgl': {
      appendDocument: true,
      exposeGlobal: true
    }
  }
});

But I get an error in console when try to run it. What am I doing wrong? (I use Chrome on Windows)
Console output

@petuhovskiy
Copy link
Author

gl-shader error stacktrace

createShader    @bundle.js:15955
(anonymous function)    @bundle.js:15517
ShaderPlugin.createAOShader @bundle.js:15456
ShaderPlugin.ginit  @bundle.js:15379
EventEmitter.emit   @bundle.js:39172
initGLNow   @bundle.js:6407
EventEmitter.emit   @bundle.js:39147
initGameShell   @bundle.js:7614

@deathcap
Copy link
Member

maybe related: voxel/voxel-shader#11 gl-shader: Error compling vertex shader: ERROR: 0:18: '=' : global variable initializers must be constant expressions

@deathcap
Copy link
Member

@petuhovskiy I saw slightly different errors:

[Error] gl-shader: Error compling vertex shader: – "ERROR: 0:12: Invalid call of undeclared identifier 'webgl_a39852140000000d'↵ERROR: 0:26: Use of undeclared identifier 'webgl_7d8bd5b70000000c'↵"
[Error] Error: gl-shader: Error compiling vertex shader:ERROR: 0:12: Invalid call of undeclared identifier 'webgl_a39852140000000d'
ERROR: 0:26: Use of undeclared identifier 'webgl_7d8bd5b70000000c'
[Error] Error: voxel-shader render() called before gl-init, shader=
[Error] Error: voxel-shader render() called before gl-init, shader=
[Error] Error: voxel-shader render() called before gl-init, shader=

but they were preceded by another error which caused them, and quickly scrolled past the console output, but fixing this error fixed my errors at least:

voxel/voxel-shader#11 gl-shader: Error compling vertex shader: ERROR: 0:18: '=' : global variable initializers must be constant expressions

can you check if http://deathcap.github.io/voxel-example/ (now updated with this fix) reproduces your original errors? If not, will need to test Chrome on Windows, there might be some other incompatibilities, the "ERROR 0:12: '=' : cannot convert from 'const float' to 'highp 4X4 matrix of float'" is suspicious..

@deathcap
Copy link
Member

Tested Google Chrome 47 on Windows 7 in VMware Fusion, voxel-engine-stackgl 1.0.1 works for me - pretty sure this was fixed by voxel/voxel-shader#11:

screen shot 2015-12-30 at 7 43 21 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants