Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
GeometryRaytraceCtx Class Reference

Class holding the current context of the raytracing. More...

Classes

class  FilterData
 

Public Types

typedef unsigned long long Flags
 

Public Member Functions

const GeometryRaytraceDataget_data () const
 Get the input data.
 
const GMathFrustumget_world_frustum () const
 Get the frustum in world space.
 
const GMathRayget_world_rays () const
 Get rays in world space.
 
const GMathRayget_world_ray (const unsigned int &index) const
 Get a ray by its index in world space.
 
const GMathFrustumget_local_frustum () const
 Get the frustum in the local space of the geometry.
 
const GMathBasicRayget_local_rays () const
 Get rays in the local space of the geometry.
 
const GMathBasicRayget_local_ray (const unsigned int &index) const
 Get a ray by its index in the local space of the geometry.
 
const GeometryIntersectionPathget_intersection_path (const unsigned int &index) const
 Get the transparency path of a ray by its index.
 
const GMathMatrix4x4d & get_matrix (const unsigned int &index) const
 Get the matrix corresponding to the local ray.
 
const GMathMatrix4x4d & get_matrix_dt (const unsigned int &index) const
 Get the matrix corresponding to the local ray at (t + dt)
 
const unsigned int & get_dimension () const
 Get the sampling dimension.
 
const unsigned int & get_seed (const unsigned int &index) const
 Get the sampling seed of a ray by its index.
 
const unsigned int & get_id (const unsigned int &index) const
 Get the sampling ID of a ray by its index.
 
double get_tnear (const unsigned int &index) const
 Get the near clip plane value of a ray by its index.
 
double get_tfar (const unsigned int &index) const
 Get the far clip plane value of a ray by its index.
 
const Flags & get_flags (const unsigned int &index) const
 Get the flags of a ray by its index.
 
const int & get_first_index () const
 Get the index of the first ray to process.
 
const int & get_last_index () const
 Get the index of the last ray to process.
 
const unsigned int & get_ray_count () const
 Get the total number of rays in the packet.
 
bool is_distance_clipped (const unsigned int &index, const double &t) const
 Tell if a distance is clipped for a given ray.
 
bool push_intersection (const CtxEval &eval_ctx, const unsigned int &ray_index, const unsigned int &primitive_id, const double &u, const double &v, const double &w, const unsigned int &sub_primitive_id, const double &su, const double &sv, const double &sw, const double &t, const double &bias=0.0, const GeometryMediumDescriptor &medium=GeometryMediumDescriptor(), GeometryCustomData *custom_data=0)
 Insert an intersection for a given ray.
 
bool push_intersection (const CtxEval &eval_ctx, const unsigned int &ray_index, const unsigned int &primitive_id, const double &u, const double &v, const double &w, const double &t, const double &bias=0.0, const GeometryMediumDescriptor &medium=GeometryMediumDescriptor(), GeometryCustomData *custom_data=0)
 Insert an intersection for a given ray.
 
void clamp_path (const unsigned int &path_index, const double &t, const bool &shorten_path=true) const
 Clamp a path to a given distance.
 
void enable_flags (const Flags &flags) const
 Enable flags on results.
 
void enable_flags (const Flags &flags, const unsigned int &ray_index) const
 Enable flags on results for a give ray.
 
void disable_flags (const Flags &flags) const
 Disable flags on results.
 
void disable_flags (const Flags &flags, const unsigned int &ray_index) const
 Disable flags on results for a given ray.
 
void setup_intersection (GeometryIntersection &intersection, const unsigned int &ray_index) const
 Setup an intersection with the current context.
 

Friends

class GeometryRaytraceData
 

Internal use only

enum  {
  RAYTRACE_FAST = 0,
  RAYTRACE_ACCURATE
}
 
typedef bool(* FilterObjectCallback )(const CtxEval &eval_ctx, const GeometryRaytraceCtx &ray_ctx, FilterData &data)
 
typedef bool(* FilterPrimitiveCallback )(const CtxEval &eval_ctx, const GeometryRaytraceCtx &ray_ctx, const unsigned int &primitive_index, FilterData &data)
 
typedef bool(* FilterIntersectionCallback )(const CtxEval &eval_ctx, const GeometryRaytraceCtx &ray_ctx, const unsigned int &ray_index, GeometryIntersection &intersection, FilterData &data)
 
GeometryRaytraceTransform * transform
 
GeometryObjectDescriptorobject
 
const GMathFrustumlocal_frustum
 
const char * local_rays
 
GeometryMotionBlurSamplemotion_blur_samples
 
GeometryOverridegeometry_override
 
const SceneObjectShading * shading
 
const MatteTablematte_table
 
ModuleMaterialshading_material
 
const ShadingVariableAccessorshading_variables
 
double raytrace_offset
 
double smoothing_approximation
 
float shading_opacity
 
unsigned int raytrace_quality
 
unsigned int motion_blur_mode
 
unsigned int local_ray_size
 
unsigned int shading_group_offset
 
unsigned int geometry_offset
 
unsigned int sub_object_offset
 
unsigned int hierarchy_level
 
unsigned int hierarchy_node
 
bool has_object_filters () const
 
bool has_primitive_filters () const
 
bool has_intersection_filters () const
 
bool has_object_filter (FilterObjectCallback cb) const
 
bool has_primitive_filter (FilterPrimitiveCallback cb) const
 
bool has_intersection_filter (FilterIntersectionCallback cb) const
 
void push_object_filter (FilterObjectCallback cb, FilterData &data)
 
void push_primitive_filter (FilterPrimitiveCallback cb, FilterData &data)
 
void push_intersection_filter (FilterIntersectionCallback cb, FilterData &data)
 
void pop_object_filter ()
 
void pop_primitive_filter ()
 
void pop_intersection_filter ()
 
void clear_object_filters ()
 
void clear_primitive_filters ()
 
void clear_intersection_filters ()
 
void clear_filters ()
 
void copy_object_filters (const GeometryRaytraceCtx &src)
 
void copy_primitive_filters (const GeometryRaytraceCtx &src)
 
void copy_intersection_filters (const GeometryRaytraceCtx &src)
 
void copy_filters (const GeometryRaytraceCtx &src)
 
void copy_object_filters (const GeometryRaytraceCtx &src, unsigned int offset)
 
void copy_primitive_filters (const GeometryRaytraceCtx &src, unsigned int offset)
 
void copy_intersection_filters (const GeometryRaytraceCtx &src, unsigned int offset)
 
bool apply_object_filters (const CtxEval &eval_ctx) const
 
bool apply_primitive_filters (const CtxEval &eval_ctx, const unsigned int &primitive_index) const
 
bool apply_intersection_filters (const CtxEval &eval_ctx, const unsigned int &ray_index, GeometryIntersection &intersection) const
 

Detailed Description

Class holding the current context of the raytracing.

Member Function Documentation

void GeometryRaytraceCtx::clamp_path ( const unsigned int &  path_index,
const double &  t,
const bool &  shorten_path = true 
) const
inline

Clamp a path to a given distance.

Parameters
path_indexthe index of the path to clamp
tthe distance at which the path must be clamped
shorten_pathwhen true, all intersections that are beyond the given distance are removed from the path
bool GeometryRaytraceCtx::is_distance_clipped ( const unsigned int &  index,
const double &  t 
) const
inline

Tell if a distance is clipped for a given ray.

Parameters
[in]indexthe index of the ray
[in]tthe distance to test
Returns
true if the distance is clipped for the given ray, else false
bool GeometryRaytraceCtx::push_intersection ( const CtxEval eval_ctx,
const unsigned int &  ray_index,
const unsigned int &  primitive_id,
const double &  u,
const double &  v,
const double &  w,
const unsigned int &  sub_primitive_id,
const double &  su,
const double &  sv,
const double &  sw,
const double &  t,
const double &  bias = 0.0,
const GeometryMediumDescriptor medium = GeometryMediumDescriptor(),
GeometryCustomData custom_data = 0 
)

Insert an intersection for a given ray.

Parameters
[in]eval_ctxa valid evaluation context
[in]ray_indexthe index of the ray
[in]primitive_idthe ID of the primitive that has been hit
[in]u,v,wparametric coordinates of the intersection in the primitive
[in]sub_primitive_idthe ID of the sub-primitive that has been hit
[in]su,sv,swparametric coordinates of the intersection in the sub-primitive
[in]tthe distance of the intersection
[in]biasthe bias to apply to the intersection to avoid self intersections
[in]mediummedium information about the fragment that has been hit
[in]custom_datacustom data to attach to the fragment
Returns
true if the intersection has been inserted, else false
Note
When the intersection is rejected (false is returned), the given custom data is automatically deleted.
bool GeometryRaytraceCtx::push_intersection ( const CtxEval eval_ctx,
const unsigned int &  ray_index,
const unsigned int &  primitive_id,
const double &  u,
const double &  v,
const double &  w,
const double &  t,
const double &  bias = 0.0,
const GeometryMediumDescriptor medium = GeometryMediumDescriptor(),
GeometryCustomData custom_data = 0 
)
inline

Insert an intersection for a given ray.

Parameters
[in]eval_ctxa valid evaluation context
[in]ray_indexthe index of the ray
[in]primitive_idthe ID of the primitive that has been hit
[in]u,v,wparametric coordinates of the intersection in the primitive
[in]tthe distance of the intersection
[in]biasthe bias to apply to the intersection to avoid self intersections
[in]mediummedium information about the fragment that has been hit
[in]custom_datacustom data to attach to the fragment
Returns
true if the intersection has been inserted, else false
Note
When the intersection is rejected (false is returned), the given custom data is automatically deleted.
void GeometryRaytraceCtx::setup_intersection ( GeometryIntersection intersection,
const unsigned int &  ray_index 
) const

Setup an intersection with the current context.

Parameters
intersectionthe intersection to setup
ray_indexthe index of the ray with witch the intersection has to be setup
Note
A matrix_dt can be put in the intersection, it's up to the caller to release it before releasing the intersection.