question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set manual mipmaps for CubeTexture

See original GitHub issue
Description 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Jan 13, 2020

Should be solved via #17072

0reactions
robertoranoncommented, Oct 5, 2018

This PR should do exactly what requested

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found