Mia_Material_Advanced
- October 27th, 2011
- Write comment
Mia_Material_Advanced is a shader phenomena which should solve most of your issues with the standard Softimage implementation of the Architectural Material, facilitate working with channels, plus add few additional nice features. Since I’ve spend quite some time investigating the whole topic, I thought it might be a good idea to describe the whole process on why I ended up writing my own spdl for the shader. But feel free to skip all that and just download the .xsiaddon at the bottom of the post.
So why would you need yet another version of the Architectural Material?
Initially I’ve been searching for a working solution to use Softimage Framebuffers/Channels in conjunction with the Architectural Material. So what’s the problem with the build-in channels?
At first glance everything works fine:
So far so good. But let’s try something more difficult. I love “Enhance XSI” procedural textures a lot and I use them very frequently. So what happens if we pipe an Enhance Procedural into the Architectural Material.
The image looks good, but rendertime went from about 10 seconds to more than two and a half minutes!!! The funny thing is, this even happens if you pipe the shader into ports like refraction color, which shouldn’t be evaluated at all. Obviously this is a bug with the Enhance shaders, because other procedurals like the standard fractal or the the Binary Alchemy Fractal work fine. And actually it’s got nothing to do with the Architectural Material as well. If you look at the code of the Architectural shader, you will discover that it’s actually a shader phenomena. It contains the Architectural_Multi-Out Shader, plus some “Store Color in Channel” shaders to store the output of the Mia into the standard Softimage channels. If we use the Architectural_Multi-out shader directly, everything renders fast again, but of course our channels are now empty. And if we try to store the output into channels in the rendertree, rendering slows down again. So obviously there is some problem with the “Store Color in Channel” shader and the enhance shaders. I reported the issue already some time ago, but so far it hasn’t been fixed.
So if you want to use the Enhance procedurals in conjunction with channels there is no way to make use of the usual “Store Color in Channel” shader. That’s also the reason why Guillaume Laforge’s mia_x_RenderChannels Compound won’t work very well in this case (actually there is another reason why you should stay away from shader compounds completely, as you can read below).
The solution: the excellent Mia Material Wrapper by Jarno Gruppen, which stores the channels of the Architectural Material directly on a shader level.
Like this everything, including channels, works fine, even with Enhance procedurals. Another advantage over the build-in channels are additional channels like the raw components and the corresponding level masks or AO and opacity channels. Since I wanted to add a few other features to the shader, I initially build a shader compound which exposed all the parameters. But I encountered another nasty Softimage bug, which (to my knowledge) hasn’t been fixed yet. If you expose a lot of parameters out of a shader compound, as soon as you draw a region, Softimage freezes for a certain time before it even starts to render. This delay grows with the number of exposed parameters and instances of the shader itself. And since the Architectural Material has more than 50 parameters it sometimes took minutes until the rendering started for more complex scenes, which made tweaking parameters unbearable. That’s why I decided to build a shader phenomena via spdl in the end.
Features of the shader:
Please note: I ended up including two 3rd party shaders directly in the addon. I didn’t code any of these shaders, so all credit goes to their original authors!
- Additional Tab to add or remove channels directly in the shader: simple check-boxes to add all the available channels of the Architectural_Multi-Out Material in a way that they work together with the wrapper. Please note: this doesn’t activate or deactivate storing render channels for individual shader instances in you scene. It just globally adds channels to the scene and corresponding framebuffers to the current pass.
- Avanced rayswitch functionallity: I recompiled the excellent RRayType shader by Reinhard Claus for 64bit systems and included it in the phenomena. An additional rayswich tab gives you the possibility to control secondary and tertiary generation rays for both reflection and refraction. This can be very useful to optimize performance as well as for artistic purposes ( for example by changing the color values).
- Solves anisotropic highlight problem: since forever the default Architectural Material distorts highlights on objects with UV’s (even if you don’t use anisotropic reflections) unless you type “none” or something else into the anisotropic texture space. You can see the effect in the topmost picture: the left sphere shows the Architectural Material with default values and stretched highlight, the right sphere the same material with “none” typed into texture space. Actually the original design of the MIA Material by mental ray allows both vector and numeric inputs. My guess is that since that’s not possible inside Softimage, they decided to implement only the vector input. But the problem is that you will very rarely need vector map inputs for your anisotropic reflections while on the other hand it’s very annoying to type something into the texture space, each and every time you use the shader. So I decided to go with the numeric input which gives you the following options. From the mental images arch&design docs:
anisotropy channel can also have the following “special” values:-1: the base rotation follows the local object coordinate system.-2: the base rotation follows the bump basis vectors-3: the base rotation follows the surface derivatives
In the very rare case you need to create an effect like this, you can still use the normal Architectural_Multi-out material. - Clamp for HDR rendering: a small utility in the optimization tab. Since we are rendering to 32bit hdr files most of the times these days, we often encounter problems with super bright highlights. Since traditional specular highlights are a remnant from the beginnings of computer graphics, they often don’t work well when rendering to hdr files. For very reflective surfaces the specular’s intensity can grow to very unrealistic values, up to hundred times brighter than white. This can lead to flickering, especially when those specular’s are seen by other reflective surfaces. To a certain extend it can help to clamp all values above a certain level, and that’s exactly what the parameters does.
Here is a video with the shader in action:
Usage:
The xsiaddon will install the spdl of the shader phenomena plus the mia_material_wrapper and the RRaytype shaders. Everything x64 only, sorry!
For some reason you will have to restart softimage after installing the .xsiaddon or the interface of the shader won’t load fine in some cases.
You should then find a shader preset in your Illumination category inside the render tree. This will drop the shader and the wrapper already connected into your tree, which is how the shader should be used. Unfortunately I wasn’t able to include the wrapper directly into the phenomena (any hints on how to do this would be much appreciated).
Additionally you will find a category called Mia_Material_Advanced which contains the three separate shaders if you need them.
Download:
Let me know if you encounter any problems.
Cheers!












