EvilEngine/PIPT: Difference between revisions

new movie format
No edit summary
(new movie format)
 
(3 intermediate revisions by 2 users not shown)
Line 4:
{{#vardefine:type|[[Binary]]}}<nowiki/>
{{#vardefine:basetype|}}<nowiki/>
{{#vardefine:games|BFBB TSSM Incredibles ROTU RatProto}}<nowiki/>
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Core/x/xModel.h xModel.h]}}<nowiki/>
{{#vardefine:image|}}<nowiki/>
Line 15:
The file starts with an int which defines the amount of entries, then each entry has the following layout, being 0x0C bytes long in BFBB and 0x10 in Movie:
 
'''Battle for Bikini Bottom'''
<source lang=cpp>
struct xModelPipeInfo
Line 21 ⟶ 22:
unsigned int SubObjectBits;
unsigned int PipeFlags;
};
unsigned int unknown; // only present in Movie
</source>
'''The SpongeBob SquarePants Movie - Ratatouille Prototype'''
<source lang=cpp>
struct xModelPipeTable
{
unsigned int ModelHashID;
unsigned int SubObjectBits;
xModelPipe Pipe;
};
 
struct xModelPipe
{
unsigned int Flags;
unsigned char Layer;
unsigned char AlphaDiscard;
unsigned short PipePad;
};
</source>
 
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x00 || uint32 || '''ModelHashID''' || [[MODL]] ID
|-
| 0x04 || uint32 || '''SubObjectBits''' || Specifies which RW atomics in the model to apply this pipe info entry to. Each bit is an on/off state for an atomic, starting with the last atomic as the least significant bit (0x1) and ending with the first atomic as the most significant bit.
 
For example, if a model has 4 atomics:
Line 40 ⟶ 57:
When a pipe entry should be applied to all atomics, this is usually set to 0xFFFFFFFF.
|-
| 0x08 || uint32 || '''PipeFlags [Flags]''' || Bitfield of various rendering flags. The layout is the following (left side is most significant, right side is least significant):
<pre>
AAAA AAAA BBBB CCCD EEEE FFFF GGHH IIJJ
Line 51 ⟶ 68:
* F - Source Blend (0-15). Source [[#RwBlendFunction|RwBlendFunction]] for atomics.
* G - Lighting Mode (0-3).
** 0 - UnknownLightKit only
** 1 - Prelight only
** 1 - Disabled. Atomics will not be rendered with lighting.
** 2 - UnknownLightKit and Prelight
** 3 - Unknown
* H - Cull Mode (0-3).
Line 67 ⟶ 84:
* J - Unknown
|-
| 0x0C || uint8 || '''Layer''' || [[#LayerType|LayerType list]]. Specifies when to draw a transparent object
| 0x0C || unknown || Only present in Movie.
|-
| 0x0D || uint8 || '''AlphaDiscard''' ||
|-
| 0x0E || uint16 || '''PipePad''' ||
|}
 
Line 83 ⟶ 104:
* 10 - Inverse Destination Color
* 11 - Source Alpha Saturated
 
===LayerType===
<pre>
00 - FIRST Draw first
01 - PREPICKUP Draw before pickups
02 - POSTPICKUP Draw just after pickups
03 - PREOOB Draw before the OOB object
04 - POSTOOB Draw just after the OOB object
05 - PRECUTSCENE Draw before cutscene objects
06 - POSTCUTSCENE Draw just after cutscene objects
07 - PRENPC Draw before NPC objects
08 - POSTNPC Draw just after NPC objects
09 - PRESHADOW Draw before shadows
10 - POSTSHADOW Draw just after shadows
11 - PREFX Draw before lightning, glares, etc.
12 - POSTFX Draw after glares, etc.
13 - PREPARTICLES Draw before particles
14 - POSTPARTICLES Draw after particles
15 - PRENORMAL4 Draw before normal transparencies (4 stages)
16 - PRENORMAL3 Draw before normal transparencies (3 stages)
17 - PRENORMAL2 Draw before normal transparencies (2 stages)
18 - PRENORMAL Draw before normal transparencies
19 - NORMAL Draw in the normal position
20 - POSTNORMAL Draw directly after transparencies
21 - POSTNORMAL2 Draw directly after transparencies (2 stages)
22 - POSTNORMAL3 Draw directly after transparencies (3 stages)
23 - POSTNORMAL4 Draw directly after transparencies (4 stages)
24 - PREPTANK Draw before ptank effects
25 - POSTPTANK Draw after ptank effects
26 - PREDECAL Draw before decals
27 - POSTDECAL Draw after decals
28 - PRELASTFX Draw before lasers, etc.
29 - POSTLASTFX Draw directly after lasers, etc.
30 - PRELAST Draw before last
31 - LAST Draw last
</pre>
 
===Movie Model Asset ID===
2,079

edits