unity 中震动提示_Unity中的水提示
unity 中震动提示
This post will show you how to create water with a custom mesh, adjust the settings and gain some artist insight into making water look nice. To keep up to date with the latest tech this post will primarily concentrate on new Pro water stuff, but later on there are some general tips which should be useful to all.
这篇文章将向您展示如何使用自定义网格创建水,调整设置并获得一些艺术家的见解,使水看起来更漂亮。 为了跟上最新技术,本文将主要集中在新的Pro水产品上,但是稍后有一些通用提示对所有人都有用。
什么元素造水? (What elements make water?)
Hydrogen & Oxygen
氢氧
在Unity中? (in Unity?)
There are many different types of water you can create or use from prefabs. To take advantage of the latest water effects and scripts I will be concentrating on the Water4ExampleSimple assets which are essentially a couple of 3D meshes representing your water surface, with:
您可以使用预制件制造或使用多种不同类型的水。 为了利用最新的水效果和脚本,我将专注于Water4ExampleSimple资产,这些资产本质上是代表您的水表面的几个3D网格,具有:
- WaterTile script WaterTile脚本
- Water shader 水着色器
An empty object indicating the world space placement with:
一个空对象,用于指示世界空间位置,其中包括:
- A Water script which exposes the colours, normal texture and main parameters for the effect 一个Water脚本,可以显示效果的颜色,正常纹理和主要参数
- A reflection script 反射脚本
- An optional lighting script for specular effects 用于镜面反射效果的可选照明脚本
- An optional displacement script 可选的置换脚本
我该怎么做水? (How can I make some water?)
The simplest way is to drag the prefab into your scene, and assign your custom mesh:
最简单的方法是将预制件拖到场景中,并分配自定义网格:
- Assets > Import Package > Water (pro only) 资产>进口包装>水(仅限专业人士)
- In the project window open the Standard Assets > Water (Pro only) folder 在项目窗口中,打开“标准资产”>“水”(仅限Pro)文件夹
- Open up Water4 folder 打开Water4文件夹
- Drag the Water4Example (Simple) Prefab into your scene 将Water4Example(Simple)Prefab拖放到场景中
- Position approximately where you need it 大约放置在您需要的位置
-
Select one of the tile meshes, go to the mesh component in the inspector > select the round target icon on the right and choose your mesh (must be in your project)
选择一个平铺网格物体,转到检查器中的网格物体组件>选择右侧的圆形目标图标,然后选择您的网格物体(必须在您的项目中)
- Rotate the Water4ExampleSimple parent node 90 degrees, if your mesh comes in at the wrong angle (this can be caused when you export from a 3D app with a different co-ordinate system to Unity) 如果您的网格物体以错误的角度进入,则将Water4ExampleSimple父节点旋转90度(这可能是从具有不同坐标系的3D应用程序导出到Unity时引起的)
- Place your mesh by moving the parent node 通过移动父节点放置网格
-
Remove the second tile mesh
删除第二个瓷砖网格
设定值 (Settings)
Once you have your mesh as water you can begin to play with the settings. Select your Water4ExampleSimple node, and check the parameters in the inspector.
一旦将网格物体变成水,就可以开始使用设置了。 选择您的Water4ExampleSimple节点,然后在检查器中检查参数。
水基 (Water Base)
平面反射 (Planar Reflection)
This script is for enabling/disabling realtime planar reflections. Reflections are claculated in relation to the height of the parent mesh that has this script attached to. So the local Y transform of child meshes should be 0. Here you can also enable the reflections to include (or not) the skybox.
该脚本用于启用/禁用实时平面反射。 反射与附着此脚本的父网格的高度有关。 因此,子网格物体的局部Y变换应为0。在这里,您还可以启用反射以包括(或不包括)天空盒。
镜面照明 (Specular Lighting)
You can adjust the specular power from here and drag’n’drop any transform to indicate a specular light source. This can be your directional light transform or any other game object (doesn’t need to be a light).
您可以从此处调整镜面反射功率,并拖放任何变换以指示镜面反射光源。 这可以是您的定向灯光变换,也可以是任何其他游戏对象(不需要是灯光)。
格斯特纳位移 (Gerstner Displace)
Here you can adjust the settings for the wave generation created by the Gerstner waves generation algorithm.
在这里,您可以调整Gerstner波浪生成算法创建的波浪生成的设置。
水上艺术技巧 (Water art tips)
- Go and check out some actual water – its always wise to get some visual ref for what you are trying to do. Make a video if you can. 去检查一些实际的水-通常明智的做法是为您要做的事情获得一些视觉参考。 如果可以,请制作视频。
-
Water absorbs red light from the spectrum reflecting back more green and blue rays, in additions to sky, which gives water the impression of being Blue in colour so:
水吸收了光谱中的红光,除了天空以外还反射了更多的绿色和蓝色光线,这给水带来了蓝色的印象,因此:
- You can’t make your surface blue (and you probably shouldn’t) but if you use green and blue colours on the surfaces below the water such as a pool you can help with the illusion. 您不能将表面设为蓝色(您可能不应该),但是如果您在水面以下的表面(例如游泳池)上使用绿色和蓝色,则可以帮助您解决错觉。
- (I guess this is why Pool designers use green/blue/turquoise tiles). (我想这就是Pool设计人员使用绿色/蓝色/青绿色瓷砖的原因)。
- The darker the blue, the deeper water appears – you can use a darker colour on the bottom and tint the refraction darker. 蓝色越深,出现的水越深–您可以在底部使用较深的颜色,并使折射色变深。
-
Moderate the effects, subtlety can help suspend disbelief, be sure to experiment but think about moderating:
适度地发挥作用,微妙可以帮助暂时置疑,一定要尝试一下,但要考虑缓和:
- Scrolling speed of normals 法线滚动速度
- Reflection 反射
- Refraction 折射
- Fresnel and Normal strengths 菲涅耳强度和法线强度
- Displacement 移位
- One useful tip is to turn practically everything off e.g. set sliders to zero and then build up the effects to get the desired impact. 一个有用的技巧是关闭几乎所有内容,例如将滑块设置为零,然后建立效果以获得所需的效果。
- If you have a convex mesh (such as water fall/pool lip) add poly detail to the curve to help the water ‘bend’. 如果您有凸形网格(例如,水流/池唇),请在曲线上添加多边形细节,以帮助水“弯曲”。
Next time > Water 4 Advanced is the same tech but with foam and depth extinction.
下次> Water 4 Advanced是相同的技术,但具有泡沫和深度消光功能。
翻译自: https://blogs.unity3d.com/2011/10/07/top-tips-for-water-in-unity/
unity 中震动提示