|
| 1 | +--- |
| 2 | +description: Liquid Model (.liquid) |
| 3 | +--- |
| 4 | + |
| 5 | +import Tabs from '@theme/Tabs'; |
| 6 | +import TabItem from '@theme/TabItem'; |
| 7 | +import ReactPlayer from "react-player"; |
| 8 | + |
| 9 | +# Liquid Model (.liquid) |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +:::note |
| 18 | + |
| 19 | +Not to be confused by Liquid Physics, this article its for the rather unused Model Liquid |
| 20 | + |
| 21 | +::: |
| 22 | + |
| 23 | +Model Liquids are a rather special mode, they don't use a model mesh per say, but uses a `.liquid` file in the `liquid/` folder under |
| 24 | +the game folder. |
| 25 | + |
| 26 | +Liquid models are unique in the sense that they are create in runtime under the contents of the `.liquid` file: |
| 27 | + |
| 28 | +```C |
| 29 | +seed 1337420 |
| 30 | + |
| 31 | +size_x 256 |
| 32 | +size_y 256 |
| 33 | +verts_x 16 |
| 34 | +verts_y 16 |
| 35 | +liquid_type 2 |
| 36 | +density 0.97 |
| 37 | +drop_height 4 |
| 38 | +drop_radius 4 |
| 39 | +drop_delay 1.0 |
| 40 | +update_rate 30 |
| 41 | +shader textures/base_floor/conc_panel02 |
| 42 | +``` |
| 43 | + |
| 44 | +Would create something like this: |
| 45 | + |
| 46 | +`testModel models/water2.liquid` |
| 47 | + |
| 48 | +<ReactPlayer controls src='https://www.youtube.com/watch?v=uxGFbWrluTA' /> |
| 49 | + |
| 50 | +## Breakdown |
| 51 | + |
| 52 | +A `.liquid` file consist of the next : |
| 53 | + |
| 54 | +- **size_x/size_y**: In Units, defines the size of the liquid plane. |
| 55 | +- **verts_x**: Must be at least two per axis. |
| 56 | +- **verts_y**: `scale_y = size_y / ( verts_y - 1 )` |
| 57 | +- **liquid_type**: defines the deform; must be 1, 2 or 3. |
| 58 | +- **density**: The actual "density" of a liquid, but rather a percentage of time of animation in which it deforms? |
| 59 | +- **drop_height**: |
| 60 | +- **drop_radius**: |
| 61 | +- **drop_delay**: In Seconds, controls how many second it takes for the liquid to rest. |
| 62 | +- **update_rate**: Dictates how fast the animation is. in hz [60 >= val > 0]. |
| 63 | +- **shader**: The texture to be use for this liquid. |
0 commit comments