Skip to main content

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.

Comments

Popular posts from this blog

About this blog

This blog is about mental ray, a rendering software. What is mental ray? Mental ray is a rendering software produced by a German company (a subsidiary company of NVidia. (2009)) mental images, GmbH . Several DCC (Digital Contents Creation) software, e.g., Maya, 3dsMax, Softimage XSI, employ mental ray as one of a renderer. Mental ray is also used in some CAD software, like Solidworks. The famous usage is special effect of some movies, such as StarWars, Matrix II/III, recently one is The Curious Case of Benjamin Button. http://www.mentalimages.com/products/mental-ray.html http://www.mentalimages.com/gallery/motion-pictures.html The main sales point of mental ray is a lot of features and you can do a lot of things. But on the other hand, we can do everything means sometimes we can do nothing. It is complex and thus difficult. Especially the customization ability of shaders is flexible, but it is a bit hard for me. However, usually it is suffice to use the provided shaders. One of my Ital

A note of mental ray/iray camera terminology.

The original mental ray camera is a pinhole camera. Therefore, some of the terminology differs with a normal camera. I will write them down here. aperture: This is the film width size. This has no relationship with lens aperture/opening. mental ray's camera was a pinhole camera, there is no lens aperture. focal: This is the distance from lens to the film (sensor). Pinhole camera always focused, so there is no focal length meaning. But using parameters aperture and focal length, we can compute the horizontal field of view. I think these two parameters exist for this purpose. aspect ratio: This is film(sensor)'s aspect ratio. There is no relationship with pixel resolution and camera geometry.  aspect ratio = film width/film height. Note: If we use aperture, focal, and aspect ratio, we can compute the vertical field of view. mental ray/iray camera model (pinhole camera) without lens shader Current mental ray/iray can have depth of field effect, etc., this termino