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


This is designed to read from a G3D-style velocity (optical flow) buffer. More...

Public Member Functions

float cone (float dist, float r)
 
float cylinder (float dist, float r)
 
float fastCone (float dist, float invR)
 
float hash (int2 c)
 Computes a pseudo-random number on [0, 1] from pixel position c. More...
 
void main ()
 
float3 readAdjustedNeighborhoodVelocity (int2 C, out float r)
 NeighborMax[C] from the paper. More...
 
float3 readAdjustedVelocity (int2 C, sampler2D sampler, out float r)
 Called from readAdjustedVelocity() and readAdjustedNeighborhoodVelocity() More...
 
float3 readAdjustedVelocity (int2 C, out float r)
 
V[C] in the paper. More...
 
float softDepthCompare (float depth_A, float depth_B)
 0 if depth_A << depth_B, 1 if depth_A >> z_depth, fades between when they are close More...
 
float softZCompare (float z_A, float z_B)
 

Public Attributes

uniform sampler2D colorBuffer
 No guard band. More...
 
uniform sampler2D depthBuffer
 Typical hyperbolic depth buffer: close values are greater than distant values. More...
 
uniform float exposureTime
 In fraction of frame duration. More...
 
const float HALF_PIX = 0.5
 
float2 jitter
 Amount on [-0.5, 0.5] to randomly perturb samples by at each pixel. More...
 
uniform sampler2D neighborMinMax_buffer
 Uses the same encoding as SS_POSITION_CHANGE but has three channels. More...
 
uniform sampler2D randomBuffer
 32x32 tiled random numbers More...
 
out float3 resultColor
 
uniform sampler2D SS_POSITION_CHANGE_buffer
 Unprocessed differences between previous and current frame in screen space. More...
 
uniform vec4 SS_POSITION_CHANGE_readAddSecond
 
uniform vec4 SS_POSITION_CHANGE_readMultiplyFirst
 
uniform ivec2 trimBandThickness
 

Detailed Description


This is designed to read from a G3D-style velocity (optical flow) buffer.

For performance, you could just write out velocity in the desired format rather than adjusting it per texture fetch.

Member Function Documentation

◆ cone()

float glsl::MotionBlur_gather_pix::cone ( float  dist,
float  r 
)
inline

◆ cylinder()

float glsl::MotionBlur_gather_pix::cylinder ( float  dist,
float  r 
)
inline

◆ fastCone()

float glsl::MotionBlur_gather_pix::fastCone ( float  dist,
float  invR 
)
inline

◆ hash()

float glsl::MotionBlur_gather_pix::hash ( int2  c)
inline

Computes a pseudo-random number on [0, 1] from pixel position c.

◆ main()

void glsl::MotionBlur_gather_pix::main ( void  )
inline

◆ readAdjustedNeighborhoodVelocity()

float3 glsl::MotionBlur_gather_pix::readAdjustedNeighborhoodVelocity ( int2  C,
out float  r 
)
inline

NeighborMax[C] from the paper.

◆ readAdjustedVelocity() [1/2]

float3 glsl::MotionBlur_gather_pix::readAdjustedVelocity ( int2  C,
sampler2D  sampler,
out float  r 
)
inline

Called from readAdjustedVelocity() and readAdjustedNeighborhoodVelocity()

(xy) is the velocity, z is the minimum blur radius in the tile for neighbor velocity and zero for expressive motion.

◆ readAdjustedVelocity() [2/2]

float3 glsl::MotionBlur_gather_pix::readAdjustedVelocity ( int2  C,
out float  r 
)
inline


V[C] in the paper.

v = half-velocity vector r = magnitude of v

◆ softDepthCompare()

float glsl::MotionBlur_gather_pix::softDepthCompare ( float  depth_A,
float  depth_B 
)
inline

0 if depth_A << depth_B, 1 if depth_A >> z_depth, fades between when they are close

◆ softZCompare()

float glsl::MotionBlur_gather_pix::softZCompare ( float  z_A,
float  z_B 
)
inline

Member Data Documentation

◆ colorBuffer

uniform sampler2D glsl::MotionBlur_gather_pix::colorBuffer

No guard band.

◆ depthBuffer

uniform sampler2D glsl::MotionBlur_gather_pix::depthBuffer

Typical hyperbolic depth buffer: close values are greater than distant values.

Guard band.

◆ exposureTime

uniform float glsl::MotionBlur_gather_pix::exposureTime

In fraction of frame duration.

◆ HALF_PIX

const float glsl::MotionBlur_gather_pix::HALF_PIX = 0.5

◆ jitter

float2 glsl::MotionBlur_gather_pix::jitter

Amount on [-0.5, 0.5] to randomly perturb samples by at each pixel.

◆ neighborMinMax_buffer

uniform sampler2D glsl::MotionBlur_gather_pix::neighborMinMax_buffer

Uses the same encoding as SS_POSITION_CHANGE but has three channels.

No guard band.

◆ randomBuffer

uniform sampler2D glsl::MotionBlur_gather_pix::randomBuffer

32x32 tiled random numbers

◆ resultColor

out float3 glsl::MotionBlur_gather_pix::resultColor

◆ SS_POSITION_CHANGE_buffer

uniform sampler2D glsl::MotionBlur_gather_pix::SS_POSITION_CHANGE_buffer

Unprocessed differences between previous and current frame in screen space.

Guard band.

◆ SS_POSITION_CHANGE_readAddSecond

uniform vec4 glsl::MotionBlur_gather_pix::SS_POSITION_CHANGE_readAddSecond

◆ SS_POSITION_CHANGE_readMultiplyFirst

uniform vec4 glsl::MotionBlur_gather_pix::SS_POSITION_CHANGE_readMultiplyFirst

◆ trimBandThickness

uniform ivec2 glsl::MotionBlur_gather_pix::trimBandThickness

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