-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Creating a CubeTexture from 6 CompressedTextures doesn't work after r136 #24065
Comments
Can confirm the issue is isolated to changes made in that PR. Among them, this should perhaps be three.js/src/renderers/webgl/WebGLTextures.js Lines 1080 to 1084 in 5c70435
However, the cube texture is still unrenderable in this case (issues with mipmaps?). Setting |
A vanilla version would be great! Ideally with
There is an example that uses a compressed cube map and it works fine. Using |
It does not quite work for me. |
Your platform probably does not fully support S3TC. |
Cool, I'll get on that
I think maybe you misunderstood the specific workflow I'm trying to achieve. I can see in that example the compressed textures are loaded using the From my understanding, Three.js's I could just be misinterpreting what you're saying. I'm not super familiar with the WebGL APIs and what goes on under the hood with Three.js. If there's some specific requirements for texture for the |
Yeah, I guess this is something we should try to support, too. You're just using the cubemaps as backgrounds and not environment maps, correct?
Hm we must be using RGB_ETC2_Format and RGBA_ASTC_4x4_Format with sRGB encoding elsewhere... this warning may not be quite right? |
@donmccurdy That's correct. I'm just using it as a scene background.
You know what, I think that error goes away when I set |
A background texture probably should be sRGB though -- so I suspect your original code was right and the warning is incorrect for this case. |
This warning is generate in I think the main problem is that compressed cube textures also have to use |
Possible solution: |
Thanks @donmccurdy! That indeed does resolve my issue. I think composing the cube texture manually should be possible now. Although, it's probably best to load it as a single .ktx2 cubemap texture, which is now possible thanks to your work on the KTX2Loader to support that 🙏 . Good to close this ticket out now. |
Describe the bug
Prior to version
r136
of the library, creating aCubeTexture
from 6CompressedTextures
used to work just fine. However, it seems like this change introduced in r136 changed the behaviour of how textures are loaded into the GPU when WebGL 2 APIs are available, which broke this use-case.As a work-around, I have been able to get the cube texture to render by setting
texture.isVideoTexture = true
on theCubeTexture
. According to this line, that forces Three to opt-out of usingtexStorage2D
which seems to be causing the issueCode
Live example
Expected behavior
It should load the
CubeTexture
just fine as the scene background. Instead, the scene background is black and the following errors show in the console:and
Upgrading to r140.2, also shows this added error:
Screenshots
Screen.Recording.2022-05-15.at.11.01.09.AM.mov
Platform:
The text was updated successfully, but these errors were encountered: