Skip to content
プロジェクト

CristianQiu/Unity-URP-Volumetric-Light

GitHubで見る

概要

Unity 2022.3 および Unity 6 以降に対応した Unity パッケージです。URP でメインライトと追加ライトの両方にボリューメトリックライティングをレンダリングする機能を追加します。Unity 6 以降の URP レンダーグラフにも対応しています。

ゲーム・エミュレーター

この数値の測り方

できること

  • Render graph and compatibility mode support for Unity 6 and above.
  • Support for the main light, spot lights and point lights.
  • Shadows and light cookies support for the lights described above.
  • Realtime and mixed lights support.

計測したスター増加

24時間
0
7日間
0
15日間
+5
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Requirements

Any Unity version posterior to 2022.3 LTS (included), up to Unity 6000.6.

Features

  • Render graph and compatibility mode support for Unity 6 and above.
  • Support for the main light, spot lights and point lights.
  • Shadows and light cookies support for the lights described above.
  • Realtime and mixed lights support.
  • APV support for Unity 2023.1+.
  • Perspective and orthographic projection support.
  • Single pass VR rendering support. This is verified by users, since I do not work on VR.
  • Seamlessly integrated into URP volume system.
  • Works in forward, deferred, forward+ and deferred+ rendering paths. See limitations section.
  • Verified in DirectX11, DirectX12, OpenGLES3, OpenGLCore and Vulkan.

Installation

The recommended way to install the package is through the package manager in Unity (UPM). Before installing, make sure that URP is installed and correctly set up in your project. Then you can proceed to install this package:

  1. Inside Unity, go to "Window"-> "Package Manager".
  2. Once the window is opened, go to the "+" symbol at the top left corner, and select "Install package from git URL". See the image below.

Install

  1. Write the following URL: https://github.com/CristianQiu/Unity-URP-Volumetric-Light.git and click install.

How to add volumetric fog

  1. Add volumetric fog renderer feature to you URP Renderer.
  2. Enable post-processing both in your camera and URP Renderer.
  3. Add a volume to your scene and add override: "Custom->Volumetric Fog".
  4. Tick the "Enabled" checkbox, as fog is disabled by default.
  5. Make sure that "Enable Main Light Contribution" and "Enable Additional Lights Contribution" are also enabled depending on your needs, as they are also disabled by default.
  6. For spot and point lights, add the component "VolumetricAdditionalLight" to those lights that you want to contribute to the volumetric fog.
  7. If you still can not see the fog, play with the different volume parameters or try to increase the intensity of your lights.

Known limitations

  • Multipass VR rendering is not supported.
  • WebGL is not supported. See https://github.com/CristianQiu/Unity-URP-Volumetric-Light/issues/7.
  • Not tested on Switch 1/2 and PS4 consoles. Verified by users in Steam Deck, Xbox One/XSX and PS5 as of v0.5.6.
  • Transparent objects are not blended correctly with fog.
  • Fully baked lights are only supported through APV.
  • Fog is only rendered up to a certain distance from the camera.
  • It may be possible to notice more noise in some light regions at certain view angles.
  • When using forward or deferred rendering path, performance can be heavily affected when adding multiple additional lights. Forward+ or Deferred+ is highly recommended for best performance when support for additional lights is needed.

Known Bugs

TODO

There are a few things that I would like to add at some point, as I like coming back to this project from time to time in my spare time. Some of which are (in no particular order):

  • WebGL support.
  • Further improvements on performance and quality: quarter resolution rendering, reprojection, better transparency support...
  • New features: density volumes, noise, self shadowing...
  • And of course... bug fixing! Do not hesitate to open issues for anything that you find unexpected or buggy.

Preview

Using it in a Tower Defense I am working on as an indie dev

TD

I am also working alongside Siesta Games studio to implement it in Empire in Decay, a roguelike deckbuilder chess-like game that will be released this year. I also plan to release a new version in the future with some of the stuff that we used in the game. You can play the demo and wishlist it now or see the volumetric fog in action in our release trailer!

Empire In Decay Empire In Decay

関連プロジェクトを探す

読み込み中…