mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
both outline and a shadow for 'behind' actors
This commit is contained in:
@@ -103,7 +103,7 @@ description_koKR=\uAE30\uBCF8 \uAC8C\uC784
|
||||
description_nlNL=Het spel
|
||||
description_noNB=Spillet
|
||||
description_pt=O jogo
|
||||
description_roRO=Joculzr
|
||||
description_roRO=Jocul
|
||||
description_ruRU=\u0418\u0433\u0440\u0430
|
||||
description_svSE=Spelet
|
||||
description_thTH=\u0E40\u0E01\u0E21
|
||||
|
||||
@@ -80,7 +80,8 @@ object IngameRenderer : Disposable {
|
||||
private lateinit var fboRGBactorsMiddle: Float16FrameBuffer // for large shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
private lateinit var fboRGBterrain: Float16FrameBuffer // for large shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
|
||||
private lateinit var fboRGBactorsBehindShadow: Float16FrameBuffer // for small shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
private lateinit var fboRGBactorsBehindShadow: Float16FrameBuffer // for tiny shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
private lateinit var fboRGBactorsBehindShadow2: Float16FrameBuffer // for small shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
private lateinit var fboRGBactorsMiddleShadow: Float16FrameBuffer // for large shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
private lateinit var fboRGBterrainShadow: Float16FrameBuffer // for large shadow eff; A channel is for glow effects so they don't get shadow effects
|
||||
|
||||
@@ -481,6 +482,8 @@ object IngameRenderer : Disposable {
|
||||
blendNormalStraightAlpha(batch)
|
||||
}
|
||||
|
||||
private val shadowBlack2 = Color(0f, 0f, 0f, 0.55f)
|
||||
|
||||
/**
|
||||
* This "screencap" will capture the game WITHOUT gui and postprocessors!
|
||||
* To capture the entire game, use [App.requestScreenshot]
|
||||
@@ -526,6 +529,7 @@ object IngameRenderer : Disposable {
|
||||
}
|
||||
}
|
||||
BlurMgr.makeBlurSmall(fboRGBactorsBehind, fboRGBactorsBehindShadow, 1f)
|
||||
BlurMgr.makeBlur(fboRGBactorsBehind, fboRGBactorsBehindShadow2, 0.5f)
|
||||
|
||||
fboRGBactorsMiddle.inAction(camera, batch) {
|
||||
clearBuffer()
|
||||
@@ -570,13 +574,22 @@ object IngameRenderer : Disposable {
|
||||
|
||||
batch.inUse {
|
||||
batch.shader = shaderShadowShallow
|
||||
batch.color = Color.BLACK
|
||||
shaderShadowShallow.setUniformi("u_wall", 1)
|
||||
setCameraPosition(0f, 0f)
|
||||
batch.drawFlipped(fboRGBactorsBehindShadow.colorBufferTexture, 0f, 0f)
|
||||
}
|
||||
batch.inUse {
|
||||
batch.shader = shaderShadowDeep
|
||||
batch.color = shadowBlack2
|
||||
shaderShadowShallow.setUniformi("u_wall", 1)
|
||||
setCameraPosition(0f, 0f)
|
||||
batch.drawFlipped(fboRGBactorsBehindShadow2.colorBufferTexture, 0f, 0f)
|
||||
}
|
||||
|
||||
batch.inUse {
|
||||
batch.shader = shaderShadowDeep
|
||||
batch.color = Color.BLACK
|
||||
shaderShadowDeep.setUniformi("u_wall", 1)
|
||||
setCameraPosition(0f, 0f)
|
||||
batch.drawFlipped(fboRGBterrainShadow.colorBufferTexture, 0f, 0f)
|
||||
@@ -1305,6 +1318,7 @@ object IngameRenderer : Disposable {
|
||||
fboRGBactorsMiddle = Float16FrameBuffer(width, height, false)
|
||||
fboRGBterrain = Float16FrameBuffer(width, height, false)
|
||||
fboRGBactorsBehindShadow = Float16FrameBuffer(width, height, false)
|
||||
fboRGBactorsBehindShadow2 = Float16FrameBuffer(width, height, false)
|
||||
fboRGBactorsMiddleShadow = Float16FrameBuffer(width, height, false)
|
||||
fboRGBterrainShadow = Float16FrameBuffer(width, height, false)
|
||||
fboRGBwall = Float16FrameBuffer(width, height, false)
|
||||
@@ -1374,6 +1388,7 @@ object IngameRenderer : Disposable {
|
||||
if (::fboRGBactorsMiddle.isInitialized) fboRGBactorsMiddle.tryDispose()
|
||||
if (::fboRGBterrain.isInitialized) fboRGBterrain.tryDispose()
|
||||
if (::fboRGBactorsBehindShadow.isInitialized) fboRGBactorsBehindShadow.tryDispose()
|
||||
if (::fboRGBactorsBehindShadow2.isInitialized) fboRGBactorsBehindShadow2.tryDispose()
|
||||
if (::fboRGBactorsMiddleShadow.isInitialized) fboRGBactorsMiddleShadow.tryDispose()
|
||||
if (::fboRGBterrainShadow.isInitialized) fboRGBterrainShadow.tryDispose()
|
||||
if (::fboRGBwall.isInitialized) fboRGBwall.tryDispose()
|
||||
|
||||
@@ -138,7 +138,10 @@ internal object SavegameMigrator {
|
||||
}
|
||||
}
|
||||
else {
|
||||
actor.inventory.add(itm, qty)
|
||||
// try {
|
||||
actor.inventory.add(itm, qty)
|
||||
// }
|
||||
// catch (e: NullPointerException) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@ uniform sampler2D u_texture;
|
||||
uniform sampler2D u_wall;
|
||||
out vec4 fragColor;
|
||||
|
||||
vec4 mult = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
void main() {
|
||||
vec4 backcol = texture(u_wall, v_texCoords);
|
||||
vec4 incol = texture(u_texture, v_texCoords);
|
||||
vec4 outcol = vec4(incol.rgb, backcol.a * pow(incol.a, 1.4142));
|
||||
fragColor = mult * outcol;
|
||||
fragColor = v_color * outcol;
|
||||
}
|
||||
@@ -10,11 +10,9 @@ uniform sampler2D u_texture;
|
||||
uniform sampler2D u_wall;
|
||||
out vec4 fragColor;
|
||||
|
||||
vec4 mult = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
void main() {
|
||||
vec4 backcol = texture(u_wall, v_texCoords);
|
||||
vec4 incol = texture(u_texture, v_texCoords);
|
||||
vec4 outcol = vec4(incol.rgb, backcol.a * incol.a);
|
||||
fragColor = mult * outcol;
|
||||
fragColor = v_color * outcol;
|
||||
}
|
||||
Reference in New Issue
Block a user