Public Member Functions |
|
| ProjectionScreen (const string &name="") |
| void | clear_undist_lut () |
| | Removes the distortion lookup table from the projector, if specified.
|
| virtual bool | cull_callback (CullTraverser *trav, CullTraverserData &data) |
| | This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
|
|
virtual TypeHandle | force_init_type () |
| bool | get_auto_recompute () const |
| | Returns the auto_recompute flag.
|
| const LColor & | get_frame_color () const |
| | Returns the color the screen will be painted at the portions outside of the lens' frustum.
|
| bool | get_invert_uvs () const |
| | Returns whether this screen is compensating for a graphics driver inverting the framebuffer image.
|
| const UpdateSeq & | get_last_screen () const |
| | Returns an UpdateSeq corresponding to the last time a screen mesh was generated for the ProjectionScreen.
|
| const NodePath & | get_projector () const |
| | Returns the NodePath to the LensNode that is to serve as the projector for this screen, or empty if no projector is associated.
|
| bool | get_texcoord_3d () const |
| | See set_texcoord_3d().
|
| string | get_texcoord_name () const |
| | Returns the name of the texture coordinates that will be generated by this particular ProjectionScreen, as set by set_texcoord_name().
|
|
virtual TypeHandle | get_type () const |
| const PfmFile & | get_undist_lut () const |
| | Returns the distortion lookup table provided via set_undist_lut(), if any.
|
| const LColor & | get_vignette_color () const |
| | Returns the color the screen will be painted at the portions outside of the lens' frustum.
|
| bool | get_vignette_on () const |
| | Returns true if vertex-based vignetting is on, false otherwise.
|
| bool | has_undist_lut () const |
| | Returns true if a valid distortion lookup table was provided via set_undist_lut(), false otherwise.
|
| virtual PandaNode * | make_copy () const |
| | Returns a newly-allocated Node that is a shallow copy of this one.
|
|
| PT (GeomNode) generate_screen(const NodePath &projector |
|
| PT (PandaNode) make_flat_mesh(const NodePath &this_np |
| void | recompute () |
| | Recomputes all the UV's for geometry below the ProjectionScreen node, as if the texture were projected from the associated projector.
|
| bool | recompute_if_stale () |
| | Calls recompute() only if the relative transform between the ProjectionScreen and the projector has changed, or if any other relevant property has changed.
|
| bool | recompute_if_stale (const NodePath &this_np) |
| | Calls recompute() only if the relative transform between the ProjectionScreen and the projector has changed, or if any other relevant property has changed.
|
| void | regenerate_screen (const NodePath &projector, const string &screen_name, int num_x_verts, int num_y_verts, PN_stdfloat distance, PN_stdfloat fill_ratio) |
| | Removes all the children from the ProjectionScreen node, and adds the newly generated child returned by generate_screen().
|
| void | set_auto_recompute (bool auto_recompute) |
| | Sets the auto_recompute flag.
|
| void | set_frame_color (const LColor &frame_color) |
| | Specifies the color the screen will be painted at the portions outside of the lens' frustum; i.e.
|
| void | set_invert_uvs (bool invert_uvs) |
| | Some OpenGL graphics drivers are known to invert the framebuffer image when they copy it to texture.
|
| void | set_projector (const NodePath &projector) |
| | Specifies the LensNode that is to serve as the projector for this screen.
|
| void | set_texcoord_3d (bool texcoord_3d) |
| | Set this true to force 3-D texture coordinates to be created for the geometry.
|
| void | set_texcoord_name (const string &texcoord_name) |
| | Specifies the name of the texture coordinates that are generated by this particular ProjectionScreen.
|
| void | set_undist_lut (const PfmFile &undist_lut) |
| | Applies a distortion lookup table to the projector.
|
| void | set_vignette_color (const LColor &vignette_color) |
| | Specifies the color the screen will be painted at the portions outside of the lens' frustum; i.e.
|
| void | set_vignette_on (bool vignette_on) |
| | Specifies whether vertex-based vignetting should be on.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Public Attributes |
|
const NodePath & | camera |
|
const string int int PN_stdfloat | distance |
const string int int
PN_stdfloat PN_stdfloat | fill_ratio |
|
const string int | num_x_verts |
|
const string int int | num_y_verts |
|
const string & | screen_name |
Protected Member Functions |
|
| ProjectionScreen (const ProjectionScreen ©) |
A ProjectionScreen implements a simple system for projective texturing.
The ProjectionScreen node is the parent of a hierarchy of geometry that is considered a "screen"; the ProjectionScreen will automatically recompute all the UV's (for a particular texture stage) on its subordinate geometry according to the relative position and lens parameters of the indicated LensNode.
All this does is recompute UV's; the caller is responsible for applying the appropriate texture(s) to the geometry.
This does not take advantage of any hardware-assisted projective texturing; all of the UV's are computed in the CPU. (Use NodePath::project_texture() to enable hardware-assisted projective texturing.) However, the ProjectionScreen interface does support any kind of lens, linear or nonlinear, that might be defined using the Lens interface, including fisheye and cylindrical lenses.
Definition at line 55 of file projectionScreen.h.
This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.
Note that this function will *not* be called unless set_cull_callback() is called in the constructor of the derived class. It is necessary to call set_cull_callback() to indicated that we require cull_callback() to be called.
By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.
The return value is true if this node should be visible, or false if it should be culled.
Reimplemented from PandaNode.
Definition at line 121 of file projectionScreen.cxx.
References WorkingNodePath::get_node_path(), and recompute_if_stale().
Specifies whether vertex-based vignetting should be on.
When this is enabled, vertex color will be set on the screen vertices to color the screen two distinct colors, usually white and black, for the parts of the screen in front of and outside the lens' frustum, respectively. When this is not enabled, the screen color will be left alone.
This effect generally looks terrible, but it does at least make the boundaries of the lens clear.
Definition at line 183 of file projectionScreen.I.