【Unity urp】可交互草地模拟-适用移动端-UnityURP-MobileDrawMeshInstancedIndirectExample

【Unity urp】可交互草地模拟-适用移动端-UnityURP-MobileDrawMeshInstancedIndirectExample-盘古CG网
【Unity urp】可交互草地模拟-适用移动端-UnityURP-MobileDrawMeshInstancedIndirectExample
此内容为免费资源,请登录后查看
0
免费资源
图片[1]-【Unity urp】可交互草地模拟-适用移动端-UnityURP-MobileDrawMeshInstancedIndirectExample - 盘古CG网-盘古CG网

UnityURP-MobileDrawMeshInstancedIndirectExample

YouTube 运行时演示视频:https://youtu.be/A7rav4tS88s
下载.apk,请在您的 Android 手机上试用:https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view

DrawMeshInstancedIndirect 开  DrawMeshInstancedIndirect 开(草地弯曲)   DrawMeshInstancedIndirect 关

为什么要创建此存储库?

要演示可以绘制数百万个实例的 API,请>在移动设备上运行的 DrawMeshInstancedIndirect()。

此演示可以在中端移动设备上运行吗?

  • 可以在三星 Galaxy A70 上处理 1000 万个实例(GPU = adreno612,不是强大的 GPU),50~60fps,性能主要受屏幕上可见草地数量的影响(绘制距离 = 125)
  • 可以在联想 S5 上处理 1000 万个实例(GPU = adreno506,一个较弱的 GPU),30fps,性能主要受屏幕上可见草数的影响(绘制距离 = 75)

要求

如果您想尝试预构建的 .apk,您的 Android 设备必须支持 Opengles3.2 / Vulkan
下载 .apk:https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view

重要文件在哪里

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

编辑 器

2019.4.15f1

注意

这是一个简化的示例存储库,用于在移动平台上演示 DrawMeshInstancedIndirect API。
这个存储库尽可能简单,只包含一个简单的 CPU 单元视锥体剔除(甚至不包含四叉树)->最小计算 GPU 视锥体剔除(无加速算法),然后只有 1 个 DrawMeshInstancedIndirect 调用,没有别的,代码非常短。

照明和动画并不是这个项目的主要重点,但~40%的时间都花在了编写草着色器的照明和动画上,如果你有兴趣,可以看看InstancedIndirectGrass.shader。

此存储库还包含一个 RendererFeature(GrassBendingRTPrePass.cs) 来渲染屏幕外的 RT(R8),它渲染自上而下的视图草地弯曲区域(通过跟踪渲染器跟随移动对象),这是一个非常简单的方法,但结果对于此演示来说已经足够好了。

参考

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容