Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitonicPixelSorter (fork)

This repository is a fork of ruccho/BitonicPixelSorter. The following changes have been made.

Changes

  • Requires URP + Render Graph, and compatibility mode support has been removed. URP 17 or higher is required.
  • BitonicPixelSorter.Execute has been removed.
  • Implementation has been moved to BitonicPixelSorter. This allows separate parameters to be set for each camera.
  • BitonicPixelSorter properties are exposed to the public, allowing them to be controlled from script.

Installation

https://github.com/nuskey8/BitonicPixelSorter.git?path=/Packages/com.ruccho.bitonicpixelsorter

Setup

Due to changes, the setup procedure is slightly different from the original repository.

  1. Add the Bitonic Pixel Sorting Feature to the Render Asset.
  2. Attach the BitonicPixelSorter component to the target camera.
  3. Set BitonicPixelSorter.compute to the ComputeShader.

Below is the original README.md.

--

BitonicPixelSorter

GPU-accelerated pixel sorter with bitonic sorting for Unity.

Live Demo (WebGPU port)

The screenshot below shows it running on an NVIDIA GeForce RTX 4070 and it keeps over 1000 FPS at FHD resolution.

Image

Installation

Use UPM git dependencies.

  1. Open Package Manager and click + > Add package from git URL...

  2. Enter https://github.com/ruccho/BitonicPixelSorter.git?path=/Packages/com.ruccho.bitonicpixelsorter#release

  3. (Optional) To use a RendererFeature for UniversalRP, also install https://github.com/ruccho/BitonicPixelSorter.git?path=/Packages/com.ruccho.bitonicpixelsorter.urp#release

BitonicPixelSorter Component

image

Property Type Description
Use As Image Effect bool It works as an image effect when attached to the camera. This is only active when you are using builtin render pipeline.
Shader ComputeShader Set BoitonicPixelSorter.compute.
Direction bool Switches sorting direction between horizontal / vertical.
Ascending bool Switches ordering.
Threshold Min float Lower threshold of the brightness.
Threshold Max float Upper threshold of the brightness.

Use from code

var sorter = GetComponent<BitonicPixelSorter>();

//BitonicPixelSorter.Execute(Texture src, RenderTexture dst)
sorter.Execute(sourceTexture, destinationTexture);

Use RendererFeature for UniversalRP

In your renderer asset, add Bitonic Pixel Sorting Feature to the renderer feature list.

References

https://github.com/hiroakioishi/UnityGPUBitonicSort

https://www.inf.hs-flensburg.de/lang/algorithmen/sortieren/bitonic/oddn.htm

About

GPU-accelerated pixel sorter with bitonic sorting for Unity

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages