Outline with fade-out?

Anything libgdx related goes here!

Outline with fade-out?

Postby lukas____ » Thu Apr 05, 2018 6:19 am

Hey guys,
I looked for an outline shader and found this one: http://www.allpiper.com/2d-selection-ou ... in-libgdx/
Works great! But I need an alpha transition/fade-out to achieve a glow-effect.
Do you have an idea?
lukas____
 
Posts: 12
Joined: Tue May 12, 2015 10:31 am

Re: Outline with fade-out?

Postby Hangman » Tue Apr 10, 2018 2:28 am

Just add a new uniform value for alpha, or change the existing Vec3 u_color to Vec4.
Multiply both alpha values before you give it to gl_FragColor.
Hangman
 
Posts: 11
Joined: Mon Jan 23, 2017 4:16 pm

Re: Outline with fade-out?

Postby RafaSKB » Tue Apr 10, 2018 3:07 am

Just something to keep in mind about performance: When using Shader code, ifs and fors can make the code very slow, because the GPU usually processes many pixels at once with the same code, unless there are fors and ifs.
Awesome libGDX - A curated list of resources and tutorials to help developers make awesome games. https://github.com/rafaskb/awesome-libgdx#readme

Grashers - Trash-themed roguelike set in space. http://www.grashers.com
RafaSKB
 
Posts: 144
Joined: Sat Aug 01, 2015 5:14 am
Location: São Paulo, Brazil


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 1 guest