-// Copyright (C) 2014 Patryk Nadrowski\r
-// This file is part of the "Irrlicht Engine".\r
-// For conditions of distribution and use, see copyright notice in Irrlicht.h\r
-\r
-#pragma once\r
-\r
-#include "IShaderConstantSetCallBack.h"\r
-#include "IMaterialRendererServices.h"\r
-\r
-namespace irr\r
-{\r
-namespace video\r
-{\r
-\r
-class COpenGL3MaterialBaseCB : public IShaderConstantSetCallBack\r
-{\r
-public:\r
- COpenGL3MaterialBaseCB();\r
-\r
- virtual void OnSetMaterial(const SMaterial& material);\r
- virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);\r
-\r
-protected:\r
- bool FirstUpdateBase;\r
-\r
- s32 WVPMatrixID;\r
- s32 WVMatrixID;\r
- s32 NMatrixID;\r
-\r
- s32 GlobalAmbientID;\r
- s32 MaterialAmbientID;\r
- s32 MaterialDiffuseID;\r
- s32 MaterialEmissiveID;\r
- s32 MaterialSpecularID;\r
- s32 MaterialShininessID;\r
-\r
- s32 FogEnableID;\r
- s32 FogTypeID;\r
- s32 FogColorID;\r
- s32 FogStartID;\r
- s32 FogEndID;\r
- s32 FogDensityID;\r
-\r
- s32 ThicknessID;\r
-\r
- bool LightEnable;\r
- SColorf GlobalAmbient;\r
- SColorf MaterialAmbient;\r
- SColorf MaterialDiffuse;\r
- SColorf MaterialEmissive;\r
- SColorf MaterialSpecular;\r
- f32 MaterialShininess;\r
-\r
- s32 FogEnable;\r
- s32 FogType;\r
- SColorf FogColor;\r
- f32 FogStart;\r
- f32 FogEnd;\r
- f32 FogDensity;\r
-\r
- f32 Thickness;\r
-};\r
-\r
-class COpenGL3MaterialSolidCB : public COpenGL3MaterialBaseCB\r
-{\r
-public:\r
- COpenGL3MaterialSolidCB();\r
-\r
- virtual void OnSetMaterial(const SMaterial& material);\r
- virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);\r
-\r
-protected:\r
- bool FirstUpdate;\r
-\r
- s32 TMatrix0ID;\r
- s32 AlphaRefID;\r
- s32 TextureUsage0ID;\r
- s32 TextureUnit0ID;\r
-\r
- f32 AlphaRef;\r
- s32 TextureUsage0;\r
- s32 TextureUnit0;\r
-};\r
-\r
-class COpenGL3MaterialSolid2CB : public COpenGL3MaterialBaseCB\r
-{\r
-public:\r
- COpenGL3MaterialSolid2CB();\r
-\r
- virtual void OnSetMaterial(const SMaterial& material);\r
- virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);\r
-\r
-protected:\r
- bool FirstUpdate;\r
-\r
- s32 TMatrix0ID;\r
- s32 TMatrix1ID;\r
- s32 TextureUsage0ID;\r
- s32 TextureUsage1ID;\r
- s32 TextureUnit0ID;\r
- s32 TextureUnit1ID;\r
-\r
- s32 TextureUsage0;\r
- s32 TextureUsage1;\r
- s32 TextureUnit0;\r
- s32 TextureUnit1;\r
-};\r
-\r
-class COpenGL3MaterialLightmapCB : public COpenGL3MaterialBaseCB\r
-{\r
-public:\r
- COpenGL3MaterialLightmapCB(float modulate);\r
-\r
- virtual void OnSetMaterial(const SMaterial& material);\r
- virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);\r
-\r
-protected:\r
- bool FirstUpdate;\r
-\r
- s32 TMatrix0ID;\r
- s32 TMatrix1ID;\r
- s32 ModulateID;\r
- s32 TextureUsage0ID;\r
- s32 TextureUsage1ID;\r
- s32 TextureUnit0ID;\r
- s32 TextureUnit1ID;\r
-\r
- f32 Modulate;\r
- s32 TextureUsage0;\r
- s32 TextureUsage1;\r
- s32 TextureUnit0;\r
- s32 TextureUnit1;\r
-};\r
-\r
-class COpenGL3MaterialReflectionCB : public COpenGL3MaterialBaseCB\r
-{\r
-public:\r
- COpenGL3MaterialReflectionCB();\r
-\r
- virtual void OnSetMaterial(const SMaterial& material);\r
- virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);\r
-\r
-protected:\r
- bool FirstUpdate;\r
-\r
- s32 TMatrix0ID;\r
- s32 TextureUsage0ID;\r
- s32 TextureUsage1ID;\r
- s32 TextureUnit0ID;\r
- s32 TextureUnit1ID;\r
-\r
- s32 TextureUsage0;\r
- s32 TextureUsage1;\r
- s32 TextureUnit0;\r
- s32 TextureUnit1;\r
-};\r
-\r
-class COpenGL3MaterialOneTextureBlendCB : public COpenGL3MaterialBaseCB\r
-{\r
-public:\r
- COpenGL3MaterialOneTextureBlendCB();\r
-\r
- virtual void OnSetMaterial(const SMaterial& material);\r
- virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);\r
-\r
-protected:\r
- bool FirstUpdate;\r
-\r
- s32 TMatrix0ID;\r
- s32 BlendTypeID;\r
- s32 TextureUsage0ID;\r
- s32 TextureUnit0ID;\r
-\r
- s32 BlendType;\r
- s32 TextureUsage0;\r
- s32 TextureUnit0;\r
-};\r
-\r
-}\r
-}\r
+// Copyright (C) 2014 Patryk Nadrowski
+// This file is part of the "Irrlicht Engine".
+// For conditions of distribution and use, see copyright notice in Irrlicht.h
+
+#pragma once
+
+#include "IShaderConstantSetCallBack.h"
+#include "IMaterialRendererServices.h"
+
+namespace irr
+{
+namespace video
+{
+
+class COpenGL3MaterialBaseCB : public IShaderConstantSetCallBack
+{
+public:
+ COpenGL3MaterialBaseCB();
+
+ virtual void OnSetMaterial(const SMaterial& material);
+ virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
+
+protected:
+ bool FirstUpdateBase;
+
+ s32 WVPMatrixID;
+ s32 WVMatrixID;
+ s32 NMatrixID;
+
+ s32 GlobalAmbientID;
+ s32 MaterialAmbientID;
+ s32 MaterialDiffuseID;
+ s32 MaterialEmissiveID;
+ s32 MaterialSpecularID;
+ s32 MaterialShininessID;
+
+ s32 FogEnableID;
+ s32 FogTypeID;
+ s32 FogColorID;
+ s32 FogStartID;
+ s32 FogEndID;
+ s32 FogDensityID;
+
+ s32 ThicknessID;
+
+ bool LightEnable;
+ SColorf GlobalAmbient;
+ SColorf MaterialAmbient;
+ SColorf MaterialDiffuse;
+ SColorf MaterialEmissive;
+ SColorf MaterialSpecular;
+ f32 MaterialShininess;
+
+ s32 FogEnable;
+ s32 FogType;
+ SColorf FogColor;
+ f32 FogStart;
+ f32 FogEnd;
+ f32 FogDensity;
+
+ f32 Thickness;
+};
+
+class COpenGL3MaterialSolidCB : public COpenGL3MaterialBaseCB
+{
+public:
+ COpenGL3MaterialSolidCB();
+
+ virtual void OnSetMaterial(const SMaterial& material);
+ virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
+
+protected:
+ bool FirstUpdate;
+
+ s32 TMatrix0ID;
+ s32 AlphaRefID;
+ s32 TextureUsage0ID;
+ s32 TextureUnit0ID;
+
+ f32 AlphaRef;
+ s32 TextureUsage0;
+ s32 TextureUnit0;
+};
+
+class COpenGL3MaterialSolid2CB : public COpenGL3MaterialBaseCB
+{
+public:
+ COpenGL3MaterialSolid2CB();
+
+ virtual void OnSetMaterial(const SMaterial& material);
+ virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
+
+protected:
+ bool FirstUpdate;
+
+ s32 TMatrix0ID;
+ s32 TMatrix1ID;
+ s32 TextureUsage0ID;
+ s32 TextureUsage1ID;
+ s32 TextureUnit0ID;
+ s32 TextureUnit1ID;
+
+ s32 TextureUsage0;
+ s32 TextureUsage1;
+ s32 TextureUnit0;
+ s32 TextureUnit1;
+};
+
+class COpenGL3MaterialLightmapCB : public COpenGL3MaterialBaseCB
+{
+public:
+ COpenGL3MaterialLightmapCB(float modulate);
+
+ virtual void OnSetMaterial(const SMaterial& material);
+ virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
+
+protected:
+ bool FirstUpdate;
+
+ s32 TMatrix0ID;
+ s32 TMatrix1ID;
+ s32 ModulateID;
+ s32 TextureUsage0ID;
+ s32 TextureUsage1ID;
+ s32 TextureUnit0ID;
+ s32 TextureUnit1ID;
+
+ f32 Modulate;
+ s32 TextureUsage0;
+ s32 TextureUsage1;
+ s32 TextureUnit0;
+ s32 TextureUnit1;
+};
+
+class COpenGL3MaterialReflectionCB : public COpenGL3MaterialBaseCB
+{
+public:
+ COpenGL3MaterialReflectionCB();
+
+ virtual void OnSetMaterial(const SMaterial& material);
+ virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
+
+protected:
+ bool FirstUpdate;
+
+ s32 TMatrix0ID;
+ s32 TextureUsage0ID;
+ s32 TextureUsage1ID;
+ s32 TextureUnit0ID;
+ s32 TextureUnit1ID;
+
+ s32 TextureUsage0;
+ s32 TextureUsage1;
+ s32 TextureUnit0;
+ s32 TextureUnit1;
+};
+
+class COpenGL3MaterialOneTextureBlendCB : public COpenGL3MaterialBaseCB
+{
+public:
+ COpenGL3MaterialOneTextureBlendCB();
+
+ virtual void OnSetMaterial(const SMaterial& material);
+ virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData);
+
+protected:
+ bool FirstUpdate;
+
+ s32 TMatrix0ID;
+ s32 BlendTypeID;
+ s32 TextureUsage0ID;
+ s32 TextureUnit0ID;
+
+ s32 BlendType;
+ s32 TextureUsage0;
+ s32 TextureUnit0;
+};
+
+}
+}