LibGDX 抗锯齿
2022-09-02 09:26:56
要平滑任何线条或形状,请使用多采样消除锯齿
,将:
替换为:Gdx.gl.glclear()
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT | (Gdx.graphics.getBufferFormat().coverageSampling?GL20.GL_COVERAGE_BUFFER_BIT_NV:0))
对于Android,打开AndroidLauncher.java文件并放入:2是一个不错的价值config.numSamples = 2
对于台式机,这将完成您的工作...config.samples=3
您也可以将滤镜放在纹理本身中
bg = new TextureRegion(new Texture(
Gdx.files.internal("data/bg.png")));
//bg.getTexture().setFilter(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR);
bg.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);