Fluid
July 24, 2023 ยท View on GitHub
from tdw.obi_data.fluids.fluid import Fluid
Data for an Obi fluid. For more information, read this.
Fields
-
smoothingA 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_tensionIncreasing this value will make the fluid try to minimize its surface area, causing spherical drops to form. -
viscosityViscosity smooths out the velocity field generated by fluid particles when moving. -
vorticityAmount of vorticity confinement, it will contribute to maintain vortical details in the fluid. This value should always be between approximately 0 and 0.5. -
reflectionAmount of reflection. -
transparencyAmount of fluid transparency. -
refractionAmount of light refraction. This effect is more noticeable in thicker regions of the fluid. -
buoyancyControls the relative density between the fluid and the surrounding air. -
diffusionA diffusion value that will modifydiffusion_data. Read this for more information. -
diffusion_dataA 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_dragThe amount of air resistance. -
atmospheric_pressureThe amount of inward pressure applied by air on the surface of the fluid. -
particle_z_writeA shader rendering flag. This should be false for semi-transparent objects and true for opaque objects. -
thickness_cutoffA threshold for rendering fluid thickness. Regions that are less thick than this are discarded. -
thickness_downsampleIncrease this value to use a lower-resolution rendering buffer. -
blur_radiusAmount of depth blurring applied before generating normals. Higher values will result in a smoother surface. -
surface_downsampleDownsampling of the depth/normals buffers. Increase it to use lower-resolution buffers. -
render_smoothnessSurface smoothness of the fluid. High values will result in small specular glints, lower values will result in a rougher-looking surface. -
metalnessControls reflection metalness: high values will cause reflection/specular to be tinted with the fluid's surface color. -
ambient_multiplierA parameter that affects the fluid vis a vis the ambient lighting. -
absorptionHow much light is absorbed by the fluid, as light travels trough it: higher values will tint the background with the fluid color. -
refraction_downsampleDownsampling of the refraction buffers. Increase it to use a lower-resolution buffer. -
foam_downsampleDownsampling of the foam buffer. Increase it to use a lower-resolution buffer. -
capacityThe maximum amount of emitted particles. -
resolutionThe size and amount of particles in 1 cubic meter. A value of 1 will use 1000 particles per cubic meter. -
colorThe visual color of the fluid. -
rest_densityThe fluid density in kg/m3. -
radius_scaleThis scales the size at which particles are drawn. -
random_velocityRandom 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.