Samples
Table of contents
- Importing Samples
- Running Samples
- Controls
- River
- Grand Canyon
- Water Modifiers
- Volcano
- Terraform
- Simple Terraform
- Tiled Simulation
- Runtime Setup
Important Info! To prevent project bloat the samples are not imported into your Assets folder by default. Follow the instructions below to import them.
Fluid Frenzy contains five sample scenes to showcase the functionality and help with understanding how to work with the fluid simulation. You can import the samples using the Package Manager.
Importing Samples
- Open the
Package Manager
. - Select
In Project
. - Select
Fluid Frenzy
in the list underPackages - Frenzy Byte
. - Go to the
Samples
tab. - Click the
Import
button.
Running Samples
To run the samples, open any of the scenes in the Assets/Samples/Fluid Frenzy/1.0.7/Samples
folder and click play. Scenes can be loaded at run-time in the Scenes tab in the UI. There are several options in the UI Input Tab to select from. Control the fluid input type, fluid rigid body spawning, boat driving and “FlyCam”.
Note: The samples optionally use the Unity Post-Processing package for higher-quality visuals. It will be automatically enabled if the Post-Processing package is imported into the project.
Controls
- F1 - select the Fly Cam to fly around the scene using the ‘WASD’ keys and mouse.
- F2 - select the Offset Cam which follows around the Player Boat.
- F3 - select the Third Person Cam which follows around the Player Boat.
- F4 - select the Smooth Third Person Cam which follows around the Player Boat.
- F5 - select the Orbit Cam which orbits around the Player Boat and can be controlled with the mouse.
- F6 - enables the RTS Cam which can be used to pan over the scene using the ‘WASD’ keys.
- 1-5 - select the simulation input mode depending on the scene loaded. 1 Is always water.
- ‘WASD’ - controls the Fly Cam, RTS Cam, and the Player Boat, allowing you to move forward.
- Arrows - rotates the Fly Cam and RTS Cam.
- Mouse Left - when held rotates Fly Cam and RTS Cam when moving the mouse.
- Mouse Right - when held adds the selected fluid/terrain to the simulation at the mouse location.
River
The River sample shows the use of Fluid Modifier Volume adding water from multiple sources to create three river branches. The camera starts at the end of one of these branches with a boat that can be driven across the scene. Water flows out of the scene due to the Open Borders functionality of the fluid simulation to prevent flooding of the scene. This scene makes use of the Unity Terrain so modifying the terrain in realtime- is not possible.
Grand Canyon
The Grand Canyon sample shows the use of Fluid Modifier Volume adding water from multiple sources on top of the canyon filling the canyon below. The camera starts a boat that can be driven across the scene. Water stays in the scene due to the Open Borders functionality of the fluid simulation being disabled causing the scene to eventually flood. This scene makes use of the Unity Terrain so modifying the terrain in real-time is not possible.
Water Modifiers
The Water Modifiers sample shows the use of Fluid Modifier Waves to create different types of waves, Fluid Modifier Volume to create a vortex, and Fluid Rigidbody showcasing buoyancy and advection of objects. The camera starts overlooking the vortex, you can add water and spawn Fluid Rigid Bodies using the mouse.
Volcano
The Volcano scene showcases that different fluids can be rendered like lava. This scene uses the Lava Surface Fluid Renderer to create an erupting volcano. This scene makes use of the Unity Terrain so modifying the terrain in real-time is not possible.
Terraform
The Terraform scene showcases God Game simulation with two types of fluid interacting with each other and erosion of the top sand layer. Water and Lava are automatically added to the scene from different locations and when they touch they turn into rocky terrain and steam. Fluid and Terrain can be added using the mouse input as described in the controls section. This scene makes use of a custom terrain allowing modifications to be made to it in real-time by adding erodible sand, or non-erodible rock and vegetation.
Simple Terraform
The Simple Terraform scene a minimal version of the terraform simulation, it has a simpler UI so that it’s scripts be be easily copied to other scenes. *Note: The scripts, scene and UI components in this sample are setup with specific type of terrain layers and fluids. If you wish to reuse the scripts make sure your scene is setup the same or modify your layers accordingly
Tiled Simulation
Demonstrates multiple simulations that neighbour each other on different Terrain tiles interacting with each other. In this sample fluid from each tile can flow into it’s neighbouring tile. Allowing the creation of larger and non-square scenes. More information can be found here
Runtime Setup
Demonstrates how to setup a fluid simulation at runtime. This can be useful for when a game makes use of procedurally generated terrain that does not exist before entering playmode.
- Previous
- Next