Support Forum G3D Web Page |
Computes the near field blur.
More...
Public Member Functions | |
bool | inNearField (float radiusPixels) |
void | main () |
float | square (float x) |
Public Attributes | |
uniform sampler2D | blurSourceBuffer |
Source image in RGB, normalized CoC in A. More... | |
const int2 | direction = int2(0, 1) |
uniform float | fieldOfView |
uniform float | invNearBlurRadiusPixels |
uniform float | lowResolutionFactor |
uniform int | maxCoCRadiusPixels |
Maximum blur radius for any point in the scene, in pixels. More... | |
uniform int | nearBlurRadiusPixels |
uniform sampler2D | nearSourceBuffer |
For the second pass, the output of the previous near-field blur pass. More... | |
Computes the near field blur.
This is included by both the horizontal (first) and vertical (second) passes.
The shader produces two outputs:
blurResult
A buffer that is the scene blurred with a spatially varying kernel kernel that attempts to make the point-spread function at each pixel equal to its circle of confusion radius.
blurResult.rgb = color blurResult.a = normalized coc radius
nearResult
A buffer that contains only near field, blurred with premultiplied alpha. The point spread function is a fixed RADIUS in this region.
nearResult.rgb = coverage * color nearResult.a = coverage
|
inline |
|
inline |
|
inline |
uniform sampler2D glsl::DepthOfField_blur_pix::blurSourceBuffer |
Source image in RGB, normalized CoC in A.
uniform float glsl::DepthOfField_blur_pix::fieldOfView |
uniform float glsl::DepthOfField_blur_pix::invNearBlurRadiusPixels |
uniform float glsl::DepthOfField_blur_pix::lowResolutionFactor |
uniform int glsl::DepthOfField_blur_pix::maxCoCRadiusPixels |
Maximum blur radius for any point in the scene, in pixels.
Used to reconstruct the CoC radius from the normalized CoC radius.
uniform int glsl::DepthOfField_blur_pix::nearBlurRadiusPixels |
uniform sampler2D glsl::DepthOfField_blur_pix::nearSourceBuffer |
For the second pass, the output of the previous near-field blur pass.