2013-12-08 16:56:59 +00:00
|
|
|
#ifndef LIGHTINGMANAGER_H
|
|
|
|
#define LIGHTINGMANAGER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
2013-12-08 19:54:34 +00:00
|
|
|
#include <set>
|
|
|
|
|
2013-12-08 16:56:59 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Global lighting manager.
|
|
|
|
*
|
|
|
|
* This manager handles the light filters and final light rendering.
|
|
|
|
*/
|
|
|
|
class SOFTWARESHARED_EXPORT LightingManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LightingManager();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Register a filter that will receive all alterable lights.
|
|
|
|
*/
|
|
|
|
void registerFilter(LightFilter* filter);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Alter the light component at a given location.
|
|
|
|
* @return true if the light is useful
|
|
|
|
*/
|
|
|
|
bool alterLight(LightComponent &component, const Vector3 &location);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enable or disable the specularity lighting.
|
|
|
|
*/
|
|
|
|
void setSpecularity(bool enabled);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Apply a final component on a surface material.
|
|
|
|
*/
|
2013-12-08 19:54:34 +00:00
|
|
|
Color applyFinalComponent(const LightComponent &component, const Vector3 &eye, const Vector3 &location, const Vector3 &normal, const SurfaceMaterial &material);
|
2013-12-08 16:56:59 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int specularity;
|
|
|
|
|
2013-12-08 19:54:34 +00:00
|
|
|
std::set<LightFilter*> filters;
|
2013-12-08 16:56:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // LIGHTINGMANAGER_H
|