29 #ifndef __SHADOWGEOMETRY_H__
30 #define __SHADOWGEOMETRY_H__
68 virtual void onAdd(
Node *n );
69 virtual void onRemove(
Node *n );
74 Inst< SFTransformNode > _transform = 0,
75 Inst< SFGeometryNode > _geometry = 0,
76 Inst< SFBool > _enabled = 0 );
78 virtual void update();
97 virtual void computeShadowVolumeInformationCPU(
const LightDataStruct& light_data, Matrix4f accumulated_fwd,
bool render_caps, std::vector< Vec4d >& coord );
99 virtual void renderShadowGPU(
const LightDataStruct& light_data, Matrix4f accumulated_fwd,
bool render_caps );
103 void buildShadowVolumeDataCPU( LightDataStruct light_data,
105 const Matrix4f &local_to_global,
106 const Matrix4f &global_to_local,
107 bool rebuild_triangle_info,
108 std::vector< Vec4d >& coord );
113 void addDirectionalLightQuadPoints( vector< Vec4d > &triangle_points,
120 void addPointLightQuadPoints( vector< Vec4d > &triangle_points,
122 const Vec3d& light_pos );
128 void updateNeighbours(
const vector< HAPI::Collision::Triangle > &triangles);
133 void updateSilhouetteEdgesDirectionalLight(
const vector< HAPI::Collision::Triangle > &,
134 const vector<int> &neighbours,
135 const Vec3d &direction );
139 void updateSilhouetteEdgesPointLight(
const vector< HAPI::Collision::Triangle > &,
140 const vector<int> &neighbours,
146 void updateAdjacentVertexArray(
const vector< HAPI::Collision::Triangle > &triangles,
147 vector< Vec3d > &triangle_points,
148 vector< unsigned int > &adjacency_index );
154 int getMissingPointIndex(
const HAPI::Collision::Triangle &t,
191 Matrix4f transform_matrix_ts;
193 bool rebuild_triangles_ts;
Header file for ComposedShader, X3D scene-graph node.
Header file for DirectionalLight, X3D scene-graph node.
Header file for H3DShadowObjectNode.
Header file for PointLight, X3D scene-graph node.
Contains the SFRotation field class.
Header file for X3DGeometryNode, X3D scene-graph node.
The H3DShadowObjectNode is the base class for all shadow objects for use in the ShadowCaster node.
Definition: H3DShadowObjectNode.h:49
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
SFGeometryNode is specialized to route the boundTree field from the X3DGeometryNodes that are put int...
Definition: ShadowGeometry.h:66
The ShadowGeometry object specifies a X3DGeometryNode that should be used for casting a shadow when u...
Definition: ShadowGeometry.h:59
static H3DNodeDatabase database
The H3DNodeDatabase object for this node.
Definition: ShadowGeometry.h:95
std::vector< HAPI::Collision::Triangle > triangles_ts
The triangles of the geometry.
Definition: ShadowGeometry.h:197
std::map< X3DLightNode *, pair< H3DTime, vector< Vec4d > > > triangle_points_fallback
Points to be used for each light vertex array rendering if CPU based.
Definition: ShadowGeometry.h:170
vector< int > neighbours
Array of 3*nr_triangles triangle indices specifying for each triangle edge which triangle is its neig...
Definition: ShadowGeometry.h:159
H3DUniquePtr< SFGeometryNode > geometry
The geometry field specifies the X3DGeometryNode that should cast a shadow.
Definition: ShadowGeometry.h:92
H3DUniquePtr< Field > triangles_changed
This field will be sent an event when the triangles in the geometry field have changed.
Definition: ShadowGeometry.h:84
vector< bool > is_silhouette_edge
Array of 3*nr_triangles values, one for each triangle edge.
Definition: ShadowGeometry.h:180
vector< bool > triangle_facing_light
Array of nr_triangle values indicating if the triangle is facing the light source or not.
Definition: ShadowGeometry.h:184
bool use_geometry_shader_last_loop
True if geometry shader was used last time this ShadowGeometry was rendered.
Definition: ShadowGeometry.h:187
vector< Vec3d > triangle_points_geom_shader
Points to be used for vertex array rendering with adjacency info.
Definition: ShadowGeometry.h:166
vector< unsigned int > index_geom_shader
Index to be used for vertex array rendering with adjacency info.
Definition: ShadowGeometry.h:173
vector< HAPI::Collision::Triangle > triangles
The triangles of the geometry.
Definition: ShadowGeometry.h:163
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194