A module defining core path tracing functions to process path vertices, perform NEE and process its generated samples
|
FERMAT_DEVICE FERMAT_FORCEINLINE void | per_warp_atomic_add (uint64 *ptr, uint64 val) |
|
template<typename TPTContext > |
FERMAT_HOST_DEVICE void | compute_per_bounce_options (TPTContext &context, const RenderingContextView &renderer) |
|
template<typename TPTContext > |
FERMAT_DEVICE MaskedRay | generate_primary_ray (TPTContext &context, RenderingContextView &renderer, const uint2 pixel, cugar::Vector3f U, cugar::Vector3f V, cugar::Vector3f W) |
|
template<typename TPTContext > |
FERMAT_DEVICE MaskedRay | generate_primary_ray (TPTContext &context, RenderingContextView &renderer, const uint2 pixel) |
|
template<typename TPTContext , typename TPTVertexProcessor > |
FERMAT_DEVICE void | solve_occlusion (TPTContext &context, TPTVertexProcessor &vertex_processor, RenderingContextView &renderer, const bool shadow_hit, const PixelInfo pixel_info, const cugar::Vector3f w, const cugar::Vector3f w_d, const cugar::Vector3f w_g, const uint32 vertex_info=uint32(-1), const uint32 nee_vertex_id=uint32(-1), const uint32 nee_sample_id=uint32(-1)) |
|
template<typename TPTContext > |
FERMAT_DEVICE float | vertex_sample (const uint2 pixel, TPTContext &context, const uint32 i) |
|
template<typename TPTContext , typename TPTVertexProcessor > |
FERMAT_DEVICE bool | shade_vertex (TPTContext &context, TPTVertexProcessor &vertex_processor, RenderingContextView &renderer, const uint32 bounce, const PixelInfo pixel_info, const uint2 pixel, const MaskedRay &ray, const Hit hit, const cugar::Vector4f w, const uint32 prev_vertex_info=uint32(-1), const uint32 prev_nee_vertex_id=uint32(-1), const cugar::Vector2f cone=cugar::Vector2f(0)) |
|
◆ compute_per_bounce_options()
template<typename TPTContext >
FERMAT_HOST_DEVICE void compute_per_bounce_options |
( |
TPTContext & |
context, |
|
|
const RenderingContextView & |
renderer |
|
) |
| |
compute options relative to the current bounce and set them in the TPTContext class:
- TPTContext::do_nee : whether to perform NEE
- TPTContext::do_accumulate_emissive : whether to accumulate emissive surface hits
- TPTContext::do_scatter : whether to perform scattering
◆ generate_primary_ray() [1/2]
template<typename TPTContext >
generate a primary ray based on the given pixel index
- Template Parameters
-
TPTContext | A path tracing context |
- Parameters
-
context | the path tracing context |
renderer | the rendering context |
pixel | the unpacked 2d pixel index |
U | the horizontal (+X) camera frame vector |
V | the vertical (+Y) camera frame vector |
W | the depth (+Z) camera frame vector |
◆ generate_primary_ray() [2/2]
template<typename TPTContext >
generate a primary ray based on the given pixel index
- Template Parameters
-
TPTContext | A path tracing context |
- Parameters
-
context | the path tracing context |
renderer | the rendering context |
pixel | the unpacked 2d pixel index |
◆ shade_vertex()
template<typename TPTContext , typename TPTVertexProcessor >
FERMAT_DEVICE bool shade_vertex |
( |
TPTContext & |
context, |
|
|
TPTVertexProcessor & |
vertex_processor, |
|
|
RenderingContextView & |
renderer, |
|
|
const uint32 |
bounce, |
|
|
const PixelInfo |
pixel_info, |
|
|
const uint2 |
pixel, |
|
|
const MaskedRay & |
ray, |
|
|
const Hit |
hit, |
|
|
const cugar::Vector4f |
w, |
|
|
const uint32 |
prev_vertex_info = uint32(-1) , |
|
|
const uint32 |
prev_nee_vertex_id = uint32(-1) , |
|
|
const cugar::Vector2f |
cone = cugar::Vector2f(0) |
|
) |
| |
processes a path vertex, performing the following three steps:
- sampling NEE
- accumulating emissive surface hits
- scattering
- Template Parameters
-
TPTContext | A path tracing context, which must adhere to the TPTContext interface |
TPTVertexProcessor | A vertex processor, which must adhere to the TPTVertexProcessor interface |
- Parameters
-
context | the path tracing context |
vertex_processor | the vertex processor |
renderer | the rendering context |
pixel_info | the packed pixel info |
pixel | the unpacked 2d pixel index |
ray | the incoming ray |
hit | the hit information |
w | the current path weight |
prev_nee_vertex_id | the NEE slot corresponding to the previous vertex |
cone | the incoming ray cone |
◆ solve_occlusion()
template<typename TPTContext , typename TPTVertexProcessor >
FERMAT_DEVICE void solve_occlusion |
( |
TPTContext & |
context, |
|
|
TPTVertexProcessor & |
vertex_processor, |
|
|
RenderingContextView & |
renderer, |
|
|
const bool |
shadow_hit, |
|
|
const PixelInfo |
pixel_info, |
|
|
const cugar::Vector3f |
w, |
|
|
const cugar::Vector3f |
w_d, |
|
|
const cugar::Vector3f |
w_g, |
|
|
const uint32 |
vertex_info = uint32(-1) , |
|
|
const uint32 |
nee_vertex_id = uint32(-1) , |
|
|
const uint32 |
nee_sample_id = uint32(-1) |
|
) |
| |
processes a NEE sample, using occlusion information
- Template Parameters
-
TPTContext | A path tracing context, which must adhere to the TPTContext interface |
TPTVertexProcessor | A vertex processor, which must adhere to the TPTVertexProcessor interface |
- Parameters
-
context | the path tracing context |
vertex_processor | the vertex processor |
renderer | the rendering context |
shadow_hit | a bit indicating whether the sample is occluded or not |
pixel_info | the packed pixel info |
w | the total sample weight |
w_d | the diffuse sample weight |
w_g | the glossy sample weight |
nee_vertex_id | the current NEE slot computed by the direct lighting engine |
nee_sample_id | the current NEE cluster computed by the direct lighting engine |
◆ vertex_sample()
template<typename TPTContext >
FERMAT_DEVICE float vertex_sample |
( |
const uint2 |
pixel, |
|
|
TPTContext & |
context, |
|
|
const uint32 |
i |
|
) |
| |
return the i-th dimensional sample for this vertex, with i in [0,6[