Author Topic: Faster gaussian blur - early bailing based on mask  (Read 1585 times)

0 Members and 1 Guest are viewing this topic.

Beherith

  • World Machine Veteran
  • ***
  • Posts: 38
    • View Profile
Faster gaussian blur - early bailing based on mask
« on: February 12, 2014, 03:30:00 AM »
Often times Blur devices are very expensive for me (I probably use too much of them with too high radii anyway), even if i'm only using them masked off on small parts of the terrain.

Would it be a good idea to check if the mask value is zero before calculating the gaussian blur of a pixel? This could be applied to other slow devices as well.

EDIT: it just occured to me that gaussian blur seems to be a 2 pass algorithm, (cause its ordo linear with kernel size), so implementing this might not be straightforward.
« Last Edit: February 12, 2014, 04:34:27 AM by Beherith »

Remnant

  • Author
  • World Machine Guru
  • *****
  • Posts: 2311
    • View Profile
    • http://www.world-machine.com/
Re: Faster gaussian blur - early bailing based on mask
« Reply #1 on: February 12, 2014, 11:15:45 AM »
Hi there,

Funny enough, the next major feature branch release includes a new blur algorithm that, in exchange for a slight reduction in blur smoothness compared to full Gaussian blur, gains massive speed improvements at large world resolutions where the huge kernel size of a regular Gaussian blur becomes prohibitive -- like dozens to thousands of times faster depending on the exact scenario!
-- Stephen Schmitt
- Creator of World Machine