API

Class FluidRenderer

Class responsible for fluid rendering. It is implementing the method described in https://developer.download.nvidia.com/presentations/2010/gdc/Direct3D_Effects.pdf

Index

Retrieves all the render objects managed by the class

targetRenderers: FluidRenderingTargetRenderer[]

Retrieves all the render target renderers managed by the class

  • Adds a custom particle set to the fluid renderer.

    Parameters

    • buffers: { [key: string]: FloatArray }

      The list of buffers (should contain at least a "position" buffer!)

    • numParticles: number

      Number of particles in each buffer

    • OptionalgenerateDiffuseTexture: boolean

      True if you want to generate a diffuse texture from buffers and use it as part of the fluid rendering (default: false). For the texture to be generated correctly, you need a "color" buffer in the set!

    • OptionaltargetRenderer: FluidRenderingTargetRenderer

      The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one

    • Optionalcamera: any

      The camera used by the target renderer (if the target renderer is created by the method)

    Returns IFluidRenderingRenderObject

    the render object corresponding to the custom particle set

  • Adds a particle system to the fluid renderer.

    Parameters

    • ps: IParticleSystem

      particle system

    • OptionalgenerateDiffuseTexture: boolean

      True if you want to generate a diffuse texture from the particle system and use it as part of the fluid rendering (default: false)

    • OptionaltargetRenderer: FluidRenderingTargetRenderer

      The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one

    • Optionalcamera: any

      The camera used by the target renderer (if the target renderer is created by the method)

    Returns IFluidRenderingRenderObject

    the render object corresponding to the particle system