2.1 ManualObject in release mode not visible

Problems building or running the engine, queries about how to use features etc.
Post Reply
Lax
Gnome
Posts: 369
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 8

2.1 ManualObject in release mode not visible

Post by Lax » Wed Jan 02, 2019 2:36 pm

Ogre Version: 2.1 :?:
Operating System: Windows 10 :?:
Render System: Any :?:

Hi,

I'm really desperate, as I tried everything, but somehow my manual object is only visible in debug mode, but not in release mode, no matter what I do. I tried everything.

I want to draw physics collision lines for a mesh.

Code: Select all

m_debugCollisionLines = m_sceneManager->createManualObject(isStatic ? Ogre::SCENE_STATIC : Ogre::SCENE_DYNAMIC);
m_debugCollisionLines->setRenderQueueGroup(250); // Render in foreground
m_debugCollisionLines->setQueryFlags(0 << 0);
m_debugCollisionLines->setCastShadows(false);
((Ogre::SceneNode*)m_node)->attachObject(m_debugCollisionLines);
m_debugCollisionLines->begin("GreenNoLighting", Ogre::OperationType::OT_LINE_LIST);
...
m_debugCollisionLines->position(p0);			
m_debugCollisionLines->position(p1);
m_debugCollisionLines->line(a++, a++);
...
m_debugCollisionLines->end();

GreenNoLighting Is an unlit material which does exist. Also in the Ogre.log there is nothing suspicious. I get not error nothing. The lines are just not there :(

Has somebody any clue that might help?

Thanks in advance
Lax
0 x

Boost113
Kobold
Posts: 35
Joined: Sun Sep 08, 2013 6:39 pm
x 5

Re: 2.1 ManualObject in release mode not visible

Post by Boost113 » Sat Jan 05, 2019 10:56 am

I can't say that I'd experienced this problem before. But whenever I have trouble with Ogre I usually use RenderDoc to see what is actually going on.

One idea I have regarding this issue specifically is that if you aren't setting the bounding box the object might get culled immediately (and due to memory initialization etc. that behaves differently in release mode).
1 x

Lax
Gnome
Posts: 369
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 8

Re: 2.1 ManualObject in release mode not visible

Post by Lax » Sun Feb 03, 2019 10:54 am

I could solve the issue. Something messy is going on when using ManualObject2 to create lines and using line(index1, index2) to build the indices.

So I changed:

Code: Select all

m_debugCollisionLines->position(p0);
m_debugCollisionLines->position(p1);
m_debugCollisionLines->line(a++, a++);
To:

Code: Select all

m_debugCollisionLines->position(p0);
m_debugCollisionLines->index(a++);
m_debugCollisionLines->position(p1);
m_debugCollisionLines->index(a++);
I could not find out what is wrong with 'line' and it cost lots of nerves.

Best Regards
Lax
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4064
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 228
Contact:

Re: 2.1 ManualObject in release mode not visible

Post by dark_sylinc » Sun Feb 03, 2019 4:06 pm

Do not use dodgy expressions such as 'm_debugCollisionLines->line(a++, a++);'

It is not easy to tell whether it will become line( 0, 1 ) or line( 1, 0 ) and for some versions of C++ it is undefined in which order it should be updated. See unsequenced errors and C++

Cheers
2 x

Lax
Gnome
Posts: 369
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 8

Re: 2.1 ManualObject in release mode not visible

Post by Lax » Sun Feb 03, 2019 8:18 pm

Thanks for pointing that out! I never thought about that phenomen.
0 x

Post Reply