22 #ifndef STARK_GFX_OPENGL_ACTOR_H 23 #define STARK_GFX_OPENGL_ACTOR_H 25 #include "engines/stark/gfx/renderentry.h" 26 #include "engines/stark/visual/actor.h" 27 #include "engines/stark/gfx/opengl.h" 29 #include "common/hashmap.h" 30 #include "common/hash-ptr.h" 32 #include "graphics/opengl/system_headers.h" 34 #if defined(USE_OPENGL_GAME) 69 typedef _ActorVertex ActorVertex;
71 class OpenGLActorRenderer :
public VisualActor {
73 OpenGLActorRenderer(OpenGLDriver *gfx);
74 virtual ~OpenGLActorRenderer();
76 void render(
const Math::Vector3d &position,
float direction,
const LightEntryArray &lights)
override;
83 ActorVertex *_faceVBO;
84 FaceBufferMap _faceEBO;
87 void uploadVertices();
88 ActorVertex *createModelVBO(
const Model *model);
89 uint32 *createFaceEBO(
const Face *face);
90 void setLightArrayUniform(
const LightEntryArray &lights);
92 Math::Vector3d getShadowLightDirection(
const LightEntryArray &lights,
const Math::Vector3d &actorPosition, Math::Matrix3 worldToModelRot);
94 bool getPointLightContribution(LightEntry *light,
const Math::Vector3d &actorPosition,
95 Math::Vector3d &direction,
float weight = 1.0f);
96 bool getDirectionalLightContribution(LightEntry *light, Math::Vector3d &direction);
97 bool getSpotLightContribution(LightEntry *light,
const Math::Vector3d &actorPosition, Math::Vector3d &direction);
103 #endif // defined(USE_OPENGL_GAME) 105 #endif // STARK_GFX_OPENGL_ACTOR_H