131static unsigned Define_FVF(
MeshModelClass* mmc,
bool enable_lighting)
140 unsigned fvf=D3DFVF_XYZ;
148 fvf|=D3DFVF_SPECULAR;
151 switch (tex_coord_count) {
155 case 1: fvf|=D3DFVF_TEX1;
break;
156 case 2: fvf|=D3DFVF_TEX2;
break;
157 case 3: fvf|=D3DFVF_TEX3;
break;
158 case 4: fvf|=D3DFVF_TEX4;
break;
159 case 5: fvf|=D3DFVF_TEX5;
break;
160 case 6: fvf|=D3DFVF_TEX6;
break;
161 case 7: fvf|=D3DFVF_TEX7;
break;
162 case 8: fvf|=D3DFVF_TEX8;
break;
184 unsigned fvf=D3DFVF_XYZ;
186 int tex_coord_count=0;
197 switch (tex_coord_count) {
201 case 1: fvf|=D3DFVF_TEX1;
break;
202 case 2: fvf|=D3DFVF_TEX2;
break;
203 case 3: fvf|=D3DFVF_TEX3;
break;
204 case 4: fvf|=D3DFVF_TEX4;
break;
205 case 5: fvf|=D3DFVF_TEX5;
break;
206 case 6: fvf|=D3DFVF_TEX6;
break;
207 case 7: fvf|=D3DFVF_TEX7;
break;
208 case 8: fvf|=D3DFVF_TEX8;
break;
228 int active_polygon_count=0;
229 bool arrays_used=
false;
230 for (pass=0;pass<model->
Get_Pass_Count() && !arrays_used;++pass) {
247 active_polygon_count=0;
277 active_polygon_count++;
300 legacy_shader=model->
Get_Shader(first_polygon,pass);
318 texture=model->
Get_Texture(first_polygon,pass,stage);
345 for (
int uvi=0;uvi<uv_array_count;++uvi) {
395#if (!OPTIMIZE_VNORM_RAM)
411 legacy_shader->
Set_FVF(Define_FVF(
this,
true));
533 mdlnorms[i].
Set(norm.
X,norm.
Y,norm.
Z);
781 unsigned short tri[3];
797 sizeof(
unsigned short)*3
798 )!=
sizeof(
unsigned short)*3
@ W3D_CHUNK_SHDSUBMESH_SHADER
@ W3D_CHUNK_SHDSUBMESH_VERTEX_SHADE_INDICES
@ W3D_CHUNK_SHDSUBMESH_TANGENT_BASIS_S
@ W3D_CHUNK_SHDSUBMESH_VERTEX_NORMALS
@ W3D_CHUNK_SHDSUBMESH_TRIANGLES
@ W3D_CHUNK_SHDSUBMESH_TANGENT_BASIS_SxT
@ W3D_CHUNK_SHDSUBMESH_VERTICES
@ W3D_CHUNK_SHDSUBMESH_UV0
@ W3D_CHUNK_SHDSUBMESH_UV1
@ W3D_CHUNK_SHDSUBMESH_VERTEX_INFLUENCES
@ W3D_CHUNK_SHDSUBMESH_TANGENT_BASIS_T
uint32 Read(void *buf, uint32 nbytes)
uint32 * get_shade_indices(bool create=true)
ShareBufferClass< uint8 > * PolySurfaceType
ShareBufferClass< Vector3 > * Vertex
const Vector3 * Get_Vertex_Normal_Array(void)
int Get_Vertex_Count(void) const
TriIndex * get_polys(void)
const TriIndex * Get_Polygon_Array(void)
ShareBufferClass< Vector3 > * VertexNorm
MeshGeometryClass & operator=(const MeshGeometryClass &that)
uint16 * get_bone_links(bool create=true)
ShareBufferClass< TriIndex > * Poly
void Set_Flag(FlagsType flag, bool onoff)
int Get_Polygon_Count(void) const
void get_deformed_vertices(Vector3 *dst_vert, Vector3 *dst_norm, const HTreeClass *htree)
Vector3 BoundSphereCenter
int Get_Flag(FlagsType flag)
Vector3 * get_vert_normals(void)
TextureClass * Peek_Texture(int pidx, int pass=0, int stage=0) const
bool Has_Shader_Array(int pass) const
unsigned * Get_DCG_Array(int pass)
unsigned * Get_Color_Array(int array_index, bool create=true)
bool Needs_Vertex_Normals(void)
const Vector2 * Get_UV_Array_By_Index(int index)
VertexMaterialClass * Peek_Material(int vidx, int pass=0) const
bool Has_Material_Array(int pass) const
int Get_Pass_Count(void) const
TextureClass * Get_Texture(int pidx, int pass=0, int stage=0) const
VertexMaterialClass * Get_Single_Material(int pass=0) const
bool Has_Texture_Array(int pass, int stage) const
TextureClass * Get_Single_Texture(int pass=0, int stage=0) const
VertexMaterialClass * Get_Material(int vidx, int pass=0) const
int Get_UV_Array_Count(void)
ShaderClass Get_Shader(int pidx, int pass=0) const
ShaderClass Get_Single_Shader(int pass=0) const
WWINLINE void Release_Ref(void) const
static ShaderClass _PresetOpaqueShader
virtual bool Is_Opaque(void) const
void Set_FVF(unsigned fvf)
virtual ShdInterfaceClass * Create(void) const =0
static void Load_Shader(ChunkLoadClass &cload, ShdDefClass **shddef)
virtual ShdInterfaceClass * Create() const
WW3DErrorType read_uv0(ChunkLoadClass &cload)
WW3DErrorType read_vertex_influences(ChunkLoadClass &cload)
ShareBufferClass< Vector3 > * S
WW3DErrorType read_tangent_basis_s(ChunkLoadClass &cload)
WW3DErrorType read_shader(ChunkLoadClass &cload)
void Init_From_Legacy_Mesh_Model(MeshModelClass *model, int first_polygon)
ShareBufferClass< Vector2 > * UV[MAX_TEXTURE_STAGES]
ShareBufferClass< Vector3 > * SxT
const Vector2 * Get_UV_Array(unsigned stage)
WW3DErrorType read_chunks(ChunkLoadClass &cload)
WW3DErrorType Load_W3D(ChunkLoadClass &cload)
ShareBufferClass< unsigned > * Diffuse
WW3DErrorType read_vertex_shade_indices(ChunkLoadClass &cload)
const unsigned * Get_Diffuse_Array()
WW3DErrorType read_tangent_basis_t(ChunkLoadClass &cload)
WW3DErrorType read_triangles(ChunkLoadClass &cload)
WW3DErrorType read_uv1(ChunkLoadClass &cload)
void Get_Deformed_Vertices(Vector3 *dst_vert, Vector3 *dst_norm, const HTreeClass *htree)
ShdSubMeshClass & operator=(const ShdSubMeshClass &that)
ShdInterfaceClass * Shader
WW3DErrorType read_vertices(ChunkLoadClass &cload)
WW3DErrorType read_vertex_normals(ChunkLoadClass &cload)
WW3DErrorType read_tangent_basis_sxt(ChunkLoadClass &cload)
ShareBufferClass< Vector3 > * T
WWINLINE void Set(float x, float y, float z)
static bool Is_Sorting_Enabled(void)
const unsigned dynamic_fvf_type
const unsigned MAX_TEXTURE_STAGES
#define REF_PTR_RELEASE(x)
#define REF_PTR_SET(dst, src)
@ SHDDEF_CLASSID_LEGACYW3D