Jump to content


Scene management and rendering


5 replies to this topic

#1 g(h)eerko

    Member

  • Members
  • PipPip
  • 40 posts

Posted 13 May 2007 - 12:48 PM

Hi guys, is it possilble to have the scene represented in a particluar way, but decouple the rendering from it, i' be able to choose later on to see the scene differently and be rendered in a different fashion.

--I cant explain what im trying to do here exactly coz, im not sure of how to tie it up anyway.

Till now what i have been doing is, build scene graphs with mesh nodes and visit them one by one, for each mesh there is a render fn that sends the triangles to the device.

i want to decouple this render fn, and put it across a generic inter face, the object is it, implement occlusion culling/type x,y,z techniques later in plugins while rendering, but exactly from where??

now comes the confusion, does the scene manament have a handle to the render object /interface or the other way round?

#2 g(h)eerko

    Member

  • Members
  • PipPip
  • 40 posts

Posted 13 May 2007 - 05:27 PM

think i posted it in the wrong place, should be in graphics theory and programming...

#3 .oisyn

    DevMaster Staff

  • Moderators
  • 1822 posts

Posted 14 May 2007 - 05:21 PM

Of course that's possible. For the scene manager, the only thing it needs to know about objects are their bounding volumes and their location/orientation in the world. If you create an interface, say a class Drawable with a virtual Draw() function, and if you attach an instance of a Drawable to a specific object, the scene manager can call that function if it determines that the object is visible.

You can create different kinds of Drawables that in turn interact with your renderer. One drawable implementation can simply draw a mesh, but another can encompass a complete particle simulation for example. The scene manager doesn't care what you do in the Draw() function, it just calls it when appropriate.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#4 g(h)eerko

    Member

  • Members
  • PipPip
  • 40 posts

Posted 18 May 2007 - 01:33 AM

well, i did some progress over this issue in a different direction, i made a singular format of how mesh data is represented, but had a meshloader interface attached to the meshnode in the SG, that is just an interface to the actual mesh specific mesh loader implemented in the library, which i plan to implement as a dll, this way the drawable objects needs to be attached to just the native mesh object,

another thing is that i donot know the mesh types before hand, the meshloaders objects have to be created at startup, all need to be discovered at startup by looking at dlls in a specific directory, the only thing they do is export the mesh data to the other side.

yet again i hit an anomaly, the meshnode<T> object calls a method with the scenemanager to return a interface to the meshloader object, but then the scenemanagers doesnt already exits !.

the scenemanager itself implements a pure interface that the engine gets, will just making the scenemanager static help?

#5 Jare

    Valued Member

  • Members
  • PipPipPip
  • 247 posts

Posted 22 May 2007 - 08:31 AM

>>Head explodes<<

Don't make it static, that's just sidestepping a flaw in your design, but the flaw will still exist and will bite you later. Just wait until the scenemanager is created before letting the mesnode<T> call it. What's the rush?

#6 marek-knows.com

    Valued Member

  • Members
  • PipPipPip
  • 189 posts
  • LocationOntario, Canada

Posted 05 June 2007 - 01:39 PM

Have a look at my website to see how I implemented my scene graph structure.
3D OpenGL, C++ Game Development Video Tutorials @
www.marek-knows.com





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users