Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | List of all members
glsl::DepthOfField_blur_pix Class Reference


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...
 

Detailed Description


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

Member Function Documentation

◆ inNearField()

bool glsl::DepthOfField_blur_pix::inNearField ( float  radiusPixels)
inline

◆ main()

void glsl::DepthOfField_blur_pix::main ( void  )
inline

◆ square()

float glsl::DepthOfField_blur_pix::square ( float  x)
inline

Member Data Documentation

◆ blurSourceBuffer

uniform sampler2D glsl::DepthOfField_blur_pix::blurSourceBuffer

Source image in RGB, normalized CoC in A.

◆ direction

const int2 glsl::DepthOfField_blur_pix::direction = int2(0, 1)

◆ fieldOfView

uniform float glsl::DepthOfField_blur_pix::fieldOfView

◆ invNearBlurRadiusPixels

uniform float glsl::DepthOfField_blur_pix::invNearBlurRadiusPixels

◆ lowResolutionFactor

uniform float glsl::DepthOfField_blur_pix::lowResolutionFactor

◆ maxCoCRadiusPixels

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.

◆ nearBlurRadiusPixels

uniform int glsl::DepthOfField_blur_pix::nearBlurRadiusPixels

◆ nearSourceBuffer

uniform sampler2D glsl::DepthOfField_blur_pix::nearSourceBuffer

For the second pass, the output of the previous near-field blur pass.


documentation generated on Wed Nov 24 2021 08:02:03 using doxygen 1.8.15