private void setTextureFilters (TextureFilter min, TextureFilter mag) { for (Texture texture : trackedTextures) { texture.setFilter(min, mag); } trackedTextures.clear(); }
private void setTextureFilters (TextureFilter min, TextureFilter mag) { for (Texture texture : trackedTextures) { texture.setFilter(min, mag); } trackedTextures.clear(); }
public void actionPerformed (ActionEvent event) { editor.getTexture().setFilter((TextureFilter)minFilterBox.getSelectedItem(), (TextureFilter)magFilterBox.getSelectedItem()); } };
public void actionPerformed (ActionEvent event) { editor.getTexture().setFilter((TextureFilter)minFilterBox.getSelectedItem(), (TextureFilter)magFilterBox.getSelectedItem()); } };
@Override public Texture load (String fileName) { Texture result = new Texture(Gdx.files.internal(fileName), useMipMaps); result.setFilter(minFilter, magFilter); result.setWrap(uWrap, vWrap); return result; } }
protected void load (BitmapFontData data) { super.load(data); // Distance field font rendering requires font texture to be filtered linear. final Array<TextureRegion> regions = getRegions(); for (TextureRegion region : regions) region.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
protected void load (BitmapFontData data) { super.load(data); // Distance field font rendering requires font texture to be filtered linear. final Array<TextureRegion> regions = getRegions(); for (TextureRegion region : regions) region.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
@Override protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Texture result = new Texture(data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { GLOnlyTextureData data = new GLOnlyTextureData(bufferBuilder.width, bufferBuilder.height, 0, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type); Texture result = new Texture(data); result.setFilter(TextureFilter.Linear, TextureFilter.Linear); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { FloatTextureData data = new FloatTextureData( bufferBuilder.width, bufferBuilder.height, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type, attachmentSpec.isGpuOnly ); Texture result = new Texture(data); if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet) result.setFilter(TextureFilter.Linear, TextureFilter.Linear); else // no filtering for float textures in OpenGL ES result.setFilter(TextureFilter.Nearest, TextureFilter.Nearest); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override public Texture load (String fileName) { Texture result = new Texture(Gdx.files.internal(fileName), useMipMaps); result.setFilter(minFilter, magFilter); result.setWrap(uWrap, vWrap); return result; } }
@Override protected Texture createTexture (FrameBufferTextureAttachmentSpec attachmentSpec) { FloatTextureData data = new FloatTextureData( bufferBuilder.width, bufferBuilder.height, attachmentSpec.internalFormat, attachmentSpec.format, attachmentSpec.type, attachmentSpec.isGpuOnly ); Texture result = new Texture(data); if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet) result.setFilter(TextureFilter.Linear, TextureFilter.Linear); else // no filtering for float textures in OpenGL ES result.setFilter(TextureFilter.Nearest, TextureFilter.Nearest); result.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge); return result; }
@Override public Texture loadSync (AssetManager manager, String fileName, FileHandle file, TextureParameter parameter) { if (info == null) return null; Texture texture = info.texture; if (texture != null) { texture.load(info.data); } else { texture = new Texture(info.data); } if (parameter != null) { texture.setFilter(parameter.minFilter, parameter.magFilter); texture.setWrap(parameter.wrapU, parameter.wrapV); } return texture; }
@Override public Texture loadSync (AssetManager manager, String fileName, FileHandle file, TextureParameter parameter) { if (info == null) return null; Texture texture = info.texture; if (texture != null) { texture.load(info.data); } else { texture = new Texture(info.data); } if (parameter != null) { texture.setFilter(parameter.minFilter, parameter.magFilter); texture.setWrap(parameter.wrapU, parameter.wrapV); } return texture; }
private void createTexture () { Pixmap pixmap = new Pixmap(256, 256, Format.RGB565); boolean useRed = true; for (int y = 0; y < 256; y += 8) { for (int x = 0; x < 256; x += 8) { pixmap.setColor(useRed ? 1 : 0, 0, useRed ? 0 : 1, 1); pixmap.fillRectangle(x, y, 8, 8); useRed = !useRed; } useRed = !useRed; } texture = new Texture(pixmap, true); texture.setFilter(TextureFilter.MipMapLinearLinear, TextureFilter.Linear); }
@Override public void create () { batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/g2d/progressive-libgdx.jpg")); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); drawable = new TextureRegionDrawable(new TextureRegion(texture)); }
@Override public void create () { Pixmap pixmap = new Pixmap(256, 256, Format.RGBA8888); pixmap.setColor(1, 0, 0, 1); pixmap.fill(); texture = new Texture(pixmap, false); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); batch = new SpriteBatch(); pixmap.dispose(); }
public void create () { Batch batch = new CpuSpriteBatch(); // batch = new SpriteBatch(); stage = new Stage(new ExtendViewport(500, 500), batch); Gdx.input.setInputProcessor(stage); texture = new Texture("data/bobargb8888-32x32.png"); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); TextureRegionDrawable drawable = new TextureRegionDrawable(new TextureRegion(texture)); for (int i = 0; i < NUM_GROUPS; i++) { Group group = createActorGroup(drawable); stage.addActor(group); } }
@Override public void render () { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_TEXTURE_2D); camera.update(); currTexture = hwMipMap.isChecked() ? textureHW : textureSW; currTexture.bind(); currTexture.setFilter(TextureFilter.valueOf(minFilter.getSelected()), TextureFilter.valueOf(magFilter.getSelected())); shader.begin(); shader.setUniformMatrix("u_projTrans", camera.combined); shader.setUniformi("s_texture", 0); mesh.render(shader, GL20.GL_TRIANGLE_FAN); shader.end(); ui.act(); ui.draw(); }
@Override public void create () { texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), true); texture.setFilter(TextureFilter.MipMap, TextureFilter.Linear); ObjLoader objLoader = new ObjLoader(); mesh = objLoader.loadModel(Gdx.files.internal("data/cube.obj")); mesh.materials.get(0).set(new TextureAttribute(TextureAttribute.Diffuse, texture)); modelInstance = new ModelInstance(mesh); modelBatch = new ModelBatch(); cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(3, 3, 3); cam.direction.set(-1, -1, -1); batch = new SpriteBatch(); font = new BitmapFont(); }