Page 3 of 3

Posted: Sun May 10, 2009 1:45 pm
by VilleK
Nice article about convolution. Maybe we can make a property on the Blur-component that let's you optionally set the values of the convolution matrix using a zexpression? We can also have presets for all the common filters. Looks like the blur-component is becoming a little filter-factory of its own.

Posted: Sun May 10, 2009 5:41 pm
by Kjell
Hi,

In case somebody wants to do image filtering using GLSL, here is a basic convolution shader with some variations.

In clockwise order: None, Blur, Sharp, Glow

K

Posted: Mon May 11, 2009 3:25 pm
by jph_wacheski
That is cool Kjell,. I was wundering of ways to use shaders in a 2d sprite based game and I think I can adapt from those into some interesting effects,. . however yeah it is probably best to do bitmap generation in software to keep it uniform,. I do like the convolution filter,. perhaps we rename the 'blur' to 'convolution' and supply some presets,. .

Posted: Mon May 11, 2009 3:55 pm
by kattle87
Ok guys: I'm positive about:
-Blur component with something that replaces the old "passes" variable with a "type of blurs" preset. 3 or 4 presets are possible. Plus we add a "convolution" component that can use presets and a 2-D array to get a custom filter computed.
-Rename the blur component and transform it into the "Convolution" component with some presets and 2-D custom array.

I'm not in with keeping the blur component (I mean keeping the name "Blur"!) while adding some functions. It's just a mess IMHO =)

So what so you guys think about this?
Ville, if I have understood how saving works, the option #2 (that is "rename" and extend the blur component) would break backward compatibility. Is this correct? Can we add some cases to the file loading function to keep the compatibility?

Y off set, we really need your opinion too! ^^ We need to know what the end user prefers ^^

Posted: Mon May 11, 2009 10:00 pm
by Kjell
Depends,

Sometimes software only is the way to go .. for other projects you might want to have a hardware and software mode to choose from .. but going with the "modern video required" path can be just as valid.

You don't want to create a software path for heavy real-time filtering / lens-distortion ( see attached ) using Bitmap / Mesh Expressions :wink:

K

Posted: Tue May 12, 2009 6:40 am
by VilleK
I think ease-of-use is a very important consideration to attract new users and for this reason I think we should keep a component called "Blur" because it is easy to understand. A "Convolution" component is quite advanced and require to read a tutorial before you fully understand how to use it.

So I vote for:
- Blur component with "Kind"-property for different style of blur-filters
- Convolution for more advanced convolution

Since both components will share most of the code it will not affect the code-size noticeable.

Re: Blur

Posted: Fri Mar 08, 2019 5:22 am
by rrTea
Hi Kjell!
Kjell wrote: Sun May 10, 2009 5:41 pm In case somebody wants to do image filtering using GLSL, here is a basic convolution shader with some variations.

In clockwise order: None, Blur, Sharp, Glow
I'm trying to use the Blur on a material with a material texture that has TextureScale.Y set to 5.

But as soon as I activate the Blur shader, it renders the bitmap as if it used TextureScale.Y of 1. How can I fix it?

Re: Blur

Posted: Fri Mar 08, 2019 11:55 am
by Kjell
Hi rrTea,
rrTea wrote: Fri Mar 08, 2019 5:22 amI'm trying to use the Blur on a material with a material texture that has TextureScale.Y set to 5. But as soon as I activate the Blur shader, it renders the bitmap as if it used TextureScale.Y of 1. How can I fix it?
Change the "gl_TexCoord[0] = gl_MultiTexCoord0;" line in the vertex shader into "gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;". However, this was merely a demonstration* of some things you can do with a convolution shader. If you just want blur, there are better performing alternatives.

*Aside from that example being outdated and containing fragment shaders that won't work on every system / driver anymore.

K

Re: Blur component "refresh"

Posted: Fri Mar 08, 2019 12:02 pm
by rrTea
Alright thanks! I was just testing it but good to know it was just a demonstration / not guaranteed to work on some systems.