[2.1] Wireframe on solid?

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Jay721
Halfling
Posts: 62
Joined: Mon Jan 29, 2018 8:19 am

[2.1] Wireframe on solid?

Post by Jay721 »

Hi guys.

Nooby question here, I need to show a wireframe ontop of a solid object. I've been doing

Code: Select all

macroblock.mPolygonMode = Ogre::PM_WIREFRAME;
To get a pure wireframe, but not sure how to get solid and wireframe at the same time?

Thanks..
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] Wireframe on solid?

Post by al2950 »

You will need to render the object twice. I would recommend duplicating the objecting and putting it in a separate render queue and a separate pass. Render the solid object first then render your wireframe object. To ensure the wireframe object does not get culled by the depth buffer make sure you set the depth bias, see HlmsMacroblock::mDepthBiasConstant
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: [2.1] Wireframe on solid?

Post by xrgo »

Haven't tried it but you could also implement wireframe drawing via pixel shader:
http://codeflow.org/entries/2012/aug/02 ... ordinates/
You can extend the PBS implementation using custom pieces
Post Reply