colinleung-nilocat / unityurp-mobiledrawmeshinstancedindirectexample Goto Github PK
View Code? Open in Web Editor NEWExample project to draw 1million grass instances on mobile
Home Page: https://youtu.be/A7rav4tS88s
License: MIT License
Example project to draw 1million grass instances on mobile
Home Page: https://youtu.be/A7rav4tS88s
License: MIT License
In Unity 2022.3.5 and 2022.3.6 the grass renders in the editor, but in a built application only a single pink triangle is drawn. If you move the camera close to the triangle the framerate drops significantly. The triangle can only be seen from one side.
The same issues occurs on:
Note: Dynamic Resolution is broken in Unity 2022 so disable it on the camera before testing.
In the documentation for Graphics.DrawMeshInstancedIndirect, it says:
This function is now obsolete. Use Graphics.RenderMeshIndirect instead. Draws the same mesh multiple times using GPU instancing.
However, I was able to get the sample code in Graphics.DrawMeshInstancedIndirect to render a mesh such as a plane or cube in both the editor and a built application. The mesh wasn't pink like the grass, but they were rendered in the same position so it appeared like a single object. The example script is supposed to assign random positions to each instance but this doesn't seem to be working.
It seems that you use vertex lighting for your grass, that might explain why this is so fast.
Can this be done in a shader graph?
I'm asking because I'd like to add volume lighting and I haven't the faintest idea how to convert such complex graph to vertex shader.
https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Volume
Hello,
Thanks so much for publishing this. I've tried so many different grass assets for Unity (for VR) and this is hands down the best I've found--and most of the others I've tried I had to pay for.
I'm trying to understand the code and I have two questions for you (I'm new to URP):
Thanks again!
Kai
Hello friend,
i am terribly sorry to create an issue. But I have no idea how to send you a message :/
Please can I ask, if this grass project can be used in my RPG game? I really like the performance and stylized look.
I can see the licence is MIT. But i just want to be sure.
Thank you very much for any answer, and once again I am sorry to contact you this way.
I will delete the message if needed.
Have a nice day!! :))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.