mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
framebuffers: fix some transparency/translucency issues
This commit is contained in:
parent
fbabebcecd
commit
f8d1382364
@ -32,20 +32,12 @@ object RenderConstants {
|
||||
|
||||
val TEXT_BACKGROUND_COLOR = RGBColor(0, 0, 0, 80)
|
||||
|
||||
const val TEXT_LINE_PADDING = 2
|
||||
val WORD_SEPARATORS = arrayOf(' ', '.', ',', '!', '-', '?')
|
||||
|
||||
const val FRUSTUM_CULLING_ENABLED = true
|
||||
const val SHOW_FPS_IN_WINDOW_TITLE = true
|
||||
|
||||
const val MAXIMUM_QUEUE_TIME_PER_FRAME = 20L
|
||||
|
||||
const val DISABLE_LIGHTING = false
|
||||
|
||||
const val RENDER_BLOCKS = true
|
||||
const val RENDER_FLUIDS = true
|
||||
const val RENDER_HUD = true
|
||||
|
||||
|
||||
val DEBUG_TEXTURE_RESOURCE_LOCATION = ResourceLocation("minosoft:textures/debug.png")
|
||||
const val DEBUG_TEXTURE_ID = 0 // always add the debug texture to the texture array first to ensure the id is 0
|
||||
|
@ -41,7 +41,7 @@ interface RenderSystem {
|
||||
blending: Boolean = false,
|
||||
faceCulling: Boolean = true,
|
||||
depthMask: Boolean = true,
|
||||
sourceAlpha: BlendingFunctions = BlendingFunctions.SOURCE_ALPHA,
|
||||
sourceAlpha: BlendingFunctions = BlendingFunctions.ONE,
|
||||
destinationAlpha: BlendingFunctions = BlendingFunctions.ONE_MINUS_SOURCE_ALPHA,
|
||||
depth: DepthFunctions = DepthFunctions.LESS,
|
||||
clearColor: RGBColor = Colors.TRANSPARENT,
|
||||
@ -63,7 +63,7 @@ interface RenderSystem {
|
||||
|
||||
operator fun set(source: BlendingFunctions, destination: BlendingFunctions)
|
||||
|
||||
fun setBlendFunction(sourceRGB: BlendingFunctions = BlendingFunctions.SOURCE_ALPHA, destinationRGB: BlendingFunctions = BlendingFunctions.ONE_MINUS_SOURCE_ALPHA, sourceAlpha: BlendingFunctions = BlendingFunctions.ONE, destinationAlpha: BlendingFunctions = BlendingFunctions.ZERO)
|
||||
fun setBlendFunction(sourceRGB: BlendingFunctions = BlendingFunctions.ONE, destinationRGB: BlendingFunctions = BlendingFunctions.ONE_MINUS_SOURCE_ALPHA, sourceAlpha: BlendingFunctions = BlendingFunctions.ONE, destinationAlpha: BlendingFunctions = BlendingFunctions.ZERO)
|
||||
|
||||
var depth: DepthFunctions
|
||||
var depthMask: Boolean
|
||||
|
@ -1,13 +1,14 @@
|
||||
package de.bixilon.minosoft.gui.rendering.system.base.phases
|
||||
|
||||
import de.bixilon.minosoft.gui.rendering.Renderer
|
||||
import de.bixilon.minosoft.gui.rendering.system.base.BlendingFunctions
|
||||
|
||||
interface TranslucentDrawable : Renderer {
|
||||
val skipTranslucent: Boolean
|
||||
get() = false
|
||||
|
||||
fun setupTranslucent() {
|
||||
renderSystem.reset(blending = true)
|
||||
renderSystem.reset(sourceAlpha = BlendingFunctions.SOURCE_ALPHA, destinationAlpha = BlendingFunctions.ONE_MINUS_SOURCE_ALPHA, blending = true)
|
||||
}
|
||||
|
||||
fun drawTranslucent()
|
||||
|
Loading…
x
Reference in New Issue
Block a user