diff --git a/assets/mods/basegame/blocks/terrain.tga.gz b/assets/mods/basegame/blocks/terrain.tga.gz index 9184e7e18..7f0f4b467 100644 --- a/assets/mods/basegame/blocks/terrain.tga.gz +++ b/assets/mods/basegame/blocks/terrain.tga.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b72a190e0d16260271b005a21ae215f9cb21a6d3308073520cb586876c7c460a -size 338991 +oid sha256:3ceed30eba1fa56849747a60fc427b5fdbb1209d2227a7a6beec5ef2be12f9ee +size 338613 diff --git a/assets/mods/basegame/blocks/terrain_autumn.tga.gz b/assets/mods/basegame/blocks/terrain_autumn.tga.gz index 4d85f2e58..b313ab918 100644 --- a/assets/mods/basegame/blocks/terrain_autumn.tga.gz +++ b/assets/mods/basegame/blocks/terrain_autumn.tga.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d25f5074039edc2aa3a97d7ba4aefc4c5c137efc721854e2e1005a6aa0e7bb16 -size 347514 +oid sha256:6f43b5ca28c728b4252e7c4a89e5a8ca765bee70236b0f782620c33757ab811a +size 338578 diff --git a/assets/mods/basegame/blocks/terrain_spring.tga.gz b/assets/mods/basegame/blocks/terrain_spring.tga.gz new file mode 100644 index 000000000..c75bd3a6d --- /dev/null +++ b/assets/mods/basegame/blocks/terrain_spring.tga.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fb01f1c7ae6ea2da405f6a8e8f382707b98a33881fe868188c02f1247e14cdc +size 338742 diff --git a/assets/mods/basegame/blocks/terrain_winter.tga.gz b/assets/mods/basegame/blocks/terrain_winter.tga.gz new file mode 100644 index 000000000..bf23cebd6 --- /dev/null +++ b/assets/mods/basegame/blocks/terrain_winter.tga.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db1aef13523681938ab391829de02c8915b8ccda69defed5df281d33c253d85c +size 338602 diff --git a/src/net/torvald/terrarum/Terrarum.kt b/src/net/torvald/terrarum/Terrarum.kt index 3d1ef652f..085861e4f 100644 --- a/src/net/torvald/terrarum/Terrarum.kt +++ b/src/net/torvald/terrarum/Terrarum.kt @@ -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 diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/PlayerBuilderTestSubject1.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/PlayerBuilderTestSubject1.kt index ebd86cd98..1606cf0dc 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/PlayerBuilderTestSubject1.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/PlayerBuilderTestSubject1.kt @@ -31,9 +31,6 @@ object PlayerBuilderTestSubject1 { PlayerBuilderSigrid.fillTestInventory(p.inventory) - p.isNoClip = true - - return p } } \ No newline at end of file diff --git a/work_files/graphics/! Artists must read me !.txt b/work_files/graphics/! Artists must read me !.txt new file mode 100644 index 000000000..2d5184167 --- /dev/null +++ b/work_files/graphics/! Artists must read me !.txt @@ -0,0 +1,9 @@ +All the images must be exported as .tga or .tga.gz. All the alpha must be premultiplied. + +It is recommended to use ImageMagick command line tool to convert PSD to TGA directly. + + convert terrain.psd -colorspace sRGB -write mpr:temp -background black -alpha Remove mpr:temp -compose Copy_Opacity -composite terrain.tga + +'convert' is a ImageMagick's convert.exe, usually located at 'C:\Program Files\ImageMagick-7.0.8-Q16' + +If you have ImageMagick installed, please use included batch file. \ No newline at end of file diff --git a/work_files/graphics/! PSD to TGA imagemagick.bat b/work_files/graphics/! PSD to TGA imagemagick.bat new file mode 100644 index 000000000..c2dfa5788 --- /dev/null +++ b/work_files/graphics/! PSD to TGA imagemagick.bat @@ -0,0 +1,14 @@ +SET basefilename=%~d1%~p1%~n1 +SET inputextension=%~x1 +rem inputextension should be dot-psd + +IF "%inputextension%" NEQ ".psd" goto fail + +convert %1 -colorspace sRGB -write mpr:temp -background black -alpha Remove mpr:temp -compose Copy_Opacity -composite "%basefilename%.tga" + +exit + +:fail +echo "File not PSD" +pause +exit /b 1 diff --git a/work_files/graphics/terrain/terrain_autumn.psd b/work_files/graphics/terrain/terrain_autumn.psd deleted file mode 100644 index f7eb20f47..000000000 --- a/work_files/graphics/terrain/terrain_autumn.psd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8e5a927dae87d6ee8476a5e0bc09118d125961d1bf14ccd8821ccb44b1e96f6e -size 2976472 diff --git a/work_files/graphics/terrain/terrain_autumn.psd.gz b/work_files/graphics/terrain/terrain_autumn.psd.gz new file mode 100644 index 000000000..f7d9a681c --- /dev/null +++ b/work_files/graphics/terrain/terrain_autumn.psd.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09b7572139a120970463991262d86463f654741f837392043ebc9212e744e829 +size 997709 diff --git a/work_files/graphics/terrain/terrain_spring.psd b/work_files/graphics/terrain/terrain_spring.psd deleted file mode 100644 index a3b26d50c..000000000 --- a/work_files/graphics/terrain/terrain_spring.psd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b6161e5e9800ec7462024d478821e608e4775bc207c7b8fcc09667c3b88e139f -size 2976534 diff --git a/work_files/graphics/terrain/terrain_spring.psd.gz b/work_files/graphics/terrain/terrain_spring.psd.gz new file mode 100644 index 000000000..7d9c1e969 --- /dev/null +++ b/work_files/graphics/terrain/terrain_spring.psd.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00c96dd1930cfca88454e1a07591941407ab79a3c20f20a61b3ece28554d4346 +size 997493 diff --git a/work_files/graphics/terrain/terrain_winter.psd b/work_files/graphics/terrain/terrain_winter.psd deleted file mode 100644 index 1c0e7ea8b..000000000 --- a/work_files/graphics/terrain/terrain_winter.psd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b923df9bc927e3eb324a4c869ff9d1cd161fedd47862040942f0112e737aae86 -size 2976610 diff --git a/work_files/graphics/terrain/terrain_winter.psd.gz b/work_files/graphics/terrain/terrain_winter.psd.gz new file mode 100644 index 000000000..cd718bdca --- /dev/null +++ b/work_files/graphics/terrain/terrain_winter.psd.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a021e317ad14e3ad4fff3fdaceb8b7053f45df53e6fcb697acb421a39766599 +size 997731