• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample: Example proj ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample

开源软件地址(OpenSource Url):

https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample

开源编程语言(OpenSource Language):

C# 58.1%

开源软件介绍(OpenSource Introduction):

UnityURP-MobileDrawMeshInstancedIndirectExample

youtube runtime demo video: https://youtu.be/A7rav4tS88s
download .apk, try it on your android phone: https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view

DrawMeshInstancedIndirect ON screenshot DrawMeshInstancedIndirect ON (grass bending) screenshot screenshot DrawMeshInstancedIndirect OFF screenshot

Why create this repository?

To demonstrate an API that can draw millions of instance -> DrawMeshInstancedIndirect(), running on mobile devices.

Can this demo runs on midrange mobile?

  • can handle 10 million instances on Samsung Galaxy A70 (GPU = adreno612, not a strong GPU), 50~60fps, performance mainly affected by visible grass count on screen(draw distance = 125)
  • can handle 10 million instances on Lenovo S5 (GPU = adreno506, a weak GPU), 30fps, performance mainly affected by visible grass count on screen(draw distance = 75)

Requirement

if you want to try the pre-built .apk, your android device must support Opengles3.2 / Vulkan
download .apk: https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view

Where are the important files

https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/tree/master/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core

Editor

2019.4.15f1

Note

This is a simplified example repository to demonstrate DrawMeshInstancedIndirect API on mobile platform.
This repository is as simple as possible, only contains a simple CPU cell frustum culling(not even a quadtree) -> minimum compute GPU frustum culling (no Acceleration Algorithms), then just 1 DrawMeshInstancedIndirect call, nothing else, code is very short.

Lighting and animation is not the main focus of this project, but ~40% of the time was spent on writing grass shader's lighting & animation, you can have a look at InstancedIndirectGrass.shader if you are interested.

This repository also contains a RendererFeature(GrassBendingRTPrePass.cs) to render an offscreen RT(R8), which renders top down view grass bending area (by trail renderer following moving objects), it is a very simple method but the result is good enough for this demo.

reference




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap