Java Code Examples for com.jogamp.opengl.GL4#glGenTextures()
The following examples show how to use
com.jogamp.opengl.GL4#glGenTextures() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Gl_430_fbo_invalidate.java From jogl-samples with MIT License | 6 votes |
private boolean initTexture(GL4 gl4) { gl4.glGenTextures(Texture.MAX, textureName); { gl4.glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textureName.get(Texture.MULTISAMPLE)); gl4.glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_RGBA8, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y, true); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gl4.glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0); } { gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.COLOR)); gl4.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, null); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gl4.glBindTexture(GL_TEXTURE_2D, 0); } return true; }
Example 2
Source File: Gl_440_sampler_wrap.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE_DXT5)); gl4.glGenTextures(1, textureName); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); for (int level = 0; level < texture.levels(); ++level) { gl4.glCompressedTexImage2D( GL_TEXTURE_2D, level, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, texture.dimensions(level)[0], texture.dimensions(level)[1], 0, texture.size(level), texture.data(level)); } } catch (IOException ex) { Logger.getLogger(Gl_440_sampler_wrap.class.getName()).log(Level.SEVERE, null, ex); } return checkError(gl4, "initTexture"); }
Example 3
Source File: Gl_450_clip_control.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D_ARRAY, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage3D(GL_TEXTURE_2D_ARRAY, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1], 1); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage3D(GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], 1, format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_450_clip_control.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 4
Source File: Gl_400_texture_buffer_rgb.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { gl4.glGenTextures(Texture.MAX, textureName); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.DISPLACEMENT)); gl4.glTexBuffer(GL_TEXTURE_BUFFER, GL_RGB32F, bufferName.get(Buffer.DISPLACEMENT)); gl4.glBindTexture(GL_TEXTURE_BUFFER, 0); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.DIFFUSE)); gl4.glTexBuffer(GL_TEXTURE_BUFFER, GL_RGB32F, bufferName.get(Buffer.DIFFUSE)); gl4.glBindTexture(GL_TEXTURE_BUFFER, 0); return checkError(gl4, "initTextureBuffer"); }
Example 5
Source File: Gl_400_fbo_rtt.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { gl4.glActiveTexture(GL_TEXTURE0); gl4.glGenTextures(Texture.MAX, textureName); for (int i = Texture.R; i <= Texture.B; ++i) { gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(i)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gl4.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, windowSize.x / FRAMEBUFFER_FACTOR, windowSize.y / FRAMEBUFFER_FACTOR, 0, GL_RGB, GL_UNSIGNED_BYTE, null); } return checkError(gl4, "initTexture"); }
Example 6
Source File: Gl_500_glsl_vote_arb.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_500_glsl_vote_arb.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 7
Source File: Gl_430_texture_storage.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D_ARRAY, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage3D(GL_TEXTURE_2D_ARRAY, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1], 1); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage3D(GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], 1, format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_430_texture_storage.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 8
Source File: Gl_410_glsl_block.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexImage2D(GL_TEXTURE_2D, level, format.internal.value, texture.dimensions(level)[0], texture.dimensions(level)[1], 0, format.external.value, format.type.value, texture.data(level)); } gl4.glGenerateMipmap(GL_TEXTURE_2D); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_410_glsl_block.class.getName()).log(Level.SEVERE, null, ex); } return checkError(gl4, "initTexture"); }
Example 9
Source File: Gl_430_draw_without_vertex_attrib.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_430_draw_without_vertex_attrib.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 10
Source File: Gl_400_sampler_fetch.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D_ARRAY, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); for (int level = 0; level < texture.levels(); ++level) { gl4.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, level, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, texture.dimensions(level)[0], texture.dimensions(level)[1], 1, 0, texture.size(level), texture.data(level)); } } catch (IOException ex) { Logger.getLogger(Gl_400_sampler_fetch.class.getName()).log(Level.SEVERE, null, ex); } return checkError(gl4, "initTexture"); }
Example 11
Source File: Gl_400_fbo_rtt_texture_array.java From jogl-samples with MIT License | 5 votes |
private boolean initTexture(GL4 gl4) { gl4.glActiveTexture(GL_TEXTURE0); gl4.glGenTextures(1, textureName); gl4.glBindTexture(GL_TEXTURE_2D_ARRAY, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST); Vec2i framebufferSize = new Vec2i(windowSize.x / FRAMEBUFFER_SIZE, windowSize.y / FRAMEBUFFER_SIZE); gl4.glTexImage3D( GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8, framebufferSize.x, framebufferSize.y, 3, //depth 0, GL_RGB, GL_UNSIGNED_BYTE, null); return checkError(gl4, "initTexture"); }
Example 12
Source File: Gl_420_fbo.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { boolean validated = true; try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(Texture.MAX, textureName); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.DIFFUSE)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), GL_COMPRESSED_RGB_S3TC_DXT1_EXT, texture.dimensions()[0], texture.dimensions()[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glCompressedTexSubImage2D( GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], GL_COMPRESSED_RGB_S3TC_DXT1_EXT, texture.size(level), texture.data(level)); } gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.COLORBUFFER)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); gl4.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, windowSize.x, windowSize.y); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.RENDERBUFFER)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); gl4.glTexStorage2D(GL_TEXTURE_2D, 1, GL_DEPTH_COMPONENT24, windowSize.x, windowSize.y); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_420_fbo.class.getName()).log(Level.SEVERE, null, ex); } return validated; }
Example 13
Source File: Gl_500_buffer_pinned_amd.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { boolean validated = true; try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D_ARRAY, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_R, format.swizzles.r.value); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_G, format.swizzles.g.value); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_B, format.swizzles.b.value); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_SWIZZLE_A, format.swizzles.a.value); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage3D(GL_TEXTURE_2D_ARRAY, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1], 1); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage3D(GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], 1, format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_500_buffer_pinned_amd.class.getName()).log(Level.SEVERE, null, ex); } return validated; }
Example 14
Source File: Gl_430_debug.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { boolean validated = true; try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(1, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0)); gl4.glObjectLabel(GL_TEXTURE, textureName.get(0), -1, "Texture object".getBytes(), 0); gl4.glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 1, GL_DEBUG_SEVERITY_NOTIFICATION, -1, "Throwing an error on glTexParameteri"); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_LINEAR); // Generates an error GL_LINEAR instead of GL_ALPHA gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), GL_RGBA8, texture.dimensions(0)[0], texture.dimensions(0)[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D( GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], GL_BGR, GL_UNSIGNED_BYTE, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_430_debug.class.getName()).log(Level.SEVERE, null, ex); } return validated; }
Example 15
Source File: Gl_430_program_compute_image.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(Texture.MAX, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.DIFFUSE)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); int[] textureBufferOffset = {0}; gl4.glGetIntegerv(GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT, textureBufferOffset, 0); int textureBufferRange = Math.max(positionSize, textureBufferOffset[0]); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.POSITION_INPUT)); gl4.glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F, bufferName.get(Buffer.POSITION_INPUT), 0, textureBufferRange); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.TEXCOORD_INPUT)); gl4.glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F, bufferName.get(Buffer.TEXCOORD_INPUT), 0, textureBufferRange); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.COLOR_INPUT)); gl4.glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F, bufferName.get(Buffer.COLOR_INPUT), 0, textureBufferRange); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.POSITION_OUTPUT)); gl4.glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F, bufferName.get(Buffer.POSITION_OUTPUT), 0, textureBufferRange); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.TEXCOORD_OUTPUT)); gl4.glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F, bufferName.get(Buffer.TEXCOORD_OUTPUT), 0, textureBufferRange); gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.COLOR_OUTPUT)); gl4.glTexBufferRange(GL_TEXTURE_BUFFER, GL_RGBA32F, bufferName.get(Buffer.COLOR_OUTPUT), 0, textureBufferRange); gl4.glBindTexture(GL_TEXTURE_BUFFER, 0); } catch (IOException ex) { Logger.getLogger(Gl_430_program_compute_image.class.getName()).log(Level.SEVERE, null, ex); } return checkError(gl4, "initTexture"); }
Example 16
Source File: Gl_420_draw_image_space_rendering.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(Texture.MAX, textureName); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.DIFFUSE)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), GL_COMPRESSED_RGB_S3TC_DXT1_EXT, texture.dimensions()[0], texture.dimensions()[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glCompressedTexSubImage2D( GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[0], GL_COMPRESSED_RGB_S3TC_DXT1_EXT, texture.size(level), texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_420_draw_image_space_rendering.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 17
Source File: Gl_420_picking.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glGenTextures(Texture.MAX, textureName); // Diffuse { gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.DIFFUSE)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions(0)[0], texture.dimensions(0)[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } // Piking { gl4.glBindTexture(GL_TEXTURE_BUFFER, textureName.get(Texture.PICKING)); gl4.glTexBuffer(GL_TEXTURE_BUFFER, GL_R32F, bufferName.get(Buffer.PICKING)); gl4.glBindTexture(GL_TEXTURE_BUFFER, 0); } } catch (IOException ex) { Logger.getLogger(Gl_420_picking.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 18
Source File: Gl_430_fbo_without_attachment.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); jgli.Gl.Swizzles swizzles = jgli.Gl.translate(texture.swizzles()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(Texture.MAX, textureName); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.DIFFUSE)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, swizzles.r.value); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, swizzles.g.value); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, swizzles.b.value); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, swizzles.a.value); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions()[0], texture.dimensions()[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.COLORBUFFER)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); gl4.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, windowSize.x, windowSize.y); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_430_fbo_without_attachment.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 19
Source File: Gl_500_multi_draw_indirect_count_arb.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { try { jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE)); assert (!texture.empty()); jgli.Gl.Format format = jgli.Gl.translate(texture.format()); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gl4.glGenTextures(Texture.MAX, textureName, 0); gl4.glActiveTexture(GL_TEXTURE0); gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.A]); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_NONE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_NONE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, GLint(Texture.levels() - 1)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions()[0], texture.dimensions()[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.B]); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_NONE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_NONE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, GLint(Texture.levels() - 1)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions()[0], texture.dimensions()[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glBindTexture(GL_TEXTURE_2D, textureName[Texture.C]); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_NONE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_NONE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, GLint(Texture.levels() - 1)); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), format.internal.value, texture.dimensions()[0], texture.dimensions()[1]); for (int level = 0; level < texture.levels(); ++level) { gl4.glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, texture.dimensions(level)[0], texture.dimensions(level)[1], format.external.value, format.type.value, texture.data(level)); } gl4.glBindTexture(GL_TEXTURE_2D, 0); gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4); } catch (IOException ex) { Logger.getLogger(Gl_500_multi_draw_indirect_arb.class.getName()).log(Level.SEVERE, null, ex); } return true; }
Example 20
Source File: Gl_420_texture_cube.java From jogl-samples with MIT License | 4 votes |
private boolean initTexture(GL4 gl4) { gl4.glActiveTexture(GL_TEXTURE0); gl4.glGenTextures(1, textureName); gl4.glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textureName.get(0)); gl4.glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_BASE_LEVEL, 0); gl4.glTexParameteri(GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_MAX_LEVEL, 2); jgli.TextureCube textureA = new TextureCube(jgli.Format.FORMAT_RGBA8_UNORM_PACK32, new int[]{512, 512}, 1); assert (!textureA.empty()); textureA.clear(0, 0, 0, new byte[]{(byte) 255, (byte) 0, (byte) 0, (byte) 255}); textureA.clear(0, 1, 0, new byte[]{(byte) 255, (byte) 128, (byte) 0, (byte) 255}); textureA.clear(0, 2, 0, new byte[]{(byte) 255, (byte) 255, (byte) 0, (byte) 255}); textureA.clear(0, 3, 0, new byte[]{(byte) 0, (byte) 255, (byte) 0, (byte) 255}); textureA.clear(0, 4, 0, new byte[]{(byte) 0, (byte) 255, (byte) 255, (byte) 255}); textureA.clear(0, 5, 0, new byte[]{(byte) 0, (byte) 0, (byte) 255, (byte) 255}); jgli.TextureCube textureB = new TextureCube(jgli.Format.FORMAT_RGBA8_UNORM_PACK32, new int[]{256, 256}, 1); assert (!textureB.empty()); textureB.clear(0, 0, 0, new byte[]{(byte) 255, (byte) 128, (byte) 128, (byte) 255}); textureB.clear(0, 1, 0, new byte[]{(byte) 255, (byte) 192, (byte) 128, (byte) 255}); textureB.clear(0, 2, 0, new byte[]{(byte) 255, (byte) 255, (byte) 128, (byte) 255}); textureB.clear(0, 3, 0, new byte[]{(byte) 128, (byte) 255, (byte) 128, (byte) 255}); textureB.clear(0, 4, 0, new byte[]{(byte) 128, (byte) 255, (byte) 255, (byte) 255}); textureB.clear(0, 5, 0, new byte[]{(byte) 128, (byte) 128, (byte) 255, (byte) 255}); jgli.TextureCube textureC = new TextureCube(jgli.Format.FORMAT_RGBA8_UNORM_PACK32, new int[]{128, 128}, 1); assert (!textureC.empty()); textureC.clear(0, 0, 0, new byte[]{(byte) 255, (byte) 192, (byte) 192, (byte) 255}); textureC.clear(0, 1, 0, new byte[]{(byte) 255, (byte) 224, (byte) 192, (byte) 255}); textureC.clear(0, 2, 0, new byte[]{(byte) 255, (byte) 255, (byte) 192, (byte) 255}); textureC.clear(0, 3, 0, new byte[]{(byte) 192, (byte) 255, (byte) 192, (byte) 255}); textureC.clear(0, 4, 0, new byte[]{(byte) 192, (byte) 255, (byte) 255, (byte) 255}); textureC.clear(0, 5, 0, new byte[]{(byte) 192, (byte) 192, (byte) 255, (byte) 255}); gl4.glTexStorage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 3, GL_RGBA8, textureA.dimensions()[0], textureA.dimensions()[1], textureA.faces()); gl4.glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, 0, 0, 0, textureA.dimensions()[0], textureA.dimensions()[1], textureA.faces(), GL_RGBA, GL_UNSIGNED_BYTE, textureA.data()); gl4.glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 1, 0, 0, 0, textureB.dimensions()[0], textureB.dimensions()[1], textureB.faces(), GL_RGBA, GL_UNSIGNED_BYTE, textureB.data()); gl4.glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 2, 0, 0, 0, textureC.dimensions()[0], textureC.dimensions()[1], textureC.faces(), GL_RGBA, GL_UNSIGNED_BYTE, textureC.data()); //glGenerateMipmap(GL_TEXTURE_CUBE_MAP_ARRAY); return true; }