?? How to make 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 has two types of daytime water (daylight water) and night water (nighttime water) in water (water), the Professional edition of standard resources (pro Assets), 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 to do this is to change it in the mesh filter of the Water object:
Create water from the beginning (advanced)
Simple water in Unity requires attaching a script to a plane-like grid and using the water shader:
- A grid that is practical for water. The grid should be flat. Horizontal direction. UV coordinates are not required.
Water game objects should use a water (water) layer (layer), which can be set in the viewer (Inspector).
- Attach the Watersimple script to the object from standard resource (Assets)/water (water)/source (Sources).
- Use the Fx/water (simple) shader in the material, or adjust one of the supplied water materials (easy-to-day water (daylight simply water) or simple water at night (nighttime easy water).
Reflected/refracted water in Unity Pro requires a similar procedure to start from scratch:
- A grid that is practical 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).
- 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.
- 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. |
|
The second normal map is half the size of the first sheet. |
wave velocity (wave speed) |
first normal map (numbers 1th and 2nd) and second normal map (3rd and 4th The scrolling speed of the number). |
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) |
Suppose that too old a video card can not perform any of the better shader, on this kind of video card to represent the water texture. |
Hardware support
- Reflection + refractive water is capable of supporting Pixel Shader 2.0 (GeForce FX and higher version numbers. Radeon 9500 and later version number. The Intel 9xx) is executed on the graphics card. Use reflective water on the old graphics card.
- The reflected water can be executed on graphics cards that support pixel shader 1.4 (GeForce FX and higher, Radeon 8500 and later, Intel 9xx). Use simple water on the old graphics card.
- Simple water can be used on whatever machine. The level of detail applied varies depending on the hardware capabilities.
Unity3d graphics problem How to make water?