RenderPass Problem

It's me again ^^

I tried to switch from a multitextured texturestate for an object to using multipass with severel texturestates today.

As far as i understand it, spatials using multipass aren't drawn anymore via the hirarchical drawing of the rootnode, but are drawn through the PassManager / The RenderPass they're registered with.

Now i have this model that has to be attached and detached again (a kind of "ghost"model that is attached to indicate movement when pointing with the mouse).

As it is no longer rendered through the rootNode drawing, detaching it from the scene no longer removes it from the screen. Sure: it is still registered with the RenderPass that holds its texture.

This is a big problem for me at the moment that i don't see a possibility to resolve easily.

  • Detaching it doesn't interest the engine anymore.
  • There is no dectivate() methode or anything similar.
  • And removing it from the RenderPass everytime doesn't seem very practical. What if the "ghost model" consists of numerous spatials that would have to be registered and deregistered every time the player wants to give a move order…

    Am i just missing something or missed to understand a part of the concept?

    Or is this really a problem of the RenderPass thing?

    Best thing for me would be to keep everything in the rootNode drawing as it used to be and just assign to a spatial "you now have those 3 RenderPasses". But i guess that won't be possible, right?

I'm having trouble following…  maybe because of your concept of a rootNode?  There is no "one scenegraph" in jME.  Any Node object is a scenegraph unto itself, therefore, it depends entirely on how you use them in your app.

Question about your ghost object…  Why attach/detach at all?  Why not use the cull mode of the node containing that ghost node to cull/show it as needed?  Alternatively, you could put the ghost node in its own Pass and enable/disable the pass as needed.  There are several ways to go about what I think you are talking about.