Polygon mode wireframe missing for Metal render system?

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
mrmclovin
Goblin
Posts: 287
Joined: Sun May 11, 2008 9:27 pm
x 7

Polygon mode wireframe missing for Metal render system?

Post by mrmclovin » Sun Jun 09, 2019 9:57 am

I'm trying to set polygon mode to wireframe in my JSON hlms file, and I can see that my renderable's datablock has PM_WIREFRAME set, but my renderable still renders as a solid object.

From my findings (or lack of it actually) it seems that wireframe mode isn't implemented for Metal. Is that correct? I wanted to try to fix it but I'm unsure of how complicated it would be or if there are any rabbit holes to look out for?

Running Ogre 2.1 on macos sierra on a 2012 mac book air.
0 x

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

Re: Polygon mode wireframe missing for Metal render system?

Post by dark_sylinc » Mon Jun 10, 2019 5:39 am

It appears to be an oversight.

I think calling:

Code: Select all

MTLTriangleFillMode fillMode = pso->macroblock->mPolygonMode == PM_SOLID ?
                                           MTLTriangleFillModeFill : MTLTriangleFillModeLines;
[mActiveRenderEncoder setTriangleFillMode:fillMode];
inside MetalRenderSystem::_setPipelineStateObject may just do it.

If that works, we should cache "fillMode" in MetalHlmsPso (in MetalRenderSystem::_hlmsPipelineStateObjectCreated) instead of evaluating the comparison on every _setPipelineStateObject call as a performance optimization.
1 x

mrmclovin
Goblin
Posts: 287
Joined: Sun May 11, 2008 9:27 pm
x 7

Re: Polygon mode wireframe missing for Metal render system?

Post by mrmclovin » Sat Jun 29, 2019 10:52 am

Thank you!

It worked!
0 x

Post Reply