New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigning a shader to fe.Text makes the background colour black #457

Open
oomek opened this Issue Jul 9, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@oomek
Collaborator

oomek commented Jul 9, 2018

I've observed this a while ago, but I've never come up with an idea what might be causing it.
It could be fixed by assigning a separate shader just for the background, but this may be an unnecessary overcomplication if there is a better solution.

local flw = fe.layout.width
local flh = fe.layout.height

local bg = fe.add_text( "", 0, 0, flw, flh )
bg.set_bg_rgb( 50, 50, 100 )

local txt1 = fe.add_text("Text without shader", 0, flh / 3, flw, flh / 10 )
txt1.set_bg_rgb( 200, 0, 0 )

local txt2 = fe.add_text("Text with shader", 0, flh / 3 * 2, flw, flh / 10 )
txt2.set_bg_rgb( 200, 0, 0 )

local sh = fe.add_shader( Shader.Fragment, "shader.frag" )
txt2.shader = sh

shader.frag is the default one

@oomek

This comment has been minimized.

Collaborator

oomek commented Jul 9, 2018

2018-07-09 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment