Skip to content

Alpha preserving feature for Unity URP

Notifications You must be signed in to change notification settings

keijiro/URP-AlphaBypass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URP Alpha Bypass Feature Sample

Frame 1-2

URP-AlphaBypass is a Unity URP sample project that prevents the alpha channel in the color target from being overwritten by the post-processing pass.

in URP, the post-processing pass typically clears the alpha channel (setting alpha = 1), which can be problematic if you're rendering to a render texture and need to preserve the alpha channel for compositing.

Starting from Unity 6, the Alpha Processing option was introduced in URP settings. However, this modifies how post-processing effects are applied. For instance, when Bloom and Tonemapping are used together, Tonemapping only affects areas with alpha > 0 (as shown in the figure above, where the bloom becomes overly intense due to the absence of Tonemapping in certain areas).

The Alpha Bypass feature solved this issue by storing the alpha channel before post-processing and restoring it afterward. This allows you to apply post-processing effects to the entire frame while preserving the original alpha channel values.

About

Alpha preserving feature for Unity URP

Resources

Stars

Watchers

Forks