Skip to main content

iray 5: iray in standalone mental ray

So far, I told about exporting an mi file. Now here is the shader conversion for iray.

iray supports mia_material. To reuse current scenes, it is nice if I could convert the 3dsmax shaders to mia_material (Arch&Design) shader. I could imagine that some of other shaders will be supported also, but, iray is a CUDA program. CUDA has a divergence problem, it means, if many kind of shaders are in the scene, the performance becomes low. That's natural. A shader is a function and many different shaders are running on a CUDA device, I could see it will be slow. But, if the same function everywhere, then CUDA works well. (in theory. If function itself has a lot of branches, then there is a problem. Though many obstacles are there, but many kind of shaders seems to have not so chance. ) Also I imagine there is less trouble if I use the mental images native supported shaders since iray is a new renderer. In my personal opinion, I would convert the shaders.

You can find 3dsmax shaders to mia_material convert 3dsmax script here (https://code.google.com/p/shitohichi-tools/source/browse/#hg/mentalray/max2mia_material). This is based on Zap's VRay shader to mia_material converter (http://mentalraytips.blogspot.com/). Thank you, Zap. You can find two scripts. The main script is yh_max2mia_material.ms. Open this and evaluate, then the shaders in the scene will be converted. (yh_material_object_map.ms is a collection of subroutines. Therefore, this script is also needed.)

Of course, automatic conversion never be perfect. Some will fail. But, I think this is a good start point if there are many shaders in your scene.

From next week, SIGGRAPH starts. (I've never been SIGGRAPH.) I assume there is some iray demo there.

I concludes the shader conversion story here, at least this moment.

Comments

Popular posts from this blog

What is mental ray shader?

mental ray shader is C/C++ code that is invoked by the mental ray core when a ray hits an object. The name ``shader'' is used by hysterical reason, I think ``Plugin'' is much better word nowadays. mental ray shader gives us a lot of freedom for users, but, I think we do not need to write a custom shader in most of the cases. The meaning of 'gives us a lot of freedom' is when a ray hit an object, a user could almost everything by a shader. For example, when a ray hit an object, mental ray can send an email from the shader. (I believe that mental ray designer does not recommended this kind of side effect usage, but, a shader is just a plugin and it should be possible.) You can do anything means also it is difficult to handle the shaders. mental ray was developed for a long time and takes care of backward compatibility, this contributed for its complexity.

Using stand alone mental ray

If you render a scene using Maya, 3dsMax, XSI, and so on, you can skip this part of article. If you have your own shaders or you are managing a render firm, then this might help you a bit. References of mental ray The following mental ray references are the important ones. Thomas Driemeyer, Rendering with mental ray, 3nd Ed. (Mental Ray Handbooks 1), ISBN-13: 978-3211228753 Thomas Driemeyer and Rolf Herken, Programming mental ray, (Mental Ray Handbooks 2), ISBN-13: 978-3211838518 Andy Kopra, Writing Mental Ray Shaders: A Perceptual Introduction (Mental Ray Handbooks 3), ISBN-13: 978-3211489642 These are advanced documentation and there are some more introductory documents around. Among these three books, I think Andy Korpa's book is easier to read. There is also a support page of the book http://www.writingshaders.com/ . Getting mental ray In my case, I use mental ray at my company. Therefore, I have no problem to get mental ray. However, if you want to have mental ray in private,