Jump to content
  • Sign Up

    Welcome to CANOPY.

    Browse the Forums, read articles in the Library, share your work in the Gallery, get the latest in Downloads

    Want more? Subscribe and get all our assets for a fraction of their asset store purchase price!

  • The Dam Content Pack features a collection of sample assets that can be used to build a dam with water overflow VFX  in your scene. This article provides information about installing and using the pack.


    Prerequisites

    The pack requires Unity 2020.3 or higher to function, alpha and beta versions of Unity are not supported.
    To use all functions and features and follow along with the instructions below, it is recommended to install both GeNa Pro and the Extrusion Pro Plugin for GeNa Pro that features the advanced mesh extrusion system - this is used to build the actual dam structure. If you do not wish to install GeNa and the Extrusion Plugin,  you could still use the remaining content and e.g. build a regular mesh version of the dam in a 3d modeling application.

    The pack is prepared to use the HDRP / URP pipeline to showcase the usage of the VFX graph. The VFX graph package needs to be installed for this purpose.
    You can use the pack in the built-in pipeline as well, but the VFX graph used for the water overflow effects will not work then. You would also need to switch the material of the dam to the standard shader of the built-in pipeline.

    Installation

    Ensure that you have installed both GeNa Pro and the Extrusion Pro Plugin for GeNa Pro before installing the Dam Creation Pack if you intend to use the Dam Cross Section Extrusion. This will ensure that all object references are correctly maintained. You can download the Dam Creation Pack as a Canopy Pro subscriber from the Download section here:

    Dam Content Pack Download

    The pack is an .unitypackage  file that can be installed by double clicking on it, or going via Assets > Import Package > Custom Package in the unity editor Window. Upom imstallation it will be installed into the following directories.

     

                Procedural Worlds
                   Content Packs
                     Dam
                       Documentation
           
                Prefabs
           
                Content Resources
             
                Audio
                         CrossSections
        
                     Effects
                         Materials
              
               Textures
                
                Dam

     

    Using the Dam Creation Pack 

    Typical Workflow

    A typical workflow would be to

    1.      Create a Unity terrain with an area for a large lake (Gaia can be used for this).

    2.      Create a lake (GeNa Pro Rivers can be used for this).

    3.      Create a Cross Section for the Dam or use the provided Cross Section.

    4.      Create a GeNa Spline using 3 nodes for the Dam, add an Extrusion Pro extension and add the Dam Cross Section to the Extrusion Pro extension and select the material for the Extrusion (an example Cross Section and Material are provided).

    5.      Either use the provided Dam Manager prefab provided or add the provided components to your game objects (more on this later).

    6.      Create a river from the bottom of the Dam.

    Asset Layout

    Here is a brief overview of the more important content directories.

    Prefabs:

    Contains the Dam Manager Prefab.

    Resources:

    Contains the asset resources used by this asset.

    Scripts:

    Contains the component scripts for the Dam Manager, the Dam Overflow, and the Dam Audio components.

     

    Dam Mesh Creation with GeNa Pro’s Extrusion Pro

    Using the Extrusion Pro’s Cross Section Editor you can create a Cross Section that can be extruded to make a Dam Mesh.

    For more information on how to use the Cross Section Editor see the help button “?” in the upper right corner of the editor’s window.  You can also load the example Dam Cross Section into the editor to view it.  It can be found in “Assets/Gena User Data/CrossSections/Dam-CrossSection1”

    First Create a terrain with an area that you want to put the lake with a Dam.

    image.png.5eac72960e6efb5fe505fbf635ea71db.png 

    Modify the terrain using Unity’s terrain tools according to the desired result.  In this case, I want a road going around the right toward the back of the dam with another road going off the right and around the mountain.

    You will also want a fall off from the lake down to the river at the bottom.

    I use a Unity Plane, enabling and disabling it to determine what the lake water level will be, and where the Dam will be.

     image.png.16132b615a453eb123d0f83a7ac5fc03.png

    As you work the area with the terrain tools your idea for what it should look like will flourish.  Think, SCULPT, because that is what you are doing, is sculpting the terrain around the features, in this case a lake and dam, with roads and soon an entire ecosystem.

    In this section, I will use GeNa Pro’s Extrusion Pro feature to create a Dam Mesh.  You can also use a 3D modeler to create a dam and place properly.

    I will create a GeNa Pro Spline with 3 nodes.

    image.png.45fd76527cf3fa91c53d823958bd454f.png

    This spline with be used to extrude the Dam Mesh.  I have levelled the nodes with one another at about the height that I want the dam to reach.

    Add an Extrusion Pro extension to the Spline, and load the Dam-CrossSection1 cross section file. This file can be found in the folder
    Assets\Procedural Worlds\Content Packs\Dam\Content Resources\CrossSections
    in your project.

    image.png.06bda82cdeb3bc470942aff6f46e62ff.png

    Adjust the X, Y and Z of the Mesh Scale so that it fits and looks good.  Add the Dam Mat material to the Extrusion Material property of the Extrusion Pro extension. Please note that this material is set up to use the HDRP lit shader by default, but you can switch it to use the respective standard shader of the pipeline you are using if you are not running HDRP.

    image.png.2dc7d35e7b0ec0a04f1cdfc057f72380.png

    Now, create the lake by Creating a New GeNa Spline with 2 Nodes and adding the Rivers extension to it. Note that "Snap to Terrain" has been turned off so that the back of the Dam can be used to raise the water level with that node.

    image.png.eea9a386257d05ba0ad134c34a665807.png

    I’ll have to adjust the width of the river to fill the area.  But, note that I have to arrange the nodes so that the line that the spline makes is perpendicular to the dam, at some point in order for the lake ends to “mate” together.

    image.png.18b7af32166013dc3fc0929efb3b8fc5.png

    Also, in order to get the lake to flow toward the dam but be as level as possible (because GeNa Pro Rivers always flow downhill) I used the back of the dam, which I slanted ever so slightly, to adjust the dam end node. Adjust the other end to get the desired level.

    image.png.1bbd72726b872f7124c08a43760f9464.png

    Now, make the river width fill the lake area.

    image.png.a111aa4adcd5525f2df21bb481a59316.png

    You may need to sculpt the terrain around the edges to account for gaps where the river spline didn’t find the edges.  If you think about the river raycasting along the spline to find the edges, then you might imagine a circle or something that doesn’t have edges hidden from the perpendicular to the spline.  The nuance to that is the Bank Overstep, which just increase the mesh size, so it can catch hidden spots along the edge. In this case I made the bank overstep a value of 5 (meters).

    Now, extend the End Cap Distance on the River extension so that it reaches almost to where it “pokes” out of the dam. That will give you the most flexibility for shaping the terrain near the dam.

    image.png.d601c8198d536bb0b5cf8156919670d0.png

    Next, let’s create the river at the bottom of the Dam.

    Create a GeNa Pro Spline with a Rivers extension to create the river, starting from the dam.  You may not get a perfect looking river at first, but remember, we are SCULPTING a scene.

    image.png.305b6d2f38fc5bd80ef93ad5638b3634.png

    Adjust the spline and sculpt the terrain to get what you want. You can also create the River by using a GeNa River Flow starting away from the Dam and then after creating a GeNa Spline from that you can use the Carve Extension, then add more nodes to reach back up to the Dam bottom.

    image.png.b96f1ff03793f7175de6d58049f547e6.png

    Here, I’ve created a small pond on the way down the hill.

     

    Adding the Overflow Dam Water

    Now, it’s time to add that water flowing down the dam. For this exercise, let’s use the provided Dam Manager prefab, which has 4 Dam Overflow components on GameObjects. The pack contains both a manager for HDRP and URP, the difference is that they use the correct VFX graph for the respective pipeline. You can create your own GameObjects with more or fewer overflows yourself using the provided Components.  Open the Dam Manager prefab to see the layout.

    Position the Dam Manager near the top center of the Dam Mesh. You can drag the Dam Manager prefab on to the Dam face from the prefabs folder.

     image.png.300d62a90f666f544180dbcc863bf2ab.png

    You may need to adjust each individual Dam Overflow component to get a good fit for each overflow component.

    Once you have the Dam Manger and the Dam Overflow components arranged to your liking, then click the “Compute Collisions” button on each Dam Overflow Component or on the Dam Manger to have it calculate the collisions with the dam and the water below (you may need to temporarily add colliders to the river below first).

    image.png.305a06b9c08bbd85957996bd85a8f01e.png

    The settings in the Overflow are dynamic and are there for debug purposes, so the “Compute Collisions” button is the only thing to worry about there.

    In the following image, we don’t see any splashes on the river at the bottom of the Dam. So we’ll need to adjust the height of the lower water level.  Perhaps the Collision check hit the terrain.

    image.png.fa589f31bb2a8e1b76386b23475d9f58.png image.png.158adb51918a7846e95704ce2ed9de76.png

    We can adjust the lower water level on the Dam Overflow Components VFX parameters.

    image.png.0d90980a084499a23a3e3f26f709d774.png

    The value that you need will vary depending on how far down from the top of the dam it is to your river.

    Once you have a good “Lower Water Level” value, copy it to the other instances of the Dam Overflow components.

    The Dam Manager Settings

    image.png.73a38cbc939058a5b259e139bb5f0def.png

    The Delay Before Start value is the time in seconds to start an animation sequence, if you choose to animate the water overflow timing.

    Checking the Animate option will use the values that follow to execute the animation.

    The “Water Volume Curve Time” value is the time in seconds that the execution of the animation curve will take place.  The animation curve is defined from 0 to 1.

    The Water Volume Flow curve defines values from 0 to 1 to send to the Overflow Components. These value that will be sent is the value which is found at the current time divided by the Water Volume Curve Time.

    Splashdown Time is the time that it takes the water, upon start, to reach the bottom. This value is used to begin an increase of the volume of the audio based on the time it takes the water to reach the river at the bottom.  Adjust it according to your taste.

    The “Compute All Collisions” button will compute the collisions for all the Dam Overflows.

    Now, hit the play button and see what you have created.

    Tips

    1.        You may want to adjust the strength of each Dam Overflow component to a slightly different value, so that each has its own character.

    2.      The Dam Manger has a Decal Projector attached which may not fit your Dam. It is included to add a “wet look” to the dam where the water flows. Remove it, or adjust the Decal Projectors values to fit your scenario.  You may also need to change the Normal map used for the Decal Projector to match your Dam’s normal map at the place you are making it “wet”.

    • Like 1

    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...