Thursday, 23 January 2025

FluidNinja VFX Tool

     There are several different modules in FluidNinja: 

  • FluidNinja(Core): create density and velocity maps with particles/ textures/paint input
  • NinjaFields: create vector field data with velocity maps
  • NinjaFlow: create animated textures using velocity maps
I'll be focusing on the FluidNinja(core) for now.
Here is the actual manual on FluidNinja. Below are just quick notes with pictures as i play with the tool.

The FluidNinja GUI

    The right side shows the inputs and outputs. The left side drives what is seen, broken up into several parts. 

Canvas



    Clicking the top squares change whether you're viewing a single canvas or all four canvas. 
    Changing options here will affect the output canvas. The page icon is used to 'blank' the canvas, or to reset the simulation

Bake



    Has the stop and play button to stop and play the simulation. The record button (the circle) will bake out the current simulation. The number underneath determines your flipbook frame length. 

    Once you bake these canvases will replace the previous bottom two. The right side shows your flipbook. The left side you use to tell FluidNinja to save it as a texture, material, or png. 

Velocity and Density


    These are your main controls over the simulation's look.

Velocity

Note that all of these are tested with the Flower preset
  • Offset X and Y:  Changes the direction of the 'wind', or which way it flows. Gives it a direction
Offset X at 0.76, smoke is flowing to the right

Offset X at -0.56 and Offset Y at -0.79, smoke flowing to the upper left

  • Rotate: creates a circular flow
rotating at 0.39

  • Turbulence: Causes more swirling
Turbulence turned down to 0.01
Turbulence Turned up to 1.04

  • Amplify: determines the strength of the velocity field. Higher Positive values will make it go outward faster. Negative values will make it flow inward (inverted). 
Amplify at 0
Amplify at 20

Amplify at -20

  • Noise: the noise is actually masking the strength (amplitude) of the input velocity field. the noise is moving, so it helps to add fluctuations to the flow sim. (note the direction of the noise does not influence the direction of the flow, only the strength matters) (additional note: negative values do not seem to affect it)
Noise at 0.05

Noise at 1.38

Density

  • Input weight: controls how much the initial input particle affects the sim
  • Out weight: controls the speed of dissolve (the 'lifetime' of a virtual density particle). The larger the value the longer the output density particles live. If you have low values, it's more like a flame, and if it's higher it is closer to smoke.
Out Weight at 0.43

Out weight at 1

  • Shading: fakes directional light on the sim can give depth to smoke and emphasize edges on flames
Shading at 0

Shading at 0.98

  • Contrast: increasing it gives a more solid look to the sim
  • Hue: Increasing it gives the output density a color. Note this is only for visualization purposes and it is recommended to bake out the density maps as greyscale
  • Curl: adds a curl noise to the field, smudges density information. Note: curl offset can be animated, you have to edit the "VeloDirNoiseSpeed' param in the preset file
0 curl
20 curl

  • Sharpen: with negative values you can blur
  • CurlScale: changes size of curl noise, negative values removes details, positive value adds details

Input


    Ninja takes 3 different inputs to generate the density maps: Niagara particles, images, and paint mode. If you don't select any particles or images for input, it defaults onto the painting mode. 
    For particles, you can zoom in and reposition the particles in the simulation area using the Scale and Offset XY params.
    Note: try to keep the particle uassets in the same folder your preset is. Presets usually will recognize particles in the same folder or in subfolders. For testing keep the preset file higher in the folder hierarchy to broaden its scope to more folders. 
    You can edit a particle in Niagara and have it upload in real time in ninja to speed up the workflow.
    Another note: sometimes particles don't look the same in ninja and Niagara :( try these things to fix it:
  • switch particle systems type to LOCAL in Emitter properties > Local Space: ON
  • only have ninja open (having both ninja and niagara running gpu sim might interfere)
  • "Ninja is capturing the particle simulation using a fixed view angle, that might be different from your view angle in Niagara/Cascade editor. In case if something does not look the same, try to swap/flip axes (eg. something is aligned on the Z axis - and change that to Y)."

Export FGA 

    You can capture the current sim as a Field Grid Ascii (FGA) type data (vector field data), to drive GPU particles. Although it is recommended to use the other module NinjaFields

No comments:

Post a Comment

Shader Tool Week 5 - Shadow Mapping

      Shadow Mapping in 4 steps Projection Texture Mapping Occlusion Depth Mapping  Projection With Occlusion Shadow Mapping Projection Text...