making dithering work on skybox drawing

This commit is contained in:
minjaesong
2019-12-15 12:39:20 +09:00
parent b319485637
commit 3e5a581e89
3 changed files with 11 additions and 2 deletions

View File

@@ -392,7 +392,7 @@ public class AppLoader implements ApplicationListener {
// set GL graphics constants
shaderBayerSkyboxFill = loadShader("assets/4096.vert", "assets/4096_bayer_skyboxfill.frag");
shaderHicolour = loadShader("assets/4096.vert", "assets/hicolour.frag");
shaderPassthruRGB = loadShader("assets/4096.vert", "assets/passthrurgb.frag");
shaderPassthruRGB = SpriteBatch.createDefaultShader();
shaderColLUT = loadShader("assets/4096.vert", "assets/passthrurgb.frag");
shaderReflect = loadShader("assets/4096.vert", "assets/reflect.frag");

View File

@@ -103,6 +103,7 @@ object DefaultConfig {
// "fancy" graphics settings
jsonObject.addProperty("fxdither", true)
jsonObject.addProperty("fxretro", false)
//jsonObject.addProperty("fx3dlut", false)

View File

@@ -173,7 +173,15 @@ internal object WeatherMixer : RNGConsumer {
skyboxTexture.dispose()
skyboxTexture = Texture(skyboxPixmap); skyboxTexture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear)
batch.shader = IngameRenderer.shaderBayer
if (AppLoader.getConfigBoolean("fxdither")) {
batch.shader = IngameRenderer.shaderBayer
batch.shader.setUniformf("rcount", 64f)
batch.shader.setUniformf("gcount", 64f)
batch.shader.setUniformf("bcount", 64f)
}
else {
batch.shader = null
}
batch.inUse {
it.draw(skyboxTexture, 0f, -AppLoader.halfScreenHf, AppLoader.screenWf, AppLoader.screenHf * 2f) // because of how the linear filter works, we extend the image by two
}