Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Right now each scene::Node has exactly one scene::Instance, but there is one exception: all the Model Nodes, where multiple Instances exist for the same Node.

 

As discussed earlier, the idea behind that was to store the raw Model data only once, which is of course desirable, but I guess this can be solved in another way. Also, there are two complications caused by the multiple-Instance-for-single-Node approach:

 

- Some Models can disappear when Regioning is turned on, because this filters out the single Model Node and all Instances along with it.

 

- The whole InstanceSet stuff is bloating the scene::Nodes with stuff that is unused most of the time (all brushes, patches, lights and whatever only have one instance and don't need to use it). The current Model approach prevents me from removing/simplifying it.

 

Of course it would be nice to have the raw model data cached and stored only once, but I guess this can be solved by removing the entire ModelNode approach and let the Entity Instances to hold the reference to the Model& data themselves.

 

So, to sum this up, right now it's something like this:

 

Doom3GroupNode ("func_static1") has a ModelNode CRATE as child

EClassModelNode ("moveable_crate1") has the same ModelNode CRATE as child

The CRATE ModelNode has two separate Instances.

 

My approach would be this:

Doom3GroupNode ("func_static") holds a reference to an abstract Model& object (whatever this may be, ASE, LWO, NullModel)

EClassModelNode ("moveable_crate1") also hold a reference to the same Model& object.

No ModelNodes, no ModelInstances. The Model object is still an Renderable/OpenGLRenderable object, so that the Doom3Group/EclassModel is not bothered with implementation details needed to render the actual model (plus filtering and skin remappings).

 

It is probably necessary to change the ModelLoader interface and the underlying resource cache a bit, because everything is designed to deliver scene::Nodes when loadModel() is called.

 

Thoughts? Should I go ahead and change this?

Posted
That sounds like an improvement, by all means go ahead although I guess some of this may become obsolete with the scenegraph refactor?

Partially, yes, especially the way the Instances are handled. But anyway, it should make our lives easier when porting the scenegraph over to the new one when this multiple-instances-one-node approach is gone. After that, each scenegraph node is an actual object with only one instance.

 

And model data is not stored in scenegraph objects.

Posted

Ok, I changed my mind, I'm not going to start on this. There are too many changes required that would become obsolete with the new scenegraph that it would be a partial waste of time.

 

After a first read through the code, I thought it was "just" reorganising the Model data references, but there's more to it than that. For example, the PicoModelInstance derives from LightCullable, SelectionTestable, SkinnedModel and whatnot. There will be much copying and moving stuff around, which would result in even more bloated Entity classes (an EClassModel would have to derive from all of the aforementioned classes).

 

Part of the problem is that the various Entity classes are a pain to maintain. This will need changing too, it's so tiresome copying stuff around. A unified Entity class would be nice.

 

That's not something I want to do before the other refactor, so I'll leave it at that. We will have to consider this model problem when we are going to layout the new scenegraph.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
×
×
  • Create New...