@Override protected Cubemap createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Cubemap result = new Cubemap(data, data, data, data, data, data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override protected Cubemap createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Cubemap result = new Cubemap(data, data, data, data, data, data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; }
@Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; }
@Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; }
@Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; }
public void setEnvironment (String name) { if (name == null) return; if (cubemap != null) { cubemap.dispose(); cubemap = null; } if (name.equals("<none>")) { if (environment.has(CubemapAttribute.EnvironmentMap)) { environment.remove(CubemapAttribute.EnvironmentMap); shaderProvider.clear(); } } else { FileHandle root = Gdx.files.internal("data/g3d/environment"); FacedCubemapData faces = new FacedCubemapData(root.child(name + "_PX.png"), root.child(name+"_NX.png"), root.child(name + "_PY.png"), root.child(name + "_NY.png"), root.child(name + "_PZ.png"), root.child(name + "_NZ.png"), false); // FIXME mipmapping on desktop cubemap = new Cubemap(faces); faces.load(CubemapSide.NegativeX, root.child(name + "_NX.png")); cubemap.load(faces); if (!environment.has(CubemapAttribute.EnvironmentMap)) shaderProvider.clear(); environment.set(new CubemapAttribute(CubemapAttribute.EnvironmentMap, cubemap)); } }
modelBatch = new ModelBatch(new DefaultShaderProvider(new Config(cubemapVS, cubemapFS))); cubemap = new Cubemap(new KTXTextureData(Gdx.files.internal("data/cubemap.zktx"), true)); cubemap.setFilter(TextureFilter.MipMapLinearLinear, TextureFilter.Linear);
public void set(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle negativeY, FileHandle positiveZ, FileHandle negativeZ) { if (cubemap != null) { cubemap.dispose(); } cubemap = new Cubemap(positiveX, negativeX, positiveY, negativeY, positiveZ, negativeZ); this.positiveX = positiveX; this.negativeX = negativeX; this.positiveY = positiveY; this.negativeY = negativeY; this.positiveZ = positiveZ; this.negativeZ = negativeZ; }
@Override protected Cubemap createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Cubemap result = new Cubemap(data, data, data, data, data, data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override public Cubemap loadSync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) { if (info == null) return null; Cubemap cubemap = info.cubemap; if (cubemap != null) { cubemap.load(info.data); } else { cubemap = new Cubemap(info.data); } if (parameter != null) { cubemap.setFilter(parameter.minFilter, parameter.magFilter); cubemap.setWrap(parameter.wrapU, parameter.wrapV); } return cubemap; }