Alexis Posted January 23, 2015 Share Posted January 23, 2015 I am new to Pixi.js. I have tried to recreate the examples to learn this.But i have an error when i try to recreate the normalMapFilter example. I have no problem when i use the same version of the demo (1.4) But in my project i use the latest version (2.2.3) and then i have errors. I get a lot of warnings and a blank canvas.Errors look like thispixi.dev.js:5829 Could not initialise shaderspixi.dev.js:5928 WebGL: INVALID_OPERATION: useProgram: program not validpixi.dev.js:5931 WebGL: INVALID_OPERATION: getUniformLocation: program not linkedI have correctly included the files<script src="js/pixi.dev.js"></script><script src="js/vendor/pixi/filters/NormalMapFilter.js"></script>And i use the same code of the demo$(document).ready(function() { var viewWidth = 1920; var viewHeight = 1080; var renderer = PIXI.autoDetectRenderer(viewWidth, viewHeight); $(renderer.view).addClass('pixi').appendTo('body'); var stage = new PIXI.Stage(0xFFFFFF); var texture = PIXI.Texture.fromImage("img/texture_norm.jpg"); var filter = new PIXI.NormalMapFilter(texture); var sprite = PIXI.Sprite.fromImage("img/texture.jpg"); sprite.filters = [filter]; stage.addChild(sprite); requestAnimationFrame(animate); function animate() { var mouse = stage.interactionManager.mouse; if( mouse.global.x < 0) mouse.global.x = 0; else if( mouse.global.x > viewWidth) mouse.global.x = viewWidth; if( mouse.global.y < 0) mouse.global.y = 0; else if( mouse.global.y > viewHeight) mouse.global.y = viewHeight; filter.uniforms.LightPos.value[0] = mouse.global.x; filter.uniforms.LightPos.value[1] = mouse.global.y; renderer.render(stage); requestAnimationFrame( animate ); }}); Am i missing something ? Quote Link to comment Share on other sites More sharing options...
Alexis Posted January 23, 2015 Author Share Posted January 23, 2015 Here is a JSFiddle where you can see the blank result and the errorshttp://jsfiddle.net/ase7qyrs/ Quote Link to comment Share on other sites More sharing options...
shaneburk89 Posted January 28, 2015 Share Posted January 28, 2015 I had similar issues where I was able to get this to work with 1.4 and not with the current version. My screen was not white after playing with it for a while I was able to get it to 'work' but the textures became a sharp green hue. It appears to be a bug from the information I found. https://github.com/GoodBoyDigital/pixi.js/issues/1355 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.