2017-03-01 03:05:54 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "gl/dynlights/gl_lightbsp.h"
|
2017-03-02 17:07:47 +00:00
|
|
|
#include "tarray.h"
|
|
|
|
|
|
|
|
class ADynamicLight;
|
2017-03-01 03:05:54 +00:00
|
|
|
|
|
|
|
class FShadowMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FShadowMap() { }
|
|
|
|
~FShadowMap() { Clear(); }
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
void Update();
|
|
|
|
|
2017-03-02 17:07:47 +00:00
|
|
|
int ShadowMapIndex(ADynamicLight *light) { return mLightToShadowmap[light]; }
|
|
|
|
|
2017-03-07 23:34:08 +00:00
|
|
|
bool ShadowTest(ADynamicLight *light, const DVector3 &pos);
|
|
|
|
|
2017-03-01 03:05:54 +00:00
|
|
|
private:
|
2017-03-01 16:17:33 +00:00
|
|
|
void UploadLights();
|
|
|
|
|
2017-03-01 03:05:54 +00:00
|
|
|
FLightBSP mLightBSP;
|
2017-03-01 16:17:33 +00:00
|
|
|
int mLightList = 0;
|
2017-03-02 17:07:47 +00:00
|
|
|
TArray<float> mLights;
|
|
|
|
TMap<ADynamicLight*, int> mLightToShadowmap;
|
2017-03-01 03:05:54 +00:00
|
|
|
|
|
|
|
FShadowMap(const FShadowMap &) = delete;
|
|
|
|
FShadowMap &operator=(FShadowMap &) = delete;
|
|
|
|
};
|