While experimenting I accidently printed two nearly identical strings ("test1" and "test2") in the same location. When I corrected this, it seemed as though the text of the two separate strings was not as intense/bright as when they overlapped. So I did a test. I printed the "test1" string 4 times at the same location and the "test2" sting just once below it. The string that is printed 4 times at the same location is clearly more intense/brighter.
Is there a way to get this brighter effect without printing multiple times?
intensity of printing
Re: intensity of printing
With a shader, you can modulate the alpha. The effect shouldn't be very different.
You could also use a different font, e.g. one with boldface, or create a bitmap font.
Code: Select all
local shader = love.graphics.newShader[[
extern number gamma;
vec4 effect(vec4 colour, Image texture, vec2 texpos, vec2 scrpos)
{
return colour * vec4(Texel(texture, texpos).rgb, pow(Texel(texture, texpos).a, gamma));
}
]]
function love.draw(txt)
shader:send('gamma', 0.35)
love.graphics.setShader(shader)
love.graphics.print("test1")
love.graphics.setShader()
love.graphics.print("test2", 0, 40)
end
Re: intensity of printing
Thanks pgimento.
Your reply is a bit over my head at my current level of knowledge of löve. At this time this is not a terribly important thing for me. Perhaps sometime in the future I'll revisit this topic and learn about shaders.
Your reply is a bit over my head at my current level of knowledge of löve. At this time this is not a terribly important thing for me. Perhaps sometime in the future I'll revisit this topic and learn about shaders.
- NobodysSon
- Prole
- Posts: 33
- Joined: Tue Oct 30, 2012 10:37 pm
Re: intensity of printing
I'm curious as why the line with multiple reprintings is more intense. Are multiple alpha levels being combined or what?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: intensity of printing
That's exactly what's happening.NobodysSon wrote: ↑Thu Jan 03, 2019 3:54 am I'm curious as why the line with multiple reprintings is more intense. Are multiple alpha levels being combined or what?
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: No registered users and 1 guest