diff --git a/assets/mods/basegame/blocks/176_emsv.tga b/assets/mods/basegame/blocks/176_emsv.tga new file mode 100644 index 000000000..492ffa27d --- /dev/null +++ b/assets/mods/basegame/blocks/176_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b5770cbb5dfcaeb3bf27a53bce604e4ba220f4616315b7242cd865c83a85d52 +size 4114 diff --git a/assets/mods/basegame/blocks/208_emsv.tga b/assets/mods/basegame/blocks/208_emsv.tga new file mode 100644 index 000000000..33ad12b88 --- /dev/null +++ b/assets/mods/basegame/blocks/208_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcbc822ff4738f1b00edb6781430383fca645b15fe97f1ca6edeb3800412ce9e +size 50194 diff --git a/assets/mods/basegame/blocks/209_emsv.tga b/assets/mods/basegame/blocks/209_emsv.tga new file mode 100644 index 000000000..3c20628eb --- /dev/null +++ b/assets/mods/basegame/blocks/209_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6fe0f96f7b1a9cc025af42866fa70ae005599a8193cc52bd4b1e1ef312ff88e +size 50194 diff --git a/assets/mods/basegame/blocks/210_emsv.tga b/assets/mods/basegame/blocks/210_emsv.tga new file mode 100644 index 000000000..dc9fa87e5 --- /dev/null +++ b/assets/mods/basegame/blocks/210_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0951c7832be2ddad390f45bfb39d8cad0dc1c4f2f5604db9b36fbf99ece00611 +size 50194 diff --git a/assets/mods/basegame/blocks/211_emsv.tga b/assets/mods/basegame/blocks/211_emsv.tga new file mode 100644 index 000000000..48c021d5c --- /dev/null +++ b/assets/mods/basegame/blocks/211_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a6eb59dab5aee75924568a5a557651c89025f218f1baa42e40120c33817f1b0 +size 50194 diff --git a/assets/mods/basegame/blocks/212_emsv.tga b/assets/mods/basegame/blocks/212_emsv.tga new file mode 100644 index 000000000..6e76fb5db --- /dev/null +++ b/assets/mods/basegame/blocks/212_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca381d31554067cf16bd617507d08bf18e11c4454c8f25f0b236763e1d480ebe +size 50194 diff --git a/assets/mods/basegame/blocks/213_emsv.tga b/assets/mods/basegame/blocks/213_emsv.tga new file mode 100644 index 000000000..c79cbc6e6 --- /dev/null +++ b/assets/mods/basegame/blocks/213_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:532fdcf542bdf5e98a8ee2b5dba01ec5b9ca35528dfc192f9aa8640290c339da +size 50194 diff --git a/assets/mods/basegame/blocks/214_emsv.tga b/assets/mods/basegame/blocks/214_emsv.tga new file mode 100644 index 000000000..915dad1b6 --- /dev/null +++ b/assets/mods/basegame/blocks/214_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d621e72c7769b20f78de7a425042bc6d7e405300bf0a42f5f7b522a92fd42136 +size 50194 diff --git a/assets/mods/basegame/blocks/215_emsv.tga b/assets/mods/basegame/blocks/215_emsv.tga new file mode 100644 index 000000000..449ec1574 --- /dev/null +++ b/assets/mods/basegame/blocks/215_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70c668a4db9034690e953fd91e228dbe2389590eecf1102333441ae89c0b1b31 +size 50194 diff --git a/assets/mods/basegame/blocks/216_emsv.tga b/assets/mods/basegame/blocks/216_emsv.tga new file mode 100644 index 000000000..038316f05 --- /dev/null +++ b/assets/mods/basegame/blocks/216_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:851f567381a997b418d76bae1d795721c746b57d3749fabf739b82d9927ec37d +size 50194 diff --git a/assets/mods/basegame/blocks/218_emsv.tga b/assets/mods/basegame/blocks/218_emsv.tga new file mode 100644 index 000000000..b3d5f109e --- /dev/null +++ b/assets/mods/basegame/blocks/218_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78505a65067e7c2495c461607481d2aca8d65189b9fbdb606d902bc18ea5f95f +size 50194 diff --git a/assets/mods/basegame/blocks/219_emsv.tga b/assets/mods/basegame/blocks/219_emsv.tga new file mode 100644 index 000000000..87f0e91a2 --- /dev/null +++ b/assets/mods/basegame/blocks/219_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bdf62e51d5b47132221a0170f6edf2abb4d02b44109dfd114bc2161336515a3 +size 50194 diff --git a/assets/mods/basegame/blocks/220_emsv.tga b/assets/mods/basegame/blocks/220_emsv.tga new file mode 100644 index 000000000..3554f7966 --- /dev/null +++ b/assets/mods/basegame/blocks/220_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eed053b2c2bc30b0ee447259d60a24c78fa2237972b036af8430f5eebfaed4f9 +size 50194 diff --git a/assets/mods/basegame/blocks/221_emsv.tga b/assets/mods/basegame/blocks/221_emsv.tga new file mode 100644 index 000000000..a6d2740e9 --- /dev/null +++ b/assets/mods/basegame/blocks/221_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:151101e93cea938ca282dff4982b94d1cc5c3ddcd63de03a3853caef6e19ca50 +size 50194 diff --git a/assets/mods/basegame/blocks/222_emsv.tga b/assets/mods/basegame/blocks/222_emsv.tga new file mode 100644 index 000000000..bafdfabc5 --- /dev/null +++ b/assets/mods/basegame/blocks/222_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:385a9595f998ed628b413791a8f3224587928e0ead860322e6fa625732c6134e +size 50194 diff --git a/assets/mods/basegame/blocks/223_emsv.tga b/assets/mods/basegame/blocks/223_emsv.tga new file mode 100644 index 000000000..7b387c786 --- /dev/null +++ b/assets/mods/basegame/blocks/223_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:956224d3221abb79c65e928ae1e6f2bb666ffb8785d7ca736699cb85fa17132f +size 50220 diff --git a/assets/mods/basegame/blocks/256_emsv.tga b/assets/mods/basegame/blocks/256_emsv.tga new file mode 100644 index 000000000..f461d1086 --- /dev/null +++ b/assets/mods/basegame/blocks/256_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b9644791d8340cfcaa20203f36ee9f31100b6bc880889fc46b22a60977494e4 +size 1042 diff --git a/assets/mods/basegame/blocks/257_emsv.tga b/assets/mods/basegame/blocks/257_emsv.tga new file mode 100644 index 000000000..6d3fed670 --- /dev/null +++ b/assets/mods/basegame/blocks/257_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9602a78472f9f884f5954f0ec8b5397adeef1331c0bbcb92965bb92e96ef79d0 +size 1042 diff --git a/assets/mods/basegame/blocks/258_emsv.tga b/assets/mods/basegame/blocks/258_emsv.tga new file mode 100644 index 000000000..959be770d --- /dev/null +++ b/assets/mods/basegame/blocks/258_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03e0216e2d50769dbce49d428da65cefff913a229f5025b8cab5a492c7652f13 +size 50194 diff --git a/assets/mods/basegame/blocks/_emsv.tga b/assets/mods/basegame/blocks/_emsv.tga new file mode 100644 index 000000000..e92d14c40 --- /dev/null +++ b/assets/mods/basegame/blocks/_emsv.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f1eb0589c8c352249b3e8623d08ae49ba6be0895a94b30de3d996454f70c5f4 +size 50194 diff --git a/assets/mods/basegame/sprites/fixtures/jukebox_emsv.tga b/assets/mods/basegame/sprites/fixtures/jukebox_emsv.tga index 7e51c4d67..fee0a9f0a 100644 --- a/assets/mods/basegame/sprites/fixtures/jukebox_emsv.tga +++ b/assets/mods/basegame/sprites/fixtures/jukebox_emsv.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:01f522bcf34135a58065931f235b4ddd555b7d02f7e5bb22e474223b1c78b854 +oid sha256:518e561bcfecc426f0af32645f3b1800b2ade4ecc46c22ac6d2cfeeff06a4b1a size 6162 diff --git a/assets/mods/basegame/sprites/fixtures/smelter_basic_emsv.tga b/assets/mods/basegame/sprites/fixtures/smelter_basic_emsv.tga index 2c136bc16..fe1acc586 100644 --- a/assets/mods/basegame/sprites/fixtures/smelter_basic_emsv.tga +++ b/assets/mods/basegame/sprites/fixtures/smelter_basic_emsv.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2e3444efdee0f3728964d52651a8b28866cb24401629905db71fc6aa8b656c23 +oid sha256:c371439dda142d5047a7b9502965c0511da190723a9865bbfb4434340b957de5 size 4114 diff --git a/assets/mods/basegame/sprites/fixtures/smelter_tall_emsv.tga b/assets/mods/basegame/sprites/fixtures/smelter_tall_emsv.tga index 6e6674a35..bb396b843 100644 --- a/assets/mods/basegame/sprites/fixtures/smelter_tall_emsv.tga +++ b/assets/mods/basegame/sprites/fixtures/smelter_tall_emsv.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0128ce2cada196e62959580aded29661487fd7a7d8dd4c15dfaa6d2044b6b638 +oid sha256:429f538f707a846c394711cdbd35b1722fbc8efb8d38f81d73f108a1b06dca9f size 12306 diff --git a/assets/mods/basegame/sprites/fixtures/tiki_torch_emsv.tga b/assets/mods/basegame/sprites/fixtures/tiki_torch_emsv.tga index e3ffbaf2d..152aa8c23 100644 --- a/assets/mods/basegame/sprites/fixtures/tiki_torch_emsv.tga +++ b/assets/mods/basegame/sprites/fixtures/tiki_torch_emsv.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d41b74905d64ce0bdee5d5109f8bd15a6119745137e5481052367e440ea08b2 +oid sha256:33641ebc67bef570720244cc4a7c2e78f1d42c763296cdc10609e062154d6cdc size 4114 diff --git a/assets/mods/basegame/sprites/test_furry/furbudglow_head.tga b/assets/mods/basegame/sprites/test_furry/furbudglow_head.tga index 43379cc93..f18ca1d1f 100644 --- a/assets/mods/basegame/sprites/test_furry/furbudglow_head.tga +++ b/assets/mods/basegame/sprites/test_furry/furbudglow_head.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eebd10a3773883a0024654cd2e4d072b2a13a400059013b1b35a530a8ced0123 -size 191 +oid sha256:b8e55b0cee4d0c0afb386a5a683eddd16f30eb91ce41971d5637790950227c24 +size 1782 diff --git a/assets/mods/basegame/sprites/test_werebeast/taimuglow_head.tga b/assets/mods/basegame/sprites/test_werebeast/taimuglow_head.tga index f0e504da8..cfa2f516f 100644 --- a/assets/mods/basegame/sprites/test_werebeast/taimuglow_head.tga +++ b/assets/mods/basegame/sprites/test_werebeast/taimuglow_head.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f28f45a3ca2c0196e22a94a86dc29ff69882768a2a2adc66d49a0fa30310b86c +oid sha256:e7c924febf6158ffe2cfcce6e94e4eaf77ce47e727e10a7cdaa406ec7d7250e3 size 1866 diff --git a/assets/mods/basegame/sprites/test_werebeastf/taimuglow_head.tga b/assets/mods/basegame/sprites/test_werebeastf/taimuglow_head.tga index 1243079ca..cfa2f516f 100644 --- a/assets/mods/basegame/sprites/test_werebeastf/taimuglow_head.tga +++ b/assets/mods/basegame/sprites/test_werebeastf/taimuglow_head.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9927a3e97a5e1a13df1aae039d0a6e2a930cfcb8a60a018d257fbc725be2b31 +oid sha256:e7c924febf6158ffe2cfcce6e94e4eaf77ce47e727e10a7cdaa406ec7d7250e3 size 1866 diff --git a/assets/mods/basegame/sprites/test_werebeastf2/taimuglow_head.tga b/assets/mods/basegame/sprites/test_werebeastf2/taimuglow_head.tga index 98026b899..cfa2f516f 100644 --- a/assets/mods/basegame/sprites/test_werebeastf2/taimuglow_head.tga +++ b/assets/mods/basegame/sprites/test_werebeastf2/taimuglow_head.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6487cb6c674f6ae307831b95a73019b2e4c7386d79112539f6903dfd8034af25 +oid sha256:e7c924febf6158ffe2cfcce6e94e4eaf77ce47e727e10a7cdaa406ec7d7250e3 size 1866 diff --git a/src/net/torvald/spriteanimation/AssembledSpriteAnimation.kt b/src/net/torvald/spriteanimation/AssembledSpriteAnimation.kt index dd0c72787..7abd7531c 100644 --- a/src/net/torvald/spriteanimation/AssembledSpriteAnimation.kt +++ b/src/net/torvald/spriteanimation/AssembledSpriteAnimation.kt @@ -14,6 +14,10 @@ import net.torvald.terrarum.modulebasegame.gameactors.Pocketed import net.torvald.terrarum.savegame.ByteArray64Reader import net.torvald.terrarum.savegame.EntryID import net.torvald.terrarum.savegame.SimpleFileSystem +import net.torvald.terrarum.savegame.VDFileID +import net.torvald.terrarum.savegame.VDFileID.BODYPARTEMISSIVE_TO_ENTRY_MAP +import net.torvald.terrarum.savegame.VDFileID.BODYPARTGLOW_TO_ENTRY_MAP +import net.torvald.terrarum.savegame.VDFileID.BODYPART_TO_ENTRY_MAP import net.torvald.terrarum.serialise.Common import net.torvald.terrarum.spriteassembler.ADProperties import net.torvald.terrarum.spriteassembler.ADPropertyObject @@ -31,12 +35,19 @@ class AssembledSpriteAnimation( @Transient val adp: ADProperties, parentActor: ActorWithBody, @Transient val disk: SimpleFileSystem?, // specify if the resources for the animation is contained in the disk archive - @Transient val bodypartToFileMap: EntryID?, // which file in the disk contains bodypart-to-fileid mapping for this particular instance of sprite animation @Transient val isGlow: Boolean, @Transient val isEmissive: Boolean ) : SpriteAnimation(parentActor) { - constructor(adp: ADProperties, parentActor: ActorWithBody, isGlow: Boolean, isEmissive: Boolean) : this(adp, parentActor, null, null, isGlow, isEmissive) + constructor(adp: ADProperties, parentActor: ActorWithBody, isGlow: Boolean, isEmissive: Boolean) : this(adp, parentActor, null, isGlow, isEmissive) + + @Transient val bodypartToFileMap = if (isEmissive) + BODYPARTEMISSIVE_TO_ENTRY_MAP + else if (isGlow) + BODYPARTGLOW_TO_ENTRY_MAP + else + BODYPART_TO_ENTRY_MAP + var currentFrame = 0 // while this number is zero-based, the frame number on the ADP is one-based private set @@ -69,13 +80,21 @@ class AssembledSpriteAnimation( val fileGetter = if (disk != null) { val bodypartMapping = Properties() - bodypartMapping.load(ByteArray64Reader(disk.getFile(bodypartToFileMap!!)!!.bytes, Common.CHARSET)) + bodypartMapping.load(ByteArray64Reader(disk.getFile(bodypartToFileMap)!!.bytes, Common.CHARSET)) AssembleSheetPixmap.getVirtualDiskFileGetter(bodypartMapping, disk) } else AssembleSheetPixmap.getAssetsDirFileGetter(adp) - adp.bodyparts.forEach { res[it] = getPartTexture(fileGetter, it) } + val fileGetterFallback = if (disk != null) { + val bodypartMapping = Properties() + bodypartMapping.load(ByteArray64Reader(disk.getFile(BODYPART_TO_ENTRY_MAP)!!.bytes, Common.CHARSET)) + + AssembleSheetPixmap.getVirtualDiskFileGetter(bodypartMapping, disk) + } + else AssembleSheetPixmap.getAssetsDirFileGetter(adp) + + adp.bodyparts.forEach { res[it] = getPartTexture(fileGetter, fileGetterFallback, it) } val (mugPixmap, headSprite0) = if (disk != null) AssembleSheetPixmap.getMugshotFromVirtualDisk(disk, -1025L, adp) @@ -225,11 +244,25 @@ class AssembledSpriteAnimation( // TODO fill in with armours/etc ) - private fun getPartTexture(getFile: (String) -> InputStream?, partName: String): TextureRegion? { + private fun getPartTexture(getFile: (String) -> InputStream?, getFileFallback: (String) -> InputStream?, partName: String): TextureRegion? { getFile(partName)?.let { val bytes = it.readAllBytes() return TextureRegion(Texture(Pixmap(bytes, 0, bytes.size))) } + getFileFallback(partName)?.let { + val bytes = it.readAllBytes() + + // filter the image so that it's either transparent or black + val pixmap = Pixmap(bytes, 0, bytes.size) + for (y in 0 until pixmap.height) { + for (x in 0 until pixmap.width) { + val c = pixmap.getPixel(x, y) + pixmap.drawPixel(x, y, c and 0xFF) + } + } + + return TextureRegion(Texture(pixmap)) + } return null } } diff --git a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt index 21054f422..e5f0b7e9b 100644 --- a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt +++ b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt @@ -1796,8 +1796,8 @@ open class ActorWithBody : Actor { if (isVisible) { blendNormalStraightAlpha(batch) if (spriteGlow != null) - drawSpriteInGoodPosition(frameDelta, spriteGlow!!, batch, 2) - else + drawSpriteInGoodPosition(frameDelta, spriteGlow!!, batch, 1) + else if (sprite != null) drawSpriteInGoodPosition(frameDelta, sprite!!, batch, 1, Color.BLACK) } } @@ -1807,7 +1807,7 @@ open class ActorWithBody : Actor { blendNormalStraightAlpha(batch) if (spriteEmissive != null) drawSpriteInGoodPosition(frameDelta, spriteEmissive!!, batch, 1) - else + else if (sprite != null) drawSpriteInGoodPosition(frameDelta, sprite!!, batch, 2, Color.BLACK) } } diff --git a/src/net/torvald/terrarum/modulebasegame/serialise/WriteActor.kt b/src/net/torvald/terrarum/modulebasegame/serialise/WriteActor.kt index aaf85ad84..90cab7d09 100644 --- a/src/net/torvald/terrarum/modulebasegame/serialise/WriteActor.kt +++ b/src/net/torvald/terrarum/modulebasegame/serialise/WriteActor.kt @@ -179,7 +179,6 @@ object ReadActor { actor.animDesc!!, actor, if (bodypartsFile != null) disk else null, - if (bodypartsFile != null) BODYPART_TO_ENTRY_MAP else null, false, false ) @@ -189,7 +188,6 @@ object ReadActor { actor.animDescGlow!!, actor, if (bodypartsFile != null) disk else null, - if (bodypartsFile != null) BODYPARTGLOW_TO_ENTRY_MAP else null, true, false ) } @@ -200,7 +198,6 @@ object ReadActor { actor.animDescEmissive!!, actor, if (bodypartsFile != null) disk else null, - if (bodypartsFile != null) BODYPARTEMISSIVE_TO_ENTRY_MAP else null, false, true ) } @@ -223,50 +220,4 @@ object ReadActor { } } - private fun makeSprite(mode: Int, actor: IngamePlayer, disk: SimpleFileSystem, file: EntryFile?, bodypartsFile: EntryFile?) { - val animDesc = when (mode) { - 0 -> actor.animDesc - 1 -> actor.animDescGlow - 2 -> actor.animDescEmissive - else -> throw IllegalArgumentException() - } - - if (file != null) { - when (mode) { - 0 -> { actor.animDesc = ADProperties(ByteArray64Reader(file.bytes, Common.CHARSET)) } - 1 -> { actor.animDescGlow = ADProperties(ByteArray64Reader(file.bytes, Common.CHARSET)) } - 2 -> { actor.animDescEmissive = ADProperties(ByteArray64Reader(file.bytes, Common.CHARSET)) } - else -> throw IllegalArgumentException() - } - - when (mode) { - 0 -> { actor.sprite = AssembledSpriteAnimation( - actor.animDesc!!, - actor, - if (bodypartsFile != null) disk else null, - if (bodypartsFile != null) BODYPART_TO_ENTRY_MAP else null, - false, false - ) } - 1 -> { actor.spriteGlow = AssembledSpriteAnimation( - actor.animDescGlow!!, - actor, - if (bodypartsFile != null) disk else null, - if (bodypartsFile != null) BODYPARTGLOW_TO_ENTRY_MAP else null, - true, false - ) } - 2 -> { actor.spriteEmissive = AssembledSpriteAnimation( - actor.animDescEmissive!!, - actor, - if (bodypartsFile != null) disk else null, - if (bodypartsFile != null) BODYPARTEMISSIVE_TO_ENTRY_MAP else null, - false, true - ) } - else -> throw IllegalArgumentException() - } - - } - else { - - } - } } \ No newline at end of file diff --git a/src/shaders/blendGlow.frag b/src/shaders/blendGlow.frag index c36c7634f..3e50842d2 100644 --- a/src/shaders/blendGlow.frag +++ b/src/shaders/blendGlow.frag @@ -16,6 +16,5 @@ const vec2 boolean = vec2(0.0, 1.0); void main(void) { vec4 colorTex0 = texture(u_texture, v_texCoords); // lightmap (RGB) pre-mixed vec4 colorTex1 = texture(tex1, v_texCoords); // lightmap (A) pre-mixed -// fragColor = (max(colorTex0, colorTex1) * boolean.yyyx) + (colorTex0 * boolean.xxxy); fragColor = fma(max(colorTex0, colorTex1), boolean.yyyx, colorTex0 * boolean.xxxy); } \ No newline at end of file diff --git a/src/shaders/blendGlowTex1Flip.frag b/src/shaders/blendGlowTex1Flip.frag index bec83192c..600fb7485 100644 --- a/src/shaders/blendGlowTex1Flip.frag +++ b/src/shaders/blendGlowTex1Flip.frag @@ -16,6 +16,10 @@ const vec2 boolean = vec2(0.0, 1.0); void main(void) { vec4 colorTex0 = texture(u_texture, v_texCoords); // lightmap (RGB) pre-mixed vec4 colorTex1 = texture(tex1, vec2(v_texCoords.x, 1.0 - v_texCoords.y)); // lightmap (A) pre-mixed -// fragColor = (max(colorTex0, colorTex1) * boolean.yyyx) + (colorTex0 * boolean.xxxy); - fragColor = fma(max(colorTex0, colorTex1), boolean.yyyx, colorTex0 * boolean.xxxy); +// if (colorTex0.a > colorTex1.a) { + fragColor = fma(max(colorTex0, colorTex1), boolean.yyyx, colorTex0 * boolean.xxxy); +// } +// else { +// fragColor = fma(max(colorTex0, colorTex1), boolean.yyyx, colorTex1 * boolean.xxxy); +// } } \ No newline at end of file