Giter Club home page Giter Club logo

unity-pcf-poisson's Introduction

Custom Unity PCF (Poisson Sampling)

PCF (Percentage Closer Filtering) via Poisson sampling for Unity and Universal Render Pipeline.

Used to prevent aliasing, which is one of the problems of shadow mapping.

Built with Unity 2021.3.0f1 and URP v12.1.6.

Preview

Implementation

The project contains:

  • A render feature to configure the poisson sampling parameters:
    • Spread
    • Mode
      • Disabled
      • Poisson Sampling
      • Poisson Sampling (Stratified)
      • Poisson Sampling (Rotated)
    • Samples Count (4 or 16)
  • Lit Shader, which uses Poisson sampling to access shadow maps. Supports the following features:
    • Lambertian lighting
    • Shadow receiving/casting
    • Ambient lighting
  • Editor utility to generate 3D Texture to sample rotations in the shader.
    • It can be accessed in Window/Rendering/Rotated Poisson Sampling Texture Generator.
    • The render feature uses the bundled 32x32x32 texture by default.

Examples

Shadow resolution is set to 4096 in all examples.

Hard shadows (built-in)

Hard Shadows

Soft shadows (built-in)

Soft Shadows

Poisson Sampling

  • Spread: 1200
  • Samples 16

Poisson (Default, 16)

Poisson Sampling

  • Spread: 1500
  • Samples 4

Poisson (Default, 4)

Poisson Sampling (Stratified)

  • Spread: 2000
  • Samples: 16

Poisson (Stratified)

Poisson Sampling (Rotated)

  • Spread: 1000
  • Samples: 16

Poisson (Rotated)

References

unity-pcf-poisson's People

Contributors

delt06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

turn-listen

unity-pcf-poisson's Issues

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.