ShipRenderLayerRules

From Cosmoteer Wiki
Modding/Components/ShipRenderLayerRules
Jump to navigation Jump to search
CalloutIconWarning.png
Work in Progress
This page is currently WORK IN PROGRESS. Some things may be missing.

Feel free to contribute and don't worry about perfection - other editors can make corrections if necessary. Just get creating!

.rules file/node location: Cosmoteer.Ships.ShipRenderLayerRules

Stores the rules for a single render layer on a ship.

The terran.rules file holds a list of these defined by the base game, ranked in order from lowest to highest UniqueBucket.

Their purpose is to determine what is displayed above what.

Inherits nothing.

Additional Render Layers may be added by a mod however there is a performance impact and it is to be avoided.

Render Layer Order and Explanation

The game uses render layers to determine which elements are displayed on top of others. The lower the UniqueBucket value, the earlier it is drawn, meaning higher values appear on top. Here's a simplified breakdown of the order and precedence:

  • **Structure Layers (Lowest)**
 * **Structure**: Base structure of the ship, drawn first (UniqueBucket = -800).
 * **Construction Structure**: Rendered during the construction phase (UniqueBucket = -750).
  • **Floor Layers**
 * **Floors**: Ship floors are drawn above the structure (UniqueBucket = -700).
  • **Turrets and Doodads**
 * **Turrets**: Basic turrets mounted on the ship (UniqueBucket = -600).
 * **Low-Level Doodads**: Small ship decorations (UniqueBucket = -500).
  • **Wall and Door Layers**
 * **Walls Stencil**: Effects for walls are rendered here (UniqueBucket = -400).
 * **External Walls**: Drawn above other structure layers (UniqueBucket = -300).
 * **Walls**: General internal walls (UniqueBucket = -200).
 * **Doors**: Ship doors, placed on top of walls (UniqueBucket = -100).
  • **Crew and Weapons Layers**
 * **Weapons**: Mounted weapons are rendered higher than doors and walls (UniqueBucket = 0).
  • **High-Level Doodads and Lighting**
 * **High-Level Doodads**: Decorative objects placed above weapons (UniqueBucket = 100).
 * **Additive Lights**: Glowing or additional lighting effects (UniqueBucket = 200).
 * **Fire**: Fire effects for damage (UniqueBucket = 300).
  • **Roof Layers (Highest)**
 * **Roofs**: Roof elements are rendered above everything else (UniqueBucket = 1000).
 * **Roof Doodads**: Decorative elements on the roof (UniqueBucket = 1100).
 * **Roof Turrets**: Turrets mounted on the roof (UniqueBucket = 1200).
 * **Roof Lights**: Advanced lighting effects on the roof (UniqueBucket = 1300).
 * **Fire Indicators**: Fire alerts and indicators for the player (UniqueBucket = 1900, Highest).

This order ensures that elements like floors are drawn first, while roofs and fire indicators are rendered last, appearing on top of all other ship components.

Parameters
Name Type Required? Buffable? Default value Description
UniqueBucket int Yes - - Visuals with lower UniqueBuckets are covered by visuals with higher ones.

Can be negative. Vanilla values are between -800 and 2000. Only works for a given ship (see RenderStage).

RenderStage ShipRenderStage Yes - - Visuals in lower RenderStages are covered by visuals in higher ones.

Unlike UniqueBucket, this works across different ships.

AtlasTextureParams AtlasTextureParams Yes - -
Material Material? - - -
StencilMaterial Material? - - -
DiffuseMaterial Material? - - -
NormalsMaterial Material? - - -
LightMaterial Material? - - -
GhostMaterial Material? - - -
DrawForLocalPlayerOnly bool - - -
DrawWithFancyLightingOnly bool - - -
IsRoof bool - - -
IsIndicators bool - - -
Inflate Float - - -
HasNormals bool - - -