Clarisse 4.0 SP14 SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
ModuleLayer3d Class Reference

This class implements a 3D Layer object in Clarisse. More...

Inheritance diagram for ModuleLayer3d:
ModuleLayerScene ModuleLayer ModuleProjectItem ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType


struct  AovGroup
 Defines an AOV group, as used in a layer. More...

Public Types

enum  UvBakeEyeDirection {
enum  UvBakeProjectionMode {
enum  UvBakeProjectionNormal {
typedef OfChannelManager::Channel AovChannelItem
 Defines an AOV channel, as used in a layer.

Public Member Functions

void destroy_all () override
const CoreArray
< ModuleSceneObject * > & 
get_shadow_objects () const
 Returns the list of objects that are used by lights to compute shadows.
const CoreArray
< ModuleSceneObject * > & 
get_raytraced_objects () const
 Returns the list of objects that are visible by the raytracer.
const CoreArray
< ModuleSceneObject * > & 
get_global_illumination_objects () const
 Returns the list of objects that are used to compute the global illumination.
const CoreSet
< ModuleSceneObject * > & 
get_holdout_objects () const
 Returns the list of objects in the holdout group.
const CoreBasicArray< short > & get_available_aovs () const
 Returns the list of AOV groups that can be outputted, ie at least one object of the scene (texture, material, etc...) defines this AOV. This list is displayed in the AOV editor.
bool get_export_aovs () const
 Does the layer exports aovs ?
void update_selected_aovs () const
 Udpate the list of channels that are defined by the selected aov groups.
void get_selected_aovs_groups (CoreSet< short > &aov_set)
 Returns the list of AOV groups that have been enabled in the layer.
void get_selected_aovs_groups (CoreArray< short > &aov_array)
 Returns the list of AOV groups that have been enabled in the layer.
void get_computed_aovs_groups (CoreSet< short > &aov_set)
 Returns the list of AOV groups that will be computed.
void get_computed_aovs_groups (CoreArray< short > &aov_array)
 Returns the list of AOV groups that will be computed.
const CoreBasicArray
< AovChannelItem > & 
get_selected_aovs_channels () const
 Returns the list of aovs channels that will be written to the image.
const CoreBasicArray
< AovChannelItem > & 
get_computed_aovs_channels () const
 Returns the list of aovs channels that will be computed.
CoreVector< AovGroup > & get_defined_aov_groups () const
 Returns the list of AOV groups that have been added to the layer.
MatteOverrideget_matte_override () const
 Return a reference to this layer matte color override for its holdout group.
double get_near_clip () const
 Returns the near clip plane distance.
double get_far_clip () const
 Returns the far clip plane distance.
double get_pixel_aspect_ratio () const override
 Returns the pixel aspect ratio.
ModuleGroupget_shadow_object_group () const
 Returns the group of shadow objects.
ModuleGroupget_raytraced_object_group () const
 Returns the group of raytraced objects.
ModuleGroupget_global_illumination_object_group () const
 Returns the group of global illumation objects.
ModuleGroupget_holdout_group () const
 Returns the holdout group.
const bool & is_uv_bake_enabled () const
UvBakeConfigget_uv_bake_config () const
void set_uv_bake_config (UvBakeConfig *config)
ModuleUvSlotget_uv_bake_slot () const
const GMathVec4d & get_uv_bake_range () const
const UvBakeEyeDirection & get_uv_bake_eye_direction () const
const UvBakeProjectionMode & get_uv_bake_projection_mode () const
const UvBakeProjectionNormal & get_uv_bake_projection_normal () const
const double & get_uv_bake_projection_offset () const
const double & get_uv_bake_projection_distance () const
void eval_uv_bake_projection_range (const CtxEval &eval_ctx, CtxShader &shader_ctx, double &offset, double &distance) const
const CoreVector< LpeDesc > & get_lpe_descs () const
const CoreVector
< ModuleSubPixelFilter * > & 
get_sub_pixel_filters () const
 Get all active sub pixel filters.
CoreVector< ModuleAovStore * > & get_global_aov_store ()
void dirty_layer (const bool &dirty_source) override
 Invalidate images, set dirtiness flags for all qualities.
ImageCache * get_cache () const
 For internal use.
void set_cache (ImageCache *cache)
const CoreBasicArray
< AovVarianceChannel > & 
get_aovs_variance_channels ()
void on_group_attr_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags)
- Public Member Functions inherited from ModuleLayerScene
const CoreArray
< ModuleSceneObject * > & 
get_scene_objects () const
const CoreArray< ModuleLight * > & get_lights () const
ModuleCameraget_camera () const
ModuleGroupget_scene_object_group () const
 Returns the group of scene objects.
ModuleGroupget_light_group () const
 Returns the group of lights.
ModuleShadingLayerget_shading_layer () const
 Returns the shading layer applied on the layer. May be null.
void set_shading_layer (ModuleShadingLayer *sl)
 Sets the shading layer.
ModuleMaterialget_override_material () const
 Returns the override material. May be null if none is set.
void set_override_material (ModuleMaterial *m)
 Sets the override material. Parameter may be null.
const ModuleRendererget_renderer () const
- Public Member Functions inherited from ModuleLayer
unsigned int get_width () const
 Returns the width of the layer.
unsigned int get_height () const
 Returns the height of the layer.
ModuleImageget_parent_image () const
 Returns the ModuleImage containing the layer.
const double & get_opacity () const
 Returns the opacity of the layer.
const int & get_blending_mode () const
 Returns the blending mode of the layer.
bool is_active () const
 Returns whether the current layer is active or not. Inactive layers are not composited in the final image.
virtual ImageHandle get_image (const ModuleImage::Quality &quality, const GMathVec4f *region=0) const
 Returns a handle to the image for the specified quality. If the image is not already available, a render is started. The function returns only when the render is finished.
virtual bool is_image_dirty (const ModuleImage::Quality &quality, const bool &strict=false) const
 Checks if the specified quality has already been computed.
const ImageCanvaspeek_source_image (const ModuleImage::Quality &quality) const
 Just returns a handle to the current image; does not launch evaluation.
bool add_image_level_update_callback (void *data, ModuleImage::ImageLevelUpdateCallback on_image_level_update)
 This function registers a new "image level update" callback item. The callback function is called every time a new render is finished (for each quality).
void remove_image_level_update_callback (void *data)
 Removes an image level updated receiver.
unsigned int get_image_level_update_receivers_count () const
 Removes an image level updated receiver.
void start_progress (const ModuleImage::Quality &quality)
 Starts the mechanism allowing the display of a progress image.
void stop_progress (ImageHandle *image)
 Stops the mechanism allowing the display of a progress image.
void update_region (const GMathVec4i &region, bool set_progress=true, float progress=-1.0f) const
 This function indicates that a new region of the image has been computed.
void bucket_render_start (const GMathVec4i &region, unsigned int thread_id)
void bucket_render_end (const GMathVec4i &region, unsigned int thread_id)
virtual void mark_as_dirty ()
 Set the dirtiness flags of all the ImageCanvas stored in the layer.
void dirty_layer_border (GMathVec4f &region)
 Dirty all the tiles of the ImageCanvas that intersect the region.
void on_update_visible (const GMathBbox2f &old_region, const GMathBbox2f &new_region)
 Updates the image channels after the visible part of the region has been modified.
const bool & is_evaluating () const
 Returns true if a render is in progress.
ModuleImage::Quality get_nearest_quality (const unsigned int &w, const unsigned int h) const
 Returns the first quality for which the size of the image is greater than the parameters given.
If none is found, QUALITY_FULL is returned.
void image_level_update (const ModuleImage::Quality &quality) const
 Call the image level update callbacks for all registered requesters.
const int & get_render_region_mode () const
 Returns how render region is used: is it inherited from the parent image, or defined in the layer itself ?
const GMathVec4f & get_render_region_bbox () const
 Returns the values of the render region box.
GMathVec4i get_overscan (const ModuleImage::Quality &quality) const
 Returns the overscan, in pixel for the current render.
GMathVec4f get_overscan () const
 Returns the overscan values (ratio).
GMathVec4i get_data_window (const ModuleImage::Quality &quality) const
 Returns the data region [ x0, y0, w, h].
bool update_overscan ()
 Updates the overscan variables from the object attribute values.
ImageHandleget_pyramid_source_image (const ModuleImage::Quality &quality) const
 Returns the ImageCanvas stored in the source pyramid for the specified quality.
void resize_image (const ImageCanvas &source, ImageCanvas &dest, const ModuleImage::Quality &quality, const int &width, const int &height, const GMathVec4f *render_region) const
 Resize an image.
char * get_progress_buffer () const
 Returns the pointer to the buffer that will be used to retrive recently computed pixels.
void init_progress_buffer (const int &quality)
void update_progress (ModuleImage &image, const CoreString &event, void *data)
ImageHandleget_highest_quality_image () const
 Returns the pointer to the best image quality that has been computed. Used to initialize the progress image.
size_t get_memory_size () const
 Returns the memory used by the current instance.
void set_finalize_image (bool _finalize_image=true)
bool get_finalize_image () const
ModuleImageFilteradd_filter (const CoreString &class_name, const CoreString &filter_name)
 Adds a new filter.
bool has_active_filters () const
int get_progress_pixel_count () const
 For internal use.
int get_progress_pixel_count_max () const
 For internal use.
float get_progress_pixel_percent () const
 For internal use.
void set_progress_pixel_count (int count)
 For internal use.

Public Attributes

bool m_need_add_aovs_from_shading

Protected Member Functions

void module_constructor (OfObject &object) override
void on_attribute_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags) override
ImageHandlecreate_pyramid_image (const ModuleImage::Quality &quality) const override
void update_channels (const ModuleImage::Quality &quality) const override
- Protected Member Functions inherited from ModuleLayerScene
void on_attribute_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags) override
void set_scene_object_group (ModuleGroup *group)
void set_scene_objects_dirty ()
bool is_scene_objects_group_overridden () const
ModuleGroupget_internal_geometries_group (const CoreString &group_name, OfObject *source_group) const
 Get (and create) the internal group associated to the given group connected to a geometry attribute of the Layer Scene.
ModuleGroupget_internal_lights_group () const
 Get (and create) the internal group associated to the group connected to the "lights" attribute.
ModuleGroupget_context_objects_group () const
 Returns the internal group of geometries used by the Layer Scene when there is no group connected in the "geometries" attribute This group references all the scene objects in the context of the Layer Scene.
ModuleGroupget_embedded_group (const CoreString &group_name, RendererFilterMode mode, const bool &is_context_relative) const
 Return an embedded group created in the OfObject of the Layer Scene.
void apply_renderer_filters (ModuleGroup *group, RendererFilterMode mode) const
 Update the class filters of group with the class filters of the renderer.
- Protected Member Functions inherited from ModuleLayer
virtual const ImageCanvasget_source_image (const ModuleImage::Quality &quality, const GMathVec4f *region=0) const
void build_image (const ModuleImage::Quality &quality, const GMathVec4f *region=0) const
void dirty_image_channels (const CoreVector< CoreString > &channel_names)
void update_image_channels (const CoreVector< CoreString > &remove_channels, const CoreVector< CoreString > &add_channels)
void dirty_layer_position ()
void image_level_update (const ModuleImage::Quality &quality, ImageHandle image) const

Additional Inherited Members

- Static Public Member Functions inherited from ModuleObject
static ResourceID declare_resource (const char *tag)
static ResourceID declare_resource (const CoreString &tag)
static bool declare_resource (ResourceID id, const char *tag)
static bool declare_resource (ResourceID id, const CoreString &tag)
static ResourceID get_resource_id (const char *tag)
static ResourceID get_resource_id (const CoreString &tag)
static const char * get_resource_tag (ResourceID id)
- Protected Types inherited from ModuleLayerScene
enum  RendererFilterMode {

Detailed Description

This class implements a 3D Layer object in Clarisse.

Member Function Documentation

void ModuleLayer3d::dirty_layer ( const bool &  dirty_source)

Invalidate images, set dirtiness flags for all qualities.

Ifnot set, the source pyramid will not be affected. Typical case: modifying a filter, as it will not have an effect on the source images.

Reimplemented from ModuleLayer.