MIT License

项目介绍

ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample 是一个托管在 GitHub 上的开源项目,主要使用 C# 编写,采用 MIT License 许可证,目前获得 1.7k 个 Star、258 次 Fork。

仓库全名
ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample
开源许可证
MIT License
Star 数
1.7k
Fork 数
258
未关闭 Issue
5

README 摘要

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 DrawMeshInstancedIndirect ON (grass bending) DrawMeshInstancedIndirect OFF Why create this repository? To demonstrate an API that can draw millions of instance ->…

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

常见问题

UnityURP-MobileDrawMeshInstancedIndirectExample 用什么语言开发?

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

UnityURP-MobileDrawMeshInstancedIndirectExample 可以免费商用吗?

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

如何获取 UnityURP-MobileDrawMeshInstancedIndirectExample 的源码?

可以直接克隆仓库:git clone https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample.git,默认分支为 master;安装与运行步骤见仓库 README。

UnityURP-MobileDrawMeshInstancedIndirectExample 最近还在维护吗?

仓库最近一次更新为 2020年11月25日,当前有 5 个未关闭 Issue;Star 数为 1.7k,可作为社区活跃度的参考。

简要分析

热度分
2260
价值分
1109
活跃状态
活跃

语言占比

C#
ShaderLab

README

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

评论

暂无评论