Giter Site home page Giter Site logo

lizmario / unity_urp_planear_shadowmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dreamfairy/unity_urp_planear_shadowmap

0.0 0.0 0.0 1.64 MB

Unity 主相机范围 扁平阴影

License: MIT License

C# 29.87% Mathematica 40.87% ShaderLab 29.26%

unity_urp_planear_shadowmap's Introduction

Unity_URP_Planear_ShadowMap

Unity Editor : 2021.3.19 基于Unity URP Forward 主相机视角平面阴影

Preview Image text

当光源和阴影接收者平面接近平行时有瑕疵

Image text

几乎100%ShadowMap面积利用率的阴影,可以在较小的分辨率下获得更高的清晰度

Image text

Dx/Ogl适配

Image text

优点

1.更节省的性能,阴影投射和阴影接受 不需要做 world space -> lightCamera space变换. 仅需要一个三角形算法求地面投影直角边计算。 可以用近似三角形或者 ∠tan 算法

2.更高的阴影清晰度 几乎100%ShadowMap面积利用率的阴影,可以在较小的分辨率下获得更高的清晰度, 因此可以降低实际ShadowMap尺寸,用以减少带宽

3.可复用URP MainCamera CullResult 直接绘制

缺点

1.只能适配当光线从高处往低处投射,当光线从低处往高处投射时需要修改算法,不能同时兼容高低光线照射角度,当光线平行地平线投射时前后物件无法正确获得阴影

2.复杂且互相叠加的阴影可能会出现渲染错误

3.低分辨率下阴影边缘锯齿抖动需要主相机同时步进适配,但是可能造成主相机观感下降,不如独立阴影相机步进

unity_urp_planear_shadowmap's People

Contributors

dreamfairy avatar

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.