Board index FlightGear Development Effects and shaders

optimizing random trees: strong effect on performance ?

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: optimizing random trees: strong effect on performance ?

Postby Thorsten » Mon Nov 23, 2015 1:53 pm

up to 2km use the current scheme
beyond that use single textured quads always facing the camera, no effects like moving and shadows.


That should give you an idea of what perf improvement to expect and whether there is mileage in it.


Not enough I suspect.

Anyway - that's fairly similar to what my old code did, except for the 'replace four crosses by a single quad showing four trees' (getting rid of another 75% of the remaining quads...) - so I know how to do it. Should I try to dig up that code for you?

I guess it's best to let the shader decide not to render the other two.


Yes - you catch it early on and simply move it out of the view frustrum before determining light or fog.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: optimizing random trees: strong effect on performance ?

Postby erik » Mon Nov 23, 2015 2:07 pm

Problem I see is that it still requires the transformation for all quads. If that part could be moved to the shaders it might have an impact.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: optimizing random trees: strong effect on performance ?

Postby Thorsten » Mon Nov 23, 2015 2:12 pm

Sorry what transformation? The billboarding? That's easy to do in the vertex shader.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: optimizing random trees: strong effect on performance ?

Postby erik » Mon Nov 23, 2015 2:16 pm

Sorry, I see the trees only get transformed once at creation time. After that the whole forest is processed as one single object. I thought trees got transformed every frame.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: optimizing random trees: strong effect on performance ?

Postby Richard » Sat Dec 19, 2015 12:26 pm

I've been pondering and researching the various methods. What looks promising is instancing at the shader level.

http://3dcgtutorials.blogspot.fr/2013/0 ... graph.html
https://github.com/MPursche/3dcgtutorials
http://trac.openscenegraph.org/projects ... winstanced

This also looks like it might be promising. http://image.diku.dk/projects/media/tru ... ing.08.pdf

It's also lead me onto wonder if instancing could be generally useful (as we have a quite a lot of items in the scenery that are the same model); but to be honest I've not really got enough of a clue how the culling would work.
Richard
 
Posts: 810
Joined: Sun Nov 02, 2014 11:17 pm
Version: Git
OS: Win10

Re: optimizing random trees: strong effect on performance ?

Postby Hooray » Sun Dec 20, 2015 1:11 am

Richard wrote in Sat Dec 19, 2015 12:26 pm:It's also lead me onto wonder if instancing could be generally useful (as we have a quite a lot of items in the scenery that are the same model)


I agree, even though we don't need to make this specific to just "scenery", but could instead look at the whole scene - even just the 2D use-case has seen quite a bit of discussion over the years (especially in the context of MFDs and complex cockpits), so that it would indeed be useful to consider adding SimGear-level support for instancing: http://wiki.flightgear.org/Canvas_Devel ... Instancing
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: optimizing random trees: strong effect on performance ?

Postby vnts » Sat Feb 10, 2018 1:41 am

Not sure if just me: Trees ultra setting+shadow: RAM usage steady blow out.

Happens since introduction of setting. (test: flying about very low. Near PHNL/ENBR/EDDI. Happens at lowish LOD:3000/4000/18000. Slow helis, faster UFO. Various win nightlies.). Seemed strange(?): at very high setting: only 2GB-ish or less. Changing settings back and reloading scenery seems to reset RAM usage. Just normal for sheer amount of trees? Cache/slow clean up of tree data structures (maybe based on bare LOD, and not lower)? If not just me, or a bug, perhaps RAM usage/LOD warning for setting is appropriate(?).

Kind Regards, vnts
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 8 guests