Gzipping PSDs; every art must be alpha premultiplied; added converter batch

This commit is contained in:
minjaesong
2019-01-13 20:35:39 +09:00
parent 4cec6fac69
commit e926b0175f
14 changed files with 51 additions and 20 deletions

View File

@@ -598,10 +598,15 @@ fun blendNormal(batch: SpriteBatch? = null) {
(batch ?: Terrarum.batch).enableBlending()
(batch ?: Terrarum.batch).setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)
// ALPHA MUST NOT BE PREMULTIPLIED //
// we're using separate blend func to accomodate not-premultiplied alpha
Gdx.gl.glBlendEquation(GL20.GL_FUNC_ADD) // batch.flush does not touch blend equation
Gdx.gl.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_SRC_ALPHA, GL20.GL_ONE)
// ALPHA *MUST BE* PREMULTIPLIED //
// One way to tell:
// 1. Check (RGB) and (A) values.
// 2. If there exist a pixel such that max(R,G,B) > (A), then the image is NOT premultiplied.
// Easy way:
// Base game (mods/basegame/blocks/terrain.tga.gz) has impure window glass. When looking at the RGB channel only:
// premultipied if the glass looks very dark.
// not premultipied if the glass looks VERY GREEN.
// helpful links:
// - https://gamedev.stackexchange.com/questions/82741/normal-blend-mode-with-opengl-trouble

View File

@@ -31,9 +31,6 @@ object PlayerBuilderTestSubject1 {
PlayerBuilderSigrid.fillTestInventory(p.inventory)
p.isNoClip = true
return p
}
}