- Game Design Document (GDD)
unity project design sample
Get started on your guided project
4.What is rendering?
5.What are render pipelines?
6.Choose a render pipeline
- Unity’s Built-In Render Pipeline works on all platforms and is pretty reliable. It’s easy to use, but it is built-in to Unity, so it’s not very customizable. It isn’t the most efficient, either.
- The Universal Render Pipeline (URP) is ideal for mobile, web, and VR projects, since it is highly optimized for performance. It’s a bit more complex to configure, but it is more customizable than the Built-In Render Pipeline. It can produce pretty decent graphics.
- The High Definition Render Pipeline (HDRP) is designed to produce high-quality graphics for high-end platforms, like consoles or gaming computers, where there is plenty of processing power. It is very complex to configure, so should only be used by people with lots of graphics experience.
- URP and HDRP are both Scriptable Render Pipelines (SRPs). SRPs are highly customizable and can even be written from scratch. Since writing a render pipeline is a big task, Unity provides these two SRPs as templates, which will handle most projects.
7.Create a new URP project
-
From the main menu, select Edit > Project Settings > Quality. At the center of the panel, you will see Low, Medium, and High Quality Levels and a green checkbox indicating the default quality level for each target platform.
-
When you cycle through these quality settings, you are actually changing which URP Asset
is used to render the scene.
-
URP Assets
control many quality settings in your project – especially related to light and shadows – and can be found in the Project window just like any other asset.(In the Quality Settings window, double-click the URP asset, which is named UniversalRP - High/Medium/LowQuality.)
-
URP asset documentation
Develop your critical evaluation skills
6.Try the decision-making framework
- Why is it important? Perhaps the feature is something that appeals to you creatively, but is it integral to your target user experience? Perhaps it doesn’t seem to be critical at this stage, but it does enhance the worldbuilding or the narrative design of the experience in a particular way — how important is that to you?
- What do you need to know? Exploring the issue further might include working out: the complexity of implementing the feature to a basic level; whether you can do it yourself or need external support; any dependencies between the feature and other systems in your experience; the current timeline for the prototype and whether including the feature is feasible; the viewpoint(s) of your target users.
- Who is impacted? This could include identifying the people who will: complete the work; test and evaluate the work; support you if there are technical or design issues; be impacted if the feature cannot be delivered or the prototype is delayed.
- How can you mitigate potential risks? Here this could include: working through a low fidelity (lofi) paper prototyping approach to test the feature further before commiting; identifying a cut-off point to decide whether or not the feature is in scope for the prototype, to allow a little further exploration; minimally scoping the feature for the prototype; finding additional support to help you implement the feature.
Shaders and materials
Explore meshes and rendering
- The Mesh Filter component points to the mesh coordinate data in your project. You can even replace the mesh here if you wish by selecting the object selector (circle icon) and picking a mesh from any other object in the project, such as an apple. Sometimes this is useful if you do a lot of work on a GameObject in Unity (with shaders and materials or animation, for example) and then you want to change the mesh — you can re-import a new mesh and replace it.
Explore shaders
- Fragment shading, also known as pixel shading, is the shading that represents mesh surfaces to produce the color of each pixel in the 2D image. In this project, we’ll be working with fragment shaders and discussing in detail how they render with the light in the scene.
- Vertex shading operates on the vertices of the mesh, typically changing their locations to make the surface move or transform. We won’t cover vertex shading in this learning experience, but we will provide more resources in a future tutorial.
- Lit shaders respond to the light in the scene, and unlit
shaders don’t. Unlit shaders are useful for certain artistic effects or for optimised projects that run more efficiently by not using lighting.
-
pipeline submenu
- 2D > Sprite-Lit-Default: Designed for 2D projects, this shader is for flat objects only and will render any 3D object as 2D. As a lit shader, it will render based on the light in the scene that reaches the object.
- Particles > Lit, Simple Lit, and Unlit: These shaders are for visual effects (VFX). In the Creative Core pathway, you will use these shaders in the VFX mission.
- Terrain > Lit: This shader is optimized for use with the Terrain tools in Unity. In the Creative Core pathway, you will use this shader in the Prototyping mission.
- Baked Lit: This shader is automatically applied to lightmaps, which you will encounter in the Creative Core pathway’s Lighting mission.
- Complex Lit, Lit, and Simple Lit: These are all variations on a general-purpose, physically based lit shader.
- Unlit: As described above, a shader that does not use light.
In this learning experience, we will use the Universal Render Pipeline/Lit Shader, a physically based shader. Because it is physically based, the materials we define will be based on properties of real-world surfaces, such as albedo color, specular value, and reflectivity — concepts you will learn in future tutorials.
Manage materials in a project
- the shader defines what a surface can look like, while the material defines what it does look like.
Automatic material upgrade for URP
Several other materials in this project are also broken so that we can demonstrate URP’s built-in tool to convert broken materials.
1. Open the folder Assets > CreativeCore_Shaders > Materials > Standard to view the materials that use the Built-In Render Pipeline’s Standard Shader. If you select any of these materials, you will notice the magenta colored preview in your Inspector window.
2. From the main menu in the Unity Editor, select Edit > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to UniversalRP Materials.
3. A popup will ask you to confirm that you have a backup of your project. You haven’t done much here yet, so don’t worry about it. Select Proceed. The materials will turn from magenta to their normal colors.
This feature is available in Unity projects that use the Universal Render Pipeline. Remember this trick when you are importing packages of assets that were developed in another render pipeline or when you are converting a project from a different render pipeline to URP.
- When you select this, t:Material appears in the search box of the Project window. The search using t: denotes the type of asset. (You could use this to search for all scripts in your project by typing in t:Script.) Leave it as is for now.
Simulate solid surfaces
- When light comes in contact with any object, it can do one of three things: bounce off of it, which is known as reflection; pass through it, if the object is transparent or translucent; or be absorbed by it.
- two ways that light reflects from an object: there are specular reflections
and diffuse reflections
- In Unity, to represent diffuse reflectivity the URP/Lit Shader calls for a Base Map, which you have already used. Other shaders commonly call this property Albedo or Diffuse Map
- The property of a surface that makes it look like metal is called specularity
Create translucent and transparent effects
Shader Graph
https://learn.unity.com/tutorial/get-started-with-shader-graph?uv=2020.3&pathwayId=61a65568edbc2a00206076dd&missionId=619f9b6cedbc2a39aabd7b1e#619cb81eedbc2a209c88c58f
- **Shader Graph 工具栏 (1)**是您保存着色器资源的地方。
- **Blackboard (2)**包含可供使用此着色器创建材质的艺术家使用的属性。您可以在此处定义属性类型及其名称、属性和默认值。
- 您的**工作区 (3)**将在其中创建着色器的节点图。
- 主**预览窗口 (4)**将为您提供着色器外观及其行为方式的实时更新。
- **Graph Inspector 窗口 (5)**将显示您选择的任何节点的当前设置、属性和值。
- **Master Stack (6)**是定义着色器最终表面外观的着色器图的终点。它列出了顶点着色器和片段着色器的主要着色器属性,并为您提供了插入必要值的末端节点。
Lighting
- Window > Rendering > Light Explorer
Unity 的全局照明系统
Baked Global Illumination 系统包括:
- 光照贴图:预先计算场景中表面的亮度并将结果存储在称为光照贴图的纹理中的过程。这个全局照明系统使用一个称为Progressive Lightmapper的特定光照贴图系统来完成这个过程。
- **Light Probes:**一种用于测量(或探测)有关穿过场景中空白空间的光的数据的工具。
- **反射探针:**在 Unity 中模拟更真实反射的工具。
Realtime Global Illumination 实时全局照明系统包括:
- **光照贴图:**这个全局照明系统使用了一个已弃用的光照贴图,称为 Enlighten 光照贴图。
- 光探头:光探头在这个全局照明系统中具有一些附加功能。
Creative Core路径使用的通用渲染管线 (URP)不支持实时全局照明系统。
The Progressive Lightmapper
天空盒
https://learn.unity.com/tutorial/configure-the-directional-light-and-skybox?uv=2020.3&pathwayId=61a65568edbc2a00206076dd&missionId=61a106efedbc2a5554f0dcba#619cce89edbc2a14f503f01e
Skybox着色器有两类:
- **Textured:**一组使用材质纹理生成天空盒的着色器。
- Procedural :使用材质上的属性来生成天空盒的着色器。
颜色空间
Color space
阴影
- The Depth Bias and Normal Bias properties help address issues where pixels on an object are in shadow but should actually be lit (this is known as shadow acne).(有助于解决对象上的像素处于阴影中但实际上应该被照亮的问题)
- Cascades Count属性。这控制了您的项目中使用了多少阴影级联。这些有助于解决由定向光(透视锯齿)创建的靠近相机的阴影像素化问题。在场景中使用的级联越多,阴影受透视锯齿的影响就越小。
- 软阴影和阴影级联都使用内存和带宽进行渲染,但它们的处理强度低于使用高分辨率阴影贴图,后者是提高场景中阴影质量的一种替代方法。
- **黄色:**游戏对象未设置为静态,并且对光照贴图计算没有任何贡献(颜色或光)。它仍然从场景的 Light Probes 接收光照数据。在您的场景中,球体应该是黄色的。
- **蓝色:**GameObject 包含在光照贴图计算中,它从场景的光照贴图中接收光照数据。这是完全烘焙的游戏对象的标准状态。场景中的环境和道具应该是蓝色的。
- **红色:**GameObject 包含在光照贴图计算中,它从场景的 Light Probes 接收光照数据。要使其变为红色,您的球体需要标记为静态并有助于场景中的光照贴图。
光照烘焙选项
- **Max Bounces:**间接照明中包含的最大光反弹数。
- **光照贴图分辨率:**这控制光照贴图的质量。降低分辨率会降低烘焙照明的质量,但也会减少烘焙时间。
- **Albedo Boost:**这可以控制 Unity 在场景中的表面之间反射的光量。增加该值将增强场景中材质的反照率。
- **间接强度:**这控制光照贴图中间接光的亮度。
错误排查
https://learn.unity.com/tutorial/refine-and-troubleshoot-the-indoor-scene?uv=2020.3&pathwayId=61a65568edbc2a00206076dd&missionId=61a106efedbc2a5554f0dcba#
- 将Max Bounces 增加到超过4几乎不会提供额外的光线,但会导致更长的烘焙时间。
反射
更多信息:
https://docs.unity3d.com/cn/2019.4/Manual/LightingGiUvs.html
https://docs.unity3d.com/cn/2020.3/Manual/LightingGiUvs-GeneratingLightmappingUVs.html