Fermat
Classes | Public Methods | Public Members | Static Public Members | List of all members
PSFPTVertexProcessor Struct Reference

Detailed description

A simple implementation of the TPTVertexProcessor policy interface required by all the PTLibCore functions. This class is responsible of processing each vertex generated by the path tracer, including:

  • the computation of NEE weights
  • the computation of scattering weights
  • the accumulation of emissive surface hits
  • the accumulation of NEE samples

#include <psfpt_vertex_processor.h>

Classes

union  CacheInfo
 [PSFPTVertexProcessor::CacheInfo] More...
 

Public Methods

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE PSFPTVertexProcessor (float _firefly_filter=1000.0f)
 [PSFPTVertexProcessor::CacheInfo]
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f clamp_sample (const cugar::Vector3f v)
 
template<typename TPTContext >
FERMAT_DEVICE uint32 preprocess_vertex (TPTContext &context, const RenderingContextView &renderer, const PixelInfo pixel_info, const EyeVertex &ev, const float cone_radius, const cugar::Bbox3f scene_bbox, const uint32 prev_vertex_info, const cugar::Vector3f w, const float p_prev)
 
template<typename TPTContext >
FERMAT_DEVICE void compute_nee_weights (const TPTContext &context, const RenderingContextView &renderer, const PixelInfo pixel_info, const uint32 prev_vertex_info, const uint32 vertex_info, const EyeVertex &ev, const cugar::Vector3f &f_d, const cugar::Vector3f &f_g, const cugar::Vector3f &w, const cugar::Vector3f &f_L, cugar::Vector3f &out_w_d, cugar::Vector3f &out_w_g, uint32 &out_vertex_info)
 [PSFPTVertexProcessor::preprocess_vertex] More...
 
template<typename TPTContext >
FERMAT_DEVICE void compute_scattering_weights (const TPTContext &context, const RenderingContextView &renderer, const PixelInfo pixel_info, const uint32 prev_vertex_info, const uint32 vertex_info, const EyeVertex &ev, const uint32 out_comp, const cugar::Vector3f &g, const cugar::Vector3f &w, cugar::Vector3f &out_w, uint32 &out_vertex_info)
 [PSFPTVertexProcessor::compute_nee_weights] More...
 
template<typename TPTContext >
FERMAT_DEVICE void accumulate_emissive (const TPTContext &context, RenderingContextView &renderer, const PixelInfo pixel_info, const uint32 prev_vertex_info, const uint32 vertex_info, const EyeVertex &ev, const cugar::Vector3f &out_w)
 [PSFPTVertexProcessor::compute_scattering_weights] More...
 
template<typename TPTContext >
FERMAT_DEVICE void accumulate_nee (const TPTContext &context, RenderingContextView &renderer, const PixelInfo pixel_info, const uint32 vertex_info, const bool shadow_hit, const cugar::Vector3f &w_d, const cugar::Vector3f &w_g)
 [PSFPTVertexProcessor::accumulate_emissive] More...
 

Public Members

float firefly_filter
 [PSFPTVertexProcessor::accumulate_nee]
 

Static Public Members

static const uint32 DIFFUSE_COMP = 0x1u
 
static const uint32 GLOSSY_COMP = 0x2u
 
static const uint32 ALL_COMPS = 0x3u
 

Member Function Documentation

◆ accumulate_emissive()

template<typename TPTContext >
FERMAT_DEVICE void PSFPTVertexProcessor::accumulate_emissive ( const TPTContext &  context,
RenderingContextView renderer,
const PixelInfo  pixel_info,
const uint32  prev_vertex_info,
const uint32  vertex_info,
const EyeVertex ev,
const cugar::Vector3f out_w 
)
inline

[PSFPTVertexProcessor::compute_scattering_weights]

[PSFPTVertexProcessor::accumulate_emissive] accumulate an emissive surface hit

Parameters
contextthe current context
rendererthe current renderer
pixel_infopacked pixel info
vertex_infopacked vertex info
evthe eye vertex
wthe emissive sample weight

◆ accumulate_nee()

template<typename TPTContext >
FERMAT_DEVICE void PSFPTVertexProcessor::accumulate_nee ( const TPTContext &  context,
RenderingContextView renderer,
const PixelInfo  pixel_info,
const uint32  vertex_info,
const bool  shadow_hit,
const cugar::Vector3f w_d,
const cugar::Vector3f w_g 
)
inline

