General
Since I will soon return to China for an internship, this sprint also included many tasks that were originally planned for later sprints, so the overall team schedule would not be affected.
Building on the previous sprint, I fully completed the water material and waterfall effects.
Water
Caustics
The main idea was to use a fake caustics texture, which I created in Substance Designer.
I then sampled the texture using the XY coordinates of the world-space position reconstructed from depth. Since the water itself does not write to depth, I used the reconstructed world position from the scene depth to sample the caustics texture. By adding opposing UV flows, I was able to create a convincing underwater caustics effect.
The most difficult part was finding a reliable way to reconstruct world-space position from depth in UE5. Unreal and Unity handle this differently, so I spent quite a bit of time working through the problem.
Magic Spark
To better match the overall scene, I also added a subtle fake particle effect to the water. Our scene already has a fairly dense particle atmosphere, so this helped the water sit more naturally in the environment. The effect is made with two Perlin Noise textures flowing in opposite directions, followed by a Step operation.
Matcap
Although it may be hard to see clearly in the screenshots, I wanted the water to retain some ambient lighting in darker environments. UE's default physically based ambient lighting was too dark for this stylized water style, so I added a Matcap texture to provide a bit of extra environmental light.
Waterfall
Before starting the material work, I first quickly modeled a waterfall mesh plane in Blender. To keep the edges transparent, I painted vertex colors and used them as a simple mask for edge transparency.
The main body of the waterfall was built with a different approach from the water material. I did not use the Single Layer Water shading model here. A waterfall usually behaves more like a thin sheet, and it generally does not have enough depth variation to drive shallow-to-deep color changes in the same way as a water surface. Using Transparent Lit made the result more direct and easier to control.
The most important part of the waterfall is the foam. The core approach is UV flow, UV distortion, and applying Step operations to noise textures to create the flowing stripe patterns I wanted. The foam system mainly includes Main Foam, Detail Foam, Waterline, and Edge Foam. Edge Foam is generated around objects intersecting with the waterfall, and its logic is similar to shoreline waves: it is calculated based on the distance to the nearest surface.
I also added some Magic Spark to the waterfall, but with a different implementation. In this case, I baked the sparkle pattern into a texture and animated it with UV flow.
There is also a Waterfall Wave effect, which is a fake effect for the pool below the waterfall: a wave spreading outward from the impact area. The idea is quite similar to the other effects, using UV flow and UV distortion to manipulate noise and produce the final result.
The most time-consuming parts were parameter tuning and creating a large number of noise textures.
没有评论:
发表评论