Scene node rendering issue

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Brainsaw
Posts: 1225
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Scene node rendering issue

Post by Brainsaw »

Hello,

I have ran into a problem, and it drives me crazy. I have a custom scene node (Rostrum Node) which holds some data necessary for the rostrum after the race, and it adds a mesh scene node as child with the model of the rostrum. After some debugging I found out that the render pass of that mesh scene node is "ESNRP_NONE", and I don't know why or how I can change this. Can you give me some hint on what I'm doing wrong?

The code in the constructor of my node is:

Code: Select all

      
      setScale(irr::core::vector3df(15.0f));
      setVisible(true);

      irr::scene::IAnimatedMesh *l_pMesh = a_pMgr->getMesh("data/objects/rostrum.3ds");

      if (l_pMesh) {
        irr::scene::IMeshSceneNode *l_pNode = a_pMgr->addMeshSceneNode(l_pMesh->getMesh(0), this, -1);
        l_pNode->setIsDebugObject(true);
        l_pNode->setVisible(true);
        l_pNode->setName("Rostrum");
      }
Edit: I am using Irrlicht trunk (but I'm not sure which version), and I see the same issue on Windows and the Raspberry Pi

Some more lines which might be of interest:

Code: Select all

    void CRostrumNode::OnRegisterSceneNode() {
      SceneManager->registerNodeForRendering(this, irr::scene::ESNRP_SOLID);
    }

    void CRostrumNode::render() {
      for (irr::core::list<irr::scene::ISceneNode *>::ConstIterator it = Children.begin(); it != Children.end(); it++)
        (*it)->render();
    }
Another edit: I am using similar scene nodes in various other placed (e.g. my self-adjusting speed limit signs), and it seems that I have the same problem there.
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
CuteAlien
Admin
Posts: 9849
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Scene node rendering issue

Post by CuteAlien »

Hm, I have an idea :-( Probably a case I didn't think about when I added the CBufferRenderNode hack *sigh* (bit ugly workaround to allow meshbuffers render sorted by material instead of by node without breaking the Irrlicht interface massively).

As workaround - can you call ISceneNode::OnRegisterSceneNode() at the end of CRostrumNode::OnRegisterSceneNode() and then not do the rendering yourself?

I'll have to code some test-case to reproduce this first. On first look I don't see right now why it fails your case, but probably I'm missing something.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9849
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Scene node rendering issue

Post by CuteAlien »

OK, fix is in svn trunk r6698 (will merge with ogl-es branch later).
As I guessed I had introduced this with the CBufferRenderNode stuff. I actually coded the right checks, but then didn't use the variable containing the result but called the original getRenderPass function again *sigh*
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Brainsaw
Posts: 1225
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Scene node rendering issue

Post by Brainsaw »

Thank you very much, I'll try the latest version in the afternoon once I'm done with my daytime work ;)
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
Brainsaw
Posts: 1225
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Scene node rendering issue

Post by Brainsaw »

Thanks, I got it working now :D
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
CuteAlien
Admin
Posts: 9849
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Scene node rendering issue

Post by CuteAlien »

Great. And thanks for reporting.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply