mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
Make the crosshair transparent (#1347)
* make crosshair transparent * fix styling * fixes
This commit is contained in:
parent
b70eb60afd
commit
735e99826e
@ -7,5 +7,8 @@ flat in vec4 fColor;
|
|||||||
in vec2 uv;
|
in vec2 uv;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
frag_color = texture(image, uv) * fColor;
|
frag_color = texture(image, uv)*fColor;
|
||||||
|
if(frag_color.a == 0) {
|
||||||
|
discard;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ const gui = @import("../gui.zig");
|
|||||||
const GuiWindow = gui.GuiWindow;
|
const GuiWindow = gui.GuiWindow;
|
||||||
const GuiComponent = gui.GuiComponent;
|
const GuiComponent = gui.GuiComponent;
|
||||||
|
|
||||||
|
const c = main.graphics.c;
|
||||||
|
|
||||||
const size: f32 = 64;
|
const size: f32 = 64;
|
||||||
pub var window = GuiWindow{
|
pub var window = GuiWindow{
|
||||||
.contentSize = Vec2f{size, size},
|
.contentSize = Vec2f{size, size},
|
||||||
@ -33,5 +35,9 @@ pub fn deinit() void {
|
|||||||
pub fn render() void {
|
pub fn render() void {
|
||||||
texture.bindTo(0);
|
texture.bindTo(0);
|
||||||
graphics.draw.setColor(0xffffffff);
|
graphics.draw.setColor(0xffffffff);
|
||||||
|
c.glBlendFunc(c.GL_ONE, c.GL_ONE);
|
||||||
|
c.glBlendEquation(c.GL_FUNC_SUBTRACT);
|
||||||
graphics.draw.boundImage(.{0, 0}, .{size, size});
|
graphics.draw.boundImage(.{0, 0}, .{size, size});
|
||||||
|
c.glBlendFunc(c.GL_SRC_ALPHA, c.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
c.glBlendEquation(c.GL_FUNC_ADD);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user