Cannot set manual mipmaps for CubeTexture
See original GitHub issueDescription of the problem
Code in “setTextureCube” seems to only handle mipmaps for compressed textures. If I replace code in path that uploads uncompressed texture with this code, it works for data textures.
var mipmaps = texture.mipmaps;
if (!mipmaps.length) {
mipmaps.push(texture.image);
}
for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) {
state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmaps[j][i].image.width, mipmaps[j][i].image.height, 0, glFormat, glType, mipmaps[j][i].image.data );
}
I haven’t tested it with different types of textures. I’d be willing to make a pull request but I have no idea how this is intended to work (plain javascript without types is pretty hard to read beyond some complexity). Is there some reason why this wasn’t handled? Which mipmaps should be used, those on CubeTexture or those on individual faces? (it also isn’t very helpful that documentation doesn’t specify what mipmaps on texture should be, ImageData or Texture? Maybe it would make things clearer)
Three.js version
- Dev
- r85
- …
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Texture#mipmaps – three.js docs
Create a texture to apply to a surface or as a reflection or refraction map. Note: After the initial use of a texture,...
Read more >Not able to set each texture mipmap level manually
I'm not able to manually set the mipmap levels in opengl. This doesn't throw an error but no texture is displayed.
Read more >Cubemaps - Unity - Manual
A Cubemap is a collection of six square textures that represent the reflections on an environment. The six squares form the faces of...
Read more >flash.display3D.textures.CubeTexture - Adobe® AIR® API ...
You cannot create a CubeTexture object directly; use the Context3D ... Uploads a cube texture in Adobe Texture Format (ATF) from a byte...
Read more >Tutorial 5 : A Textured Cube
Linear filtering; Anisotropic filtering; Mipmaps ... Create one OpenGL texture GLuint textureID; glGenTextures(1, &textureID); // "Bind" the newly created ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Should be solved via #17072
This PR should do exactly what requested