00001
00002
00003 #ifndef __ENERGY_COAT_ARCH_H
00004 #define __ENERGY_COAT_ARCH_H
00005
00006 #include <gra/arch/Architecture.h>
00007 #include <gra/render/GLEnergyRender.h>
00008
00009 using namespace esg;
00010
00011 namespace gra {
00012
00019 class GRA_EXPORT EnergyCoatArch : public Architecture {
00020 public:
00021 enum CoatType {
00022 PARTIAL_ENERGY,
00023 IMPOSTER,
00024 LIGHT_MAP
00025 };
00026
00027 struct Params : public Architecture::Params {
00028 CoatType coatType;
00029 int meshDensity;
00030 unsigned lightMapResolution;
00031
00032 Params()
00033 : coatType(PARTIAL_ENERGY),
00034 meshDensity(1),
00035 lightMapResolution(32) {}
00036 };
00037
00038 protected:
00039 CoatType _coatType;
00040 int _meshDensity;
00041 unsigned _lightMapResolution;
00042
00043 public:
00049 EnergyCoatArch (EnergyCoatArch::Params& params) : Architecture(params){
00050 _coatType = params.coatType;
00051 _meshDensity = params.meshDensity;
00052 _lightMapResolution = params.lightMapResolution;
00053 }
00054
00058 virtual Render* createRender (void) {
00059 return new GLEnergyRender(_pStopFlag, false, true);
00060 }
00061
00065 virtual Shader* createShader (void) {
00066 #if 0 // to do
00067 if (_coatType == PARTIAL_ENERGY)
00068 return new GLShader(NULL, NULL, NULL, _meshDensity);
00069 if (_coatType == LIGHT_MAP)
00070 return new PhongShader(NULL, _lightMapResolution);
00071 #endif
00072 return NULL;
00073 }
00074 };
00075
00076 }
00077
00078 #endif // __ENERGY_COAT_ARCH_H