Convert Figma logo to code with AI

QianMo logoX-PostProcessing-Library

Unity Post Processing Stack Library | Unity引擎的高品质后处理库

3,097
668
3,097
2

Top Related Projects

Post Processing Stack

2,084

A collection of custom post processing effects for Unity

Quick Overview

The X-PostProcessing-Library is a collection of high-quality, customizable post-processing effects for Unity, designed to enhance the visual quality of games and applications. It provides a wide range of post-processing effects, including Bloom, Depth of Field, Ambient Occlusion, and more, allowing developers to easily integrate these effects into their projects.

Pros

  • Extensive Effects Library: The library offers a comprehensive set of post-processing effects, catering to a wide range of visual styles and requirements.
  • Customizable and Flexible: The effects can be easily customized and tweaked to fit the specific needs of a project, allowing for a high degree of control and fine-tuning.
  • Performance-Optimized: The library is designed with performance in mind, ensuring that the post-processing effects can be applied without significantly impacting the overall performance of the application.
  • Unity Integration: The library is designed specifically for Unity, making it easy to integrate and use within the Unity development environment.

Cons

  • Learning Curve: The library may have a steeper learning curve for developers who are new to post-processing effects or Unity development.
  • Dependency on Unity: The library is tightly coupled with the Unity engine, which means that it may not be suitable for developers working with other game engines or platforms.
  • Limited Documentation: While the library is well-documented, some developers may find the documentation to be lacking in certain areas or not as comprehensive as they would like.
  • Potential Performance Impact: Depending on the complexity of the post-processing effects used, there may be a noticeable performance impact on the application, especially on lower-end hardware.

Code Examples

Here are a few code examples demonstrating the usage of the X-PostProcessing-Library:

// Applying the Bloom effect
var bloomSettings = new BloomSettings
{
    intensity = 0.5f,
    threshold = 1.1f,
    softKnee = 0.5f,
    radius = 4f,
    antiFlicker = false
};

var bloomLayer = gameObject.AddComponent<BloomLayer>();
bloomLayer.settings = bloomSettings;
// Applying the Depth of Field effect
var depthOfFieldSettings = new DepthOfFieldSettings
{
    focusDistance = 10f,
    aperture = 5.6f,
    focalLength = 50f,
    maxBlurSize = 8f
};

var depthOfFieldLayer = gameObject.AddComponent<DepthOfFieldLayer>();
depthOfFieldLayer.settings = depthOfFieldSettings;
// Applying the Ambient Occlusion effect
var ambientOcclusionSettings = new AmbientOcclusionSettings
{
    intensity = 1.0f,
    radius = 1.0f,
    sampleCount = 4,
    downsampling = 1,
    forceForwardCompatibility = false,
    ambientOnly = false
};

var ambientOcclusionLayer = gameObject.AddComponent<AmbientOcclusionLayer>();
ambientOcclusionLayer.settings = ambientOcclusionSettings;

Getting Started

To get started with the X-PostProcessing-Library, follow these steps:

  1. Import the X-PostProcessing-Library package into your Unity project.
  2. Create a new GameObject and add the desired post-processing effect components (e.g., BloomLayer, DepthOfFieldLayer, AmbientOcclusionLayer) to it.
  3. Customize the settings for each post-processing effect to match your project's requirements.
  4. Ensure that the post-processing effects are enabled and properly configured in your camera's post-processing stack.
  5. Test the post-processing effects in your application and make further adjustments as needed.

Refer to the library's documentation for more detailed instructions and information on the available post-processing effects and their customization options.

Competitor Comparisons

Post Processing Stack

Pros of PostProcessing

  • Official Unity package, ensuring compatibility and long-term support
  • Comprehensive documentation and integration with Unity's rendering pipeline
  • Regular updates and bug fixes from Unity Technologies

Cons of PostProcessing

  • Limited customization options for advanced users
  • Performance overhead for some effects, especially on lower-end devices
  • Fewer experimental or cutting-edge post-processing effects

Code Comparison

X-PostProcessing-Library:

[VolumeComponentMenu(VolumeDefine.Environment + "Screen Space Reflection")]
public class ScreenSpaceReflection : VolumeSetting
{
    public override bool IsActive() => screenSpaceReflection.value;
    public BoolParameter screenSpaceReflection = new BoolParameter(false);
}

PostProcessing:

[Serializable]
[PostProcess(typeof(ScreenSpaceReflectionsRenderer), PostProcessEvent.BeforeStack, "Unity/Screen Space Reflections")]
public sealed class ScreenSpaceReflections : PostProcessEffectSettings
{
    [Range(0, 256), Tooltip("Maximum number of steps in the raymarching pass.")]
    public IntParameter maxIterations = new IntParameter { value = 16 };
}

The X-PostProcessing-Library offers more customizable and experimental post-processing effects, while PostProcessing provides a stable, well-integrated solution for Unity projects. X-PostProcessing-Library may be better suited for advanced users seeking unique visual effects, whereas PostProcessing is ideal for developers looking for a reliable, officially supported post-processing solution.

2,084

A collection of custom post processing effects for Unity

Pros of Kino

  • More focused on artistic and cinematic effects
  • Regularly updated with new features and improvements
  • Lightweight and easy to integrate into existing Unity projects

Cons of Kino

  • Smaller collection of post-processing effects
  • Less documentation and examples compared to X-PostProcessing-Library
  • May require more manual setup for complex effects

Code Comparison

X-PostProcessing-Library:

[VolumeComponentMenu(VolumeDefine.Environment + "Screen Space Reflection")]
public class ScreenSpaceReflection : VolumeSetting
{
    public override bool IsActive() => Enable.value;
    public BoolParameter Enable = new BoolParameter(false);
}

Kino:

[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class ScreenSpaceReflection : MonoBehaviour
{
    [SerializeField] Shader _shader = null;
    Material _material;
}

Both libraries use similar approaches for implementing post-processing effects, but X-PostProcessing-Library tends to use Unity's Volume system, while Kino often relies on MonoBehaviour components.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

XPL-Title-v2.jpg

GitHub license Version GitHub issues GitHub pull requests

XPL: Unity引擎的高品质后处理库

X-PostProcessing Libray,简称XPL,是针对Unity引擎的高品质开源后处理库,旨在提供业界主流的高品质后处理特效的完整解决方案。目前已完美支持Unity Post-processing Stack v2,后续也将提供对Unity引擎URP/LWRP/HDRP的兼容支持。

X-PostProcessing Library (XPL) is a high quality post processing library for for Unity Post Processing Stack v2/LWRP/URP/HDRP

需要查看更多渲染效果图和每个特效的参数与属性,可以在下面的 目录 部分的具体后处理特效子页面中查看。

For more gallery , you can enter the specific post-processing effects sub-page in the Content section below.


1. 目录 | Content

More effects and LWRP/URP/HDRP version will arrive soon.


2. 安装 | Installation

有两种主要的安装X-PostProcessing Library的方法:

  • 【方法一】 克隆或下载此Repo,并直接使用Unity打开。建议可先从已设置好后处理的示例场景 Assets/Example/ExampleScene.unity 开始。

  • 【方法二】 将X-PostProcessing 文件夹放置在项目Assets路径下的任一位置,并确保Post Processing Stack v2也位于项目中。

You have two main ways to install X-PostProcessing Library :

  • [Method 1] Clone or download this repository , open with Unity Engine Editor and enjoy. It is recommended to start with the example scene Assets/Example/ExampleScene.unity .
  • [Method 2] Place the X-PostProcessing folder anywhere in your project, make sure that Post Processing Stack v2 is in the project as well, and enjoy.

3. 使用 | Usage

post processing profile 有各种不同的修改和添加方式,最常规的方法是,选中一个post processing profile ,在Inspetor窗口下:

  • Add effect... > X-PostProcessing > 选择一种新的后处理

The new effect should be available for a post processing profile with different injection points,just like:

  • Add effect... > X-PostProcessing > Choose an effect

4. 环境 | Environment

  • 建议使用Unity 2017.2+。

  • 如果使用的是较旧版本的Unity(5.6 或 2017.1),则需要将此文件夹 替换为 pps v2 2.1.8。

  • Unity 2017.2+ is recommended.

  • if you use older versions of Unity (5.6 and 2017.1) , you need to replace this folder with pps v2 2.1.8.


5. 文章 | Blog Post