My Project
ModelRenderPass.h
1 #pragma once
2 
3 namespace ParaEngine
4 {
5  class CParaXModel;
6  class CParameterBlock;
7  struct SceneState;
8 
10  {
11  public:
13  public:
15  uint16 indexStart, indexCount;
16  union {
17  struct {
18  uint16 vertexStart, vertexEnd;
19  };
22  };
23 
24  //TextureID texture, texture2;
25  int32 tex;
26  union{
27  float m_fStripLength;
28  float m_fCategoryID;
29  float m_fReserved0;
30  };
31 
32 
33  int16 texanim, color, opacity, blendmode;
34  int32 order;
35  int32 geoset;
36 
37  // TODO: bit align to DWORD
38  bool usetex2 : 1, useenvmap : 1, cull : 1, trans : 1, unlit : 1, nozwrite : 1, swrap : 1, twrap : 1, force_local_tranparency : 1, skinningAni : 1, is_rigid_body : 1, disable_physics : 1, force_physics : 1, has_category_id : 1;
39  DWORD: 0;// Force alignment to next boundary.
40 
42  bool init(CParaXModel *m, SceneState* pSceneState);
43  void deinit();
44 
46  bool init_FX(CParaXModel *m, SceneState* pSceneState, CParameterBlock* pMaterialParams = NULL);
47  void deinit_FX(SceneState* pSceneState, CParameterBlock* pMaterialParams = NULL);
48 
50  bool init_bmax_FX(CParaXModel *m, SceneState* pSceneState, CParameterBlock* pMaterialParams = NULL);
51  void deinit_bmax_FX(SceneState* pSceneState, CParameterBlock* pMaterialParams = NULL);
52 
54  bool IsAlphaBlended();
55 
57  int GetPhysicsGroup();
58 
59  bool hasPhysics();
60 
61  bool operator< (const ModelRenderPass &m) const
62  {
63  //return !trans;
64  if (order < m.order) return true;
65  else if (order > m.order) return false;
66  else return blendmode == m.blendmode ? (m_fReserved0 < m.m_fReserved0) : blendmode < m.blendmode;
67  }
68 
69  inline bool operator == (const ModelRenderPass &m) const
70  {
71  return tex == m.tex && blendmode == m.blendmode && color == m.color;
72  }
73 
74  void SetStartIndex(int32 nIndex);
75 
76  int32 GetStartIndex();
77 
78  int32 GetVertexStart(CParaXModel *m);
79 
81  int32 GetCategoryId();
82  void SetCategoryId(int32 nCategoryID);
83  };
84 }
bool init_bmax_FX(CParaXModel *m, SceneState *pSceneState, CParameterBlock *pMaterialParams=NULL)
for programmable pipeline
Definition: ModelRenderPass.cpp:25
It&#39;s used as parameter to Draw method of each scene object.
Definition: SceneState.h:284
uint16 indexStart
Fix LiXizhi 2010.1.14.
Definition: ModelRenderPass.h:15
different physics engine has different winding order.
Definition: EventBinding.h:32
int32 m_nIndexStart
if indexStart is 0xffff, then m_nIndexStart stores the index offset in 32 bits.
Definition: ModelRenderPass.h:21
bool init_FX(CParaXModel *m, SceneState *pSceneState, CParameterBlock *pMaterialParams=NULL)
for programmable pipeline
Definition: ModelRenderPass.cpp:72
int GetPhysicsGroup()
get the physics group.
Definition: ModelRenderPass.cpp:592
int32 GetCategoryId()
used in some shader parameter
Definition: ModelRenderPass.cpp:619
ParaX model is the model file for character animation, etc in the game world.
Definition: ParaXModel.h:30
bool init(CParaXModel *m, SceneState *pSceneState)
for fixed function pipeline
Definition: ModelRenderPass.cpp:344
Definition: ModelRenderPass.h:9
bool IsAlphaBlended()
for deferred shading, we will render alpha blended blocks after final effect.
Definition: ModelRenderPass.cpp:586
a list of CParameter{name, value} pairs of anything.
Definition: ParameterBlock.h:108