Posted by: | psaii | |
Data created: | 17 September 2010 |
Hi there, Last thing I wanted to check on Max.Net was the possibility to create a custom directX material, that is hardcoding a specific .fx file, specific technique, specific textures & other parameters (later on, this material would actually communicate with another app to get these parameters). Do you think it would be possible ? any pointers how ? IIDX9VertexShader & IIDX9PixelShader seems to be part of the equation but I'm not too sure how it's supposed to work. The material should hold of vertex shader and one pixel shader interface derived objects, and return them in the GetInterface() method, I guess, but to do that I have to implement quite a few abstract members from these interface, and don't feel like doing it if it's not the right solution ;) If you have any idea, I would appreciate :) Thanks, Psaii | |
21 September 2010
#2381 | |
Hi Psaii, Interesting thought. I've never had to make a DX9 shader in Max so I'm unfamiliar with the process. If it is, like you say, as simple as implementing a material and exposing the IIDX9VertexShader and IIDX9PixelShader through GetInterface(...) then it should be possible, alas, not with the current build. I need to think over how to expose specific interfaces for the next build to allow that to happen. Meanwhile please let me know if I am missing something about the process of DX9 shader writing (I haven't really found much info about that in the docs, I guess samples would be a better place to look). Marsel Marsel Khadiyev (Software Developer, EPHERE Inc.) | |
1 October 2013
#4619 | |
It's possible to create ShaderMaterials and wire parameters to it. I wrote a User interface plugin to handle generic fx files and create max shader materials with it. the main problem is to loop to the paramblock2 to grab and hook to the right params and the values. to create a directx shader material IMtl NewShaderMaterial = (IMtl)SceneManager.MaxCore.CreateInstance(SClass_ID.Material, MaxGlobal.Class_ID.Create(0xed995e4, 0x6133daf2)); here are some snippets to access the shader params. if you found a valid param you can manipulate them and change them directly.
to change the shader
to reload the shader if the effect file or bitmaps are changed
GetDxInterface1() is a new method i have implemented inside the max net wrapper itself. the native method was broken so i added new working methods GetDxInterface1(), GetDxInterface2() and GetDxInterface3() if someone is interesed on those wrapper changes i can post the changes in the c++ files of the wrapper
Mario Röske |