DD::Image::Render Class Referenceabstract

Base class for rendering a 3D scene to an image. More...

Inherits DD::Image::Iop.

Inherited by DD::Image::DepthMapRender, and DD::Image::RenderScene.

Classes

class  Span
 

Public Types

enum  { SINGLE_SAMPLE, MULTISAMPLE_LOW, MULTISAMPLE_MED, MULTISAMPLE_HIGH }
 
- Public Types inherited from DD::Image::Op
enum  HandlesMode { eNoHandles, eHandlesUncooked, eHandlesCooked, eHandlesMax }
 
enum  PrevalidateResult { eFinished, eCancelled, eAbandoned }
 This is a tribool return value. Do not extend.
 
enum  HandleType {
  eNone, eMouseLeftClick, eMouseRightClick, eMouseMove,
  eMouseDrag, eMouseRelease, eSelectionChanged, eSelectionChangeFinished,
  eHandleDragTranslate, eHandleDragRotate, eHandleDragScale, eHandleDragPivot,
  eAllHandles
}
 
enum  ViewableModes { eViewableMode2D, eViewableMode3D, eViewableMode3D_2DReference }
 
enum  GenerateType {
  OUTPUT_OP, ANY_CONTEXT, INPUT_OP, INPUT_OP_PEEK,
  EXECUTABLE, EXECUTABLE_SKIP, EXECUTABLE_INPUT, UICONTEXT_ONLY
}
 
enum  NodeContext { eNodeGraph, eTimeline, eOpGraph }
 
enum  StatusFlags { StatusNone, StatusModal, StatusUseCallback }
 
enum  PopUpScheme {
  ePU_Never, ePU_Done, ePU_Once, ePU_Default,
  ePU_Always
}
 Pop-up schemes determine when pop-up messages are displayed for op errors. More...
 
enum  VersionComponents { eMajor, eMinor, ePoint, eRevision }
 
typedef std::pair< int, DD::Image::Op * > Output
 Combination of input number and pointer to Op.
 
typedef std::set< OutputOutputSet
 Set of all outputs from this Op.
 
typedef std::map< Hash, std::vector< unsigned int > > ItemSelectionList
 
typedef bool( EventCallback) (Op *op, EventContext eventCtx)
 
using VersionInfo = std::tuple< int, int, int, int >
 
- Public Types inherited from DD::Image::IopInfoOwner
typedef IopInfo Info
 

Public Member Functions

virtual CameraOprender_camera (int sample=0)
 
virtual GeoOprender_geo (int sample=0)=0
 
virtual Matrix4 camera_matrix (int sample=0)
 
virtual Matrix4 projection_matrix (int sample=0)
 
virtual void format_matrix (int sample=0)
 
Matrix4 get_format_matrix (float cx, float cy)
 
void knobs (Knob_Callback)
 
void display_knobs (Knob_Callback)
 
void texture_knobs (Knob_Callback)
 
void sampling_knobs (Knob_Callback)
 
void jitter_knobs (Knob_Callback)
 
void render_knobs (Knob_Callback)
 All of the above.
 
unsigned node_color () const
 
double overscanX ()
 
double overscanY ()
 
int projection_mode () const
 
int blend_operation () const
 
const Filtertexture_filter () const
 
int multisampling () const
 
float hitThresholdDistance () const
 
virtual int multisamples () const
 
virtual Scenescene (int n=0) const
 
virtual double shutter () const
 
virtual double offset () const
 
virtual unsigned samples () const
 
HandlesMode doAnyHandles (ViewerContext *ctx)
 
void build_handles (ViewerContext *)
 
void buildGeoInfoHandle (ViewerContext *ctx, DrawHandleCallbackFunc cb)
 
virtual void probe (const Vector3 &center, const VertexContext &vtx, Pixel &out)
 Sample the frame buffer.
 
- Public Member Functions inherited from DD::Image::Iop
void fetchPlane (ImagePlane &imagePlane)
 
virtual PlanarIgetPlanarI ()
 
void force_validate (bool for_real=true) override
 
IopImpl * pImpl ()
 
Iopiop () override
 Cast to an Iop. This is much cheaper and safer than using dynamic_cast.
 
const Iopiop () const override
 
virtual ~Iop ()
 
bool test_input (int, Op *) const override
 
Opdefault_input (int) const override
 
Iopinput (int n) const
 
Iopinput (int n, int m) const
 
Iopinput0 () const
 
Iopinput1 () const
 
Cache * cache () const
 
bool cached () const
 
void cached (bool b)
 
virtual void in_channels (int, ChannelSet &) const
 
ChannelMask out_channels () const
 
int raw_channels_from () const
 
virtual bool pass_transform () const
 
void request (int x, int y, int r, int t, ChannelMask channels, int count)
 
void request (DD::Image::Box box, ChannelMask channels, int count)
 
void request (ChannelMask channels, int count)
 
void _copyState (Iop *input)
 
const BoxrequestedBox () const
 
const BoxunclampedRequestedBox () const
 
ChannelMask requested_channels () const
 
ChannelMask multi_requested_channels () const
 
ChannelMask unclamped_requested_channels () const
 
int requested_count () const
 
virtual void get (int y, int x, int r, ChannelMask, Row &)
 
void at (int x, int y, Pixel &out)
 
float at (int x, int y, Channel)
 
ChannelSet peek (int x, int y, int r, int t, Pixel &out)
 
bool peek (int x, int y, int w, int h, ChannelMask pixelChannels, PixelCallbackI &callback)
 
virtual TransformgetTransform ()
 
virtual bool set_texturemap (ViewerContext *, bool gl=true)
 
virtual TextureImage get_texturemap (ViewerContext *ctx)
 
virtual void unset_texturemap (ViewerContext *)
 
virtual bool shade_GL (ViewerContext *, GeoInfo &)
 
virtual void vertex_shader (VertexContext &)
 
virtual void fragment_shader (const VertexContext &, Pixel &out)
 
virtual void displacement_shader (const VertexContext &vtx, VArray &out)
 
virtual float displacement_bound () const
 
virtual void blending_shader (const Pixel &in, Pixel &out)
 
virtual void render_state (GeoInfoRenderState &state)
 
virtual void sample (float cx, float cy, float w, float h, Filter *, Pixel &out)
 
void sample (float cx, float cy, float w, float h, Pixel &out)
 
virtual void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Filter *filter, Pixel &out)
 
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Pixel &out)
 
virtual float sample_shadowmap (Iop *map, bool map_is_one_over_z, float cx, float cy, float W, float H, Filter *filter, float Pz)
 
virtual void inputsAttached ()
 
virtual void gpuEngine_useTextureTransform (bool useTransform)
 GPU support code. More...
 
virtual void gpuEngine_setupTextureTransform (const Matrix4 &postOpTransform)
 
virtual const char * gpuEngine_decl () const
 
virtual const char * gpuEngine_body () const
 
virtual Hash gpuEngine_shader_hash_at (double time)
 
virtual int gpuEngine_getNumRequiredTexUnits () const
 
virtual void gpuEngine_GL_begin (GPUContext *context)
 
virtual void gpuEngine_GL_end (GPUContext *context)
 
virtual IopviewerPassThrough () const
 
OpHints opHints () const override
 Return hints to control when and how this op will be evaluated by the top-down system.
 
- Public Member Functions inherited from DD::Image::Op
PrevalidateResult preValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
 
OprootOp () const
 
bool preValidateAborted (int treeStartingVersion, PrevalidateResult &result) const
 
const OutputSetgetOutputs () const
 return all the outputs of this node
 
virtual void setInputsValid (bool nowValid)
 set whether the input ops are valid (are for the right context)
 
bool inputsValid () const
 return whether the input ops are valid (are for the right context)
 
virtual bool can_clone () const
 returns whether or not an op can be cloned in the dag
 
bool haveHash () const
 return true if the hash() value is meaningful and globally unique
 
virtual std::vector< DD::Image::OutputContextgetPrevVersionsWanted () const
 
virtual const MetaData::Bundle_fetchMetaData (const char *keyname)
 
const MetaData::BundlefetchMetaData (const char *keyname)
 
Node * node () const
 
DD::Image::NodeI * getNode () const
 
void node (Node *v)
 
OpfirstOp () const
 
void firstOp (Op *v)
 
Opparent () const
 
void parent (Op *lpOp)
 
virtual void detach ()
 node has been deleted in DAG
 
virtual void attach ()
 node has been created in DAG
 
virtual void pre_write_knobs ()
 
int replace_knobs (Knob *afterthis, int n, void(*f)(void *, Knob_Callback), void *, const char *fileExt=nullptr)
 
int add_knobs (void(*f)(void *, Knob_Callback), void *, Knob_Callback)
 
void set_unlicensed ()
 
Knobknob (const char *name) const
 
Knobknob (int) const
 
bool pushed () const
 
bool panel_visible () const
 
bool node_disabled () const
 
bool node_selected () const
 
unsigned node_gl_color () const
 
void * field (const char *name)
 
void * field (const char *name, int &type)
 
void * set_field (const char *name, const void *source, int size)
 
void * get_field (const char *name, void *dest, int size)
 
void beginHandle (HandleType command, ViewerContext *ctx, EventCallback *cb, int index, float x=0, float y=0, float z=0, ViewerContext::Cursor cursor=ViewerContext::kNoCursor)
 
void endHandle (ViewerContext *ctx)
 
virtual int knob_changed (Knob *)
 
virtual int knob_change_finished (Knob *knob, bool changedByUser=true)
 
void addTime (OpTimer::Category category, long long microsecondsCPU, long long microsecondsWall, bool isTopLevel=true)
 
void getPerformanceInfo (OpTimer::Category category, OpTimer::PerformanceInfo &info) const
 return the amount of CPU time taken by this op
 
virtual bool inputs_clockwise () const
 whether unconnected inputs on the DAG should be arranged clockwise or anticlockwise (default)
 
virtual std::vector< int > input_order () const
 
virtual int inputArrows (int nodeInputs) const
 
bool script_command (const char *command, bool py=true, bool eval=true) const
 
bool script_expand (const char *str) const
 
HandlesMode anyHandles (ViewerContext *ctx)
 
void add_draw_handle (ViewerContext *)
 
virtual void draw_handle (ViewerContext *)
 
virtual void add_input_handle (int input, ViewerContext *)
 
void add_op_handle (ViewerContext *ctx)
 
void add_knob_handle (Knob *, ViewerContext *)
 
virtual int getViewableModes () const
 
virtual int optional_input () const
 
virtual int minimum_inputs () const
 
virtual int maximum_inputs () const
 
int inputs () const
 
int node_inputs () const
 
Opnode_input (int, GenerateType=OUTPUT_OP) const
 
Opnode_input (int, GenerateType, const DD::Image::OutputContext *outputContext) const
 
Opinput_op (int n=0) const
 
virtual void inputs (int n)
 
Opinput (int) const
 
int inputNumber (int input, int offset) const
 
Opinput (int input, int offset) const
 
Opinput0 () const
 return the primary input More...
 
Opinput1 () const
 return the second input, if it exists More...
 
const std::vector< Op * > & getInputs () const
 
const std::vector< Op * > & getChildren () const
 
virtual void set_input (int i, Op *op, int input, int offset)
 
void set_input0 (Op *op)
 
void set_input (int i, Op *op)
 
void set_input (int i, Op &op)
 
void set_input (int input, int offset, Op *op)
 
const OutputContextoutputContext () const
 
virtual void setOutputContext (const OutputContext &c)
 
virtual void append (Hash &)
 
virtual float uses_input (int) const
 
virtual void build_splits ()
 
virtual int split_input (int) const
 
virtual const OutputContextinputContext (int n, int offset, OutputContext &) const
 
virtual const OutputContextinputUIContext (int n, OutputContext &) const
 
const Hashhash () const
 
virtual bool frameTransformImplemented () const
 
virtual bool frameTransformDownstream (const OutputContext &context, unsigned int input, float inFrame, float &outFrame) const
 
virtual bool frameTransformUpstream (const OutputContext &context, unsigned int input, float outFrame, float &inFrame) const
 
virtual DopeItemFlags::Mask getDopeItemFlags () const
 
virtual bool shouldHideInDopeSheet (Knob *knob) const
 
virtual DD::Image::KnobgetDopeItemKnob () const
 
virtual ViewSet viewsProduced () const
 
virtual ViewSet viewsWantOn (int i) const
 
virtual ViewSet splitForViews () const
 
bool requested () const
 
void setRequested ()
 
void forgetRequestShallow ()
 
void forget_request ()
 
void forget_request (std::set< Op * > &forgotten)
 
virtual const char * node_shape () const
 
DD::Image::Hash curveHash () const
 
bool opCurrent () const
 
virtual const char * node_help () const =0
 
virtual const char * input_label (int, char *) const
 
virtual std::string input_longlabel (int) const
 
void node_redraw ()
 
void print_name (std::ostream &o) const
 
NodeContext nodeContext () const
 
std::string node_name () const
 
void invalidateSameHash ()
 
bool invalidate ()
 
bool invalidate (const Hash &hash)
 
bool update (const Box *=nullptr)
 
void asapUpdate ()
 
void asapUpdate (const Box &box, int direction=0)
 
void validate (bool for_real=true)
 
void update_handles () const
 
bool valid () const
 Returns true if it has been validated - including if there was an error. More...
 
bool real_valid () const
 Returns true if it has been real-validated - including if there was an error. More...
 
bool inErrorState () const
 
bool inInvalidState () const
 
bool opened () const
 
void open ()
 
void unopen ()
 
bool running () const
 
void running (bool v)
 
bool not_closed () const
 
void close ()
 
void callCloseAfter (double seconds)
 
void copyState (Op *input)
 
bool cached () const
 
void cached (bool b)
 
virtual Executableexecutable ()
 
void setKnobsToContext (const OutputContext &)
 
void gotoContext (const OutputContext &, bool update)
 
void progressFraction (double fraction, StatusFlags flags=StatusNone)
 
void progressFraction (int a, int b, StatusFlags flags=StatusNone)
 
void progressMessage (const char *fmt,...)
 
void progressModalMessage (const char *fmt,...)
 
void progressDismiss ()
 
int slowness () const
 
void slowness (int newval)
 
virtual bool firstEngineRendersWholeRequest () const
 
virtual bool updateUI (const OutputContext &context)
 
const Formatinput_format () const
 
const OutputContextuiContext () const
 
void error (const char *fmt,...)
 
void warning (const char *fmt,...)
 
void critical (const char *fmt,...)
 
void debug (const char *fmt,...)
 
void abort () const
 Abort all trees the op is in.
 
bool aborted () const
 True if one of the trees the op is in was aborted; ops should check this while processing and return quickly when true.
 
void cancel () const
 Cancel all trees the op is in. Make sure you also call abort() to stop processing.
 
bool cancelled () const
 True if one of the trees the op is in was cancelled (by user interaction)
 
bool addToTree (OpTree *lpTree)
 Returns true if the op was added to the tree, or false if its reference count increased.
 
bool removeFromTree (OpTree *lpTree)
 Returns false if the op was removed from the tree, or true if its reference count decreased.
 
bool isInTree (OpTree *lpTree) const
 Checks if an op is in a particular tree, for debugging purposes.
 
bool isInAnyTree () const
 Checks if an op is in any tree at all.
 
OpTreeHandlergetTreeHandler () const
 Returns the treeHandler for a given Op.
 
bool hasError () const
 
bool opOrChildHasError () const
 
const OpgetErroredOp () const
 
void setPopUpScheme (PopUpScheme lScheme)
 
PopUpScheme getPopUpScheme () const
 
bool arePopUpsEnabled ()
 Returns whether a pop-up should be enabled for the next message, modifying internal data when necessary.
 
OpMessageHandlergetMsgHandler ()
 
const OpMessageHandlergetMsgHandler () const
 
std::string getDebugInfo () const
 Returns a string of debug information about the op. For internal use.
 
std::string getDetailedDebugInfo () const
 
bool tryValidate (bool for_real=true)
 
virtual GeoOpgeoOp ()
 Cast to a GeoOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const GeoOpgeoOp () const
 
virtual ParticleOpparticleOp ()
 Cast to a ParticleOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const ParticleOpparticleOp () const
 
virtual DeepOnlyOpdeepOnlyOp ()
 Cast to a DeepOnlyOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const DeepOnlyOpdeepOnlyOp () const
 
virtual std::string getLibraryName () const
 Return a label and version string to display library version info for the Node.
 
virtual VersionInfo getLibraryVersion () const
 
virtual const char * Class () const =0
 
const std::string libraryDisplayName () const
 
virtual const char * displayName () const
 
virtual std::string docsPath () const
 
virtual bool onAction (const ViewerContext *c, const DD::Image::Flags f, void *d)
 
Opget (const Description *description)
 
- Public Member Functions inherited from DD::Image::IopInfoOwner
const Infoinfo () const
 
int x () const
 
int y () const
 
int r () const
 
int t () const
 
int w () const
 
int h () const
 
bool is_constant () const
 
int clampx (int x) const
 
int clampy (int y) const
 
const Formatformat () const
 
const Formatfull_size_format () const
 
int ydirection () const
 
bool black_outside () const
 
ChannelMask channels () const
 
const GeneralInfogeneralInfo () const
 
const Info2Dinfo2D () const
 
int first_frame () const
 
int last_frame () const
 
void format (const Format &f)
 
void full_size_format (const Format &f)
 

Static Public Member Functions

static Matrix4 get_format_matrix (const Format &format, float cx, float cy)
 
static const Intersection * multisample_array (int n)
 
static unsigned int jitter_array_size (int samples)
 
static const Intersection * jitter_array (int samples)
 
- Static Public Member Functions inherited from DD::Image::Iop
static Iopdefault_input (const OutputContext &)
 
static Opdefault_input (const Op *op)
 
static Channel channel (const char *name)
 
static const char * channel_name (Channel c)
 
- Static Public Member Functions inherited from DD::Image::Op
static int treeVersion ()
 get the current tree version
 
static bool nukeBusy ()
 is nuke processing something on a parallel thread?
 
static Opcreate (Node *node, const char *name, Op *p_op)
 
static Opcreate (const char *name, Op *p_op)
 
static void resetTimers ()
 reset all the performance timers
 
static void setTimingEnabled (bool enabled)
 turn performance timing on or off
 
static bool isTimingEnabled ()
 return whether performance timing is on or not
 
static const char * script_result (bool py=false)
 
static void script_unlock ()
 
static void all_forget_request ()
 
static void new_request_pass ()
 
static double callPendingClose (double seconds)
 
static void clearPendingClose ()
 
static Operror_op ()
 
static const char * error_message ()
 
static void clearAbortAndError ()
 To be removed.
 
static void SetDefaultPopUpEnable (bool lEnable)
 This is used by Nuke to indicate when ops using the default pop-up scheme should show pop-ups. Not recommended for customisation.
 
static std::string getVersionInfoStr (const VersionInfo &versionInfo)
 
static const Descriptionfind_description (const char *name, const Op *op_)
 
static int message_f (char t, const char *,...)
 
static int message_vf (char t, const char *, va_list)
 
static void add_timeout (float t, TimeoutHandler, void *v=nullptr)
 
static void repeat_timeout (float t, TimeoutHandler, void *=nullptr)
 
static bool has_timeout (TimeoutHandler, void *=nullptr)
 
