精選文章

SmallBurger Asset Home

  SmallBurger

2025年5月12日 星期一

An Overview of GodViewFakeDOF

 



The concept for GodViewFakeDOF originated from the challenge I faced while developing a war strategy game, where I needed to implement a fog effect based on height considerations. However, the project requirements specified that fog should not affect any content in the center of the screen, regardless of altitude. To meet this requirement, I used a mask texture to filter out the fog effect from the center of the screen. Later, when trying to apply DOF effects for a GodView perspective, I found that the top-down view resulted in overly uniform depth values, making the DOF effect less pronounced. Building on my previous experience with height-based fog effects, I developed GodViewFakeDOF specifically for this type of perspective.

Traditional DOF techniques are based on depth data for processing. However, alpha-blended objects lack depth information, which makes them challenging to handle. Even if depth is output using alpha test depth pass, edge transition issues still arise, especially with alpha-blended effects, which are completely unmanageable.



Let me explain the entire processing procedure:
  1. Create a ScreenSpaceBlurPass and run it before performing post-processing.
  2. Write the related Dual-Kaswase Blur Shader.
  3. Use UV (0.5, 0.0) as the center point to calculate the blur ratio based on screen distance.
  4. If a Mask texture is used, apply the Mask data directly.
Since depth data is not used and only screen UV distance data is applied, it supports alpha-blended objects.


The related videos are as follows:


You can find it here:

沒有留言:

張貼留言