[PSFPTVertexProcessor::accumulate_emissive]

[PSFPTVertexProcessor::accumulate_nee] accumulate a NEE sample

Parameters
contextthe current context
rendererthe current renderer
pixel_infopacked pixel info
vertex_infopacked vertex info
hitthe hit information
w_dthe diffuse nee weight
w_gthe glossy nee weight

[PSFPTVertexProcessor::accumulate_to_cache]

[PSFPTVertexProcessor::accumulate_to_cache]

[PSFPTVertexProcessor::accumulate_remainder_to_framebuffer]

[PSFPTVertexProcessor::accumulate_remainder_to_framebuffer]

[PSFPTVertexProcessor::accumulate_all_to_framebuffer]

[PSFPTVertexProcessor::accumulate_all_to_framebuffer]

◆ compute_nee_weights()

template<typename TPTContext >
FERMAT_DEVICE void PSFPTVertexProcessor::compute_nee_weights ( const TPTContext &  context,
const RenderingContextView renderer,
const PixelInfo  pixel_info,
const uint32  prev_vertex_info,
const uint32  vertex_info,
const EyeVertex ev,
const cugar::Vector3f f_d,
const cugar::Vector3f f_g,
const cugar::Vector3f w,
const cugar::Vector3f f_L,
cugar::Vector3f out_w_d,
cugar::Vector3f out_w_g,
uint32 &  out_vertex_info 
)
inline

[PSFPTVertexProcessor::preprocess_vertex]

[PSFPTVertexProcessor::compute_nee_weights] compute nee weights given a vertex

Parameters
contextthe current context
rendererthe current renderer
pixel_infopacked pixel info
vertex_infopacked vertex info
evthe eye vertex
f_dthe diffuse brdf
f_gthe glossy brdf
wthe current path weight
f_Lthe current sample contribution, including the MIS weight
out_w_dthe output diffuse weight
out_w_gthe output glossy weight
out_vertex_infothe output packed vertex info

◆ compute_scattering_weights()

template<typename TPTContext >
FERMAT_DEVICE void PSFPTVertexProcessor::compute_scattering_weights ( const TPTContext &  context,
const RenderingContextView renderer,
const PixelInfo  pixel_info,
const uint32  prev_vertex_info,
const uint32  vertex_info,
const EyeVertex ev,
const uint32  out_comp,
const cugar::Vector3f g,
const cugar::Vector3f w,
cugar::Vector3f out_w,
uint32 &  out_vertex_info 
)
inline

[PSFPTVertexProcessor::compute_nee_weights]

[PSFPTVertexProcessor::compute_scattering_weights] compute scattering weights given a vertex

Parameters
contextthe current context
rendererthe current renderer
pixel_infopacked pixel info
vertex_infopacked vertex info
evthe eye vertex
out_compthe brdf scattering component
gthe brdf scattering weight (= f/p)
wthe current path weight
out_wthe output weight
out_vertex_infothe output vertex info

◆ preprocess_vertex()

template<typename TPTContext >
FERMAT_DEVICE uint32 PSFPTVertexProcessor::preprocess_vertex ( TPTContext &  context,
const RenderingContextView renderer,
const PixelInfo  pixel_info,
const EyeVertex ev,
const float  cone_radius,
const cugar::Bbox3f  scene_bbox,
const uint32  prev_vertex_info,
const cugar::Vector3f  w,
const float  p_prev 
)
inline

[PSFPTVertexProcessor::preprocess_vertex] preprocess a vertex and return some packed vertex info

Parameters
contextthe current context
rendererthe current renderer
pixel_infopacked pixel info
evthe eye vertex
cone_radiusthe current cone radius
scene_bboxthe scene bounding box

[PSFPTVertexProcessor::compute_jittering_coordinates]

[PSFPTVertexProcessor::compute_jittering_coordinates]

[PSFPTVertexProcessor::compute_spatial_hash]

[PSFPTVertexProcessor::compute_spatial_hash]

[PSFPTVertexProcessor::insert_into_hashmap]

[PSFPTVertexProcessor::insert_into_hashmap]

[PSFPTVertexProcessor::append_refs]

[PSFPTVertexProcessor::append_refs]

[PSFPTVertexProcessor::finalize]

[PSFPTVertexProcessor::finalize]


The documentation for this struct was generated from the following file: