Public Member Functions | |
Scene () | |
virtual | ~Scene () |
virtual void | validate (int sample=0) |
virtual void | request (const ChannelSet &channels, int count) |
MotionVectorType | mb_type () const |
Scene * | mb_scene () const |
GeoOp * | geo () const |
GeometryList * | object_list () |
std::vector< DrawableGeo > * | geo_list () |
unsigned | objects () const |
GeoInfo & | object (unsigned n=0) |
int | sceneId () const |
const Format * | format () const |
int | projection_mode () const |
int | max_tessellation () const |
const Box & | screen_bbox () const |
const ChannelSet & | channels () const |
const ChannelSet & | shadow_channels () const |
MatrixArray * | transforms () |
const Matrix4 & | matrix (int n) |
const Matrix4 & | inverse_matrix (int n) |
const Matrix4 & | camera_matrix () const |
const Matrix4 & | projection_matrix () const |
const Matrix4 & | format_matrix () const |
MatrixArray * | object_transforms (unsigned n) |
bool | is_shadow_scene () const |
bool | transparency () const |
void | transparency (bool v) |
bool | raycasting () const |
void | raycasting (bool v) |
const DisplacementCoefficients & | displacementCoefficients () const |
void | displacementCoefficients (const DisplacementCoefficients &m) |
virtual void | add_light (LightOp *) |
virtual void | add_lights (const std::vector< LightOp * > *light_list) |
virtual void | clear_lights () |
virtual bool | evaluate_lights () |
Filter * | filter () const |
void | filter (Filter *v) |
void | copyInfo (const Scene *scene) |
const Quadtree< unsigned > * | quadtree () const |
void | buildGrid () |
bool | testRayIntersection (Ray &ray, const VertexContext *vtx=NULL, const Iop *material=NULL) |
virtual bool | generate_render_primitives () |
unsigned | render_primitives () const |
unsigned | displacement_primitives () const |
virtual void | add_render_primitive (rPrimitive *, PrimitiveContext *) |
virtual void | add_clipped_render_primitive (rPrimitive *) |
virtual void | add_clipped_displacement_render_primitive (rPrimitive *) |
rPrimitive * | renderable_primitive (unsigned n) const |
rPrimitive * | displacement_primitive (unsigned n) const |
virtual void | delete_render_primitives () |
virtual void | delete_light_context () |
void | print_info (const char *title) |
Public Attributes | |
CameraOp * | camera |
The shooting camera. | |
CameraOp::LensNFunc * | lens_func |
Camera projection function to use. | |
Axis | cam_vectors |
Camera PXYZ vectors in world-space. | |
std::vector< LightContext * > | lights |
Lights and their vectors. | |
std::vector< MatrixArray > | light_transforms |
Light transforms. | |
std::vector< Render * > | light_renderers |
Renderer attached to light. | |
Vector3 | ambient |
Ambient RGB color. | |
Protected Attributes | |
GeoOp * | geo_ |
GeometryList | object_list_ |
Geometry object list. | |
MotionVectorType | mb_type_ |
Motion vector type. | |
Scene * | mb_scene_ |
Next scene in time to motionblur to. | |
Quadtree< unsigned > * | quadtree_ |
Spatial subdivision tree. | |
std::vector< rPrimitive *, STLAllocator< rPrimitive * > > | render_primitives_ |
Primitives to render. | |
std::vector< rPrimitive *, STLAllocator< rPrimitive * > > | mb_render_primitives_ |
Motionblur primitives. | |
std::vector< rPrimitive *, STLAllocator< rPrimitive * > > | displacement_primitives_ |
Displacement primitives. | |
std::vector< MatrixArray > | object_transforms_ |
Rendering transforms. | |
MatrixArray | transforms_ |
const Format * | format_ |
Output render format. | |
int | projection_mode_ |
Point projection mode. | |
int | max_tessellation_ |
Threshold to limit recursive subdivision. | |
bool | transparency_ |
Transparency setting from renderer. | |
bool | raycasting_ |
Enable ray-tracing features. | |
DisplacementCoefficients | displacementCoefficients_ |
Box | screen_bbox_ |
Screen-projected bounding box. | |
ChannelSet | channels_ |
Intersected channels of all materials. | |
ChannelSet | shadow_channels_ |
shadow channels for all lights | |
Filter * | filter_ |
bool | shadow_scene_ |
Is this a shadow scene? | |
RegularGrid * | _grid |
std::vector< DrawableGeo > | _geoList |
int | _id |
id for current rendering scene | |
Friends | |
class | GeoOp |
class | Render |
class | DepthMapRender |
The Scene contains everything a renderer needs to generate an image.
Scene::Scene | ( | ) |
Constructor creates a single GeoInfo object.
References ambient, camera, channels_, DD::Image::Box::clear(), displacement_primitives_, format_, lens_func, DD::Image::CameraOp::LENS_PERSPECTIVE, light_renderers, light_transforms, lights, max_tessellation_, mb_scene_, object_transforms_, projection_mode_, quadtree_, raycasting_, render_primitives_, DD::Image::MatrixArray::reset(), screen_bbox_, DD::Image::Vector3::set(), shadow_scene_, and transforms_.
Scene::~Scene | ( | ) | [virtual] |
Destructor. Delete and clear the primitives list.
References delete_render_primitives(), and quadtree_.
void Scene::request | ( | const ChannelSet & | channels, | |
int | count | |||
) | [virtual] |
Call request on all the materials.
References camera, clamp(), DD::Image::PrimitiveContext::face_clipmask_, DD::Image::PrimitiveContext::face_uv_bbox_, DD::Image::Primitive::face_vertices(), DD::Image::Primitive::faces(), DD::Image::PrimitiveContext::geoinfo_, DD::Image::Primitive::get_face_vertices(), DD::Image::Box::h(), DD::Image::PrimitiveContext::indices_, DD::Image::CameraOp::LENS_ORTHOGRAPHIC, DD::Image::LightContext::light(), lights, DD::Image::GeoInfo::material, DD::Image::MatrixArray::matrix(), DD::Image::GeoInfo::matrix, MAX(), DD::Image::PrimitiveContext::mb_geoinfo_, DD::Image::PrimitiveContext::mb_transforms_, MIN(), DD::Image::Op::node_disabled(), object_list_, DD::Image::PrimitiveContext::primitive_, DD::Image::GeoInfo::primitive_array(), DD::Image::GeoInfo::primitives(), projection_mode_, DD::Image::Box::r(), DD::Image::GeoInfo::render_mode, DD::Image::LightOp::request(), DD::Image::Iop::request(), DD::Image::MatrixArray::set_object_matrix(), DD::Image::GeometryList::size(), DD::Image::Box::t(), DD::Image::PrimitiveContext::transforms_, transforms_, DD::Image::Primitive::vertex_shader(), DD::Image::Box::w(), DD::Image::Box::x(), DD::Image::Vector2::x, DD::Image::Box::y(), and DD::Image::Vector2::y.
void Scene::add_light | ( | LightOp * | l | ) | [virtual] |
Add a LightOp to the Scene's light list.
References light_renderers, light_transforms, lights, DD::Image::LightContext::set_depthmap(), DD::Image::LightContext::set_light(), DD::Image::LightContext::set_scene(), and DD::Image::LightContext::set_transforms().
Referenced by add_lights().
void Scene::add_lights | ( | const std::vector< LightOp * > * | light_list | ) | [virtual] |
Add LightOps from a LightOp list.
References add_light().
void Scene::clear_lights | ( | ) | [virtual] |
Clear the light list.
References light_renderers, and light_transforms.
Referenced by DD::Image::GeoOp::build_scene().
bool Scene::evaluate_lights | ( | ) | [virtual] |
Transform the Scene's lights into the scene's camera(eye) space. The renderer needs a local copy of the light transforms because the lights can be used in multiple scenes and it's cheaper to pre-transform them than to do it during rendering. This call is separate from generate_primitives() so that Materials can generate their shader previews. If the call is aborted early because of a user interrupt, return false so the calling function can abort too.
References DD::Image::Matrix4::a00, DD::Image::Matrix4::a01, DD::Image::Matrix4::a02, DD::Image::Matrix4::a03, DD::Image::Matrix4::a10, DD::Image::Matrix4::a11, DD::Image::Matrix4::a12, DD::Image::Matrix4::a13, DD::Image::Matrix4::a20, DD::Image::Matrix4::a21, DD::Image::Matrix4::a22, DD::Image::Matrix4::a23, DD::Image::Op::aborted(), DD::Image::LightOp::cast_shadows(), DD::Image::LightContext::depthmap(), DD::Image::LightOp::depthmap_width(), DD::Image::LightOp::getShadowMaskChannel(), DD::Image::LightContext::light(), light_renderers, light_transforms, lights, matrix(), DD::Image::AxisOp::matrix(), DD::Image::Op::node_disabled(), DD::Image::MatrixArray::set_camera_matrix(), DD::Image::LightContext::set_depthmap(), DD::Image::MatrixArray::set_format_matrix(), DD::Image::MatrixArray::set_object_matrix(), DD::Image::MatrixArray::set_projection_matrix(), DD::Image::LightContext::set_transforms(), and DD::Image::LightContext::vectors_.
void Scene::copyInfo | ( | const Scene * | scene | ) |
< shadow channels for all lights
References ambient, camera, channels_, filter_, format_, lens_func, light_renderers, light_transforms, lights, max_tessellation_, projection_mode_, quadtree_, DD::Image::Box::r(), screen_bbox_, shadow_channels_, DD::Image::Box::t(), transforms_, transparency_, DD::Image::Box::x(), and DD::Image::Box::y().
bool Scene::generate_render_primitives | ( | ) | [virtual] |
Create renderable primitives from the GeoInfo's primitive list. A primitive may not be directly renderable and may need tessellation(subdivision) into simpler primitives - a NURBS surface for example. Usually these primitives will create triangles, and this generally will only need to be done to support a scanline rendering algorithm as raytracing usually intersect tests directly on implicit surfaces.
Because this routine can be time intensive, we check frequently for user aborts so we can clean up and bail out quickly.
TODO: How do we communicate what kind of renderer is being supported? There's too much hardcoded scanline stuff right now. Renderers will need to test a primitive for compatibility and call the tessellation routines if not. All renderers will need to support at least the Triangle primitive I think. Perhaps this generate_primitives call should go back into the renderer's engine() call(into another procedure called from engine() that is) so that the renderer can do primitive typing tests directly.
References DD::Image::Op::aborted(), delete_render_primitives(), format_, DD::Image::PrimitiveContext::geoinfo_, DD::Image::PrimitiveContext::indices_, DD::Image::PrimitiveContext::mb_geoinfo_, mb_scene_, DD::Image::PrimitiveContext::mb_transforms_, object_list_, object_transforms_, objects(), DD::Image::GeoInfo::out_id(), DD::Image::GeoInfo::points(), DD::Image::PrimitiveContext::primitive_, DD::Image::GeoInfo::primitive_array(), DD::Image::GeoInfo::primitives(), quadtree_, DD::Image::Box::r(), DD::Image::GeoInfo::render_mode, DD::Image::GeometryList::size(), DD::Image::Box::t(), DD::Image::Primitive::tessellate(), DD::Image::PrimitiveContext::transforms_, DD::Image::GeoInfo::validate(), DD::Image::Box::x(), and DD::Image::Box::y().
void Scene::add_render_primitive | ( | rPrimitive * | p, | |
PrimitiveContext * | ptx | |||
) | [virtual] |
Add an unclipped primitive to the renderable list. This call calls clip() on the primitive. If you know the primitive is completely visible, use add_clipped_render_primitive() instead. This is usually called directly from a rPrimitive to either add a reference to a copy of itself, or to add a sub-primitive during tessellation. rPrimitives should not add a reference to themselves as the Scene deletes all its rPrimitive pointers after rendering.
The pointer 'p' is deleted after rendering is complete!****
References DD::Image::rPrimitive::add_to_displacement_render(), DD::Image::rPrimitive::add_to_render(), DD::Image::Iop::displacement_bound(), DD::Image::PrimitiveContext::geoinfo(), and DD::Image::GeoInfo::material.
Referenced by DD::Image::Triangle::tessellate(), DD::Image::Polygon::tessellate(), DD::Image::Point::tessellate(), DD::Image::ParticlesSprite::tessellate(), DD::Image::Particles::tessellate(), and DD::Image::Mesh::tessellate().
void Scene::add_clipped_render_primitive | ( | rPrimitive * | p | ) | [virtual] |
Add an already clipped primitive to the renderable list. This is usually called directly from a rPrimitive to either add a reference to a copy of itself, or to add a sub-primitive during tessellation. rPrimitives should not pass a reference to itself as the Scene deletes all its rPrimitive pointers after rendering.
The pointer 'p' is deleted after rendering is complete!****
References DD::Image::Quadtree< T >::add(), DD::Image::Quadtree< T >::add_to_root(), DD::Image::Quadtree< T >::bbox(), DD::Image::Box2f::max(), DD::Image::Box2f::min(), quadtree_, and render_primitives_.
Referenced by DD::Image::rPoint::add_to_render().
void Scene::delete_render_primitives | ( | ) | [virtual] |
Delete all added renderable primitives and their associated allocations.
References displacement_primitives_, mb_render_primitives_, quadtree_, and render_primitives_.
Referenced by generate_render_primitives(), and ~Scene().
MatrixArray DD::Image::Scene::transforms_ [protected] |
Scene transforms(object, camera, projection, format)
Referenced by copyInfo(), request(), and Scene().
©2009 The Foundry Visionmongers, Ltd. All Rights Reserved. |