mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
making dithering work on skybox drawing
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ object DefaultConfig {
|
||||
|
||||
|
||||
// "fancy" graphics settings
|
||||
jsonObject.addProperty("fxdither", true)
|
||||
jsonObject.addProperty("fxretro", false)
|
||||
//jsonObject.addProperty("fx3dlut", false)
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user