Skip to content

Commit 6213396

Browse files
committed
Fix mipmaps generation for cubemap framebuffer targets #1222
1 parent 52ffaef commit 6213396

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,12 +2030,14 @@ public void setFrameBuffer(FrameBuffer fb) {
20302030
for (int i = 0; i < context.boundFB.getNumColorBuffers(); i++) {
20312031
RenderBuffer rb = context.boundFB.getColorBuffer(i);
20322032
Texture tex = rb.getTexture();
2033-
if (tex != null
2034-
&& tex.getMinFilter().usesMipMapLevels()) {
2033+
if (tex != null && tex.getMinFilter().usesMipMapLevels()) {
20352034
setTexture(0, rb.getTexture());
2036-
2037-
int textureType = convertTextureType(tex.getType(), tex.getImage().getMultiSamples(), rb.getFace());
2038-
glfbo.glGenerateMipmapEXT(textureType);
2035+
if(tex.getType()==Texture.Type.CubeMap){
2036+
glfbo.glGenerateMipmapEXT(GL.GL_TEXTURE_CUBE_MAP);
2037+
}else{
2038+
int textureType = convertTextureType(tex.getType(), tex.getImage().getMultiSamples(), rb.getFace());
2039+
glfbo.glGenerateMipmapEXT(textureType);
2040+
}
20392041
}
20402042
}
20412043
}

0 commit comments

Comments
 (0)