Skip to content

WoW55QQ/UnityURP-MobileDrawMeshInstancedIndirectExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityURP-MobileDrawMeshInstancedIndirectExample

youtube: ______ download .apk: __________

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

Why create this project?

To demonstrate DrawMeshInstancedIndirect API on mobile devices.

  • can draw 10,000 instance on almost any mobile GPU(e.g. adreno506) within 4ms, performance mainly affected by grass's vertex shader
  • can draw 100,000 instances on 2018/2019 flagship mobile GPU (adreno630) within 4ms, performance mainly affected by grass's vertex shader

Requirement

your android device must support Opengles3.2 / Vulkan

Editor

2019.4.3f1

Note

This is a simplified example project, just to demonstrate DrawMeshInstancedIndirect API on mobile.
Does not contain any compute GPU culling and Acceleration Algorithms. It is as simple as possible, just 1 DrawMeshInstancedIndirect call.

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

This project also contains a RendererFeature(GrassBendingRTPrePass.cs) to render an offscreen 64x64 RT(R8) recording top down view grass bending area using trail renderer, it is a very simple method but the result is good enough for this demo.

Asset that use DrawMeshInstancedIndirect?

About

Example project to draw 1million grass instances on mobile

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ShaderLab 57.1%
  • C# 42.9%