All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EnvironmentMaterialFactory.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Rendering.h"
7 #include "Lighting.h"
8 #include "IdTypes.h"
9 #include "MaterialRepository.h"
10 #include "AsyncTexturing.h"
11 #include <string>
12 
13 namespace Eegeo
14 {
15  namespace Rendering
16  {
18  {
19  private:
20  Eegeo::Rendering::Shaders::PackedDiffuseTransitionShader* m_pPackedDiffuseTransitionShader;
21  Eegeo::Rendering::Shaders::PackedDiffuseShader* m_pPackedDiffuseShader;
22  Eegeo::Rendering::Shaders::PackedDiffuseFoggedShader* m_pPackedDiffuseFoggedShader;
23 
24  Eegeo::Rendering::Shaders::PackedDiffuseTransitionShader* m_pPunchThroughPackedDiffuseTransitionShader;
25  Eegeo::Rendering::Shaders::PackedDiffuseShader* m_pPunchThroughPackedDiffuseShader;
26  Eegeo::Rendering::Shaders::PackedDiffuseFoggedShader* m_pPunchThroughPackedDiffuseFoggedShader;
27 
28  Eegeo::Rendering::Shaders::PackedStencilShadowShader* m_pPackedStencilShadowShader;
31  Eegeo::Rendering::Shaders::LightmappedPackedDiffuseTransitionShader* m_pLightmapPackedDiffuseTransitionShader;
32  Eegeo::Rendering::Shaders::LightmappedPackedDiffuseShader* m_pLightmapPackedDiffuseShader;
34  Eegeo::Rendering::Shaders::WaterTransitionShader* m_pWaterTransitionShader;
36  Eegeo::Rendering::Shaders::PackedDiffuseAlphaShader* m_pPackedDiffuseAlphaShader;
37  Eegeo::Rendering::Shaders::PackedDiffuseAlphaShader* m_pPunchThroughPackedDiffuseAlphaShader;
38 
40 
41  Eegeo::Rendering::MaterialRepository* m_pDiffuseMaterials;
42  Eegeo::Rendering::MaterialRepository* m_pLightmappedMaterials;
43  Eegeo::Rendering::MaterialRepository* m_pTransitionMaterials;
44  Eegeo::Rendering::MaterialRepository* m_pFoggedMaterials;
46  Rendering::Materials::ShadowMaterial* m_pShadowQuadMaterial;
47 
51  Rendering::Materials::MaterialIdGenerator& m_materialIdGenerator;
52 
53  const float m_waterEnvMapFadeoutAltitude;
54 
55  public:
57  Rendering::Shaders::ShaderIdGenerator& shaderIdGenerator,
58  Rendering::Materials::MaterialIdGenerator& materialIdGenerator,
59  Eegeo::Lighting::GlobalLighting& globalLighting,
60  Eegeo::Lighting::GlobalFogging& globalFogging,
61  Eegeo::Lighting::GlobalShadowing& globalShadowing,
62  Rendering::AsyncTexturing::IAsyncTexture& placeholderTexture,
63  Rendering::AsyncTexturing::IAsyncTexture& placeholderCubeTexture,
64  float waterEnvMapFadeoutAltitude
65  );
66 
68  Eegeo::Rendering::EnvironmentMaterialRepository& GetMaterialRepository();
69 
70  private:
71  MaterialRepository* CreatePackedDiffuseFoggedMaterials(Rendering::AsyncTexturing::IAsyncTexture& placeholderTextureId, Rendering::AsyncTexturing::IAsyncTexture& defaultWaterReflectionCubeMapTextureId);
72  MaterialRepository* CreateTransitionMaterials(Rendering::AsyncTexturing::IAsyncTexture& placeholderTextureId, Rendering::AsyncTexturing::IAsyncTexture& defaultWaterReflectionCubeMapTextureId);
73  MaterialRepository* CreateDiffuseMaterials(Rendering::AsyncTexturing::IAsyncTexture& placeholderTextureId, Rendering::AsyncTexturing::IAsyncTexture& defaultWaterReflectionCubeMapTextureId);
74  MaterialRepository* CreateLightmappedMaterials(Rendering::AsyncTexturing::IAsyncTexture& placeholderTextureId, Rendering::AsyncTexturing::IAsyncTexture& defaultWaterReflectionCubeMapTextureId);
75 
76  void AddRasterTerrainMaterials(Rendering::IMaterialRepository* pMaterialRepository, Rendering::AsyncTexturing::IAsyncTexture& placeholderTextureId);
77  void AddVehicleMaterials(Rendering::IMaterialRepository* pMaterialRepository, Rendering::AsyncTexturing::IAsyncTexture& placeholderTextureId);
78 
79  Rendering::Materials::ShadowMaterial* CreateShadowMaterial();
80  Rendering::Materials::WaterTransitionMaterial* CreateWaterTransitionMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& diffuseTextureId, Rendering::AsyncTexturing::IAsyncTexture& normalMapTextureId, Rendering::AsyncTexturing::IAsyncTexture& reflectionMapTextureId);
81  Rendering::Materials::WaterMaterial2* CreateWaterMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& diffuseTextureId, Rendering::AsyncTexturing::IAsyncTexture& normalMapTextureId, Rendering::AsyncTexturing::IAsyncTexture& reflectionMapTextureId);
82  Rendering::Materials::LightmappedPackedDiffuseMaterial* CreateLightmappedPackedDiffuseMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
83  Rendering::Materials::PackedDiffuseMaterial* CreatePackedDiffuseMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
84  Rendering::Materials::DiffuseMaterial* CreateDiffuseMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
85  Rendering::Materials::UniqueDiffuseMaterial* CreateUniqueDiffuseMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
86  Rendering::Materials::CustomLandmarkDiffuseMaterial* CreateLandmarkDiffuseMaterial(const std::string& materialName);
87  Rendering::Materials::CustomLandmarkDiffuseMaterial* CreatePunchThroughLandmarkDiffuseMaterial(const std::string& materialName);
88  Rendering::Materials::CustomLandmarkDiffuseFoggedMaterial* CreateLandmarkDiffuseFoggedMaterial(const std::string& materialName);
89  Rendering::Materials::CustomLandmarkDiffuseFoggedMaterial* CreatePunchThroughLandmarkDiffuseFoggedMaterial(const std::string& materialName);
90  Rendering::Materials::ProceduralLandmarkDiffuseMaterial* CreateProceduralLandmarkDiffuseMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
91  Rendering::Materials::PackedDiffuseFoggedMaterial* CreatePackedDiffuseFoggedMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
92  Rendering::Materials::PackedDiffuseTransitionMaterial* CreatePackedDiffuseTransitionMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
93  Rendering::Materials::CustomLandmarkDiffuseTransitionMaterial* CreateLandmarkDiffuseTransitionMaterial(const std::string& materialName);
94  Rendering::Materials::CustomLandmarkDiffuseTransitionMaterial* CreatePunchThroughLandmarkDiffuseTransitionMaterial(const std::string& materialName);
95  Rendering::Materials::LightmappedPackedDiffuseTransitionMaterial* CreateLightmappedPackedDiffuseTransitionMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& textureId);
96  Rendering::Materials::PackedStencilShadowMaterial* CreatePackedStencilShadowMaterial();
97 
98  Rendering::Materials::ModelMaterial* CreateModelMaterial(const std::string& materialName, Rendering::AsyncTexturing::IAsyncTexture& texture);
99  };
100  }
101 }