static void remove_timeout (TimeoutHandler, void *=nullptr)
 

Static Public Attributes

static const char * multisampling_table []
 Output sampling modes:
 
- Static Public Attributes inherited from DD::Image::Iop
static bool sPreserveCaches
 
- Static Public Attributes inherited from DD::Image::Op
static unsigned current_request_pass
 
static void(* node_redraw_cb )(const Op *)
 
static void(* print_name_cb )(std::ostream &, const Op *)
 
static void(* status_callback )(const Op *, float, float, const char *, StatusFlags)
 
static constexpr int kInvalidVersion
 
static constexpr VersionInfo kUnsetVersion
 

Protected Member Functions

 Render (Node *node, bool enable_mip_filter=false)
 
void _validate (bool)
 
virtual void overrideBBox (Box &f) const
 
void _request (int x, int y, int r, int t, ChannelMask, int)
 
void engine (int y, int x, int r, ChannelMask, Row &)
 
virtual bool generate_render_primitives ()
 
virtual bool evaluate_lights (Scene *scene)
 
virtual void initialize ()
 
void draw_primitives (int y, int x, int r, ChannelMask, Row &, const Row *bg)
 
void _close ()
 
- Protected Member Functions inherited from DD::Image::Iop
 Iop (Node *node)
 
virtual void _invalidate () override
 
virtual void _open () override
 
virtual void doFetchPlane (ImagePlane &imagePlane)
 
bool inUse () const override
 
void copy_info (int input)
 
void copy_info (int input, ChannelMask)
 
void copy_info ()
 
void clear_info ()
 
void merge_info (int input=0)
 
void merge_info (int input, ChannelMask)
 
void mergeFrameRange (int input)
 
void set_out_channels (ChannelMask m)
 
void set_out_channels (ChannelSetInit m)
 
void set_out_channels (Channel z)
 
void raw_channels_from (int n)
 
void set_out_channels (ChannelMask m, int n)
 
IopasIop (Op *op) const
 
TransformgetDefaultTransform () const
 
template<class TileType >
void doSample (float cx, float cy, float w, float h, Filter *, Pixel &out)
 
template<class TileType >
float do_sample_shadowmap (Iop *map, bool map_is_one_over_z, float cx, float cy, float W, float H, Filter *filter, float Pz)
 
- Protected Member Functions inherited from DD::Image::Op
 Op (Node *node)
 The constructor is protected so only subclasses can create the base class.
 
Opcreate (Node *node, const char *name)
 
Opcreate (const char *name)
 
HandlesMode anyInputHandles (ViewerContext *)
 return if any of the inputs (recursively) wish to draw handles More...
 
HandlesMode anyKnobHandles (ViewerContext *)
 return if any of the knobs on this node wish to draw handles More...
 
void build_input_handles (ViewerContext *)
 
void build_knob_handles (ViewerContext *)
 
void disallowNoTrees ()
 Call this to tell the op that it should always have op trees for normal behaviour (for internal use)
 
virtual PrevalidateResult doPreValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
 

Protected Attributes

TextureFilter texture_filter_
 Default filter to use in texture filtering.
 
int projection_mode_
 Point projection mode.
 
int max_tessellation_
 Threshold to limit recursive subdivision.
 
int blend_operation_
 Default blending operation for textures.
 
int multisampling_
 Output sampling modes.
 
int samples_
 User set number of samples to render.
 
ShutterControls shutter_
 shutter controls
 
double spatial_jitter_
 User set jittering of sample in raster.
 
double temporal_jitter_
 User set jittering of sample in time.
 
const Intersection * jitter
 XY jitter array to use - based on total samples.
 
unsigned input_scenes
 Number of scenes renderer gets from it's input.
 
unsigned render_scenes
 Number of scenes to render.
 
const Intersection * multisample_array_
 Multisampling array to use.
 
double overscanX_
 
double overscanY_
 overscan size of the frame buffer
 
Format overscanFormat_
 overscan format
 
int junk
 
