Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a IHLSLMaterialTransloator plug-in

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
560 Views, 4 Replies

Creating a IHLSLMaterialTransloator plug-in

Hi,
I was wondering if someone could offer any suggestions to a problem I am encountering.

 

We currently have a very simple plug-in that derives from Mtl. I'm currently attempting to update it so it utilizes the IHLSLMaterialTranslator in order to run some of our own generated .fx files.

 

The plug-in loads and I can assign the material to an object but it isn't calling the UpdateHLSLMaterial or GetHLSLMaterialHandle functions. My GetInterface function only returns the IHLSLMaterialTranslator interface if it asks for IHLSL_MATERIAL_TRANSLATOR_INTERFACE_ID, otherwise I return Mtl::GetInterface.


This is a material I'm attempting to use in the Nitrous Viewport. I'm assuming this is possible? I'm not quite sure what information to provide to give enough of an overview of my current situation.

Any help would be greatly appreciated.

 

Thanks,

Nick

4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

I've got one working, in 3ds 2015 SP2.

 

Try this in your material constructor:

 

SetMtlFlag( MTL_HW_MAT_ENABLED | MTL_HW_TEX_ENABLED | MTL_DISPLAY_ENABLE_FLAGS );
Message 3 of 5
Anonymous
in reply to: Anonymous

Unfortunately I already had those set.

Message 4 of 5
Anonymous
in reply to: Anonymous

Did you update 3ds ? I remember i had issues before upgrading to SP1.

Message 5 of 5
Anonymous
in reply to: Anonymous

I'm having a similar issue. Has anyone had any luck with implementing a IHLSLMaterialTranslator based material plugin in Max 2016?

 

In 2016 (sp1) my material plugin just renders black, and it doesn't seem like the "GetInterface" ever asks for an IHLSLMaterialTranslator. I tried compiling for and running in 2015 (sp2), and it seems to work fine. It's worth noting that the "HLSLMaterial" plugin in the how-to also just renders black in viewport.

 

I noticed in the what's new page that they mention "MetaSL is no longer supported in 3ds Max 2016. This affects IShaderManager and IHLSLMaterialTranslator. To customize the viewport display in realistic mode, use HLSL directly." Any idea what "use HLSL directly" is referring to?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report