[2.1] Wireframe on solid?

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
Jay721
Halfling
Posts: 41
Joined: Mon Jan 29, 2018 8:19 am

[2.1] Wireframe on solid?

Post by Jay721 » Tue Oct 09, 2018 6:14 pm

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..
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1125
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 50

Re: [2.1] Wireframe on solid?

Post by al2950 » Tue Oct 09, 2018 6:28 pm

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
0 x

xrgo
OGRE Expert User
OGRE Expert User
Posts: 902
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 50

Re: [2.1] Wireframe on solid?

Post by xrgo » Tue Oct 09, 2018 11:14 pm

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
0 x

Post Reply