Scene editors, graphs and widgets

Started by
2 comments, last by GameDev.net 17 years, 1 month ago
Hi, So I have made this little engine with a scene graph and some scene nodes and I'm testing it with a simple editor. So far it's mostly been picking and rotating basic meshes but now I'm implementing shading, lights and effect nodes which raises a question. These types of objects do not have a natural representation in the scene graph like a mesh does and thus I can't see, pick or move them with the mouse pointer. Of course, like in any other 3D editor I need some kind of widget to represent these objects. On one hand it would be so easy to implement them as scene nodes and insert them directly into the scene graph as a parent node so that when moved it automatically moves its child nodes. On the other hand these widgets are only for representing non-visual objects and you wouldn't want them to be saved with your final scene. Because of this, maybe it's better to store them separately from the graph. Any ideas? How do people usually do this?
Advertisement
Quote:Original post by tonyoto
On the other hand these widgets are only for representing non-visual objects and you wouldn't want them to be saved with your final scene.

Why not? Surely shading and lighting are important in defining the look and feel of a scene. Throwing that information away when you save and load doesn't seem like a good idea to me.
Quote:Original post by OrangyTang
Quote:Original post by tonyoto
On the other hand these widgets are only for representing non-visual objects and you wouldn't want them to be saved with your final scene.

Why not? Surely shading and lighting are important in defining the look and feel of a scene. Throwing that information away when you save and load doesn't seem like a good idea to me.


Sorry if I was unclear. I'm not talking about the lights themselves but the often simple cones, spheres, rhombi or such that might be representing them in a 3D editor only as a visual aid. Surely it must be unnecessary to save them with the scene.
I don't understand why you think lights should not be in the scene graph. I add lights to my scene graph so I can cull lights that are not effecting the scene. I would store the lights within the scene graph, and just have the editor fill in the widget to select them as it traverses the graph, you don't need to store the widget geometry in the graph, just the light properties.

As far as shader and effect nodes, that depends. I would define shaders as a property of the objects in the scene graph. As far as effect nodes, it depends on what you mean by effects. Certain effects can easily be placed as a node in the graph. If you need an object to rotate around a parent, place an effect node between the parent and object. A better solution may be to use a decorator pattern for the effects, and apply the decorator to the node.

Just my opinion.

This topic is closed to new replies.

Advertisement