项目作者: sienaiwun

项目描述 :
A demo to show rendering custom draw calls in the Unity's SRP framework. Take planar shadow rendering for example.
高级语言: C#
项目地址: git://github.com/sienaiwun/Unity_PlanarShadow.git
创建时间: 2020-01-18T09:19:47Z
项目社区:https://github.com/sienaiwun/Unity_PlanarShadow

开源协议:

下载


license
PRs Welcome

Unity_PlanarShadow

In the Unity’s Scriptable Rendering Pipeline(SRP) framework, MonoBehaviour.OnRenderObject() is deprecated. However, there are always some needs to add custom per-mesh or per-object drawings besides their own materials’ rendering drawing calls. For example, the planar shadow call, which is a very cheap and efficient way to add a shadow to a object, needs a custom drawing to the objects which casts shadow.

planer_shadow

In this demo, we restore OnRenderObject() in the Universal Rendering Pipeline using SRP. We give a demo to add custom draws - which are the planar-shadow drawing calls- to a mesh (the sphere) and a prefab (the props). We can also specify the drawing’s order in the drawing script.

Cons:

  1. Command buffer draw calls cannot be batched very easily.
  2. Custom culling or disableing this draw call is needed if this draw does not contribute to the final view.