2.1 ManualObject in release mode not visible

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

2.1 ManualObject in release mode not visible

Post by Lax »

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

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

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

Re: 2.1 ManualObject in release mode not visible

Post by Boost113 »

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).
Lax
Hobgoblin
Posts: 583
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 50

Re: 2.1 ManualObject in release mode not visible

Post by Lax »

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

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

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

Re: 2.1 ManualObject in release mode not visible

Post by dark_sylinc »

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
Lax
Hobgoblin
Posts: 583
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 50

Re: 2.1 ManualObject in release mode not visible

Post by Lax »

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

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

Post Reply