Unity3d How to use water for graphics problems?

Source: Internet
Author: User

How to use water?

Note: The content described on this page applies only to Desktop editor mode.

The standard resources for Unity and the standard Resource Pack for Professional Edition Assets packages include a number of water presets (including required shaders, scripts, and art resources) in Assets and pro standards. Unity includes a basic water effect, while Unity Pro includes water with real-time reflection and refraction, both of which offer water presets that are separated by day and night.

Daytime water reflection effect (Unity Pro)

Water reflection/refraction effect during the day (Unity Professional Edition)

Water settings

In most cases, just put an existing preset (PREFAB) into the scene (verify that standard Assets installed is installed):

    • Unity has two types of daytime simple water (daylight simple water) and night water (nighttime simplicity water) in water (water), standard Assets.
    • The Unity Professional Edition is available in the Professional edition of standard resources (pro Assets), water (water) with daytime water (daylight water) and night water (nighttime water), but requires standard resources Assets), some of the resources in water (water). The water mode (simple, reflective, refraction) can be set in the viewer (Inspector).

Presets use an oval grid to represent water. If you need to use a different mesh, the simplest way is to change it in the mesh filter of the Water object:

Create water from scratch (advanced)

Simple water in Unity requires attaching a script to a plane-like grid and using the water shader:

    1. Has a grid for water. Should be flat grid, horizontal orientation. UV coordinates are not required. Water game objects should use a water (water) layer (layer), which can be set in the viewer (Inspector).
    2. Attach the Watersimple script to the object from standard resource (Assets)/water (water)/source (Sources).
    3. Use the Fx/water (simple) shader in the material, or adjust one of the supplied water materials (easy water during the day (daylight simplicity Water) or simple water at night (nighttime easy water).

The reflection/refraction water in Unity Pro requires a similar step from the beginning to setup:

    1. Has a grid for water. Should be flat grid, horizontal orientation. UV coordinates are not required. Water game objects should use a water (water) layer (layer), which can be set in the viewer (Inspector).
    2. The water (water) script is attached to the object from the Professional Edition standard Assets/Water (water)/source (Sources).
      • The water rendering mode can be set in the viewer (Inspector): simple, reflective, or refracted.
    3. Use the Fx/water shader in the material, or adjust one of the supplied water materials (daytime water (daylight water) or night water (nighttime water).
Properties of water material

These properties are used in the reflection and refraction (reflective & refractive) water shader. Most are also used for simple water shaders.

   
wave size (wave s Cale)
reflection/refraction distortion (reflection/refraction distort) wave normal map distorted reflection/refraction Amount 。
refraction color (refraction color)
ambient reflection/refraction (Environment reflection/refraction) real-time reflection and refraction rendering textures.
wave velocity (wave speed) first normal map (numbers 1th and 2nd) and the second normal map (numbers 3rd and 4th) Scrolling speed.
Fresnel (Fresnel)

The rest of the properties are not used in reflection and refraction shaders (reflective & refractive shader), but are also set up so that the user's video card is not supported and must be returned to a simpler shader:

Reflection Color (reflective color)/cube and Fresnel (Cube and Fresnel) Defines the texture of the water's color (RGB) and Fresnel effect (A) according to the perspective.
Horizon colors (Horizon color) The color of the water on the horizon. (used only in simple water shaders)
Backing texture (Fallback texture) If too old a video card can not run any better shader, on this kind of video card to represent the water texture.
Hardware support
    • Reflection + refraction water can be run on graphics cards that support Pixel Shader 2.0 (GeForce FX and later, Radeon 9500 and later, Intel 9xx). Use reflective water on the old graphics card.
    • The reflected water can be run on graphics cards that support pixel shader 1.4 (GeForce FX and later, Radeon 8500 and later, Intel 9xx). Use simple water on the old graphics card.
    • Simple water can be used on any machine, with different hardware capabilities and different levels of detail applied.

Unity3d How to use water for graphics problems?

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.