Skip to content

Latest commit

 

History

History
115 lines (73 loc) · 7.63 KB

fluid.md

File metadata and controls

115 lines (73 loc) · 7.63 KB

Fluid

from tdw.obi_data.fluids.fluid import Fluid

Data for an Obi fluid. For more information, read this.


Fields

  • smoothing A percentage of the particle radius used to define the radius of the zone around each particle when calculating fluid density. Larger values will create smoother fluids, which are also less performant.

  • surface_tension Increasing this value will make the fluid try to minimize its surface area, causing spherical drops to form.

  • viscosity Viscosity smooths out the velocity field generated by fluid particles when moving.

  • vorticity Amount of vorticity confinement, it will contribute to maintain vortical details in the fluid. This value should always be between approximately 0 and 0.5.

  • reflection Amount of reflection.

  • transparency Amount of fluid transparency.

  • refraction Amount of light refraction. This effect is more noticeable in thicker regions of the fluid.

  • buoyancy Controls the relative density between the fluid and the surrounding air.

  • diffusion A diffusion value that will modify diffusion_data. Read this for more information.

  • diffusion_data A dictionary of four floats that can be used arbitrarily, for example to colorize a fluid based on its physical state. Read this for more information.

  • atmospheric_drag The amount of air resistance.

  • atmospheric_pressure The amount of inward pressure applied by air on the surface of the fluid.

  • particle_z_write A shader rendering flag. This should be false for semi-transparent objects and true for opaque objects.

  • thickness_cutoff A threshold for rendering fluid thickness. Regions that are less thick than this are discarded.

  • thickness_downsample Increase this value to use a lower-resolution rendering buffer.

  • blur_radius Amount of depth blurring applied before generating normals. Higher values will result in a smoother surface.

  • surface_downsample Downsampling of the depth/normals buffers. Increase it to use lower-resolution buffers.

  • render_smoothness Surface smoothness of the fluid. High values will result in small specular glints, lower values will result in a rougher-looking surface.

  • metalness Controls reflection metalness: high values will cause reflection/specular to be tinted with the fluid's surface color.

  • ambient_multiplier A parameter that affects the fluid vis a vis the ambient lighting.

  • absorption How much light is absorbed by the fluid, as light travels trough it: higher values will tint the background with the fluid color.

  • refraction_downsample Downsampling of the refraction buffers. Increase it to use a lower-resolution buffer.

  • foam_downsample Downsampling of the foam buffer. Increase it to use a lower-resolution buffer.

  • capacity The maximum amount of emitted particles.

  • resolution The size and amount of particles in 1 cubic meter. A value of 1 will use 1000 particles per cubic meter.

  • color The visual color of the fluid.

  • rest_density The fluid density in kg/m3.

  • radius_scale This scales the size at which particles are drawn.

  • random_velocity Random velocity of emitted particles.


Functions

__init__

Fluid(smoothing, surface_tension, viscosity, vorticity, reflection, transparency, refraction, capacity, resolution, color, rest_density)

Fluid(smoothing, surface_tension, viscosity, vorticity, reflection, transparency, refraction, capacity, resolution, color, rest_density, buoyancy=-1, diffusion=0, diffusion_data=None, atmospheric_drag=0, atmospheric_pressure=0, particle_z_write=False, thickness_cutoff=1.2, thickness_downsample=2, blur_radius=0.02, surface_downsample=1, render_smoothness=0.8, metalness=0, ambient_multiplier=1, absorption=5, refraction_downsample=1, foam_downsample=1, radius_scale=1.7, random_velocity=0)

Parameter Type Default Description
smoothing float A percentage of the particle radius used to define the radius of the zone around each particle when calculating fluid density. Larger values will create smoother fluids, which are also less performant.
surface_tension float Increasing this value will make the fluid try to minimize its surface area, causing spherical drops to form.
viscosity float Viscosity smooths out the velocity field generated by fluid particles when moving.
vorticity float Amount of vorticity confinement, it will contribute to maintain vortical details in the fluid. This value should always be between approximately 0 and 0.5.
reflection float Amount of reflection.
transparency float Amount of fluid transparency.
refraction float Amount of light refraction. This effect is more noticeable in thicker regions of the fluid.
capacity int The maximum amount of emitted particles.
resolution float The size and amount of particles in 1 cubic meter. A value of 1 will use 1000 particles per cubic meter.
color Dict[str, float] The visual color of the fluid.
rest_density float The fluid density in kg/m3.
buoyancy float -1 Controls the relative density between the fluid and the surrounding air.
diffusion float 0 A diffusion value that will modify diffusion_data. Read this for more information.
diffusion_data Dict[str, float] None A dictionary of four floats that can be used arbitrarily, for example to colorize a fluid based on its physical state. Read this for more information.
atmospheric_drag float 0 The amount of air resistance.
atmospheric_pressure float 0 The amount of inward pressure applied by air on the surface of the fluid.
particle_z_write bool False A shader rendering flag. This should be false for semi-transparent objects and true for opaque objects.
thickness_cutoff float 1.2 A threshold for rendering fluid thickness. Regions that are less thick than this are discarded.
thickness_downsample int 2 Increase this value to use a lower-resolution rendering buffer.
blur_radius float 0.02 Amount of depth blurring applied before generating normals. Higher values will result in a smoother surface.
surface_downsample int 1 Downsampling of the depth/normals buffers. Increase it to use lower-resolution buffers.
render_smoothness float 0.8 Surface smoothness of the fluid. High values will result in small specular glints, lower values will result in a rougher-looking surface.
metalness float 0 Controls reflection metalness: high values will cause reflection/specular to be tinted with the fluid's surface color.
ambient_multiplier float 1 A parameter that affects the fluid vis a vis the ambient lighting.
absorption float 5 How much light is absorbed by the fluid, as light travels trough it: higher values will tint the background with the fluid color.
refraction_downsample int 1 Downsampling of the refraction buffers. Increase it to use a lower-resolution buffer.
foam_downsample int 1 Downsampling of the foam buffer. Increase it to use a lower-resolution buffer.
radius_scale float 1.7 This scales the size at which particles are drawn.
random_velocity float 0 Random velocity of emitted particles.

to_dict

self.to_dict()

Returns: A JSON dictionary of this object.