EvilEngine/PIPT: Difference between revisions

Battlepedia>Igorseabra4
No edit summary
Battlepedia>Seil
Line 6:
==Format==
The pipe information contains additional material information for level objects. 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:
 
<source lang=cpp>
struct xModelPipeInfo
{
unsigned int ModelHashID;
unsigned int SubObjectBits;
unsigned int PipeFlags;
| 0x0C || byte ||unsigned int unknown; ||// Onlyonly present in Movie.
};
</source>
 
{| class="wikitable"
! Offset !! TypeVariable !! Description !! Notes
|-
| 0x00 || int'''ModelHashID''' || [[AssetIDMODL]] || [[MODL]]ID
|-
| 0x04 || '''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.
| 0x04 || int || unknown || Usually -1; might be mesh index in the model?
 
For example, if a model has 4 atomics:
* 0x1 is the on/off state for the 4th atomic
* 0x2 is the on/off state for the 3rd atomic
* 0x4 is the on/off state for the 2nd atomic
* 0x8 is the on/off state for the 1st atomic
|-
| 0x08 || '''PipeFlags''' || Bitfield of various rendering flags. The layout is the following (left side is most significant, right side is least significant):
| 0x08 || byte || Related to visibility? ||
<pre>
AAAA AAAA BBBB CCCD EEEE FFFF GGHH IIJJ
</pre>
* A - Alpha compare value (0-255). Atomics with transparent textures use this value to filter out pixels below a certain alpha threshold. Only pixels with an alpha > this value will be rendered. Set this to 0 if you want all pixels to be rendered.
* B - Unknown (0-15)
* C - Unknown (0-7)
* D - Ignore Fog (0-1). If set, atomics will not be rendered with fog.
* E - Destination Blend (0-15). Destination [[#RwBlendFunction|RwBlendFunction]] for atomics.
* F - Source Blend (0-15). Source [[#RwBlendFunction|RwBlendFunction]] for atomics.
* G - Lighting Mode (0-3).
** 0 - Unknown
** 1 - Disabled. Atomics will not be rendered with lighting.
** 2 - Unknown
** 3 - Unknown
* H - Cull Mode (0-3).
** 0 - Unknown
** 1 - None. Atomics will be rendered with no front or back face culling.
** 2 - Back. Atomics will be rendered with back face culling.
** 3 - Dual. Atomics will be rendered once with front face culling, then once with back face culling.
* I - Z-Write Mode (0-3).
** 0 - Enabled. Atomics will be rendered with z-write enabled.
** 1 - Disabled. Atomics will be rendered with z-write disabled.
** 2 - Dual. Atomics will be rendered once with z-write disabled, then once with z-write enabled.
** 3 - Unknown
* J - Unknown
|-
| 0x090x0C || byteunknown || CullingOnly ||present in Movie.
|-
| 0x0A || byte || Destination/Source Blend || When one of the digits is set to 0, their default factors will be used instead.
|-
| 0x0B || byte || unknown ||
|-
| 0x0C || byte || unknown || Only present in Movie.
|-
| 0x0D || byte || unknown || Only present in Movie.
|-
| 0x0E || byte || unknown || Only present in Movie.
|-
| 0x0F || byte || unknown || Only present in Movie.
|}
 
===RwBlendFunction===
Note: this applies to big endian (GameCube) only. The 4 bytes are reversed in little endian.
* 0x020 - OneN/A
 
* 1 - Zero
===Blend factor types===
* 2 - One
* 0x00 - Source Alpha/Inverse Source Alpha
* 0x013 - ZeroSource Color
* 0x004 - Source Alpha/Inverse Source AlphaColor
* 0x02 - One
* 0x035 - Source ColorAlpha
* 0x046 - Inverse Source ColorAlpha
* 0x057 - SourceDestination Alpha
* 0x068 - Inverse SourceDestination Alpha
* 0x079 - Destination AlphaColor
* 0x0810 - Inverse Destination AlphaColor
* 0x0B11 - Source Alpha Saturated
* 0x09 - Destination Color
* 0x0A - Inverse Destination Color
* 0x0B - Source Alpha Saturated
 
===Movie Model Asset ID===
Anonymous user