APEX NxFluid IOS Programmers Guide

../_images/ParticlesIcon.JPG

The NxFluid IOS module is only available when APEX is used with PhysX 2.8.4.

Introduction

The NxFluid IOS provides the ability to control the parameters that are common to all particle systems. In addition to the simple capabilities of the BasicIOS the NxFluid IOS provides the ability to interact with PhysX SDK actors and force fields. This provides capabilities such as interacting with APEX Explosion. Collision detection with other APEX actors as well as self collision is also provided. Smoothed-Particle Hydrodynamic (SPH) based simulation is also an option that can be selected. These capabilities, of course, have greater overhead than the Basic IOS. There are several key parameters that are critical to the performance of all NxFluid based simulations. They are the restDensity, kernelRadiusMultiplier, motionLimitMultiplier, packetSizeMultiplier parameters. Special care should be taken when settting these parameters. It should be noted that these parameters effect both the performance and can change the simulation results. An example of this would be changing the motionLimitMultiplier, to a very small value can result in the forces applied to particles even if they are very large greatly limiting the distance that particles can move in a single simulation step. Consequently these parameters should be set as early as possible in the development process to avoid the necessity of updating other PhysX parameters such as the force field parameters. These parameters are described in more detail in the NxParameterized NxFluid IOS document and the PhysX SDK documentation.

Tuning the fluid parameters in general can require multiple iterations to achieve and tune an effect. In most cases it is advisable to start from the values in one of the sample programs or the default values when trying to achieve a certain effect.

These parameters are described in the document referenced here:

Errors and Warnings

APEX NxFluidIOS outputs the following error and warning messages using the standard APEX error stream.

ERROR CODE MESSAGE Explanation
APEX_INTERNAL_ERROR Unknown authorable type: %s, please load the IOFX module. The IOFX module must be loaded before emitters are created
APEX_INTERNAL_ERROR NxFluid creation failed. NxFluid creation failed.
APEX_INTERNAL_ERROR Out of free injectors. All injectors are in use and none are free. Currently the number of injectors is limited to 32.
APEX_DEBUG_INFO FluidIosActor::putInScene - Clearing NX_FF_PRIORITY_MODE settings Priority mode has been disabled.
APEX_DEBUG_WARNING Invalid fluid desc The fluid descriptor contains one or more invalid parameters.