forked from rtpHarry/Sokoban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShadowMapEffect.h
51 lines (42 loc) · 1.04 KB
/
ShadowMapEffect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include "GLee.h"
#include <gl/GLU.h>
//#include <gl\gl.h>
//#include <gl/GLee.h> // gl extension loader [gl.h is included with this]
// need to know window dimensions
// need to know camera positions
#include "Matrix4x4.h"
#include "Vector3.h"
class ShadowMapEffect
{
public:
ShadowMapEffect(void);
~ShadowMapEffect(void);
// is the shadow map effect being used
bool m_ShadowMapEnabled;
// TODO add a hook to keep it in sync with real camera
CVector3 m_CameraPosition;
CVector3 m_LightPosition;
//Size of shadow map
// TODO make this a const
int m_ShadowMapSize;
//Textures
GLuint m_ShadowMapTexture;
//Matrices
Matrix4x4 m_LightProjectionMatrix, m_LightViewMatrix;
Matrix4x4 m_CameraProjectionMatrix, m_CameraViewMatrix;
public:
// setup the shadow map effect if the hardware supports it
void SetupEffect(void);
public:
void RenderFirstPass(void);
public:
void RenderSecondPass(void);
public:
void RenderThirdPass(void);
public:
void RenderCleanUp(void);
};