spritebatch with hdr colour

This commit is contained in:
minjaesong
2023-09-14 23:17:37 +09:00
parent f8b74f2445
commit d6fea9889e
9 changed files with 1410 additions and 103 deletions

View File

@@ -3,13 +3,14 @@ package net.torvald.terrarum
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.badlogic.gdx.graphics.g2d.UnpackedColourSpriteBatch
/**
* Don't flip the assets! Flip the draw command instead!
*
* Created by minjaesong on 2021-12-13.
*/
class FlippingSpriteBatch(size: Int = 1000) : SpriteBatch(size, DefaultGL32Shaders.createSpriteBatchShader()) {
class FlippingSpriteBatch(size: Int = 1000) : UnpackedColourSpriteBatch(size, DefaultGL32Shaders.createSpriteBatchShader()) {
/**
* This function draws the flipped version of the image by giving flipped uv-coord to the SpriteBatch
@@ -42,6 +43,7 @@ class FlippingSpriteBatch(size: Int = 1000) : SpriteBatch(size, DefaultGL32Shade
draw(region.texture, x, y, region.regionWidth.toFloat(), region.regionHeight.toFloat(), region.u, region.v2, region.u2, region.v)
/**
* NOTE TO SELF:
*