Support Forum G3D Web Page |
1D Gaussian blur.
More...
Public Types | |
enum | Direction { VERTICAL, HORIZONTAL } |
Static Public Member Functions | |
static void | apply (class RenderDevice *rd, const shared_ptr< Texture > &source, const Vector2 &direction, int N, const Vector2 &destSize, bool clear=true, bool unitArea=true, float stddevMultiplier=1.0f, float computeFraction=-1.0f) |
Blurs the source to the current G3D::Framebuffer. More... | |
static void | apply (class RenderDevice *rd, const shared_ptr< Texture > &source, const Vector2 &direction=Vector2(1.0f, 0.0f), int N=17) |
static String | getPreamble (int N, bool unitArea, float stddevMultiplier=1.0f) |
Returns the preamble for the GuassianBlur shader containing: More... | |
1D Gaussian blur.
Call twice to produce a 2D blur.
Operates on the graphics card; this requires a RenderDevice. See G3D::gaussian for gaussian filter coefficients on the CPU.
|
static |
Blurs the source to the current G3D::Framebuffer.
Assumes RenderDevice::push2D rendering mode is already set. Blurs the alpha channel the same as any color channel, however, you must have alphaWrite enabled to obtain that result.
2D blur is not directly supported because handling of the intermediate texture is different for Framebuffer and backbuffer rendering.
N | Number of taps in the filter (filter kernel width) |
direction | Direction of the blur. For best results, use Vector2(1,0) and Vector(0,1). |
destSize | output dimensions |
clear | Clear the target first? |
unitArea | If true, the taps sum to 1. If false, the center tap has magnitude 1. |
computeFraction | If >= 0, only compute on a disk that covers this fraction of the diameter of the screen (max of width, height). |
|
static |
|
static |
Returns the preamble for the GuassianBlur shader containing: