JPA (File Format): Difference between revisions
AwesomeTMC (talk | contribs) (Finish off documenting what I currently know) |
AwesomeTMC (talk | contribs) (More formatting...) |
||
Line 145: | Line 145: | ||
bool IsNoDrawChild = (flags >> 0x1C) & 0x01<br /> | bool IsNoDrawChild = (flags >> 0x1C) & 0x01<br /> | ||
|- | |- | ||
| 0x0C || UInt16 || Primary Color Data Offset. ColorFlags & 0x02 must equal | | 0x0C || UInt16 || Primary Color Data Offset. ColorFlags & 0x02 must equal 1 | ||
|- | |- | ||
| 0x0E || UInt16 || Environment Color Data Offset. ColorFlags & 0x08 must equal | | 0x0E || UInt16 || Environment Color Data Offset. ColorFlags & 0x08 must equal 1 | ||
|- | |- | ||
| 0x10 || Single || BaseSizeX | | 0x10 || Single || BaseSizeX | ||
Line 154: | Line 154: | ||
|- | |- | ||
| 0x18 || UInt16 || Blend Mode Flags: | | 0x18 || UInt16 || Blend Mode Flags: | ||
BlendMode = (blendFlags & 0x03). See [[JPA (File Format)#Blend Mode|Blend Mode]] | BlendMode = (blendFlags & 0x03). See [[JPA (File Format)#Blend Mode|Blend Mode]]<br/> | ||
SourceFactor = (blendFlags >> 2) & 0x0F. See [[JPA (File Format)#Blend Factor|Blend Factor]] | SourceFactor = (blendFlags >> 2) & 0x0F. See [[JPA (File Format)#Blend Factor|Blend Factor]]<br/> | ||
DestinationFactor = (blendFlags >> 6) & 0x0F. See [[JPA (File Format)#Blend Factor|Blend Factor]] | DestinationFactor = (blendFlags >> 6) & 0x0F. See [[JPA (File Format)#Blend Factor|Blend Factor]]<br/> | ||
|- | |- | ||
| 0x1A || UInt8 || Alpha Compare Flags: | | 0x1A || UInt8 || Alpha Compare Flags: | ||
AlphaCompareType0 = (alphaFlags & 0x07). See [[JPA (File Format)#Compare Type|Compare Type]] | AlphaCompareType0 = (alphaFlags & 0x07). See [[JPA (File Format)#Compare Type|Compare Type]]<br/> | ||
AlphaOperator = (alphaFlags >> 3) & 0x03. See [[JPA (File Format)#Alpha Operator|Alpha Operator]] | AlphaOperator = (alphaFlags >> 3) & 0x03. See [[JPA (File Format)#Alpha Operator|Alpha Operator]]<br/> | ||
AlphaCompareType1 = (alphaFlags >> 5) & 0x07. See [[JPA (File Format)#Compare Type|Compare Type]] | AlphaCompareType1 = (alphaFlags >> 5) & 0x07. See [[JPA (File Format)#Compare Type|Compare Type]]<br/> | ||
|- | |- | ||
| 0x1B || UInt8 || Alpha Reference 0 | | 0x1B || UInt8 || Alpha Reference 0 | ||
Line 168: | Line 168: | ||
|- | |- | ||
| 0x1D || UInt8 || Z Mode Flags: | | 0x1D || UInt8 || Z Mode Flags: | ||
bool DepthTest = (zModeFlags & 0x01) | bool DepthTest = (zModeFlags & 0x01)<br/> | ||
DepthCompareType = (zModeFlags >> 1) & 0x07. See [[JPA (File Format)#Compare Type|Compare Type]] | DepthCompareType = (zModeFlags >> 1) & 0x07. See [[JPA (File Format)#Compare Type|Compare Type]]<br/> | ||
bool DepthWrite = (zModeFlags >> 4) & 0x01 | bool DepthWrite = (zModeFlags >> 4) & 0x01 | ||
|- | |- | ||
Line 179: | Line 179: | ||
| 0x20 || UInt8 || TextureIndex | | 0x20 || UInt8 || TextureIndex | ||
|- | |- | ||
| 0x21 || UInt8 || Color Flags:<br/>bool IsPrimaryColorAnimEnabled = (ColorFlags >> 1) & 0x01 | | 0x21 || UInt8 || Color Flags:<br/>bool IsPrimaryColorAnimEnabled = (ColorFlags >> 1) & 0x01<br/> | ||
bool IsEnvironmentColorAnimEnabled = (ColorFlags >> 3) & 0x01 | bool IsEnvironmentColorAnimEnabled = (ColorFlags >> 3) & 0x01<br/> | ||
Color Calculate Index Type = (ColorFlags >> 0x04) & 0x07. See the [[#Calculate_Index_Types|Calculate Index Type Table]] | Color Calculate Index Type = (ColorFlags >> 0x04) & 0x07. See the [[#Calculate_Index_Types|Calculate Index Type Table]] | ||
|- | |- | ||
| 0x22 || UInt8 || Primary Color Animation Data Count. ColorFlags & 0x02 must equal | | 0x22 || UInt8 || Primary Color Animation Data Count. ColorFlags & 0x02 must equal 1 | ||
|- | |- | ||
| 0x23 || UInt8 || Environment Color Animation Data Count. ColorFlags & 0x08 must equal | | 0x23 || UInt8 || Environment Color Animation Data Count. ColorFlags & 0x08 must equal 1 | ||
|- | |- | ||
| 0x24 || UInt16 || Color Animation Max Frame | | 0x24 || UInt16 || Color Animation Max Frame | ||
Line 234: | Line 234: | ||
| 0x0 || UInt8['''TexIDAnimCount'''] || A list of bytes representing texture IDs | | 0x0 || UInt8['''TexIDAnimCount'''] || A list of bytes representing texture IDs | ||
|- | |- | ||
|}This extra data exists (after the above data if that exists) if ColorFlags & 0x02 equals | |}This extra data exists (after the above data if that exists) if ColorFlags & 0x02 equals 1 | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
Line 242: | Line 242: | ||
|} | |} | ||
This extra data exists (after the above data if that exists) if ColorFlags & 0x08 equals | This extra data exists (after the above data if that exists) if ColorFlags & 0x08 equals 1 | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description |
Latest revision as of 17:12, 29 January 2025
This page is in progress and may contain incomplete information or editor's notes. |
---|
JPA stands for JPArticle, and is part of Nintendo's JSystem. The version of JPA documented here is JPAC2-10.
JPA Header
The file starts with this Header
Offset | Type | Description |
---|---|---|
0x00 | String | JPAC2-10 in ASCII |
0x08 | UInt16 | Particle Count |
0x0A | UInt16 | Image/Texture Count |
0x0C | UInt32 | Offset to the TEX1 section |
0x10 | UInt32 | Unknown |
0x14 | UInt32 | Unknown |
BEM1
This section is the Base Emitter, which contains settings for the emitter object.
Also known as JPADynamicsBlock.
This chunk is required for every particle
Offset | Type | Description |
---|---|---|
0x00 | String | BEM1 in ASCII |
0x04 | UInt32 | Section Length |
0x08 | UInt32 | Flags. VolumeType = (flags >> 8) & 0x07. See the Volume Type Table bool FixedDensity = (flags >> 0) & 0x01 |
0x0C | UInt32 | ResUserWork Unused in SMG2? |
0x10 | Single | Emitter Scale X |
0x14 | Single | Emitter Scale Y |
0x18 | Single | Emitter Scale Z |
0x1C | Single | Emitter Translation X |
0x20 | Single | Emitter Translation Y |
0x24 | Single | Emitter Translation Z |
0x28 | Single | Emitter Direction X |
0x2C | Single | Emitter Direction Y |
0x30 | Single | Emitter Direction Z |
0x34 | Single | Initial Velocity Omni-Directional (?) |
0x38 | Single | Initial Velocity Axis |
0x3C | Single | Initial Velocity Random |
0x40 | Single | Initial Velocity Direction |
0x44 | Single | Spread |
0x48 | Single | Initial Velocity Ratio |
0x4C | Single | Rate |
0x50 | Single | Rate Random |
0x54 | Single | Lifetime Random |
0x58 | Single | Volume Sweep |
0x5C | Single | Volume Minimum Radius |
0x60 | Single | Air Resistance |
0x64 | Single | Moment Random |
0x68 | Int16 | Emitter Rotation X in Degrees |
0x6A | Int16 | Emitter Rotation Y in Degrees |
0x6C | Int16 | Emitter Rotation Z in Degrees |
0x6E | Int16 | Max Frame |
0x70 | Int16 | Start Frame |
0x72 | Int16 | Lifetime |
0x74 | Int16 | Volume Size |
0x76 | Int16 | Division Number |
0x78 | UInt8 | Rate Step |
0x79 | UInt8[3] | Padding |
BSP1
This section is the Basic Shape, which contains settings on how to draw the particle.
This chunk is required for every particle
Offset | Type | Description |
---|---|---|
0x00 | String | BSP1 in ASCII |
0x04 | UInt32 | Section Length |
0x08 | UInt32 | Flags:
ShapeType = flags & 0x0F. See the Shape Type Table bool IsGlobalColorAnimation = (flags >> 0xC) & 0x01 bool IsGlobalTextureAnimation = (flags >> 0xE) & 0x01 bool IsEnableProjection = (flags >> 0x14) & 0x01 bool IsDrawForwardAhead = (flags >> 0x15) & 0x01 bool IsDrawPrintAhead = (flags >> 0x16) & 0x01 bool IsEnableTexScrollAnim = (flags >> 0x18) & 0x01 bool IsNoDrawParent = (flags >> 0x1B) & 0x01 bool IsNoDrawChild = (flags >> 0x1C) & 0x01 |
0x0C | UInt16 | Primary Color Data Offset. ColorFlags & 0x02 must equal 1 |
0x0E | UInt16 | Environment Color Data Offset. ColorFlags & 0x08 must equal 1 |
0x10 | Single | BaseSizeX |
0x14 | Single | BaseSizeY |
0x18 | UInt16 | Blend Mode Flags:
BlendMode = (blendFlags & 0x03). See Blend Mode |
0x1A | UInt8 | Alpha Compare Flags:
AlphaCompareType0 = (alphaFlags & 0x07). See Compare Type |
0x1B | UInt8 | Alpha Reference 0 |
0x1C | UInt8 | Alpha Reference 1 |
0x1D | UInt8 | Z Mode Flags:
bool DepthTest = (zModeFlags & 0x01) |
0x1E | UInt8 | Texture Flags: bool IsEnableTextureAnimation = (TextureFlags & 0x01) Texture Calculate Index Type = (TextureFlags >> 2) & 0x07. See the Calculate Index Type Table |
0x1F | UInt8 | Texture Index Animation Count TexIDAnimCount |
0x20 | UInt8 | TextureIndex |
0x21 | UInt8 | Color Flags: bool IsPrimaryColorAnimEnabled = (ColorFlags >> 1) & 0x01 bool IsEnvironmentColorAnimEnabled = (ColorFlags >> 3) & 0x01 |
0x22 | UInt8 | Primary Color Animation Data Count. ColorFlags & 0x02 must equal 1 |
0x23 | UInt8 | Environment Color Animation Data Count. ColorFlags & 0x08 must equal 1 |
0x24 | UInt16 | Color Animation Max Frame |
0x26 | Color RGBA UInt8[4] |
Primary Color |
0x2A | Color RGBA UInt8[4] |
Environment Color |
0x2E | UInt8 | Animation Random |
0x2F | UInt8 | Color Loop Offset Mask |
0x30 | UInt8 | Texture Index Loop Offset Mask |
0x31 | UInt8[3] | Padding |
Extra BSP1 Data
This extra data exists if IsEnableTextureScrollAnimation is TRUE
Offset | Type | Description |
---|---|---|
0x00 | Single | Texture Init Translation X |
0x04 | Single | Texture Init Translation Y |
0x08 | Single | Texture Init Scale X |
0x0C | Single | Texture Init Scale Y |
0x10 | Single | Texture Init Rotation |
0x14 | Single | Texture Increment Translation X |
0x18 | Single | Texture Increment Translation Y |
0x1C | Single | Texture Increment Scale X |
0x20 | Single | Texture Increment Scale Y |
0x24 | Single | Texture Increment Rotation |
This extra data exists (after the above data if that exists) if isEnableTextureAnimation is TRUE
Offset | Type | Description |
---|---|---|
0x0 | UInt8[TexIDAnimCount] | A list of bytes representing texture IDs |
This extra data exists (after the above data if that exists) if ColorFlags & 0x02 equals 1
Offset | Type | Description |
---|---|---|
0x0 | ColorTable[Primary Color Animation Data Count] | A table of primary color keyframes |
This extra data exists (after the above data if that exists) if ColorFlags & 0x08 equals 1
Offset | Type | Description |
---|---|---|
0x0 | ColorTable[Environment Color Animation Data Count] | A table of environment color keyframes |
ColorTable
Offset | Type | Description |
---|---|---|
0x0 | UInt16 | The keyframe of the color |
0x2 | Color RGBA UInt8[4] | The color at the keyframe |
ESP1
Extra settings for how to draw the particle. This chunk is optional.
Offset | Type | Description |
---|---|---|
0x00 | String | ESP1 in ASCII |
0x04 | UInt32 | Section Length |
0x08 | UInt32 | Flags. bool IsEnableScale = (flags & 0x01) |
0x0C | Single | Scale In Timing |
0x10 | Single | Scale Out Timing |
0x14 | Single | Scale In Value X |
0x18 | Single | Scale Out Value X |
0x1C | Single | Scale In Value Y |
0x20 | Single | Scale Out Value Y |
0x24 | Single | Scale Out Random |
0x28 | UInt16 | Scale Animation X Max Frame |
0x2A | UInt16 | Scale Animation Y Max Frame |
0x2C | Single | Alpha In Timing |
0x30 | Single | Alpha Out Timing |
0x34 | Single | Alpha In Value |
0x38 | Single | Alpha Base Value |
0x3C | Single | Alpha Out Value |
0x40 | Single | Alpha Wave Frequency |
0x44 | Single | Alpha Wave Random |
0x48 | Single | Alpha Wave Amplitude |
0x4C | Single | Rotate Angle |
0x50 | Single | Rotate Angle Random |
0x54 | Single | Rotate Speed |
0x58 | Single | Rotate Speed Random |
0x5C | Single | Rotate Direction |
SSP1
Settings for child particles that are spawned from the parent particle
Offset | Type | Description |
---|---|---|
0x00 | String | SSP1 in ASCII |
0x04 | UInt32 | Section Length |
0x08 | UInt32 | Flags:
ShapeType = flags & 0x0F. See the Shape Type Table |
0x0C | Single | Position Random |
0x10 | Single | Base Velocity |
0x14 | Single | Base Velocity Random |
0x18 | Single | Velocity Inf (Influence?) Rate |
0x1C | Single | Gravity |
0x20 | Single | Global Scale 2D X |
0x24 | Single | Global Scale 2D Y |
0x28 | Single | Inherit Scale |
0x2C | Single | Inherit Alpha |
0x30 | Single | Inherit RGB |
0x34 | Color RGBA UInt8[4] |
Primary Color |
0x38 | Color RGBA UInt8[4] |
Environment Color |
0x3C | Single | Timing |
0x40 | UInt16 | Life |
0x42 | UInt16 | Rate |
0x44 | UInt8 | Step |
0x45 | UInt8 | Texture Index |
0x46 | UInt16 | Rotate Speed |
ETX1
Settings for configuring two or three textures on a particle
Offset | Type | Description |
---|---|---|
0x00 | String | ETX1 in ASCII |
0x04 | UInt32 | Section length |
0x08 | UInt32 | Flags:
IndirectTextureMode = flags & 0x01. See the Indirect Texture Mode Table. Note that due to masking, SUBTRACT isn't used. bool UseSecondTextureIndex = (flags >> 8) & 0x01 |
0x0C | Single | Indirect Texture Matrix. Item00 |
0x10 | Single | Indirect Texture Matrix. Item01 |
0x14 | Single | Indirect Texture Matrix. Item02 |
0x18 | Single | Indirect Texture Matrix. Item10 |
0x1C | Single | Indirect Texture Matrix. Item11 |
0x20 | Single | Indirect Texture Matrix. Item12 |
0x24 | Int8 | Matrix Scale |
0x25 | UInt8 | Indirect Texture Index |
0x26 | UInt8 | Second Texture Index. Set to -1 if (flags & 0x00000100) is true |
0x27 | UInt8 | Padding |
KFA1
Contains curve animation tracks that can affect various properties of the emitter over time
Offset | Type | Description |
---|---|---|
0x00 | String | KFA1 in ASCII |
0x04 | UInt32 | Section length |
0x08 | UInt8 | Key Type. See the JPA Key Types Table |
0x09 | UInt8 | Key Count |
0x0A | UInt8 | Padding/Unused?, sometimes has 0x01 in it |
0x0B | bool | Loop |
0x0C | J3DKeyframe[] | Keyframes |
J3D Keyframe
Offset | Type | Description |
---|---|---|
0x00 | Single | Time |
0x04 | Single | Value |
0x08 | Single | Tangent In |
0x0C | Single | Tangent Out |
FLD1
Defines different physics simulation fields that affect the particles
Offset | Type | Description |
---|---|---|
0x00 | String | FLD1 in ASCII |
0x04 | UInt32 | Section length |
0x08 | UInt32 | Flags: Type = flags & 0x0F. See the Field Type Table bool NoInheritRotate = (flags >> 0x11) & 0x01 bool AirDrag = (flags >> 0x12) & 0x01 bool FadeUseEnterTime = (flags >> 0x13) & 0x01 bool FadeUseDistanceTime = (flags >> 0x14) & 0x01 bool FadeUseFadeIn (flag >> 0x15) & 0x01 bool FadeUseFadeOut (flag >> 0x16) & 0x01) |
0x0C | Single | Position X |
0x10 | Single | Position Y |
0x14 | Single | Position Z |
0x18 | Single | Direction X |
0x1C | Single | Direction Y |
0x20 | Single | Direction Z |
0x24 | Single | Param 1 |
0x28 | Single | Param 2 |
0x2C | Single | Param 3 |
0x30 | Single | Fade In |
0x34 | Single | Fade Out |
0x38 | Single | Enter Time (?) |
0x3C | Single | Distance Time |
0x40 | UInt8 | Cycle |
0x41 | UInt8[3] | Padding |
TDB1
This "chunk" stores a mapping of particle texture indices to the JPAC texture indices.
This chunk is required for every particle
Offset | Type | Description |
---|---|---|
0x00 | String | TDB1 in ASCII |
0x04 | UInt32 | Section length - 0x08 |
0x08 | UInt16[] | JPAC Texture Indices |
Type Lists
Volume Types
Value | Type |
---|---|
0x00 | CUBE |
0x01 | SPHERE |
0x02 | CYLINDER |
0x03 | TORUS |
0x04 | POINT |
0x05 | CIRCLE |
0x06 | LINE |
Shape Types
Value | Type |
---|---|
0x00 | POINT |
0x01 | LINE |
0x02 | BILLBOARD |
0x03 | DIRECTION |
0x04 | DIRECTIONCROSS |
0x05 | STRIPE |
0x06 | STRIPECROSS |
0x07 | ROTATION |
0x08 | ROTATIONCROSS |
0x09 | DIRBILLBOARD |
0x0A | YBILLBOARD |
Direction Types
Value | Type |
---|---|
0x00 | VELOCITY |
0x01 | POSITION |
0x02 | POSITIONINVERSE |
0x03 | EMITTERDIRECTION |
0x04 | PREVIOUSPARTICLE |
Rotation Types
Value | Type |
---|---|
0x00 | X |
0x01 | Y |
0x02 | Z |
0x03 | XYZ |
0x04 | YJIGGLE |
Plane Types
Value | Type |
---|---|
0x00 | XY |
0x01 | XZ |
0x02 | X |
Calculate Index Types
Value | Type |
---|---|
0x00 | NORMAL |
0x01 | REPEAT |
0x02 | REVERSE |
0x03 | MERGE |
0x04 | RANDOM |
Calculate Scale Animation Types
Value | Type |
---|---|
0x00 | NORMAL |
0x01 | REPEAT |
0x02 | REVERSE |
Calculate Alpha Wave Types
Value | Type |
---|---|
0xFF | NONE |
0x00 | NORMALSIN |
0x01 | ADDSIN |
0x02 | MULTIPLYSIN |
Indirect Texture Mode
Value | Mode |
---|---|
0x00 | OFF |
0x01 | NORMAL |
0x02 | SUBTRACT |
Field Types
Value | Type |
---|---|
0x00 | GRAVITY |
0x01 | AIR |
0x02 | MAGNET |
0x03 | NEWTON |
0x04 | VORTEX |
0x05 | RANDOM |
0x06 | DRAG |
0x07 | CONVECTION |
0x08 | SPIN |
Field Add Types
Value | Type |
---|---|
0x00 | FIELDACCELERATION |
0x01 | BASEVELOCITY |
0x02 | FIELDVELOCITY |
JPA Key Types
Value | Type |
---|---|
0x00 | RATE |
0x01 | VOLUMESIZE |
0x02 | VOLUMESWEEP |
0x03 | VOLUMEMINIMUMRADIUS |
0x04 | LIFETIME |
0x05 | MOMENT |
0x06 | INITIALVELOCITYOMNIDIRECTIONAL (?) |
0x07 | INITIALVELOCITYAXIS |
0x08 | INITIALVELOCITYDIRECTION |
0x09 | SPREAD |
0x0A | SCALE |
Blend Mode
Value | Type |
---|---|
0x00 | NONE |
0x01 | BLEND |
0x02 | LOGIC |
Blend Factor
Value | Type |
---|---|
0x00 | ZERO |
0x01 | ONE |
0x02 | SOURCE_COLOR |
0x03 | INVERSE_SOURCE_COLOR |
0x04 | SOURCE_COLOR (Duplicate?) |
0x05 | INVERSE_SOURCE_COLOR (Duplicate?) |
0x06 | SOURCE_ALPHA |
0x07 | INVERSE_SOURCE_ALPHA |
0x08 | DESTINATION_ALPHA |
0x09 | INVERSE_DESTINATION_ALPHA |
Compare Type
Value | Type |
---|---|
0x00 | NEVER |
0x01 | LESS_THAN |
0x02 | LESS_THAN_EQUAL |
0x03 | EQUAL |
0x04 | NOT_EQUAL |
0x05 | GREATER_THAN_EQUAL |
0x06 | GREATER_THAN |
0x07 | ALWAYS |
Alpha Operator
Value | Type |
---|---|
0x00 | AND |
0x01 | OR |
0x02 | XOR |
0x03 | XNOR |
(Source: noclip.website source code, Pikmin 2 decompilation)