csOrigin | Camera-space ray origin, which must be within the view volume and must have z < -0.01 and project within the valid screen rectangle |
csDirection | Unit length camera-space ray direction |
projectToPixelMatrix | A projection matrix that maps to pixel coordinates (not [-1, +1] normalized device coordinates). Usually g3d_ProjectToPixelMatrix or gbuffer_camera_projectToPixelMatrix. |
csZBuffer | The depth or camera-space Z buffer, depending on the value of csZBufferIsHyperbolic |
csZBufferSize | Dimensions of csZBuffer |
csZThickness | Camera space thickness to ascribe to each pixel in the depth buffer |
csZBufferIsHyperbolic | True if csZBuffer is an OpenGL depth buffer, false (faster) if csZBuffer contains (negative) "linear" camera space z values. Const so that the compiler can evaluate the branch based on it at compile time |
clipInfo | See G3D::Camera documentation |
nearPlaneZ | Negative number. Doesn't have to be THE actual near plane, just a reasonable value for clipping rays headed towards the camera |
stride | Step in horizontal or vertical pixels between samples. This is a float because integer math is slow on GPUs, but should be set to an integer >= 1 |
jitterFraction | Number between 0 and 1 for how far to bump the ray in stride units to conceal banding artifacts, plus the stride ray offset. It is recommended to set this to at least 1.0 to avoid self-intersection artifacts. Using 1 + float((int(gl_FragCoord.x) + int(gl_FragCoord.y.y)) & 1) * 0.5 gives a nice dither pattern when stride is > 1.0; |
maxSteps | Maximum number of iterations. Higher gives better images but may be slow |
maxRayTraceDistance | Maximum camera-space distance to trace before returning a miss |
hitPixel | Pixel coordinates of the first intersection with the scene |
csHitPoint | Camera space location of the ray hit |