MIT License

项目介绍

CristianQiu/Unity-URP-Volumetric-Light 是一个托管在 GitHub 上的开源项目,主要使用 C# 编写,采用 MIT License 许可证,目前获得 933 个 Star、74 次 Fork。

仓库全名
CristianQiu/Unity-URP-Volumetric-Light
开源许可证
MIT License
Star 数
933
Fork 数
74
未关闭 Issue
4

README 摘要

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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Unity-URP-Volumetric-Light 用什么语言开发?

主要使用 C# 编写,采用 MIT License 许可证,目前有 933 个 Star。

Unity-URP-Volumetric-Light 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 Unity-URP-Volumetric-Light 的源码?

可以直接克隆仓库:git clone https://github.com/CristianQiu/Unity-URP-Volumetric-Light.git,默认分支为 main;安装与运行步骤见仓库 README。

Unity-URP-Volumetric-Light 最近还在维护吗?

仓库最近一次更新为 3 周前,当前有 4 个未关闭 Issue;Star 数为 933,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Unity package for versions 2022.3 and Unity 6 and above. Adds support to render volumetric lighting for both the main and additional lights in URP. Compatible with URP render graph in Unity 6 and above.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1103
价值分
584
活跃状态
活跃

语言占比

C#
HLSL
ShaderLab

Release

README

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

评论

暂无评论