10,000 grass nodes

Share your helpful Urho3D code snippets, samples and tutorials here.

10,000 grass nodes

PostPosted by Lumak » 11 Nov 2016, 00:50

I saw a Urho3D video on youtube some months ago demonstrating replicated grass in the scene. I don't know how many grass nodes were placed in the scene, but I clearly remember the low frame rate at around 20 - 35 fps.

I wanted to test this and test to see if some optimization can be made for sometime now and got a chance to today.
Rendering 10k grass nodes created individually using staticModel, the frame rate sat around 67 fps.

Repo: https://github.com/Lumak/Urho3D-Geom-Replication/

Replication w/ normals overriden:
Image

Added wind animation:
Image

Edit: added another screenshot
Last edited by Lumak on 14 Nov 2016, 00:19, edited 4 times in total.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: 10,000 grass nodes

PostPosted by Lumak » 11 Nov 2016, 02:08

Just curious if I had 50k replicated grass:

replicated w/ normals overriden:
Image

FPS is still decent. Note: you'll want to make these replicated models in small patches, and not like the 50k example shown ;)
Last edited by Lumak on 13 Nov 2016, 01:22, edited 1 time in total.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: 10,000 grass nodes

PostPosted by rasteron » 11 Nov 2016, 07:03

great stuff Lumak! I think this should be added to the examples. :)
User avatar
rasteron
Have many posts
Have many posts
 
Posts: 437
Joined: 07 Mar 2014, 07:46
Location: web

Re: 10,000 grass nodes

PostPosted by NiteLordz » 11 Nov 2016, 12:33

Agree, this should become a sample, i have been looking for a solid vegetation sample, and this could definitely help out ( or integrate into the Terrain sample even )
User avatar
NiteLordz
Some active
Some active
 
Posts: 51
Joined: 11 Feb 2014, 12:21
Location: United States

Re: 10,000 grass nodes

PostPosted by Lumak » 11 Nov 2016, 19:09

I'll try to push a PR for this. I think a Replicate() function in the StaticModel would be ideal.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: 10,000 grass nodes

PostPosted by Lumak » 12 Nov 2016, 23:10

Added simple wind velocity animation.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: 10,000 grass nodes

PostPosted by Lumak » 13 Nov 2016, 00:37

Added an option to override geom normals.
Last edited by Lumak on 14 Nov 2016, 00:20, edited 1 time in total.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: 10,000 grass nodes

PostPosted by coldev » 13 Nov 2016, 01:20

Thanks 4 share..

God Bless You
User avatar
coldev
New user
New user
 
Posts: 1
Joined: 13 Nov 2016, 01:10

Re: 10,000 grass nodes

PostPosted by Lumak » 13 Nov 2016, 16:40

10k grass animated:
Image
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38


Return to Code Exchange

Who is online

Users browsing this forum: No registered users and 0 guests

cron