mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
Gzipping PSDs; every art must be alpha premultiplied; added converter batch
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
assets/mods/basegame/blocks/terrain_spring.tga.gz
LFS
Normal file
BIN
assets/mods/basegame/blocks/terrain_spring.tga.gz
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/blocks/terrain_winter.tga.gz
LFS
Normal file
BIN
assets/mods/basegame/blocks/terrain_winter.tga.gz
LFS
Normal file
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -31,9 +31,6 @@ object PlayerBuilderTestSubject1 {
|
||||
|
||||
PlayerBuilderSigrid.fillTestInventory(p.inventory)
|
||||
|
||||
p.isNoClip = true
|
||||
|
||||
|
||||
return p
|
||||
}
|
||||
}
|
||||
9
work_files/graphics/! Artists must read me !.txt
Normal file
9
work_files/graphics/! Artists must read me !.txt
Normal file
@@ -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.
|
||||
14
work_files/graphics/! PSD to TGA imagemagick.bat
Normal file
14
work_files/graphics/! PSD to TGA imagemagick.bat
Normal file
@@ -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
|
||||
Binary file not shown.
BIN
work_files/graphics/terrain/terrain_autumn.psd.gz
LFS
Normal file
BIN
work_files/graphics/terrain/terrain_autumn.psd.gz
LFS
Normal file
Binary file not shown.
Binary file not shown.
BIN
work_files/graphics/terrain/terrain_spring.psd.gz
LFS
Normal file
BIN
work_files/graphics/terrain/terrain_spring.psd.gz
LFS
Normal file
Binary file not shown.
Binary file not shown.
BIN
work_files/graphics/terrain/terrain_winter.psd.gz
LFS
Normal file
BIN
work_files/graphics/terrain/terrain_winter.psd.gz
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user