phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Issue with WebGL filters on some devices. #554

Closed VektreX closed 4 years ago

VektreX commented 6 years ago

Hi, I just ran into a strange issue with using filters. For some reason if I try to run some code that involves applying a filter to a sprite on my OnePlus 3T (Running Android 8.0.0), the sprite fails to display at all. The issue only arises on that device; I've tried it with Chrome 67 on Windows 10, Mac OSX High Sierra , as well as my older Android devices which are a Nexus 9 and a Nexus 5, all with no issues. Here is some basic sample code : https://codepen.io/VektreX/pen/ZRMOvm On the OP3T, the sprite in the corner shows up just fine, but the one in the middle with a filter applied doesn't display at all. The console also gets flooded in WebGL: INVALID_VALUE: vertexAttribPointer: index out of range errors.

nazimboudeffa commented 6 years ago

Do you use Cordova to port your code to Android or is it running in the smartphone's browser ?

VektreX commented 6 years ago

The code is running in the smartphone's browser (Chrome 67)

nazimboudeffa commented 6 years ago

So this is what I got when running your example in codepen on my Android smartphone but it displays on my PC, I'll try to dig on why, not sure I am able to explain why but going to take a look and try to understand the problem

screenshot_20180713-225932

nazimboudeffa commented 6 years ago

Juste a first question @VektreX : Can you test please this page https://phaser.io/examples/v2/filters/blur on your smartphone because it works on mine and the blur effect is displayed ?

VektreX commented 6 years ago

Yes, the example from the Phaser site does display correctly on Android, but it is using 2.6.2. I forked my pen to use 2.6.2 and filters do work correctly with that version, so there was a regression in Phaser CE that wasn't caught before. https://codepen.io/VektreX/pen/ZjbqqZ

VektreX commented 6 years ago

OK so I have gone through previous versions of Phaser CE and the issue seems to have been introduced with 2.7.0 where it was affecting all platforms, and then was seemingly resolved for most platforms with 2.7.8. I hope this can help to pinpoint the issue.

nazimboudeffa commented 6 years ago

Very good point that will help investigate this bug

samme commented 4 years ago

Closing, but please reopen if you see this issue again.