Box3 world_bbox
 Intersected world-space bbox of all scenes.
 
Box screen_bbox
 Intersected screen-space bbox of all scenes.
 
int output_motion_vectors
 Whether renderer outputs motion vector channels.
 
Channel MB_channel [3]
 Motion vector channels to output.
 
bool generate_primitives
 Threading lock to keep other threads waiting.
 
std::vector< Scene * > scenes_
 List of Scenes, one per sample.
 
- Protected Attributes inherited from DD::Image::Iop
ChannelSet out_channels_
 protected so validate() can directly modify it
 
int raw_channels_from_
 
- Protected Attributes inherited from DD::Image::Op
bool _haveHash
 whether the _hash actually has been set by a call to invalidate(Hash) ever.
 
- Protected Attributes inherited from DD::Image::IopInfoOwner
Info info_
 

Additional Inherited Members

- Public Attributes inherited from DD::Image::Op
const MetaData::BundlemetaCache
 
Hash metaCacheHash
 

Detailed Description

Base class for rendering a 3D scene to an image.

Constructor & Destructor Documentation

Member Function Documentation

CameraOp * Render::render_camera ( int  sample = 0)
virtual

Return a CameraOp for 'sample'. The base class returns null.

Reimplemented in DD::Image::RenderScene.

Referenced by _validate().

GeoOp * DD::Image::Render::render_geo ( int  sample = 0)
pure virtual

Return a GeoOp for 'sample'. This GeoOp will have it's cache enabled which will be created during _validate(). The base class returns 0.

Implemented in DD::Image::RenderScene.

Referenced by _validate().

Matrix4 Render::camera_matrix ( int  sample = 0)
virtual

Calculate the camera's inverse local matrix for 'sample'. Base class pulls the camera away in Z by the format's width, and XY centered. Remember, this is the camera's inverse matrix, so translations are reversed.

Reimplemented in DD::Image::RenderScene, and DD::Image::DepthMapRender.

References DD::Image::IopInfoOwner::format(), DD::Image::Format::height(), DD::Image::Matrix4::makeIdentity(), DD::Image::Matrix4::translate(), and DD::Image::Format::width().

Referenced by _validate().

Matrix4 Render::projection_matrix ( int  sample = 0)
virtual

Calculate the camera projection matrix for 'sample'. Base class implementation sets up a simple projection with a lens of 1.

Reimplemented in DD::Image::RenderScene.

References DD::Image::IopInfoOwner::format(), DD::Image::IopInfoOwner::h(), DD::Image::Format::height(), DD::Image::Matrix4::projection(), DD::Image::Matrix4::scaling(), DD::Image::IopInfoOwner::w(), and DD::Image::Format::width().

Referenced by _validate().

void Render::format_matrix ( int  sample = 0)
virtual

obsolete virtual function, do not use. Call get_format_matrix() instead

Matrix4 Render::get_format_matrix ( float  cx,
float  cy 
)

Calculate the transformation from post-projection NDC to pixel space. cx,cy are where in the pixel the -1,-1 corner should be.

References DD::Image::IopInfoOwner::info_.

Referenced by _validate(), and DD::Image::RenderScene::build_handles().

Matrix4 Render::get_format_matrix ( const Format format,
float  cx,
float  cy 
)
static

Calculate the transformation from post-projection NDC to pixel space. cx,cy are where in the pixel the -1,-1 corner should be.

References DD::Image::IopInfoOwner::h(), DD::Image::Format::height(), DD::Image::Matrix4::makeIdentity(), DD::Image::Matrix4::scale(), DD::Image::Matrix4::translate(), DD::Image::IopInfoOwner::w(), and DD::Image::Format::width().

void Render::_validate ( bool  for_real)
protectedvirtual

Base-class implementation allocates a Scene structure for each time sample and enables the generation of primitives in the first engine() call.

Reimplemented from DD::Image::Iop.

Reimplemented in DD::Image::RenderScene.

