Blur component "refresh"
Moderator: Moderators
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.
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
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
- Attachments
-
- Convolution.jpg (48.61 KiB) Viewed 48593 times
-
- Convolution.zgeproj
- (157.25 KiB) Downloaded 1308 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
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,. .
iterationGAMES.com
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 ^^
-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 ^^
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
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 :wink:](./images/smilies/icon_wink.gif)
K
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 :wink:](./images/smilies/icon_wink.gif)
K
- Attachments
-
- FishEye.zip
- (79.68 KiB) Downloaded 1265 times
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.
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
Hi Kjell!
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?
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
Hi rrTea,
*Aside from that example being outdated and containing fragment shaders that won't work on every system / driver anymore.
K
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"
Alright thanks! I was just testing it but good to know it was just a demonstration / not guaranteed to work on some systems.