Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Maya 2018 SDK: DX11ViewportRenderer not working

Maya 2018 SDK: DX11ViewportRenderer not working

Anonymous
Not applicable
1,462 Views
10 Replies
Message 1 of 11

Maya 2018 SDK: DX11ViewportRenderer not working

Anonymous
Not applicable

Hi!

 

I have for the past generations of maya build an DirecX11 renderer for our engine, making preview of our models very convenient with our shader solution.

 

But since the new Maya 2018 and its sdk it is now malfunctioning. I get this error (posing the error from the SDK sample):

 

"// Warning: file: D:/Program Files/Autodesk/Maya2018/scripts/others/setRendererInModelPanel.mel line 42: The renderer ('DX11ViewportRenderer') is not currently available. Viewport 2.0 will be used instead. // "

 

I get the same error with my solution. Is there something new I have missed that I need to enable/disable?

 

 

 

0 Likes
Accepted solutions (2)
1,463 Views
10 Replies
Replies (10)
Message 2 of 11

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

I can't reproduce the warning here. Can you try with set MAYA_ENABLE_LEGACY_VIEWPORT=1 in your environment variables? MViewportRenderer is obsolete, please migrate to MRenderOverride or MSceneRender.

 

Yours,

Li

Message 3 of 11

Anonymous
Not applicable

Thank you for your answer!

It now seems to work just fine! Is there any plans to update the SDK samplesto reflect these new changes? Or is there a quick way to convert my existing viewport without much code changes?

0 Likes
Message 4 of 11

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

There are new samples for MRenderOverride(viewMRenderOverride, viewRender*, etc...). I am afraid there isn't a specific guide or quick way for porting MViewportRenderer to MRenderOverride. There is a VP2 API porting guide you could use as a reference.

 

Yours,

Li

0 Likes
Message 5 of 11

Anonymous
Not applicable

Can you point me to a devkit sample which uses a custom renderer (lika a custom DirectX11 renderer). As far as I can find, I can only overide sertain things with the MSceneRenderer, I can't create my own system like the old legacy viewport system?

0 Likes
Message 6 of 11

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

Have checked viewDX11DeviceAccess sample?

 

It should be similar to DX11ViewportRenderer.

 

Yours,

Li

Message 7 of 11

Anonymous
Not applicable

Perfect! That example gave me a good start on how to convert my project. Thank you for all the help!

0 Likes
Message 8 of 11

Anonymous
Not applicable

Hello again!

 

Thank you so much for your help with this problem. I have however a new problem with the viewDX11DeviceAccess example and with my code as well on my way o the convertion. I have tested the viewDX11DeviceAccess example on different computers with the same issue. I have illustrated the problem in this video:

 

https://youtu.be/DP2Ql8wY7i0

 

As you can see, if we render just tha plane, everything works as intended. But as soon as I create a new shape and mess around with the XYZ axis (just hoovering), the whole scene will flicker into a wireframe without textures.

 

It will be repolicated with the original sample that comes eith the devkit: "devkit\plug-ins\viewDX11DeviceAccess".

 

Is there a workaround I can do?

 

Thank you!

0 Likes
Message 9 of 11

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It looks not working properly, I'll do some research and discuss with our engineers later this week or next. 

 

Yours,

Li

0 Likes
Message 10 of 11

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

Please add following code into drawPlaneDX after PSSetShader.

 

		m_pD3DDeviceContext->GSSetShader(NULL, NULL, 0);

It appears Maya uses geometry shaders when selecting the object and it wasn't cleared when setting a new PS shader.

 

Yours,

Li

0 Likes
Message 11 of 11

Anonymous
Not applicable

Everything seems to work perfectly now. Thank you so much for your help!

0 Likes