Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-01-06 06:46:54 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-01-06 06:46:54 +0300
commit2e6d57618232b8b4ce8e5afe84fd278041cbbbfe (patch)
treec0f05e6b59aada420dd600f1138e9149b97d9e9d /source/gameengine/Ketsji/KX_BlenderMaterial.h
parentef520a8cc9e863aa234be0ee60d1038e7ec8fc44 (diff)
Sorry to break the cvs-closed status, so if you really need to make a new 2.40 build, just disable the game engine if it doesn't compile for a platform. Again, sorry if this breaks non-windows platforms, but I hope people help to get this amazing fix working for all platforms. Armature-fixing contribution from Snailrose. Also lots of cool things from Snailrose and Lagan.
Armatures are back Split screen Double sided lightning Ambient lighting Alpha test Material IPO support (one per object atm) Blender materials GLSL shaders - Python access Up to three texture samplers from the material panel ( 2D & Cube map ) Python access to a second set of uv coordinates See http://www.elysiun.com/forum/viewtopic.php?t=58057
Diffstat (limited to 'source/gameengine/Ketsji/KX_BlenderMaterial.h')
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
new file mode 100644
index 00000000000..012bbef2795
--- /dev/null
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -0,0 +1,108 @@
+#ifndef __KX_BLENDER_MATERIAL_H__
+#define __KX_BLENDER_MATERIAL_H__
+
+#include <vector>
+
+
+#include "RAS_IPolygonMaterial.h"
+#include "BL_Material.h"
+#include "BL_Texture.h"
+#include "BL_Shader.h"
+
+#include "PyObjectPlus.h"
+
+#include "MT_Vector3.h"
+#include "MT_Vector4.h"
+
+struct TFace;
+class KX_Scene;
+
+class KX_BlenderMaterial : public PyObjectPlus, public RAS_IPolyMaterial
+{
+ Py_Header;
+public:
+ // --------------------------------
+ KX_BlenderMaterial(
+ class KX_Scene* scene, // light/obj list
+ BL_Material* mat,
+ bool skin,
+ int lightlayer,
+ void* clientobject,
+ PyTypeObject* T=&Type
+ );
+
+ virtual ~KX_BlenderMaterial();
+
+ // --------------------------------
+ virtual TCachingInfo GetCachingInfo(void) const
+ {
+ // --
+ return (void*) this;
+ }
+
+ // --------------------------------
+ virtual bool Activate(
+ RAS_IRasterizer* rasty,
+ TCachingInfo& cachingInfo) const;
+
+ void ActivateMat(
+ RAS_IRasterizer* rasty,
+ TCachingInfo& cachingInfo)const;
+
+ void ActivatShaders(
+ RAS_IRasterizer* rasty,
+ TCachingInfo& cachingInfo)const;
+ // --------------------------------
+
+ TFace* GetTFace(void) const;
+
+ // for ipos
+ void UpdateIPO(
+ MT_Vector4 rgba, MT_Vector3 specrgb,
+ MT_Scalar hard, MT_Scalar spec,
+ MT_Scalar ref, MT_Scalar emit, MT_Scalar alpha
+ );
+
+ // --------------------------------
+ virtual PyObject* _getattr(const STR_String& attr);
+ virtual int _setattr(const STR_String& attr, PyObject *pyvalue);
+
+ KX_PYMETHOD_DOC( KX_BlenderMaterial, getShader );
+ KX_PYMETHOD_DOC( KX_BlenderMaterial, useShader );
+ KX_PYMETHOD_DOC( KX_BlenderMaterial, getMaterialIndex );
+ KX_PYMETHOD_DOC( KX_BlenderMaterial, getTexture );
+ KX_PYMETHOD_DOC( KX_BlenderMaterial, setTexture );
+
+ // --------------------------------
+ // pre calculate to avoid pops/lag at startup
+ virtual void OnConstruction( );
+
+private:
+ BL_Material* mMaterial;
+ BL_Shader* mShader;
+ bool mUseShader;
+ KX_Scene* mScene;
+ BL_Texture mTextures[MAXTEX]; // texture array
+
+ // message centers
+ void setTexData( bool enable );
+ void setShaderData( bool enable );
+
+ void setTextureEnvironment( int textureIndex );
+ void setEnvMap( bool val, bool cube=false);
+ void setTexMatrixData(int i);
+ bool setDefaultBlending();
+ bool setBlending( int ind, bool enable=false );
+ void setObjectMatrixData(int i);
+
+ // cleanup stuff
+ void DisableTexData();
+ void OnExit();
+
+ //void DisableNonEnabled();
+ // --
+ mutable int mPass;
+};
+
+
+#endif