https://learn.unity.com/project/make-a-flag-move-with-shadergraph
URP 简介
https://learn.unity.com/tutorial/introduction-to-urp?uv=2019.4&projectId=5d0a4b59edbc2a001fe52445#5fc3f3ecedbc2a55bbadc214
ShaderGraph: Vertex Position
The Position node provides access to the Mesh vertex or fragment’s position. It controls how a Shader behaves in a Scene and in what space it renders. For example, if you change the position to View, the shader will always render from the view direction of the camera. The output is the coordinate space that can be determined by the Space dropdown. This node has a single output and one parameter.
Parameter:
- Space: Allows you to select the coordinate space of Position to output. It has the following options, Object, View, World, and Tangent.
- Object: When you want the Position to based on the object's coordinates within the scene. It’s useful for using coordinates related specifically to the object that the shader is attached to.
- View: When you want to use the viewer coordinates. It’s useful when you want to use the position and direction the viewer is facing to affect your Shader.
- World: This option is useful when you want to use the coordinate system for the entire Scene. Useful for when you want to use the positional data of the entire Scene rather than being restricted to the object or view coordinates.
- Tangent: This option derives the positional coordinates the best approximates an object as a given point. Imagine a point on a sphere where various planes are going through that point. One of those planes touches the sphere ever so gently, simultaneously coming as close as possible to all nearby points.
Sample Gradient
The Sample Gradient has two inputs and a single output. This node takes Gradient and Time as its inputs. The Time variable is used to move through the Gradient from one end to the other. You can use this to animate through the Gradient or pick a specific position, or color, within the Gradient.
挑战:将节点应用于旗帜
https://learn.unity.com/tutorial/apply-nodes-to-the-flag?uv=2019.4&projectId=5d0a4b59edbc2a001fe52445#
- 添加 Sine 节点和 Time 节点以随时间调整顶点。然后将效果隔离到一个轴以产生波浪效果。
- 使用 UV 节点来遮盖旗帜的移动,使一条边保持静止(一端连接到旗杆),而另一端可以自由移动