'Tindalos' (Ogre v2.0) SceneManager redesign
- Praetor
- OGRE Retired Team Member

- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
Ok, thanks for the clarification, sinbad. I was thinking of portals as being as generic as connectors, but you gave a pretty specific, limited definition of a portal.
As to what other type of connectors there could be besides portal and some more arbitrary planar boundary, I haven't the foggiest. I suppose the idea here is to put in place a mechanism for extension because based on experience there will be specialized connectors that are called for sometime in the future, regardless of whether we can conceive them now or not. At least, I take it that is your thinking sinbad, unless you actually do have some specific ideas about all sorts of different kinds of connectors.
As to what other type of connectors there could be besides portal and some more arbitrary planar boundary, I haven't the foggiest. I suppose the idea here is to put in place a mechanism for extension because based on experience there will be specialized connectors that are called for sometime in the future, regardless of whether we can conceive them now or not. At least, I take it that is your thinking sinbad, unless you actually do have some specific ideas about all sorts of different kinds of connectors.
-
Chaster
- OGRE Expert User

- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
That's what I was thinking - that "connectors" would come in different "flavors ' (portal connector, grid boundary connector, etc.) which could be extended if a new design/algorithm comes along, but I'm betting that those 2 types of connectors (portal & grid boundary) will cover 99% of the cases out there...
- tau
- Silver Sponsor

- Posts: 413
- Joined: Wed Feb 11, 2004 11:44 am
- Location: Austin (that's kept wierd :))
I see. I just wanted to know if I need to plan such changes this year Q3-Q4, or the next, 2008 onesinbad wrote: @tau: I'm not even going to speculate on time scales here. A lot depends on precisely how much time I have to dedicate to it, which in itself depends on finances over the next few months.
Anyway, I hope (and wish you the best) there will be enough finances for you
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Yeah, I think you're right, although there's also the 'tube segment' approach that gets used for some racing games too - it's not quite portal and it's not quite a grid connector although it has simlarities with both.Chaster wrote:That's what I was thinking - that "connectors" would come in different "flavors ' (portal connector, grid boundary connector, etc.) which could be extended if a new design/algorithm comes along, but I'm betting that those 2 types of connectors (portal & grid boundary) will cover 99% of the cases out there...
Basically I don't want to limit things to my current assumptions & knowledge since this is a significant redesign that's not going to happen again in the near future, so I'm trying to cover the largest possible base I can and keep my assumptions well under control. I'm well aware I don't know everything, and that new techniques come out all the time so the more flexible I can stay (without hindering the concrete implementations we all know about), the better.
My approach is always to aim for the most flexible design with the fewest assumptions, and to crawl back from that only when I have to given any practical issues. I think that can lead to better results than starting with a fixed idea of the implementation and presuming I understand all the current and future options that might be used.
-
Dom
- Halfling
- Posts: 57
- Joined: Wed Jul 14, 2004 10:12 am
- Location: Berlin
It's not really that related to the topic, but sometimes it seems precision pops up as subject. You probably already know this article, but in case not: http://home.comcast.net/~tom_forsyth/bl ... sion%5D%5D
For little chunks this might not matter but maybe for big ones or meta-chunks.
For little chunks this might not matter but maybe for big ones or meta-chunks.
- Praetor
- OGRE Retired Team Member

- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
-
Chaster
- OGRE Expert User

- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
Since we're deviating a bit off the well discussed connector topic...
Sinbad, I propose that the coordinate system be modified so that it is "relative" to an arbitrary point. This will go far in assisting with the problem of round-off error and I suspect that you already know this since you talk about multiple local coordinate systems tied together with macro coordinates.
Also, I would like to see the camera class allow for an arbitrary number of extra culling planes. I'm not suggesting this just because it would help my portal scene manager implementation (it would) but because I think it would be useful in other respects (since hardware clipping planes are quite common, but not necessarily universal).
Also, what do you think about the idea of "requiring" cameras & lights be attached to scene nodes like other entities? I think it would actually streamline some of Ogre's internals and make for a more consistent user interface, but I know others may disagree..
Chaster
Sinbad, I propose that the coordinate system be modified so that it is "relative" to an arbitrary point. This will go far in assisting with the problem of round-off error and I suspect that you already know this since you talk about multiple local coordinate systems tied together with macro coordinates.
Also, I would like to see the camera class allow for an arbitrary number of extra culling planes. I'm not suggesting this just because it would help my portal scene manager implementation (it would) but because I think it would be useful in other respects (since hardware clipping planes are quite common, but not necessarily universal).
Also, what do you think about the idea of "requiring" cameras & lights be attached to scene nodes like other entities? I think it would actually streamline some of Ogre's internals and make for a more consistent user interface, but I know others may disagree..
Chaster
- jwatte
- Gnome
- Posts: 347
- Joined: Sat Feb 05, 2005 12:56 am
What we do at work, where we have an earth-size planet, is to store entity locations (including camera) in double precision. Meshes, however, are stored in single precision. Everything is then rendered in camera-relative coordinates. Because the camera-relative coordinate is in the range [-15000..15000] or so, it turns out to be free of precision and jitter issues. We also simulate in double precision, which means we don't have to handle the case of a simulated entity rolling from one cell to another in any special way.
The main draw-back, from an Ogre point of view, is that our space is euclidean -- we can't do overlapping spaces, which you can do with certain portal solutions. However, if you have overlapping spaces, you have to be careful to never go from raw coordinate to find a space, as you may find more than one space.
The main draw-back, from an Ogre point of view, is that our space is euclidean -- we can't do overlapping spaces, which you can do with certain portal solutions. However, if you have overlapping spaces, you have to be careful to never go from raw coordinate to find a space, as you may find more than one space.
- Praetor
- OGRE Retired Team Member

- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Yes, the design has always been to have all positions within localities to be expressed relative to a local origin. Thus, operations and comparisons within that locality are subject to fewer precision issues, including the fact that the view matrix will be relative tot he locality and thus precision is regularly reset according to the locality size. Comparisons between localities will obviously have a higher imprecision but since you're only likely to want to compare neighbouring ones the extent of this is clearly well-boxed. The intention is a much-generalised version of the technique presented by Peter Freese of NCsoft in GPG4.
Arbitrary culling planes is an interesting one - we actually already support this at the RenderSystem layer but I've avoided promoting it because the vast majority of cards only support a max of 6 hardware accelerated clip planes. For just culling (not clipping) it would be ok though I guess.
Yes, I already had the removal of cameras & lights being freestanding on my personal list
The reason is that clear ownership becomes totally mandatory and it needs unifying. The other reason is because I intend making node movement / resize events the primary way a SM knows how to adjust its spatial system rather than having a tightly owned custom SceneNode. So unification is necessary.
I have a ton of scrappy notes and even more things in my head but a few unexpected things came up last week so it never got organised. rest assured I will be writing it all down properly and organising it into a design document that everyone can review - I don't expect to start coding on this for a little while yet, the design has to be a lot more solid before that happens.
Arbitrary culling planes is an interesting one - we actually already support this at the RenderSystem layer but I've avoided promoting it because the vast majority of cards only support a max of 6 hardware accelerated clip planes. For just culling (not clipping) it would be ok though I guess.
Yes, I already had the removal of cameras & lights being freestanding on my personal list
I have a ton of scrappy notes and even more things in my head but a few unexpected things came up last week so it never got organised. rest assured I will be writing it all down properly and organising it into a design document that everyone can review - I don't expect to start coding on this for a little while yet, the design has to be a lot more solid before that happens.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Explain?
The locality system helps as much as any system can with extremes in scale in a large, mostly flat structured world. There will still be a double-precision option but because this is useless at managing GPU resources, the approach should be that if you're finding the localities aren't giving you enough precision, you need to consider smaller and more numerous localities.
The locality idea is that you'll only see / need detail when it's close to you anyway - thus if you lose a small amount of precision far away you won't notice because it's too far to see, or objects are far enough away that detailed collision etc is irrelevant.
You've suggested using a local view matrix before (ie local to a SceneNode tree), and the locality concept is largely the same - it's just more explicit about what 'local' means in the more usual case of a relatively flat world tree, and for all comparisons (not just camera calculations). Being local in the sense of a subtree of the world is pretty difficult to apply to a general case world.
The locality system helps as much as any system can with extremes in scale in a large, mostly flat structured world. There will still be a double-precision option but because this is useless at managing GPU resources, the approach should be that if you're finding the localities aren't giving you enough precision, you need to consider smaller and more numerous localities.
The locality idea is that you'll only see / need detail when it's close to you anyway - thus if you lose a small amount of precision far away you won't notice because it's too far to see, or objects are far enough away that detailed collision etc is irrelevant.
You've suggested using a local view matrix before (ie local to a SceneNode tree), and the locality concept is largely the same - it's just more explicit about what 'local' means in the more usual case of a relatively flat world tree, and for all comparisons (not just camera calculations). Being local in the sense of a subtree of the world is pretty difficult to apply to a general case world.
-
satol
- Kobold
- Posts: 38
- Joined: Wed Jan 24, 2007 9:09 pm
The locality system, if I understood the concept correctly, separates space into the grid of constant cell size. A grid cell of several kilometers in size will be too small for the solar system scales. The way I suggested allows to exploit the nested local coordinate systems, so it does not have such problem. One need to take care of moving the camera between nodes though.
You need to extend the grid locality somehow to allow nested grids, then it would work always, I am not sure if it worth doing, as far as there is a simple approach.
You need to extend the grid locality somehow to allow nested grids, then it would work always, I am not sure if it worth doing, as far as there is a simple approach.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
I see what you mean. Well, I never in fact said that localities had to be in a grid, and I actually did say that they can overlap (and implicitly therefore can be nested). The reason for that was actually indoor localities within a larger outdoor one, but your space example is a good one.
So in the case you describe you could have one locality within another - all that's missing is a relative scale between them. Good idea, I will add that to my notes.
I'm glad because this actually vindicates my insistence of not assuming the only connector types will be portals and grid boundaries.
So in the case you describe you could have one locality within another - all that's missing is a relative scale between them. Good idea, I will add that to my notes.
I'm glad because this actually vindicates my insistence of not assuming the only connector types will be portals and grid boundaries.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
- Praetor
- OGRE Retired Team Member

- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- Game_Ender
- Ogre Magi
- Posts: 1269
- Joined: Wed May 25, 2005 2:31 am
- Location: Rockville, MD, USA
Oh, and I think we want it for free and yesterday
. Good luck on getting the design worked out. I myself should do more paper work before my fingers hit the keyboard, would probably end up saving me time.
Robotics @ Maryland AUV Team - Software Lead
-
satol
- Kobold
- Posts: 38
- Joined: Wed Jan 24, 2007 9:09 pm
I vote for more abstraction instead of complexity.
I do not want the Ogre to provide a perfect Scene Manager - there is no one exist and I do not need one. I want more abstraction in there, so I could override the behavior to have classic transformation inheritance, which would solve for me precision issues perfectly. I may be do not want to use the Ogre Scene Managers at all, only the material system and rendering driver abstraction. It is not possible to separate however in Eihort, because there is dependence on the scene managers everythere in the Ogre.
I do not want the Ogre to provide a perfect Scene Manager - there is no one exist and I do not need one. I want more abstraction in there, so I could override the behavior to have classic transformation inheritance, which would solve for me precision issues perfectly. I may be do not want to use the Ogre Scene Managers at all, only the material system and rendering driver abstraction. It is not possible to separate however in Eihort, because there is dependence on the scene managers everythere in the Ogre.
- raicuandi
- Gargoyle
- Posts: 1092
- Joined: Wed Nov 09, 2005 12:56 pm
- Location: Adelaide, Australia
- Contact:
[ot] Doesn't it, like, 'hurt your head' when you try to figure out all of these new design decisions, that probably nobody has done before, and trying to do them all: satisfy everybody, make sure its abstract enough to be extensible in the future etc.? I'm serious... 
/edit: suggesting abstraction over over-complexity too. I use it in my GUI system, and I introduced features that would otherwise take mounds of code/complexity in classic "static" systems like CEGUI.
/edit: suggesting abstraction over over-complexity too. I use it in my GUI system, and I introduced features that would otherwise take mounds of code/complexity in classic "static" systems like CEGUI.
- Kencho
- OGRE Retired Moderator

- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
Not really. There are a lot of design patterns and well-proved solutions out there. Experience does the rest (experience that, by the way, I'm sure Sinbad already hasraicuandi wrote:[ot] Doesn't it, like, 'hurt your head' when you try to figure out all of these new design decisions, that probably nobody has done before, and trying to do them all: satisfy everybody, make sure its abstract enough to be extensible in the future etc.? I'm serious...
About satisfying everybody, with the ideas exposed here, it will be great enough to cover the 99.9% of the users spectrum
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
I've renamed this thread since I've decided that these changes will go into Ogre v2.0 aka 'Tindalos' and not v1.6 aka 'Shoggoth'. I'll be developing it in parallel but the interface changes are so significant as to warrant insulating people from them if they just want the other 1.6 enhancements - the Google Summer of Code projects will be part of 1.6 for example, among other things. I also can't think of any other change that deserves a v2.0 moniker more than this one.
As for abstraction vs complexity - yes in many ways abstraction can be used to reduce complexity if done right. The existing scene manager design originates from the very first version of Ogre and has suffered growing pains since then, it's time to not so much wipe the slate clean, but to rethink everything from first principles, given what I've learned since that time (which is a lot, thanks in many ways to the diversity of this community).
Here's something else to lay on you: in Tindalos I'm almost certain to be removing the need to use SceneNode at all. There has to be something which provides transform information to the renderable objects, but it won't have to be a SceneNode, although clearly that's a rather useful structure to use for many people. By decoupling this such that objects only need a generalised 'transform source', you get quite a lot of benefits. One of which is being able to tie Ogre objects directly into your own external world management system. Having an externally managed world with just incoming sync events to drive things like SM spatial structure updates was something I wish I'd done at the start, so now I think it's time to do it. It's made possible by the fact that custom SceneNodes will no longer be the mechanism for updating custom SM structures.
The other thing will be a redesigned event system. I plan on funneling all callbacks via a generic event system which can be listened in on and extended by custom plugins so new events can be added without having to bind to specific custom interfaces. External world management systems will be required to spit events into this system to notify of object transform changes (and yes, this means separate threads can be used for each purpose).
The scope of this review is going way beyond just SceneManager techniques, I'm really looking at the whole world management & integration systems very closely looking for ways it could be done better. Clearly it's very daunting a task and will take a while, so be patient with me please.
You should know by now that I prefer to take a bit of time over these things and try to cover all the angles.
As for abstraction vs complexity - yes in many ways abstraction can be used to reduce complexity if done right. The existing scene manager design originates from the very first version of Ogre and has suffered growing pains since then, it's time to not so much wipe the slate clean, but to rethink everything from first principles, given what I've learned since that time (which is a lot, thanks in many ways to the diversity of this community).
Here's something else to lay on you: in Tindalos I'm almost certain to be removing the need to use SceneNode at all. There has to be something which provides transform information to the renderable objects, but it won't have to be a SceneNode, although clearly that's a rather useful structure to use for many people. By decoupling this such that objects only need a generalised 'transform source', you get quite a lot of benefits. One of which is being able to tie Ogre objects directly into your own external world management system. Having an externally managed world with just incoming sync events to drive things like SM spatial structure updates was something I wish I'd done at the start, so now I think it's time to do it. It's made possible by the fact that custom SceneNodes will no longer be the mechanism for updating custom SM structures.
The other thing will be a redesigned event system. I plan on funneling all callbacks via a generic event system which can be listened in on and extended by custom plugins so new events can be added without having to bind to specific custom interfaces. External world management systems will be required to spit events into this system to notify of object transform changes (and yes, this means separate threads can be used for each purpose).
The scope of this review is going way beyond just SceneManager techniques, I'm really looking at the whole world management & integration systems very closely looking for ways it could be done better. Clearly it's very daunting a task and will take a while, so be patient with me please.
- Praetor
- OGRE Retired Team Member

- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
Interesting. I look forward to seeing such a generic event system. I have a notion of generic callables in odyssey, but it is so coupled with the rest of library it would be hard to get out.
Notice the lack of type information...
Are you saying that one method for managing a scene in 2.0 will be event-based? As in, the scene just sits there dumbly, and you control all its aspects by externally raising events (like, entity moved or rotated, material switched, etc.)?
Code: Select all
Callback call1, call2;
call1 += callable1;
call2 += callable2;
call1(0.5f, this);
call2(1, 2, 3, 4);
Are you saying that one method for managing a scene in 2.0 will be event-based? As in, the scene just sits there dumbly, and you control all its aspects by externally raising events (like, entity moved or rotated, material switched, etc.)?
- raicuandi
- Gargoyle
- Posts: 1092
- Joined: Wed Nov 09, 2005 12:56 pm
- Location: Adelaide, Australia
- Contact:
So its like I'm asking another "master"-class "at what position/what orientation etc. do I render this entity?"Here's something else to lay on you: in Tindalos I'm almost certain to be removing the need to use SceneNode at all. There has to be something which provides transform information to the renderable objects, but it won't have to be a SceneNode, although clearly that's a rather useful structure to use for many people. By decoupling this such that objects only need a generalised 'transform source', you get quite a lot of benefits. One of which is being able to tie Ogre objects directly into your own external world management system. Having an externally managed world with just incoming sync events to drive things like SM spatial structure updates was something I wish I'd done at the start, so now I think it's time to do it. It's made possible by the fact that custom SceneNodes will no longer be the mechanism for updating custom SM structures.
