Skip to content
Eric Mor edited this page May 31, 2023 · 5 revisions

Effect maps are one of the way effects can react to environment information from the game. Effect maps are used to retrieve color, height, normal, or velocity information that changes on each point in space. For example, a galaxy effect can be done by using an emit map with the shape of a galaxy, therefore emitting stars at specific locations.

They can be used in particle effects with mapEmit, mapCollide, mapRepel, mapAdvect, and mapForce, among others.

Some effect maps are predefined in the code, these are listed below. Custom maps can be created using the ModAPI SDK Swarm::IEffectMap class. Additionally, other maps can be created in .pfx files using the effectMap command.

Effect map resource

In a .pfx, a custom effect map can be created using the effectMap <mapID> command. For example, this effect map uses the maximum value between the "terrain cliff binary" and the "terrain above binary" maps:

effectMap 0x62622FB8 -channel all -rect (-650, -650, 650, 650) -op max 0x01C8A610 0x01C8A626 

An effect map defines a boundary with the -rect command, anything outside that boundary is outside the map. Then, the map itself can be defined in two exclusive ways: with an -op option, which combines existing maps, or through images. Images might just define colors, but they can also define 3D positions or directions, or a binary yes/no field, etc.

Must use one of the following:

  • -op <enum> <vector4 | resourceID>...: Combines several maps through some mathematical operation. Possible operations are set, add, subtract, multiply, min, max, multiplyAdd. The arguments are up to four values, which can either be the resource ID of another map, or a vector4.
  • -image <resourceID>: A .32bitImage file
  • -monoImage <resourceID>: A .8bitImage file
  • -bitImage <resourceID>: A .bitImage file
  • -advectImage <resourceID>
  • -forceImage <resourceID>
  • -bitCubeImage <resourceID>
  • -monoCubeImage <resourceID>

Additional options

-rect <vector4>

Defines the boundaries of the map.


-channel <enum>

What color channels are used in the map. The possible values are red, green, blue, alpha, all.


-tile

-worldSpace

If used, it means the map coordinates are in world space, instead of local to the effect.


List of predefined effect maps

Terrain

These are only available when being on a planet.

  • Terrain Height: 0xf86c06
  • Terrain Gradient: 0x276b1e8
  • Terrain Normal: 0xf86c19
  • Terrain First Deriv: 0xf86c22
  • Terrain Above: 0x1acdb9c
  • Terrain Above Binary: 0x1c8a626
  • Terrain Beach: 0x1acdb92
  • Terrain Beach Binary: 0x1c8a61e
  • Terrain Cliff: 0x1acdb88
  • Terrain Cliff Binary: 0x1c8a610
  • Terrain Seabed: 0x1acdba5
  • Terrain Seabed Binary: 0x1c8a62f
  • Terrain Live Dead: 0x2c9c762
  • Terrain Grass: 0x2c9c763
  • Terrain Flora: 0x2c9c764
  • Terrain Live Flora: 0x2c9c765
  • Terrain Dead Flora: 0x2c9c766
  • Terrain Dead Flora Color: 0x2c9c767
  • Terrain Specular: 0x2f7dcd2
  • Terrain Color: 0x16f280b
  • Terrain Water Color: 0x2e831a1
  • Terrain Dead Color: 0x2e831af

Weather related:

  • Terrain Weather Jet Stream: 0x354A47B
  • Terrain Weather Pressure: 0x3589357
  • Terrain Weather Cloud Emit: 0x379A0AA

Cell Stage

Only available during cell stage.

  • Cell Stage Background: 0x1010003

Simulator

Other Simulator related maps.

  • 0x107AE878, related with GamePlantManager
Clone this wiki locally