mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-11 14:21:52 +09:00
dithering for semitransparent tiles
This commit is contained in:
@@ -34,6 +34,8 @@ import kotlin.system.exitProcess
|
||||
* NOTE: config "fx_dither" only controls the skybox (which is capable of having more than 256 colours
|
||||
* thanks to the hardware linear intp.) because this dithering shader is somewhat heavy.
|
||||
*
|
||||
* Semitransparency is rendered using dithering, so it is good idea to avoid them.
|
||||
* If you must add semitransparency to the tile, they must have alpha NOT premultiplied.
|
||||
* Actors' transparency (and not an UI) still uses its own lightweight ditherrer
|
||||
*/
|
||||
object IngameRenderer : Disposable {
|
||||
@@ -282,8 +284,6 @@ object IngameRenderer : Disposable {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// blending is correct... somewhat. Alpha must be premultiplied
|
||||
}
|
||||
// something about RGB
|
||||
else if (KeyToggler.isOn(Input.Keys.F6) &&
|
||||
|
||||
@@ -11,9 +11,9 @@ import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||
import net.torvald.terrarum.blockproperties.Block
|
||||
import net.torvald.terrarum.gameitem.ItemID
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarum.gameworld.WorldSimulator
|
||||
import net.torvald.terrarum.gameworld.WorldTime
|
||||
import net.torvald.terrarum.gameworld.fmod
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@@ -85,7 +85,7 @@ internal object BlocksDrawer {
|
||||
|
||||
|
||||
private lateinit var tilesQuad: Mesh
|
||||
private val shader = App.loadShaderFromFile("assets/4096.vert", "assets/tiling.frag")
|
||||
private val shader = App.loadShaderFromFile("assets/4096.vert", "assets/tiling_dither.frag")
|
||||
|
||||
init {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user