mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
postprocessor for 3dlut colcorr; dithering should be managed in "dirty" way
dirty way: loads dithered/passthru shader according to the game's config (boolean fxdither)
This commit is contained in:
29
src/net/torvald/terrarum/PostProcessor.kt
Normal file
29
src/net/torvald/terrarum/PostProcessor.kt
Normal file
@@ -0,0 +1,29 @@
|
||||
package net.torvald.terrarum
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.GL20
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import com.badlogic.gdx.graphics.glutils.FrameBuffer
|
||||
|
||||
object PostProcessor {
|
||||
|
||||
private val batch = SpriteBatch()
|
||||
|
||||
fun draw(screenTexHolder: FrameBuffer) {
|
||||
//Gdx.gl.glClearColor(.094f, .094f, .094f, 1f)
|
||||
//Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
|
||||
|
||||
|
||||
batch.shader = null
|
||||
batch.inUse {
|
||||
val texture = screenTexHolder.colorBufferTexture
|
||||
batch.shader.setUniformMatrix("u_projTrans", batch.projectionMatrix)
|
||||
batch.draw(texture, 0f, 0f, texture.width.toFloat(), texture.height.toFloat())
|
||||
}
|
||||
|
||||
|
||||
Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0) // don't know why it is needed; it really depresses me
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user