SHARE
TWEET

Untitled

a guest Apr 26th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Ghoul 2 formats
  2.  
  3. ## Model format
  4.  
  5. GLM is the Ghoul2 model format. Meshes/surfaces in the model are arranged in a hierarchy, starting from the torso going outwards, to make it easy to not render whole parts of the model, e.g. limbs.
  6.  
  7. LODs are built into the model format.
  8.  
  9. ### Header
  10.  
  11. type              | name             | description
  12. ------------------|------------------|-------------
  13. `int32`           | ident            | Always MD3
  14. `int32`           | version          | Always 2
  15. `char[MAX_QPATH]` | name             | Full model path
  16. `char[MAX_QPATH]` | animName         | Animation file name
  17. `int32`           | animIndex        | Unused
  18. `int32`           | numBones         | Number of bones
  19. `int32`           | numLODs          | Number of LODs
  20. `int32`           | ofsLODs          | Byte offset from start of file to the beginning of the LOD data
  21. `int32`           | numSurfaces      | Number of surfaces
  22. `int32`           | ofsSurfHierarchy | Byte offset from start of file to beginning of surface hierarchy data
  23. `int32`           | ofsEnd           | Byte offset from start of file to end of file
  24.  
  25. ### Surface hierarchy
  26.  
  27. At the start of `fileBase + header.ofsSurfHierarchy` is the surface hierarchy data. The data in this section is split into its own header and the list of surface data.
  28.  
  29. The header is a list of byte offsets of size `header.numSurfaces`. Following this is the list of surface data:
  30.  
  31. type          | name          | description
  32. --------------|---------------|---------------------------
  33. `char[MAX_QPATH]` | name       | Surface name
  34. `uint32`          | flags      | Flags
  35. `char[MAX_QPATH]` | shader     | Shader path
  36. `int32`           | shaderIndex | Unused
  37. `int32`           | parentIndex | Index of parent surface, or -1 if this is the root surface
  38. `int32`           | numChildren | Number of child surfaces
  39. `int32[numChildren]` | childIndexes | Variable-sized list of child surface indexes
  40.  
  41. ### LOD models
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top