Graphic engine effects

From SIMboxWiki
Jump to navigation Jump to search

The effects systems, commonly known as particle systems, are systems designed to simulate certain phenomena that are otherwise very hard to reproduce with conventional techniques. Examples of such phenomena include fire, smoke, dust, trails and lights. The SIMbox graphic engine contains extensive effects to help simulate these types of phenomena.

Effect Systems

The SGEV5 graphic engine has 3 separate sub-systems for rendering effects in the simulation

Legacy Effect System

The legacy effect system is the original effect system of the graphic engine. The system has existed since the release of the graphic engine. It is maintained mostly for backward compatibility.

Point Light Effect System

The Point Light Effect system has been introduced to the graphic engine since SIMbox version 5.6. The system is used to efficiently render a large number of point lights attached to objects.

Particle Universe Effect System

The Particle Universe Effect system was added to the graphic engine with the release of SIMbox version 5.6. This system replaces the legacy effect system. It is a more robust system then the previous system allowing the developer to create much more complex effects with greater ease.

Effect Scripts

All effects in the system are defined and controlled through script files. All script files and other effect resources are located in zip files in the directory [Resource]\GraphicEngine\Yoda\Resources\Effects.

To add effects to the system add a zip file containing the appropriate scripts and resources to this directory. The name of the zip file can be any you choose. When the simulation loads the graphic engine scans the directory and loads the effects from all available zip files. Also note that in order to ease the development process of new effect scripts if the effects folder contains both a zip file and a directory with the same name, The engine will load the files in the directory instead of the ones in the zip file.

The format of the effect script is dependent on the effect system to which it is addressed. For more information please refer to the appropriate page on the effect system you require.

Creating New Effects

Creating new effects is discussed, dependent on the system to which you are writing for, in the pages Point light effect system and Particle universe effect system. However there are certain points to keep in mind independent of the type of effect you are developing:

  • Scripts and all other resources for new effects should be placed in a zip file. The zip file should be placed under the directory [Resource]\GraphicEngine\Yoda\Resources\Effects.
  • All files in the zip files should be placed in the root folder. files in sub-folders will not be read by the system.
  • If you unzip the zip file in Effects directory to a sub directory with the same name as the zip file – the files will be read by the simulation from that folder and not the zip file – this can save time during the development of effects. Only add the finished zip file to content packages.
  • New effects and effect resources should have unique names. To do so give your effects and effect resources a prefix based on your ACO name. Failing to do so may generate unexpected results.
  • While developing effects you can track errors such as missing resources in the file: [Knowbook]\Bin\YodaSim.log
  • Do not use shaders or PhysX in your effects (Relevant to Particle Universe effects).
  • Remember to test you effects under different environmental conditions. Conditions such as: nighttime \ daytime, low and high visibility, etc...
  • Effects can affect performance if they are too heavy. Using fewer particles and fewer materials will help improve the performance.