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

Canvas renderer does not work on chrome OS. #41

Closed
moleCuleFFF opened this issue Apr 4, 2018 · 13 comments
Closed

Canvas renderer does not work on chrome OS. #41

moleCuleFFF opened this issue Apr 4, 2018 · 13 comments
Labels

Comments

@moleCuleFFF
Copy link

jurassicworldevolution.com/research -> example

@giniedp
Copy link
Owner

giniedp commented Apr 4, 2018

i dont have a chrome OS device to test with but will install a virtual box image later today.

@moleCuleFFF
Copy link
Author

Let me know if you need any more info about the source code as the JS is minified and compressed.

@giniedp
Copy link
Owner

giniedp commented Apr 4, 2018

Can you give me some more details about the device and the chrome OS version?

I have downloaded the chromium browser, and it seems to work. It might take me a while to get a proper virtual box image.

@moleCuleFFF
Copy link
Author

So it works absolutely fine on all versions of chrome except across the board on android as far as I can tell. It also works if you set the renderer to image but for various reasons I require the canvas renderer.
It seems to reproduce the same issue if you don't tell spritesmith about the framesX.

@moleCuleFFF
Copy link
Author

It appears that the canvasRatio is not being set correctly.
On chrome android it is set at 4. Everywhere else it is 2.625

@giniedp
Copy link
Owner

giniedp commented Apr 4, 2018

which version of spritespin do you use? There has been an issue with hi def canvas which i had fixed recently
82d0628

@giniedp
Copy link
Owner

giniedp commented Apr 4, 2018

looking through the sourcecode on the page it seems you have an older version of spritespin. Please try a recent version which you can get here

http://unpkg.com/[email protected]/release/spritespin.js

or via NPM

npm install spritespin

The examples from the website do work under android

http://spritespin.ginie.eu/samples/#/basics-basics

@moleCuleFFF
Copy link
Author

I'll try updating thanks m8, am using yarn so the lock file may well be out of date.

@moleCuleFFF
Copy link
Author

Updated and still getting the same issue although feeling it's to do with spritespin being instantiated to early and not yet knowing the dimensions of it's wrapper. Going to close this issue as your demo's seem to work on chrome 4 android.

@giniedp
Copy link
Owner

giniedp commented Apr 5, 2018

i see you use pretty large spritesheets. Maybe it is related to #42
May i use one of your images to investigate the issue isolated from the website you are working on?

@giniedp
Copy link
Owner

giniedp commented Apr 5, 2018

i assume this has something to do with the maximum texture size of a device.

check this site to detect the limitation on your device GPU
https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/limits/gl-max-texture-dimensions.html

SpriteSpin seems to do correct calculations, but as soon as it gets to the HTMLCanvas.drawImage then the drawing is simply not correct, the image seems to be downscaled.

The Canvas element on Chrome is GPU accelerated so a call to HTMLCanvas.drawImage hits that GPU limit. However, this is all speculation since i can not find a proper documentation (right now)

You could split your sprite sheet into several sprite sheets. All spritespin parameters wont change, except the source, there you have to put an array of urls.

@giniedp giniedp reopened this Apr 5, 2018
@giniedp
Copy link
Owner

giniedp commented Apr 5, 2018

the solution i mentioned is not functional yet (multiple sprite sheets), but i am working on it

@giniedp
Copy link
Owner

giniedp commented Apr 5, 2018

closed in favor of #43

@giniedp giniedp added the bug label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants