Code Monkey home page Code Monkey logo

unity-srp-vxgi's Introduction

Unity - Scriptable Render Pipeline - Voxel-based Global Illumination

Showcase

Screenshot 1 Screenshot 2

Requirements

  • Unity 2019.
  • Shader Model 4.5 or newer.
  • Graphic API that supports geometry shader (this excludes Metal API).
  • Approximately 1GB of VRAM for highest voxel resolution setting.

Installation

This method is the easiest way to install a package. Just add the following dependency to <project path>/Packages/manifest.json:

{
  "dependencies": {
    "com.looooong.srp.vxgi": "https://github.com/Looooong/Unity-SRP-VXGI.git"
  }
}

If you want to fiddle with the source code while using this package, you can install the package locally.

For more information on how to manage UPM package, please refer to this.

Usage

Enable VXGI Render Pipeline

  • Goto Asset/Rendering/VXGI Render Pipeline Asset to create a new VXGI render pipeline asset.
  • Open Project Settings window by going to Edit/Project Settings....
  • Assign the newly created render pipeline asset to Graphics/Scriptable Render Pipeline Settings.

Enable VXGI Rendering on a Camera

  • Add VXGI component to a Camera.
  • Assign tag MainCamera to the same Camera to preview VXGI rendering in Scene View.
  • Optional: Add VXGI Mipmap Debug to the same Camera to visualize the voxel mipmap volume.

Apply VXGI materials to objects in the Scene

Apply the material that uses one of the following VXGI shaders:

  • VXGI/Standard and VXGI/Standard (Specular setup)
    • Only Albedo, Metallic, Specular, Smoothness, Normal Map and Emission are supported.
  • VXGI/Particles/Standard Unlit
    • Only Additive rendering mode is supported.

Light Sources

Directional light, point light and spot light are supported. Lighting fall-off follows the inverse-squared distance model without range attenuation. The fall-off model will be expanded with more options in the future.

Configuration

VXGI Component Properties

  • Voxel Volume:
    • Follow Camera: make the voxel volume center follow the camera position.
    • Center: the center of the voxel volume in World Space.
    • Bound: the size of the voxel volume in World Space.
    • Resolution: the resolution of the voxel volume.
    • Anti Aliasing: the anti-aliasing level of the voxelization process.
    • Mipmap Filter Mode: specify the method to generate the voxel mipmap volume.
    • Limit Refresh Rate: limit the voxel volume refresh rate.
    • Refresh Rate: the target refresh rate of the voxel volume.
  • Rendering:
    • Indirect Diffuse Modifier: how strong the diffuse cone tracing can affect the scene.
    • Indirect Specular Modifier: how strong the specular cone tracing can affect the scene.
    • Diffuse Resolution Scale: downscale the diffuse cone tracing pass.

VXGI Mipmap Debug Component Properties

  • Mipmap Level: Mipmap level to visualize.
  • Ray Tracing Step: how big is a step when ray tracing through the voxel volume.
  • Filter Mode: visualization filter mode.

Known Issues and Limitations

  • VXGI uses geometry shader, which is not supported by few graphics APIs, e.g., Metal.
  • The content of Unity UI element is not displayed in Scene View, but only bounding Rect Transform is displayed. Unity UI element is displayed normally in Game View.

Contributing

All pull requests are welcome.

License

MIT

Backers

Thank you for your support! ๐Ÿ™

David Jeske

Acknowledgement

This project is inspired by sonicether/SEGI.

Icons made by Freepik from www.flaticon.com.

unity-srp-vxgi's People

Contributors

looooong avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.