lightmap downsample works, sampling bug fixed with Filter.NEAREST, now having shrinkage issue

This commit is contained in:
minjaesong
2017-07-12 14:33:59 +09:00
parent bad6ff296a
commit 6bff02d91e
5 changed files with 34 additions and 22 deletions

View File

@@ -247,6 +247,9 @@ object Terrarum : ApplicationAdapter() {
lateinit var shaderBlendGlow: ShaderProgram
lateinit var textureWhiteSquare: Texture
init {
println("[Terrarum] os.arch = $systemArch") // debug info
@@ -299,6 +302,10 @@ object Terrarum : ApplicationAdapter() {
fontSmallNumbers = TinyAlphNum
textureWhiteSquare = Texture(Gdx.files.internal("assets/graphics/ortho_line_tex_2px.tga"))
textureWhiteSquare.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest)
ShaderProgram.pedantic = false
shaderBlur = ShaderProgram(Gdx.files.internal("assets/blur.vert"), Gdx.files.internal("assets/blur.frag"))
shader4096 = ShaderProgram(Gdx.files.internal("assets/4096.vert"), Gdx.files.internal("assets/4096.frag"))
@@ -567,7 +574,7 @@ fun Float.round(): Float {
// ShapeRenderer alternative for rects
fun SpriteBatch.fillRect(x: Float, y: Float, w: Float, h: Float) {
this.draw(net.torvald.terrarum.worlddrawer.BlocksDrawer.tilesTerrain.get(1, 0), x, y, w, h)
this.draw(Terrarum.textureWhiteSquare, x, y, w, h)
}
inline fun SpriteBatch.drawStraightLine(x: Float, y: Float, p2: Float, thickness: Float, isVertical: Boolean) {
if (!isVertical)