References DD::Image::Scene::_id, DD::Image::Scene::_time, DD::Image::GeoOp::build_scene(), DD::Image::Scene::camera, camera_matrix(), DD::Image::IopInfoOwner::channels(), DD::Image::Box::clear(), DD::Image::Iop::copy_info(), DD::Image::CameraOp::default_camera(), DD::Image::eClassicMotionVector, DD::Image::eDisableMotionVector, evaluate_lights(), DD::Image::Box3::expand(), DD::Image::Scene::format_, generate_primitives, get_format_matrix(), DD::Image::Format::height(), DD::Image::IopInfoOwner::info_, DD::Image::Iop::input0(), input_scenes, DD::Image::Op::inputContext(), DD::Image::Box::intersect(), jitter, jitter_array(), DD::Image::Scene::lens_func, DD::Image::CameraOp::LENS_PERSPECTIVE, DD::Image::CameraOp::LENS_RENDER_CAMERA, DD::Image::CameraOp::lensNfunction(), MAX(), max_tessellation_, DD::Image::Scene::max_tessellation_, DD::Image::Scene::mb_scene_, DD::Image::Scene::mb_type_, DD::Image::Box::merge(), multisample_array(), multisample_array_, multisampling_, output_motion_vectors, overrideBBox(), overscanFormat_, overscanY_, DD::Image::Box::pad(), projection_matrix(), projection_mode_, DD::Image::Scene::projection_mode_, render_camera(), render_geo(), render_scenes, scenes_, screen_bbox, DD::Image::Box::set(), DD::Image::MatrixArray::set_camera_matrix(), DD::Image::MatrixArray::set_format_matrix(), DD::Image::Iop::set_out_channels(), DD::Image::MatrixArray::set_projection_matrix(), DD::Image::Op::slowness(), spatial_jitter_, texture_filter_, DD::Image::Scene::validate(), DD::Image::Op::validate(), DD::Image::Format::width(), and world_bbox.

Referenced by DD::Image::RenderScene::_validate().

virtual void DD::Image::Render::overrideBBox ( Box f) const
inlineprotectedvirtual

called in Render::_validate, to allow the deriving class to override the bbox.

Referenced by _validate().

void Render::_request ( int  x,
int  y,
int  r,
int  t,
ChannelMask  out_channels,
int  count 
)
protectedvirtual
void Render::engine ( int  y,
int  x,
int  r,
ChannelMask  channels,
Row out 
)
protectedvirtual

Default engine calls initialize() (which calls generate_render_primitives()) and then calls draw_primitives() with bg=0.

Implements DD::Image::Iop.

References draw_primitives(), and initialize().

bool Render::generate_render_primitives ( )
protectedvirtual
bool Render::evaluate_lights ( Scene scene)
protectedvirtual

Evaluate all the scene lights.

References DD::Image::Scene::evaluate_lights().

Referenced by _validate().

void Render::initialize ( )
protectedvirtual

engine() must call this before it can look at the primitives

References DD::Image::Op::aborted(), generate_primitives, generate_render_primitives(), and texture_filter_.

Referenced by engine().

void Render::draw_primitives ( int  y,
int  x,
int  r,
ChannelMask  channels,
Row out_row,
const Row bg 
)
protected
float Render::hitThresholdDistance ( ) const

Return the distance away that a span/pixel cannot intersect

References multisampling_.

const Intersection * Render::multisample_array ( int  n)
static

Return multisample array for the current output sampling mode.

Referenced by _validate().

unsigned int Render::jitter_array_size ( int  samples)
static

Determine the size of jitter array to use based on the sample count 'samples'.

const Intersection * Render::jitter_array ( int  samples)
static

Determine best jitter array to use based on the sample count 'samples'.

Referenced by _validate(), DD::Image::LightOp::get_shadowing(), and Render().

int Render::multisamples ( ) const
virtual

Return the number of samples in the current output sampling mode.

References multisampling_.

void Render::buildGeoInfoHandle ( ViewerContext ctx,
DrawHandleCallbackFunc  cb 
)


©2022 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk