ScummVM API documentation
Material_Fallback02_BaseLight.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * Copyright (C) 2006-2010 - Frictional Games
24 *
25 * This file is part of HPL1 Engine.
26 */
27
28#ifndef HPL_MATERIAL_FALLBACK02_BASE_LIGHT_H
29#define HPL_MATERIAL_FALLBACK02_BASE_LIGHT_H
30
31#include "hpl1/engine/graphics/Material.h"
32#include "hpl1/engine/scene/Light3D.h"
33
34#include "hpl1/engine/graphics/Material_BaseLight.h"
35
36namespace hpl {
37
38//---------------------------------------------------------------
39
41public:
43 const tString &asName, iLowLevelGraphics *apLowLevelGraphics,
44 cImageManager *apImageManager, cTextureManager *apTextureManager,
45 cRenderer2D *apRenderer, cGpuProgramManager *apProgramManager,
46 eMaterialPicture aPicture, cRenderer3D *apRenderer3D);
47
49
50 tTextureTypeList GetTextureTypes();
51
52 bool UsesType(eMaterialRenderType aType);
53
54 iGpuProgram *getGpuProgram(const eMaterialRenderType aType, const int alPass, iLight3D *apLight);
55 iMaterialProgramSetup *getGpuProgramSetup(const eMaterialRenderType aType, const int alPass, iLight3D *apLight);
56
57 bool VertexProgramUsesLight(eMaterialRenderType aType, int alPass, iLight3D *apLight);
58 bool VertexProgramUsesEye(eMaterialRenderType aType, int alPass, iLight3D *apLight);
59
60 eMaterialAlphaMode GetAlphaMode(eMaterialRenderType aType, int alPass, iLight3D *apLight);
61 eMaterialBlendMode GetBlendMode(eMaterialRenderType aType, int alPass, iLight3D *apLight);
62 eMaterialChannelMode GetChannelMode(eMaterialRenderType aType, int alPass, iLight3D *apLight);
63
64 iTexture *GetTexture(int alUnit, eMaterialRenderType aType, int alPass, iLight3D *apLight);
65 eMaterialBlendMode GetTextureBlend(int alUnit, eMaterialRenderType aType, int alPass, iLight3D *apLight);
66
67 int GetNumOfPasses(eMaterialRenderType aType, iLight3D *apLight);
68
70 // Old and worthless stuff, only used by 2D renderer
71 void Compile() {}
72 bool StartRendering(eMaterialRenderType aType, iCamera *apCam, iLight *pLight) { return false; }
73 void EndRendering(eMaterialRenderType aType) {}
74 tVtxBatchFlag GetBatchFlags(eMaterialRenderType aType) { return 0; }
75 bool NextPass(eMaterialRenderType aType) { return false; }
76 bool HasMultiplePasses(eMaterialRenderType aType) { return false; }
77 eMaterialType GetType(eMaterialRenderType aType) { return eMaterialType_Diffuse; }
78 void EditVertexes(eMaterialRenderType aType, iCamera *apCam, iLight *pLight,
79 tVertexVec *apVtxVec, cVector3f *apTransform, unsigned int alIndexAdd) {}
80
81protected:
82 iTexture *mpNormalizationMap;
83 iTexture *mpSpotNegativeRejectMap;
84
85 iTexture *mpAttenuationMap;
86
87 iGpuProgram *_gpuPrograms[eBaseLightProgram_LastEnum];
88 iGpuProgram *_diffuseGpuProgram;
89 iGpuProgram *_ambientGpuProgram;
90};
91
92//---------------------------------------------------------------
93
95// Diffuse
97
99public:
100 cMaterial_Fallback02_Diffuse(const tString &asName, iLowLevelGraphics *apLowLevelGraphics,
101 cImageManager *apImageManager, cTextureManager *apTextureManager,
102 cRenderer2D *apRenderer, cGpuProgramManager *apProgramManager,
103 eMaterialPicture aPicture, cRenderer3D *apRenderer3D)
105 asName, apLowLevelGraphics, apImageManager, apTextureManager, apRenderer, apProgramManager,
106 aPicture, apRenderer3D) {
107 }
108};
109
110//---------------------------------------------------------------
111
112} // namespace hpl
113
114#endif // HPL_MATERIAL_FALLBACK02_BASE_LIGHT_H
Definition: list.h:44
Definition: str.h:59
Definition: GpuProgramManager.h:39
Definition: ImageManager.h:48
Definition: Material_Fallback02_BaseLight.h:98
Definition: Renderer2D.h:79
Definition: Renderer3D.h:139
Definition: TextureManager.h:47
Definition: Camera.h:43
Definition: GPUProgram.h:62
Definition: Light3D.h:117
Definition: Light.h:38
Definition: LowLevelGraphics.h:200
Definition: Material_Fallback02_BaseLight.h:40
bool NextPass(eMaterialRenderType aType)
Definition: Material_Fallback02_BaseLight.h:75
bool HasMultiplePasses(eMaterialRenderType aType)
Definition: Material_Fallback02_BaseLight.h:76
bool StartRendering(eMaterialRenderType aType, iCamera *apCam, iLight *pLight)
Definition: Material_Fallback02_BaseLight.h:72
tVtxBatchFlag GetBatchFlags(eMaterialRenderType aType)
Definition: Material_Fallback02_BaseLight.h:74
eMaterialType GetType(eMaterialRenderType aType)
Definition: Material_Fallback02_BaseLight.h:77
void EndRendering(eMaterialRenderType aType)
Definition: Material_Fallback02_BaseLight.h:73
Definition: Material.h:203
Definition: Material.h:181
Definition: Texture.h:88