Giter Site home page Giter Site logo

urp-ssao's Introduction

URP Screen Space Ambient Occlusion Renderer Feature

This is a sample implementation for SSAO as a RendererFeature in URP. The shader is highly based on this blog post. This has been created for educational purposes, not for production.

Developed and tested on:

  • Unity 2019.3.2f1
  • Universal RP 7.1.8
  • OSX 10.14

This is how it looks:

Debug Debug mode

Enabled SSAO active

Disabled SSAO inactive

Usage

  • create or open a URP project
  • open "Package Manager"
  • click on the "+" icon on the top right
  • "Add package from git URL"
  • paste "https://github.com/sebastianhein/urp-ssao.git" into the input field
  • add new SSAO RendererFeature to the URP settings
  • "depth texture" must be enabled in the URP settings

Known issues/TODOs:

  • HDR doesn't work, the SSAO effect uses RGBA32 rendertexture. Needs a check if the current camera target is HDR enabled.

urp-ssao's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

urp-ssao's Issues

It doesnt work on play mode :/

Unity Version: 2019.3.0b12
URP: 7.1.5

The second one is in playing mode. Issue is SSAOmaterial is null in Execute method in playing mode.

resim
resim

found error in ssao:

Watch out, there is an error in the ssao.shader inside the frag() function:

float3 random = normalize( tex2D(_RandomTexture, input.uv * 4.123).rgb );
This has range of [0, 1]

You need to expand the range to [-1,1] which is what the original post contained, like so:

float3 random = tex2D(_RandomTexture, input.uv).rgb;
random = normalize(random*2-1); //NOTICE: normalize AFTER the expansion.

You also need to ensure your texture contains RGB color noise (not black-and-white monochrome)

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.