Blur component "refresh"

ZGE Source Code discussion. Ask questions, present your changes, propose patches etc.

Moderator: Moderators

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Sun May 10, 2009 1:45 pm

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.

User avatar
Kjell
Posts: 1650
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Sun May 10, 2009 5:41 pm

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
Attachments
Convolution.jpg
Convolution.jpg (48.61 KiB) Viewed 4512 times
Convolution.zgeproj
(157.25 KiB) Downloaded 343 times

User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski » Mon May 11, 2009 3:25 pm

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

kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 » Mon May 11, 2009 3:55 pm

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 ^^
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=-

User avatar
Kjell
Posts: 1650
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell » Mon May 11, 2009 10:00 pm

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
Attachments
FishEye.zip
(79.68 KiB) Downloaded 375 times

User avatar
VilleK
Site Admin
Posts: 1924
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Tue May 12, 2009 6:40 am

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.

Post Reply