Lights (Metroid Prime): Difference between revisions
→Metroid Prime 3
>Aruki No edit summary |
>Aruki |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
==Format== | ==Format== | ||
The header | The lights section has a very brief header consisting of the magic value <code>0xBABEDEAD</code>. It's then followed by a number of '''light layers'''. Each light layer consists of a count value, then an array of lights. Each layer represents a separate set of lights; actors can choose with set they're lit with through an object property in LightParameters. The number of light layers is static, but it varies from game to game; Prime 1 and 2 can have up to two light layers, while Prime 3 can have four. | ||
=== Metroid Prime 1/2 === | === Metroid Prime 1/2 === | ||
Line 26: | Line 26: | ||
| 0x4 | | 0x4 | ||
| float3 | | float3 | ||
| ''' | | '''Color''' | ||
| There is no alpha component. | | There is no alpha component. | ||
|- | |- | ||
Line 41: | Line 41: | ||
| 0x28 | | 0x28 | ||
| float | | float | ||
| ''' | | '''Brightness''' | ||
| | | Multiplied by color for local ambient, used to calculate distance attenuation coefficients for spot/custom | ||
|- | |- | ||
| 0x2C | | 0x2C | ||
| float | | float | ||
| '''Spot Cutoff''' | | '''Spot Cutoff''' | ||
| | | Used to calculate angle attenuation coefficients for spotlights | ||
|- | |- | ||
| 0x30 | | 0x30 | ||
Line 95: | Line 95: | ||
| 0x4 | | 0x4 | ||
| float4 | | float4 | ||
| ''' | | '''Color''' | ||
| This color ''does'' have an alpha component, unlike Prime 1 lights. | | This color ''does'' have an alpha component, unlike Prime 1 lights. | ||
|- | |- | ||
Line 115: | Line 115: | ||
| 0x38 | | 0x38 | ||
| float | | float | ||
| ''' | | '''Brightness''' | ||
| | | Multiplied by color for local ambient, used to calculate distance attenuation coefficients for spot/custom | ||
|- | |- | ||
| 0x3C | | 0x3C | ||
| float | | float | ||
| '''Spot Cutoff''' | | '''Spot Cutoff''' | ||
| | | Used to calculate angle attenuation coefficients for spotlights | ||
|- | |- | ||
| 0x40 | | 0x40 | ||
Line 140: | Line 140: | ||
| 0x49 | | 0x49 | ||
| u32 | | u32 | ||
| Falloff Type | | '''Falloff Type''' | ||
| | | | ||
|- | |- | ||
Line 222: | Line 222: | ||
Each falloff type will set one distance attenuation coefficient, with the other two set to 0. For each type: | Each falloff type will set one distance attenuation coefficient, with the other two set to 0. For each type: | ||
* 0: '''Constant''': Coefficient A is set to <code>2.0 / | * 0: '''Constant''': Coefficient A is set to <code>2.0 / Brightness</code> | ||
* 1: '''Linear''': Coefficient B is set to <code>250 / | * 1: '''Linear''': Coefficient B is set to <code>250 / Brightness</code> | ||
* 2: '''Quadratic''': Coefficient C is set to <code>25000 / | * 2: '''Quadratic''': Coefficient C is set to <code>25000 / Brightness</code> | ||
[[Category:File Formats]] | [[Category:File Formats]] | ||
[[Category:Metroid Prime]] | [[Category:Metroid Prime]] | ||
[[Category:Metroid Prime 2: Echoes]] | [[Category:Metroid Prime 2: Echoes]] |