Node/Distance optimization

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
scippie
Posts: 26
Joined: Sat Oct 13, 2007 3:35 pm
Location: Belgium
Contact:

Node/Distance optimization

Post by scippie »

Which do you guys think is best when I want to be able to switch between detail-level-nodes depending on the distance or something similar.

1. Create a dummy-node with several child nodes for each detail-level and make the best one visible and all the others invisible?
2. Create all nodes separate and keep track of them myself and make them visible/invisible?
3. Add/Remove the nodes? (I don't really think that's a good one)
4. Something else?

Obviously, the first one is the best one (provided that there is no reasonable 4th method) when you think practically, (one setting for all detail-levels) but... is it also the best one in terms of speed or are there better ways to do it?

Cheers!
D.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should create a custom LOD scene node, which does something between 1 and 2 in that the scene node logic takes care of the various models and makes the best matching one the visible one. If you give it a nice interface (adding/removing detail levels, representing the distance values nicely, ...) you can also submit this for integration into the core, because I'd like to have a DLOD scene node :D
scippie
Posts: 26
Joined: Sat Oct 13, 2007 3:35 pm
Location: Belgium
Contact:

Post by scippie »

:P Heheh thanks
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Hey, thanks for volunteering to do this! :P

How do you see the distance algorithm working out? I was thinking that what really matters isn't the distance per se, but the size of the object on screen, so the factors are: distance, camera FOV, and object size. Did I miss any?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply