JPA (File Format): Difference between revisions
AwesomeTMC (talk | contribs) (→Extra BSP1 Data: Further document extra BSP1 Data) |
AwesomeTMC (talk | contribs) (colour -> color for consistency (and my sanity), change note at top to follow format, make padding size accurate for ETX1) |
||
Line 1: | Line 1: | ||
[[Category:File formats]] | [[Category:File formats]] | ||
{{WIP}} | |||
'''JPA''' stands for '''JPA'''rticle, and is part of Nintendo's JSystem. The version of JPA documented here is JPAC2-10. | '''JPA''' stands for '''JPA'''rticle, and is part of Nintendo's JSystem. The version of JPA documented here is JPAC2-10. | ||
== JPA Header == | == JPA Header == | ||
Line 116: | Line 116: | ||
RotationType = (flags >> 0x07) & 0x07. See the [[#Rotation_Types|Rotation Type Table]]<br/> | RotationType = (flags >> 0x07) & 0x07. See the [[#Rotation_Types|Rotation Type Table]]<br/> | ||
PlaneType = (flags >> 0x0A) & 0x01. See the [[#Plane_Types|Plane Type Table]]. (If the ShapeType is DIRECTIONCROSS or ROTATIONCROSS, the PlaneType is always X)<br/> | PlaneType = (flags >> 0x0A) & 0x01. See the [[#Plane_Types|Plane Type Table]]. (If the ShapeType is DIRECTIONCROSS or ROTATIONCROSS, the PlaneType is always X)<br/> | ||
ColorInSelect = (flags >> 0x0F) & 0x07<br/> | |||
AlphaInSelect = (flags >> 0x12) & 0x01<br/> | AlphaInSelect = (flags >> 0x12) & 0x01<br/> | ||
TlingS = if !((flags >> 0x19) & 0x01), set to 2.0, otherwise, use 1.0<br/> | TlingS = if !((flags >> 0x19) & 0x01), set to 2.0, otherwise, use 1.0<br/> | ||
TlingT = if !((flags >> 0x1A) & 0x01), set to 2.0, otherwise, use 1.0<br/> | TlingT = if !((flags >> 0x1A) & 0x01), set to 2.0, otherwise, use 1.0<br/> | ||
bool | bool IsGlobalColorAnimation = !(flags & 0x00001000)<br/> | ||
bool IsGlobalTextureAnimation = !(flags & 0x00004000)<br/> | bool IsGlobalTextureAnimation = !(flags & 0x00004000)<br/> | ||
bool IsEnableProjection = !(flags & 0x00100000)<br/> | bool IsEnableProjection = !(flags & 0x00100000)<br/> | ||
Line 129: | Line 129: | ||
bool IsNoDrawChild = !(flags & 0x10000000)<br/> | bool IsNoDrawChild = !(flags & 0x10000000)<br/> | ||
|- | |- | ||
| 0x0C || UInt16 || Primary | | 0x0C || UInt16 || Primary Color Data Offset. ColorFlags & 0x02 must equal 0 | ||
|- | |- | ||
| 0x0E || UInt16 || Environment | | 0x0E || UInt16 || Environment Color Data Offset. ColorFlags & 0x08 must equal 0 | ||
|- | |- | ||
| 0x10 || Single || BaseSizeX | | 0x10 || Single || BaseSizeX | ||
Line 155: | Line 155: | ||
| 0x20 || UInt8 || TextureIndex | | 0x20 || UInt8 || TextureIndex | ||
|- | |- | ||
| 0x21 || UInt8 || | | 0x21 || UInt8 || Color Flags:<br/> | ||
Color Calculate Index Type = (ColorFlags >> 0x04) & 0x07 | |||
|- | |- | ||
| 0x22 || UInt8 || Primary | | 0x22 || UInt8 || Primary Color Animation Data Count. ColorFlags & 0x02 must equal 0 | ||
|- | |- | ||
| 0x23 || UInt8 || Environment | | 0x23 || UInt8 || Environment Color Animation Data Count. ColorFlags & 0x08 must equal 0 | ||
|- | |- | ||
| 0x24 || UInt16 || | | 0x24 || UInt16 || Color Animation Max Frame | ||
|- | |- | ||
| 0x26 || | | 0x26 || Color RGBA<br/>UInt8[4] || Primary Color | ||
|- | |- | ||
| 0x2A || | | 0x2A || Color RGBA<br/>UInt8[4] || Environment Color | ||
|- | |- | ||
| 0x2E || UInt8 || Animation Random | | 0x2E || UInt8 || Animation Random | ||
|- | |- | ||
| 0x2F || UInt8 || | | 0x2F || UInt8 || Color Loop Offset Mask | ||
|- | |- | ||
| 0x30 || UInt8 || Texture Index Loop Offset Mask | | 0x30 || UInt8 || Texture Index Loop Offset Mask | ||
Line 210: | Line 210: | ||
|- | |- | ||
|} | |} | ||
==== | ==== ColorTable ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x0 || UInt16 || The keyframe of the | | 0x0 || UInt16 || The keyframe of the color | ||
|- | |- | ||
| 0x2 || | | 0x2 || Color RGBA UInt8[4] || The color at the keyframe | ||
|- | |- | ||
|} | |} | ||
This extra data exists (after the above data if that exists) if | This extra data exists (after the above data if that exists) if ColorFlags & 0x02 equals 0 | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x0 || | | 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 | This extra data exists (after the above data if that exists) if ColorFlags & 0x08 equals 0 | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x0 || | | 0x0 || ColorTable['''Environment Color Animation Data Count'''] || A table of environment color keyframes | ||
|- | |- | ||
|} | |} | ||
Line 345: | Line 345: | ||
| 0x30 || Single || Inherit RGB | | 0x30 || Single || Inherit RGB | ||
|- | |- | ||
| 0x34 || | | 0x34 || Color RGBA<br/>UInt8[4] || Primary Color | ||
|- | |- | ||
| 0x38 || | | 0x38 || Color RGBA<br/>UInt8[4] || Environment Color | ||
|- | |- | ||
| 0x3C || Single || Timing | | 0x3C || Single || Timing | ||
Line 393: | Line 393: | ||
| 0x26 || UInt8 || Second Texture Index. Set to -1 if (flags & 0x00000100) is true | | 0x26 || UInt8 || Second Texture Index. Set to -1 if (flags & 0x00000100) is true | ||
|- | |- | ||
| 0x27 || UInt8 | | 0x27 || UInt8 || Padding | ||
|- | |- | ||
|} | |} |
Revision as of 07:25, 8 September 2024
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 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.
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 |
0x0C | UInt32 | Unknown |
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 |
0x0C | UInt16 | Primary Color Data Offset. ColorFlags & 0x02 must equal 0 |
0x0E | UInt16 | Environment Color Data Offset. ColorFlags & 0x08 must equal 0 |
0x10 | Single | BaseSizeX |
0x14 | Single | BaseSizeY |
0x18 | UInt16 | Blend Mode Flags |
0x1A | UInt8 | Alpha Compare Flags |
0x1B | UInt8 | Alpha Reference 0 |
0x1C | UInt8 | Alpha Reference 0 |
0x1D | UInt8 | Z Mode Flags |
0x1E | UInt8 | Texture Flags: 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: Color Calculate Index Type = (ColorFlags >> 0x04) & 0x07 |
0x22 | UInt8 | Primary Color Animation Data Count. ColorFlags & 0x02 must equal 0 |
0x23 | UInt8 | Environment Color Animation Data Count. ColorFlags & 0x08 must equal 0 |
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 |
0x34 | 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 |
ColorTable
Offset | Type | Description |
---|---|---|
0x0 | UInt16 | The keyframe of the color |
0x2 | Color RGBA UInt8[4] | The color at the keyframe |
This extra data exists (after the above data if that exists) if ColorFlags & 0x02 equals 0
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 0
Offset | Type | Description |
---|---|---|
0x0 | ColorTable[Environment Color Animation Data Count] | A table of environment color keyframes |
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 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 |
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 |
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 |
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 | YZ |
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 | LIVETIME |
0x05 | MOMENT |
0x06 | INITIALVELOCITYOMNIDIRECTIONAL (?) |
0x07 | INITIALVELOCITYAXIS |
0x08 | INITIALVELOCIRTDIRECTION |
0x09 | SPREAD |
0x0A | SCALE |
(Source: noclip.website source code)