Giter Club home page Giter Club logo

urp-sun-shafts's Introduction

URP Sun Shafts

A URP port of Unity's classic Standard Assets Effects package's Sun Shaft effect.

Sample Image The effect can be subtle, but when done well can add some much needed vibrancy to a scene.

Heads Up

This asset was created with URP 10.4.0, but it should work on any version of URP that has custom renderer feature capabilities.

Install

Download the latest version from Releases.
Open the Unity project you want the package installed in.
Open the package to install into the project's Plugins folder.

Usage

In your Forward Renderer asset, add the Sun Shafts render feature.

  • Pass Event controls when the feature will render. Leave this at Before Rendering Post Processing if you're not doing anything wacky with the rendering order.

  • Sun Shaft Material is the material used for the effect. Assign URP Sun Shafts material to the field, located in Plugins/URP Sun Shafts/Materials by default

  • Render Mode controls how the effect is created. Depth mode will only work if the URP asset has the depth option enabled. Otherwise it can be created from a skybox or the camera background color.

  • Resolution controls how large the render textures created are. High is full size, Normal is 1/4th size, and Low is 1/16th size. Lower settings will create a blurrier effect.

  • Blend Mode controls how the effect is blended on top of the scene. Screen is more subtle than Add.

  • Depth Threshold controls how much depth or color difference is required for the effect to appear. A lower value will make the effect more prominent.

  • Opacity controls the opacity of the entire effect.

  • Sun Position controls the position of the sun in world space. It's recommended to put this whereever your main light is located.

  • Radial Blur Iterations controls how many times the render texture is resampled. A larger number will give a larger blur.

  • Sun Color controls the color of the sun and the shafts.

  • Sun Threshold controls what colors do not emit shafts. For example, if set to red, any red pixels will not create the effect, but other colors will. This takes some trial and error to get the value right.

  • Sun Blur Radius controls how blurry the shafts will be.

  • Sun Intensity controls how intense the sun is.

  • Max Radius controls the maximum size of the effect relative to the screen.

urp-sun-shafts'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

Watchers

 avatar  avatar  avatar

urp-sun-shafts's Issues

Sun shafts only work when MSAA is set to 2x or higher

I get a black screen if the Universal Render Pipeline Asset > Quality > Anti Aliasing (MSAA) is set to none.
I would like to be able to use this effect without needing to enable MSAA.

This occurs in editor and in Windows/Mac Standalone builds.

No MSAA
Unity_soQZHVQfQS

MSAA 2x
Unity_zN5WXmJy34

Unable to set sun position at runtime

Hi,

I like the effect you have for Sun Shafts in URP. But I am unable to set the sun position at runtime for the shafts angle to update.

It seems the coordinate system for the sun shafts position differs for different screen resolutions.

Any suggestions?

Editor view becomes all black

Using Unity 2021.3 the effect works as expected, however the Scene view doesn't render (becomes all black, tried disabling all sorts of layers), I have to disable Sun Shaft Feature to be able to see my scene in Scene view, so basically I only enable it before generating a build.

Off topic: not sure where I can ask this, but could the sun position parameter be linked to an object (maybe move it to the material...)?

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.