EvilEngine/LODT: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
No edit summary
No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
<onlyinclude>
{{AssetInfobox
{{#vardefine:typeid|LODT}}<nowiki/>
|subtitle=LOD Table
{{#vardefine:name|LOD Table}}<nowiki/>
|type=[[Binary]]
{{#vardefine:type|[[Binary]]}}<nowiki/>
|games=Battle for Bikini Bottom<br>The SpongeBob SquarePants Movie<br>The Incredibles<br>Rise of the Underminer}}
{{#vardefine:basetype|}}<nowiki/>
{{#vardefine:games|BFBB TSSM Incredibles ROTU}}<nowiki/>
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Game/zLOD.h zLOD.h]}}<nowiki/>
{{#vardefine:image|}}<nowiki/>
</onlyinclude>
{{AutoAssetInfobox}}


A '''LOD table''' defines how models should look based on their distances from the in-game camera. A model can have up to 4 levels of detail, each level being a separate version of the model, spaced at increasing distances from the camera. Once the maximum distance is reached, the model starts fading out of view.
A '''LOD table''' defines how models should look based on their distances from the in-game camera. A model can have up to 4 levels of detail, each level being a separate version of the model, spaced at increasing distances from the camera. Once the maximum distance is reached, the model starts fading out of view.


==Format==
==Format==
The asset data starts with an int which defines the amount of entries in the LOD table, then the entries themselves. Each entry has the following format:
The asset data starts with an int which defines the amount of entries in the LOD table, then the entries themselves.


===zLODManager===
{| class="wikitable"
{| class="wikitable"
! Offset !! Type !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x00 || [[AssetID]] ([[MODL|Model]]) || '''Model'''
| 0x00 || int || '''numextra''' || Amount of LOD table entries
|}

====zLODTable====
Offset [-4] only applies to BFBB
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x00 || [[AssetID]] || '''baseBucket''' || Model asset ID
|-
| 0x04 || float || '''noRenderDist''' || Max Distance from the camera before it starts fading out.
|-
|-
| 0x04 || float || '''Max Distance''' from the camera before it starts fading out.
| 0x08 || uint || '''flags''' || '''Not present in BFBB'''
|-
|-
| 0x08 || [[AssetID]] ([[MODL|Model]]) || '''LOD1 Model''' (optional)
| 0x0C[-4] || [[AssetID]] || '''lodBucket''' || LOD1 Model (optional)
|-
|-
| 0x0C || [[AssetID]] ([[MODL|Model]]) || '''LOD2 Model''' (optional)
| 0x10[-4] || [[AssetID]] || '''lodBucket''' || LOD2 Model (optional)
|-
|-
| 0x10 || [[AssetID]] ([[MODL|Model]]) || '''LOD3 Model''' (optional)
| 0x14[-4] || [[AssetID]] || '''lodBucket''' || LOD3 Model (optional)
|-
|-
| 0x14 || float || '''LOD1 Distance''' from camera
| 0x18[-4] || float || '''lodDist''' || LOD1 Distance from camera
|-
|-
| 0x18 || float || '''LOD2 Distance''' from camera
| 0x1C[-4] || float || '''lodDist''' || LOD2 Distance from camera
|-
|-
| 0x1C || float || '''LOD3 Distance''' from camera
| 0x20[-4] || float || '''lodDist''' || LOD2 Distance from camera
|}
|}


{{Assets}}
{{Assets}}
{{AutoGameNavs}}


[[Category:Asset]]
[[Category:Asset]]

Latest revision as of 02:25, 29 October 2022

LODT
LOD Table
TypeBinary
Games usedBattle for Bikini Bottom

The SpongeBob SquarePants Movie
The Incredibles

Rise of the Underminer
Source codezLOD.h

A LOD table defines how models should look based on their distances from the in-game camera. A model can have up to 4 levels of detail, each level being a separate version of the model, spaced at increasing distances from the camera. Once the maximum distance is reached, the model starts fading out of view.

Format

The asset data starts with an int which defines the amount of entries in the LOD table, then the entries themselves.

zLODManager

Offset Type Variable Description
0x00 int numextra Amount of LOD table entries

zLODTable

Offset [-4] only applies to BFBB

Offset Type Variable Description
0x00 AssetID baseBucket Model asset ID
0x04 float noRenderDist Max Distance from the camera before it starts fading out.
0x08 uint flags Not present in BFBB
0x0C[-4] AssetID lodBucket LOD1 Model (optional)
0x10[-4] AssetID lodBucket LOD2 Model (optional)
0x14[-4] AssetID lodBucket LOD3 Model (optional)
0x18[-4] float lodDist LOD1 Distance from camera
0x1C[-4] float lodDist LOD2 Distance from camera
0x20[-4] float lodDist LOD2 Distance from camera