PianoScoreJP Posted May 6, 2015 Share Posted May 6, 2015 Hello. I have a problem using sprite sheet. I have a sprite sheet which original image size is 6000 x 1080 px.There is no problem in Chrome browser(v.42.0.2311.135 m) for windows.However In Android Chrome v42.0.2311.111 (Android OS version is 4.2.2) , sprite images are not shown( shown as black square). I've tried several image size and I found if image size exceed 4096px , problem caused. Json text {"frames":{"a.png":{"frame":{"x":0,"y":0,"w":228,"h":436},"rotated":false,"trimmed":false,"spriteSourceSize":{"x":0,"y":0,"w":228,"h":436},"sourceSize":{"w":228,"h":436}},"b.png":{"frame":{"x":229,"y":0,"w":228,"h":436},"rotated":false,"trimmed":false,"spriteSourceSize":{"x":0,"y":0,"w":228,"h":436},"sourceSize":{"w":228,"h":436}}},"meta":{"image":"test.png","format":"RGBA8888","size":{"w":4097,"h":436},"scale":1}} Please see screenshot.Windows Android resize original image to 4096 px. AndroidThere is no problem in 4096px. Is this bug or specification ?Anyone know solution ? Quote Link to comment Share on other sites More sharing options...
xerver Posted May 6, 2015 Share Posted May 6, 2015 Yes there are maximum sizes to textures. http://webglstats.com/ That page has some aggregated stats on webgl across many different users and devices. Scroll down to MAX_TEXTURE_SIZE, which is at the bottom. If you filter to just smartphones you can see that 4096 is the average max size. Quote Link to comment Share on other sites More sharing options...
PianoScoreJP Posted May 6, 2015 Author Share Posted May 6, 2015 Thanks.How can I know MAX_TEXTURE_SIZE ?Is It depended on browser or device? Quote Link to comment Share on other sites More sharing options...
xerver Posted May 7, 2015 Share Posted May 7, 2015 Thanks. How can I know MAX_TEXTURE_SIZE ? Is It depended on browser or device? Browser, device, hardware, a lot of factors. I would use that site to find the smallest supported size for your demographic and use that. Quote Link to comment Share on other sites More sharing options...
PianoScoreJP Posted May 7, 2015 Author Share Posted May 7, 2015 OK.Thank you very much. Quote Link to comment Share on other sites More sharing options...
bbyford Posted May 22, 2020 Share Posted May 22, 2020 The site doesnt mention what the measurement is, can i presume its 4096 bytes? Quote Link to comment Share on other sites More sharing options...
Exca Posted May 22, 2020 Share Posted May 22, 2020 5 minutes ago, bbyford said: The site doesnt mention what the measurement is, can i presume its 4096 bytes? For the MAX_TEXTURE_SIZE it's how many pixels the image can be in width/height. Quote Link to comment Share on other sites More sharing options...
bbyford Posted May 22, 2020 Share Posted May 22, 2020 (edited) 9 minutes ago, Exca said: For the MAX_TEXTURE_SIZE it's how many pixels the image can be in width/height. care to elaborate? is that any combination like: 1x4096, 2048x2048 etc? Or the square of 4096 to produce a square factor for width and height? Edited May 22, 2020 by bbyford Quote Link to comment Share on other sites More sharing options...
Exca Posted May 22, 2020 Share Posted May 22, 2020 Anything below or equal to MAX * MAX is quaranteed to work (almost always, unless something is wrong with the gpu/driver). Going over either of those (even if decreasing another) might work or might not work. From the khronos specifciation: "The value gives a rough estimate of the largest texture that the GL can handle. The value must be at least 64. " bbyford 1 Quote Link to comment Share on other sites More sharing options...
bbyford Posted May 22, 2020 Share Posted May 22, 2020 15 minutes ago, Exca said: Anything below or equal to MAX * MAX is quaranteed to work (almost always, unless something is wrong with the gpu/driver). Going over either of those (even if decreasing another) might work or might not work. From the khronos specifciation: "The value gives a rough estimate of the largest texture that the GL can handle. The value must be at least 64. " Super, thanks! Quote Link to comment Share on other sites More sharing options...
themoonrat Posted May 23, 2020 Share Posted May 23, 2020 The reality is, everywhere supports 4096x4096. But! If, during your app, a texture is required to be rendered from an atlas not yet in the GPU memory, then a 4096x4096 texture is going to take longer to upload to it, and, in my experience, cause a micro stutter in the app on older mobile devices. So I used 2048x2048. Not quite as efficient as more atlases required.. but texture swapping doesn't effect gameplay. Now, depending on your app, that may or may not be a problem for you! You might be able to guarantee all base textures are uploaded to GPU using prepare plugin before being used, or you might only be targeting desktop, or might not have many textures so no multi-texture swapping is required. Quote Link to comment Share on other sites More sharing options...
Exca Posted May 25, 2020 Share Posted May 25, 2020 On 5/23/2020 at 10:05 AM, themoonrat said: The reality is, everywhere supports 4096x4096. I still have cases where the max is 2048x2048. Though we support very old hardware and even ie11. Quote Link to comment Share on other sites More sharing options...
themoonrat Posted May 25, 2020 Share Posted May 25, 2020 Ouch! 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.