|
void | prepare (const Options &options) const |
| Call on the main thread if you wish to force GPU->CPU conversion and tree building to happen right now. More...
|
|
void | setScene (const shared_ptr< Scene > &scene) |
| Replaces the previous scene. More...
|
|
void | traceBuffer (Array< Ray > &rayBuffer, Radiance3 *output, const Options &options, bool lightEmissiveOnFirstHit, const float *weight=nullptr, float *distance=nullptr, Vector3 *primaryWSNormalBuffer=nullptr, Color3 *primaryAlbedoBuffer=nullptr) const |
|
More...
|
|
void | traceImage (const shared_ptr< Image > &radianceImage, const shared_ptr< Camera > &camera, const Options &options, const std::function< void(const String &, float)> &statusCallback=nullptr) const |
| Assumes that the scene has been previously set. More...
|
|
const shared_ptr< TriTree > & | triTree () const |
|
|
| PathTracer (const shared_ptr< TriTree > &t=nullptr) |
|
void | addEmissive (const Array< Ray > &rayFromEye, const Array< shared_ptr< Surfel >> &surfelBuffer, const Array< bool > &impulseRay, const Array< Color3 > &modulationBuffer, Radiance3 *outputBuffer, const Array< int > outputCoordBuffer, const shared_ptr< Image > &radianceImage, const Array< PixelCoord > &pixelCoordBuffer) const |
| In a properly modeled scene with area lights and no duplicating point lights, we should only count this term on the first bounce. More...
|
|
void | computeDirectIllumination (const Array< shared_ptr< Surfel >> &surfelBuffer, const Array< shared_ptr< Light >> &lightArray, const Array< Ray > &rayBuffer, int currentPathDepth, int currentRayIndex, const Options &options, const Array< PixelCoord > &pixelCoordBuffer, const int radianceImageWidth, Array< Radiance3 > &directBuffer, Array< Ray > &shadowRayBuffer) const |
| Choose what light surface to sample, storing the corresponding shadow ray and biradiance value. More...
|
|
void | generateEyeRays (int width, int height, const shared_ptr< Camera > &camera, Array< Ray > &rayBuffer, bool randomSubpixelPosition, Array< PixelCoord > &pixelCoordBuffer, const shared_ptr< Image > &weightSumImage, int rayIndex, int raysPerPixel) const |
| Produces a buffer of eye rays, stored in raster order in the preallocated rayBuffer. More...
|
|
const shared_ptr< Light > & | importanceSampleLight (const Array< shared_ptr< Light >> &lightArray, const Vector3 &w_o, const shared_ptr< Surfel > &surfel, int sequenceIndex, int rayIndex, int raysPerPixel, Biradiance3 &biradiance, Color3 &cosBSDFDivPDF, Point3 &lightPosition) const |
| sequenceIndex = (pixelIndex * maxPathDepth) + currentPathDepth) More...
|
|
void | prepare (const Options &options, Array< shared_ptr< Light >> &directLightArray, Array< shared_ptr< Light >> &indirectLightArray) const |
|
Point3 | sampleOneLight (const shared_ptr< Light > &light, const Point3 &X, const Vector3 &n, int pixelIndex, int lightIndex, int sampleIndex, int numSamples, float &areaTimesPDFValue) const |
|
Sample a single light and choose a point on it, potentially in a low-discrepancy or importance sampling way. More...
|
|
virtual void | scatterRays (const Array< shared_ptr< Surfel >> &surfelBuffer, const Array< shared_ptr< Light >> &indirectLightArray, int currentPathDepth, int rayIndex, int raysPerPixel, Array< Ray > &rayBuffer, Array< Color3 > &modulationBuffer, Array< bool > &impulseScatterBuffer) const |
| Compute the next bounce direction by mutating rayBuffer, and then multiply the modulationBuffer by the inverse probability density that the direction was taken. More...
|
|
virtual void | shade (const Array< shared_ptr< Surfel >> &surfelBuffer, const Array< Ray > &rayFromEye, const Array< Ray > &rayFromLight, const Array< bool > &lightShadowedBuffer, const Array< Radiance3 > &directBuffer, const Array< Color3 > &modulationBuffer, Radiance3 *outputBuffer, const Array< int > outputCoordBuffer, const shared_ptr< Image > &radianceImage, const Array< PixelCoord > &pixelCoordBuffer) const |
| Apply the BSDF for each surfel to the biradiance in the corresponding light (unless shadowed), modulate as specified, and add to the image. More...
|
|
Radiance3 | skyRadiance (const Vector3 &direction) const |
|
virtual void | traceBufferInternal (BufferSet &buffers, Radiance3 *output, const shared_ptr< Image > &radianceImage, float *distance, const Array< shared_ptr< Light >> &directLightArray, const Array< shared_ptr< Light >> &indirectLightArray, int currentRayIndex) const |
| Called from traceBuffer after the options are set and scene is processed. More...
|
|
void G3D::PathTracer::addEmissive |
( |
const Array< Ray > & |
rayFromEye, |
|
|
const Array< shared_ptr< Surfel >> & |
surfelBuffer, |
|
|
const Array< bool > & |
impulseRay, |
|
|
const Array< Color3 > & |
modulationBuffer, |
|
|
Radiance3 * |
outputBuffer, |
|
|
const Array< int > |
outputCoordBuffer, |
|
|
const shared_ptr< Image > & |
radianceImage, |
|
|
const Array< PixelCoord > & |
pixelCoordBuffer |
|
) |
| const |
|
protected |
In a properly modeled scene with area lights and no duplicating point lights, we should only count this term on the first bounce.
However, we're only going to sample point lights explicitly, so we need emissive on every bounce. Scenes like G3D cornell box where there are both point and emissives in the same location will get brighter than expected as a result.
If outputBuffer is not null, writes to it using outputCoordBuffer indices, otherwise writes to radianceImage using pixelCoordBuffer indices.
virtual void G3D::PathTracer::traceBufferInternal |
( |
BufferSet & |
buffers, |
|
|
Radiance3 * |
output, |
|
|
const shared_ptr< Image > & |
radianceImage, |
|
|
float * |
distance, |
|
|
const Array< shared_ptr< Light >> & |
directLightArray, |
|
|
const Array< shared_ptr< Light >> & |
indirectLightArray, |
|
|
int |
currentRayIndex |
|
) |
| const |
|
protectedvirtual |
Called from traceBuffer after the options are set and scene is processed.
- Parameters
-
currentRayIndex | If you are tracing multiple rays per pixel, this is the loop index of these rays. |
If output is not null, the output is written there. Otherwise the output is bilinearly blended into the radianceImage and the pixelCoordBuffer is used.
If weight is not null, it is an array of per-output weights.
If distance is not null, the distance to each primary hit is written to it (not the "Z" value).