Class FluidRenderer
Hierarchy
- FluidRenderer
Index
Constructors
constructor
Initializes the class
Parameters
scene: Scene
Scene in which the objects are part of
Returns FluidRenderer
Properties
Readonly render ObjectsSearch playground for renderObjects
Retrieves all the render objects managed by the class
Readonly target RenderersSearch playground for targetRenderers
Retrieves all the render target renderers managed by the class
Methods
add Custom ParticlesSearch playground for addCustomParticles
Adds a custom particle set to the fluid renderer.
Parameters
buffers: {}
The list of buffers (should contain at least a "position" buffer!)
[key: string]: FloatArray
numParticles: number
Number of particles in each buffer
Optional generateDiffuseTexture: 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!
Optional targetRenderer: FluidRenderingTargetRenderer
The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one
Optional camera: Camera
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
add Particle SystemSearch playground for addParticleSystem
Adds a particle system to the fluid renderer. Note that you should not normally call this method directly, as you can simply use the renderAsFluid property of the ParticleSystem/GPUParticleSystem class
Parameters
ps: IParticleSystem
particle system
Optional generateDiffuseTexture: 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)
Optional targetRenderer: FluidRenderingTargetRenderer
The target renderer used to display the particle system as a fluid. If not provided, the method will create a new one
Optional camera: Camera
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
disposeSearch playground for dispose
Disposes of all the ressources used by the class
Returns void
get Render Object From Particle SystemSearch playground for getRenderObjectFromParticleSystem
Gets the render object corresponding to a particle system (null if the particle system is not rendered as a fluid)
Parameters
ps: IParticleSystem
The particle system
Returns Nullable<IFluidRenderingRenderObject>
the render object corresponding to this particle system if any, otherwise null
recreateSearch playground for recreate
Reinitializes the class Can be used if you change the object priority (FluidRenderingObject.priority), to make sure the objects are rendered in the right order
Returns void
remove Render ObjectSearch playground for removeRenderObject
Removes a render object from the fluid renderer
Parameters
renderObject: IFluidRenderingRenderObject
the render object to remove
Optional removeUnusedTargetRenderer: boolean
True to remove/dispose of the target renderer if it's not used anymore (default: true)
Returns boolean
True if the render object has been found and released, else false
Class responsible for fluid rendering. It is implementing the method described in https://developer.download.nvidia.com/presentations/2010/gdc/Direct3D_Effects.pdf