@@ -309,6 +309,17 @@ June 5, 2001
309
309
(gth) Adding line rendering options to particle systems today. This involves a
310
310
new line-properties chunk and a RenderMode variable added to the InfoV2 struct.
311
311
312
+ TheSuperHackers @forwardport:
313
+ April 5, 2025
314
+
315
+ Added W3D_CHUNK_FX_SHADERS and subchunks, which were added in BFME2. These
316
+ chunks are used to define usage of a specific shader and pass params.
317
+
318
+ April 21, 2025
319
+
320
+ Added W3D_CHUNK_VERTEX_TANGENT and W3D_CHUNK_VERTEX_BINORMAL chunks. These are used to define
321
+ normal mapping information for a mesh. They were added in BFME2.
322
+
312
323
********************************************************************************/
313
324
314
325
@@ -374,20 +385,28 @@ enum {
374
385
W3D_CHUNK_DCG = 0x0000003B , // per-vertex diffuse color values (array of W3dRGBAStruct's)
375
386
W3D_CHUNK_DIG = 0x0000003C , // per-vertex diffuse illumination values (array of W3dRGBStruct's)
376
387
W3D_CHUNK_SCG = 0x0000003E , // per-vertex specular color values (array of W3dRGBStruct's)
388
+ W3D_CHUNK_FXSHADER_IDS = 0x0000003F , // single or per-tri array of uint32 fx shader indices (check chunk size)
377
389
378
390
W3D_CHUNK_TEXTURE_STAGE = 0x00000048 , // wrapper around a texture stage.
379
391
W3D_CHUNK_TEXTURE_IDS = 0x00000049 , // single or per-tri array of uint32 texture indices (check chunk size)
380
392
W3D_CHUNK_STAGE_TEXCOORDS = 0x0000004A , // per-vertex texture coordinates (array of W3dTexCoordStruct's)
381
393
W3D_CHUNK_PER_FACE_TEXCOORD_IDS = 0x0000004B , // indices to W3D_CHUNK_STAGE_TEXCOORDS, (array of Vector3i)
382
394
383
-
395
+ W3D_CHUNK_FX_SHADERS = 0x00000050 , // define an array of shaders to be used in the mesh
396
+ W3D_CHUNK_FX_SHADER = 0x00000051 , // a single shader entry
397
+ W3D_CHUNK_FX_SHADER_INFO = 0x00000052 , // information about the shader to be used (W3dFXShaderInfoStruct)
398
+ W3D_CHUNK_FX_SHADER_CONSTANT = 0x00000053 , // contains a constant name and value for the shader
399
+
384
400
W3D_CHUNK_DEFORM = 0x00000058 , // mesh deform or 'damage' information.
385
401
W3D_CHUNK_DEFORM_SET = 0x00000059 , // set of deform information
386
402
W3D_CHUNK_DEFORM_KEYFRAME = 0x0000005A , // a keyframe of deform information in the set
387
403
W3D_CHUNK_DEFORM_DATA = 0x0000005B , // deform information about a single vertex
388
404
389
405
W3D_CHUNK_PS2_SHADERS = 0x00000080 , // Shader info specific to the Playstation 2.
390
-
406
+
407
+ W3D_CHUNK_VERTEX_TANGENTS = 0x00000060 , // array of tangents (array of W3dVectorStruct's)
408
+ W3D_CHUNK_VERTEX_BINORMALS = 0x00000061 , // array of binormals (array of W3dVectorStruct's)
409
+
391
410
W3D_CHUNK_AABTREE = 0x00000090 , // Axis-Aligned Box Tree for hierarchical polygon culling
392
411
W3D_CHUNK_AABTREE_HEADER , // catalog of the contents of the AABTree
393
412
W3D_CHUNK_AABTREE_POLYINDICES , // array of uint32 polygon indices with count=mesh.PolyCount
@@ -922,6 +941,24 @@ struct W3dPS2ShaderStruct
922
941
uint8 pad [3 ];
923
942
};
924
943
944
+ struct W3dFXShaderInfoStruct
945
+ {
946
+ char ShaderName [W3D_NAME_LEN * 2 ];
947
+ uint8 Technique ;
948
+ uint8 Pad [3 ];
949
+ };
950
+
951
+ typedef enum
952
+ {
953
+ CONSTANT_TYPE_TEXTURE = 1 ,
954
+ CONSTANT_TYPE_FLOAT1 = 2 ,
955
+ CONSTANT_TYPE_FLOAT2 = 3 ,
956
+ CONSTANT_TYPE_FLOAT3 = 4 ,
957
+ CONSTANT_TYPE_FLOAT4 = 5 ,
958
+ CONSTANT_TYPE_INT = 6 ,
959
+ CONSTANT_TYPE_BOOL = 7
960
+ } W3D_FX_SHADER_CONSTANT_TYPES ;
961
+
925
962
inline void W3d_Shader_Reset (W3dShaderStruct * s ) {
926
963
s -> DepthCompare = W3DSHADER_DEPTHCOMPARE_PASS_LEQUAL ;
927
964
s -> DepthMask = W3DSHADER_DEPTHMASK_WRITE_ENABLE ;
0 commit comments