00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_IVIDEO_MATERIAL_H__
00020 #define __CS_IVIDEO_MATERIAL_H__
00021
00029 #include "csutil/scf.h"
00030
00032 #define CS_DEFMAT_DIFFUSE 0.7f
00033
00034 #define CS_DEFMAT_AMBIENT 0.0f
00035
00036 #define CS_DEFMAT_REFLECTION 0.0f
00037
00038 struct iEffectDefinition;
00039 struct iTextureHandle;
00040 struct csRGBpixel;
00041 struct csRGBcolor;
00042 struct iShader;
00043
00048 struct csTextureLayer
00049 {
00051 csRef<iTextureHandle> txt_handle;
00053 uint mode;
00055 float uscale, vscale;
00057 float ushift, vshift;
00058 };
00059
00060 SCF_VERSION (iMaterial, 0, 0, 6);
00061
00069 struct iMaterial : public iBase
00070 {
00071 #ifdef CS_USE_NEW_RENDERER
00072
00075 virtual void SetShader (iShader* shader) = 0;
00076
00080 virtual iShader* GetShader () = 0;
00081
00082 #endif
00083
00087 virtual void SetEffect (iEffectDefinition *ed) = 0;
00088
00092 virtual iEffectDefinition *GetEffect () = 0;
00093
00097 virtual iTextureHandle *GetTexture () = 0;
00098
00103 virtual int GetTextureLayerCount () = 0;
00104
00108 virtual csTextureLayer* GetTextureLayer (int idx) = 0;
00109
00114 virtual void GetFlatColor (csRGBpixel &oColor, bool useTextureMean=1) = 0;
00118 virtual void SetFlatColor (const csRGBcolor& col) = 0;
00119
00123 virtual void GetReflection (
00124 float &oDiffuse, float &oAmbient, float &oReflection) = 0;
00128 virtual void SetReflection (float oDiffuse, float oAmbient,
00129 float oReflection) = 0;
00130 };
00131
00132 SCF_VERSION (iMaterialHandle, 0, 0, 2);
00133
00138 struct iMaterialHandle : public iBase
00139 {
00140 #ifdef CS_USE_NEW_RENDERER
00141
00144 virtual iShader* GetShader () = 0;
00145 #endif
00146
00150 virtual iTextureHandle *GetTexture () = 0;
00151
00156 virtual void GetFlatColor (csRGBpixel &oColor) = 0;
00157
00161 virtual void GetReflection (float &oDiffuse, float &oAmbient,
00162 float &oReflection) = 0;
00163
00170 virtual void Prepare () = 0;
00171 };
00172
00175 #endif // __CS_IVIDEO_MATERIAL_H__