mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
billboard text: light
This commit is contained in:
parent
5eecbe89b7
commit
a73fc2a43c
@ -106,6 +106,7 @@ open class BillboardTextFeature(
|
||||
val shader = renderer.renderer.features.text.shader
|
||||
shader.use()
|
||||
shader.matrix = matrix
|
||||
shader.tint = renderer.light.value
|
||||
mesh.draw()
|
||||
}
|
||||
|
||||
|
@ -15,23 +15,23 @@ package de.bixilon.minosoft.gui.rendering.entities.feature.text
|
||||
|
||||
import de.bixilon.kotlinglm.mat4x4.Mat4
|
||||
import de.bixilon.kotlinglm.vec3.Vec3
|
||||
import de.bixilon.minosoft.data.text.formatting.color.ChatColors
|
||||
import de.bixilon.minosoft.gui.rendering.camera.FogManager
|
||||
import de.bixilon.minosoft.gui.rendering.light.LightmapBuffer
|
||||
import de.bixilon.minosoft.gui.rendering.shader.Shader
|
||||
import de.bixilon.minosoft.gui.rendering.shader.types.FogShader
|
||||
import de.bixilon.minosoft.gui.rendering.shader.types.LightShader
|
||||
import de.bixilon.minosoft.gui.rendering.shader.types.TextureShader
|
||||
import de.bixilon.minosoft.gui.rendering.shader.types.TintedShader
|
||||
import de.bixilon.minosoft.gui.rendering.shader.types.ViewProjectionShader
|
||||
import de.bixilon.minosoft.gui.rendering.system.base.shader.NativeShader
|
||||
import de.bixilon.minosoft.gui.rendering.system.base.texture.TextureManager
|
||||
|
||||
class BillboardTextShader(
|
||||
override val native: NativeShader,
|
||||
) : Shader(), TextureShader, LightShader, ViewProjectionShader, FogShader {
|
||||
) : Shader(), TextureShader, ViewProjectionShader, FogShader, TintedShader {
|
||||
override var textures: TextureManager by textureManager()
|
||||
override val lightmap: LightmapBuffer by lightmap()
|
||||
override var viewProjectionMatrix: Mat4 by viewProjectionMatrix()
|
||||
override var cameraPosition: Vec3 by cameraPosition()
|
||||
override var fog: FogManager by fog()
|
||||
var matrix: Mat4 by uniform("uMatrix", Mat4())
|
||||
override var tint by uniform("uTintColor", ChatColors.WHITE) { shader, name, value -> shader.setUInt(name, value.rgb) }
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ layout (location = 3) in float vinTint;
|
||||
|
||||
uniform mat4 uViewProjectionMatrix;
|
||||
uniform mat4 uMatrix;
|
||||
uniform uint uTintColor;
|
||||
|
||||
|
||||
flat out uint finTextureIndex;
|
||||
@ -29,14 +30,12 @@ out vec3 finFragmentPosition;
|
||||
out vec4 finTintColor;
|
||||
|
||||
|
||||
|
||||
#include "minosoft:color"
|
||||
#include "minosoft:light"
|
||||
|
||||
void main() {
|
||||
vec4 position = uMatrix * vec4(vinPosition, 0.0f, 1.0f);
|
||||
gl_Position = uViewProjectionMatrix * position;
|
||||
finTintColor = getRGBAColor(floatBitsToUint(vinTint)); // * getLight(lightTint >> 24u); // TODO
|
||||
finTintColor = getRGBAColor(floatBitsToUint(vinTint)) * getRGBColor(uTintColor);
|
||||
finFragmentPosition = position.xyz;
|
||||
|
||||
uint indexLayerAnimation = floatBitsToUint(vinIndexLayerAnimation);
|
||||
|
Loading…
x
Reference in New Issue
Block a user