sprites can be rendered across the world seam

This commit is contained in:
minjaesong
2021-09-17 22:54:55 +09:00
parent 58be058b86
commit 575ed4410b
47 changed files with 150 additions and 166 deletions

View File

@@ -107,8 +107,8 @@ object BlockPropUtil {
private fun getDynamicLumFunc(prop: BlockProp): Cvec {
return when (prop.dynamicLuminosityFunction) {
1 -> getTorchFlicker(prop)
2 -> (Terrarum.ingame!!.world).globalLight.cpy() // current global light
3 -> WeatherMixer.getGlobalLightOfTime(Terrarum.ingame!!.world, WorldTime.DAY_LENGTH / 2).cpy() // daylight at noon
2 -> (INGAME.world).globalLight.cpy() // current global light
3 -> WeatherMixer.getGlobalLightOfTime(INGAME.world, WorldTime.DAY_LENGTH / 2).cpy() // daylight at noon
4 -> getSlowBreath(prop)
5 -> getPulsate(prop)
else -> prop.baseLumCol
@@ -121,8 +121,8 @@ object BlockPropUtil {
/*private fun getDynamicLumFuncByChan(baseLum: Float, type: Int, chan: Int): Float {
return when (type) {
1 -> getTorchFlicker(baseLum)
2 -> (Terrarum.ingame!!.world).globalLight.cpy().mul(LightmapRenderer.DIV_FLOAT).getElem(chan) // current global light
3 -> WeatherMixer.getGlobalLightOfTime(Terrarum.ingame!!.world, WorldTime.DAY_LENGTH / 2).cpy().mul(LightmapRenderer.DIV_FLOAT).getElem(chan) // daylight at noon
2 -> (INGAME.world).globalLight.cpy().mul(LightmapRenderer.DIV_FLOAT).getElem(chan) // current global light
3 -> WeatherMixer.getGlobalLightOfTime(INGAME.world, WorldTime.DAY_LENGTH / 2).cpy().mul(LightmapRenderer.DIV_FLOAT).getElem(chan) // daylight at noon
4 -> getSlowBreath(baseLum)
5 -> getPulsate(baseLum)
else -> baseLum