About the use of water and fog in unity

Source: Internet
Author: User
Tags assert pixel coloring

Water

It's a bit of a hassle to do water and fog on your own, but it doesn't matter, unity helps us do a lot of things that we can use.

1.Unity has achieved water effects to help us solve the problem of water in the game

2.Unity of water is integrated in the Environment Environment Resource Pack, the method of import is: Assert---->import---->environent Import

Need a formal version to see this menu, no matter, we can use the online others export package

3. Moisture is water and water (basic) Two folders, the basic effect is poor, but the CPU is lower. Two folders have a prefabs Prefab folder, the folder below there are two files, corresponding to daytime and nighttime water.

4. Water is shader to achieve, so to see the water corresponding to the shader, you can adjust the parameters.

Examples of water environment

1.Assert---->import Packages---->cuotom Packages---->environment.unitypackage, e:\ movie \unity video\47

2. Enter the Assets\standard assets\environment\water\water\prefabs, drag the preform waterprodaytime into the scene, or select the water preform in basic

3. If the water area is not large enough, you can set the scale of the node

4. Create the project's file directory, res, scenes, scripts, save scene

5. In fact, in Assets\standard assets\environment\water\water\materials, put the material of the water, these materials shader properties are written by its own shader, We can also adjust the water speed in the material panel

6. The most realistic is assets\standard assets\environment\water\water4\prefabs inside, that is, water below the Water4 water of the precast body, it both vertex changes, but also has the change of pixel coloring, While the other water is just pixel coloring in the change, the worst is water (basic) below the water, medium is water below the water.

Fog

1. Turn on Unity's fog mode: Window---->lighting, tick fog

2.Fog mode: linear,exponential,exponential squared;

Linear: Fog starting from Start, close to end thicker

Exponential: Can be equipped with parameters density, the concentration of fog, the greater the intensity of fog

Exponential squared can be equipped with parameters density, the larger the fog is thicker

The color of the 3.Fog color fog, you can configure the color of the fog.

4. The Rendersettings class in the code is used to set the properties of the fog.

Fogmode: Can adjust the fog mode, turn off the fog fogmode=0

Fogdensity: Can adjust the fog concentration

Start,end fogstartdistance fogenddistance Linear mode

Examples of fog

1.Assert---->import Packages---->cuotom Packages---->motten.unitypackage, e:\ movie \unity video\47

2. Enter the ASSETS\FBX and drag the precast body of the mountain into the scene

3.Window---->lighting, check fog, configure density fog concentration

4. When the fog is opened, if you want to see the object, you must be close to, the higher the concentration, the closer you will be able to see

5. When the fog is turned on, it is common to configure the white sky box so that it does not look abrupt.

About the use of water and fog in unity

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.