Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

texImage2D/PoT errors #17

Open
StrandedKitty opened this issue Jan 27, 2020 · 1 comment
Open

texImage2D/PoT errors #17

StrandedKitty opened this issue Jan 27, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@StrandedKitty
Copy link

StrandedKitty commented Jan 27, 2020

When running the game (http://jblaha.art/03_alpha/index.html) on my Pixel 3a I get these errors in console:

image

As far as I know, your game uses WebGL 1 (THREE.WebGLRenderer is initialized without specifying any context). And WebGL 1 does not support mipmapping for non-power-of-two textures (basically, mipmapping for particular texture is turned on if Texture.minFilter is set to THREE.LinearMipmapLinearFilter, which is the default value). It may cause the errors on my device. Or it might be MAX_TEXTURE_SIZE of 4096.

Also you can try switching to WebGL 2. When using Three.js it can be easily done and it will eliminate all PoT problems.

@swift502
Copy link
Owner

swift502 commented Feb 3, 2020

Hi, thanks for the report!

Similar WebGL errors pop up occasionally (seemingly at random) in my console even on PC. I'm pretty sure my textures have power-of-two sizes (I think three.js even warns you about it, and automatically converts any non-POT textures into POT textures), and they should definitely be less than 4096px in size.

So I don't know. I'll see if I find the time for this. I'm not terribly concerned about errors appearing on mobile devices, as the demo is not even playable on them at the moment.

But thanks for the report nonetheless! 🙂

Edit: As for WebGL 2, there's this cryptic message in How to use WebGL 2 which suggests POT textures are handled by three.js even without the need to switch to WebGL 2?

  • Non-power of two (POT) textures work just the same as POT textures now. No resizing is required for best quality.

@swift502 swift502 added the bug Something isn't working label Feb 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants