GithubHelp home page GithubHelp logo

colinleung-nilocat / unityurp-mobiledrawmeshinstancedindirectexample Goto Github PK

View Code? Open in Web Editor NEW
1.4K 1.4K 211.0 3.13 MB

Example project to draw 1million grass instances on mobile

Home Page: https://youtu.be/A7rav4tS88s

License: MIT License

C# 58.12% ShaderLab 41.88%
grass indirect instancing mobile unity urp

unityurp-mobiledrawmeshinstancedindirectexample's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityurp-mobiledrawmeshinstancedindirectexample's Issues

Pink triangle when built in Unity 2022.3.6

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.

Editor:
2023-08-05

Standalone build:
2023-08-05 (1)

The same issues occurs on:

  • Windows Direct 11
  • Windows Vulkan
  • Android Vulkan
  • iOS Metal

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.

Can you fix this bug?

Без имени-1

Hi. Thanks for the grass shader example!

I found a bug. On a large area, when we look from above, some squares are visible. It happends when we change cellSize - in my case the cellSize is 10. If I change to 20 (for example) the squares also changed.

2

Code question: how to draw grass over terrain of uneven height?

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):

  1. how would you go about drawing grass over an uneven terrain, taking the y position into consideration?
  2. Could one integrate a terrain mask for this so that the grass would follow the player but only render in certain places on the terrain based on the mask (e.g. where the grass ground layer is painted)?

Thanks again!
Kai

Licence

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!! :))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.