How I built a realistic grass shader in UE5! Shader driven bend, clump, tilt, wind and more!

Ghislain Girardot
29 Feb 202443:51

Summary

TLDRIn this comprehensive video, the creator shares an in-depth guide on crafting realistic animated grass using Blender and Unreal Engine. The tutorial builds upon a previous video that introduced a 2D wind system and grass animation techniques. Here, the focus shifts to advanced methods for achieving a natural and fluffy appearance in animated grass. The artist is inspired by the grass rendering in 'Ghost of Tsushima' and explores the potential of world position offset for creating dynamic grass features. The video delves into intricate details, such as reconstructing world positions, applying instance scaling, and utilizing vertex normals for random 2D directions. It also covers the creation of a clump map for added realism and the application of various shaders and techniques to manipulate the grass's appearance based on environmental factors like wind and landscape. The summary also touches on the challenges and solutions related to normal mapping and the importance of managing vertex count and LODs for performance optimization. The creator concludes by teasing upcoming content on foliage asset creation in Blender and the development of a related Blender addon.

Takeaways

  • 🌱 The video is a tutorial on creating realistic animated grass using Blender and Unreal Engine, focusing on techniques for natural and fluffy animations.
  • 🎨 The creator used Niagara to build a 2D wind system and dynamically generate a tiling wind texture, as well as animating grass and achieving a spherical projection trick.
  • 📐 The grass mesh is non-traditional, with flat cards oriented towards the positive x-axis, and utilizes UV mapping for texturing and baking pivots, height, and random values for variation.
  • 🌿 World Position Offset (WPO) is central to achieving the grass features, with the idea of controlling features and their randomization for a more natural look.
  • 🤔 The video explores the Ghost of Tsushima game's grass rendering as inspiration, despite not having the same level of UI and rendering pipeline knowledge.
  • 💡 A key technique involves reconstructing world position from scratch and converting it to an offset, which simplifies vertex manipulation for the grass.
  • 🔄 The use of a 3x3 matrix to rotate each grass card randomly around the z-axis allows for more control and leads to more natural-looking grass.
  • 🌬️ Wind effects are integrated into the grass animation, with the wind direction influencing how much the grass cards tilt, simulating a 'sail' effect.
  • 🌄 A clump map is created to define areas where grass clumps together, adding to the natural and chaotic look of the grass field.
  • 🎭 The grass shader includes features for controlling the scale, bend, and orientation of the grass, with texture maps used to randomize these features.
  • 📉 The video discusses the importance of managing the vertex count and level of detail (LOD) to maintain performance, especially when using complex shaders and effects.

Q & A

  • What is the main focus of the video series?

    -The video series focuses on explaining how to create realistic-looking grass using Blender and Unreal Engine, with a particular emphasis on techniques for animating and rendering the grass.

  • What was covered in the first video of the series?

    -The first video covered the use of Niagara to build a 2D wind system, dynamically generating a tiling wind texture, and a simple way to animate grass using the texture. It also demonstrated a spherical normal projection trick.

  • What are some of the cool tricks showcased in the second video?

    -The second video showcases various tricks to create natural and fluffy looking animated grass, including using World Position Offset for grass mesh features, orientation, and control over these features' randomization.

  • How does the grass mesh used in the video differ from typical grass meshes?

    -The grass mesh used in the video has flat cards that are purposely undeformed and oriented towards the positive x-axis, which is not typical for grass meshes. This unique design allows for more control over the grass's appearance and behavior.

  • What is the purpose of using a 3x3 Matrix for rotating cards?

    -The 3x3 Matrix is used to rotate each card around three axes, allowing for more complex and natural-looking rotations. This method also enables the creation of cool effects, such as random rotations and aligning cards with the landscape normal.

  • How does the video approach wind animation for the grass?

    -The video uses a combination of wind direction from a texture and the direction each card is facing to modulate how much wind is applied. This creates a more natural response to wind, with grass blades acting somewhat like sails.

  • What is the significance of using a Clump Map in the grass shader?

    -The Clump Map is used to create clusters of grass, adding more randomness and a natural look to the grass field. It influences the position and tilt of the grass cards, contributing to the overall visual complexity and realism.

  • How does the video address the issue of perceived grass density?

    -The video discusses the use of Billboards or camera-facing cards to maximize pixel coverage and improve perceived grass density. It also explores techniques like pixel depth offsetting to give the illusion of depth in the grass.

  • What is the role of the landscape layer capture tool mentioned in the video?

    -The landscape layer capture tool is used to bake the painted landscape grass layer into a texture, which can then be projected in world space in the grass shader. This helps to create a smooth transition between grass and other layers like dirt.

  • How does the video handle the challenge of normal reconstruction for the grass?

    -The video describes a process of rebuilding a world space normal from scratch due to the complexities introduced by vertex offsetting and encoding a random direction in normals. It uses various techniques, including a Lerp function and a cheat method of luring the normal towards the tilt direction.

  • What are some performance considerations mentioned in the video for rendering grass?

    -The video emphasizes the importance of keeping the vertex count under control, being aggressive with LODs (Level of Detail), and minimizing quad overdraw to maintain decent performance with a large amount of grass instances.

Outlines

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Mindmap

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Keywords

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Highlights

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级

Transcripts

plate

此内容仅限付费用户访问。 请升级后访问。

立即升级
Rate This

5.0 / 5 (0 votes)

相关标签
BlenderUnreal EngineGrass AnimationShader Techniques3D ModelingGame DevelopmentVideo TutorialLandscape RenderingWorld Position OffsetTechnical Art
您是否需要英文摘要?