FDisplace v1.0 for Mental Ray

Maya/ Mental Ray FDisplace Shader
version 1.0 final, 21.01.2006.
Copyright Cristi Prefac 2006, cristi@thepixelmachine.com

DOWNLOAD

DOWNLOAD 2 test scenes, containing example shading networks. Just drag and drop them in your Maya window.

Videos:

(these videos require de xvid codec)

door.avi - an animation of the door rendered for this tutorial

shadow.avi - a small test for the selfshadows feature

testneg.avi- a small test for the selfshadows feature

testpos.avi - a small test for the selfshadows feature

What's FDisplace?

FDisplace is a Mental Ray shader inspired by the "Relief Mapping" algorithms described by
Fabio Policarpo, Manuel M. Oliveira and Joao L.D. Comba, in the "Real-Time Relief Mapping on
Arbitrary Polygonal Surfaces" document. It's a kind of bumpmap, which also has a parallax deformation.


Installation

1.put the fdisplace.dll in your maya/mentalray/lib folder
2.put the fdisplace.mi in your maya/mentalray/include folder
3.add the following lines in your maya.rayrc file:

link "{MAYABASE}/lib/fdisplace.{DSO}"
mi "{MAYABASE}/include/fdisplace.mi"

Features

- Parallax effect for up to 8 color channels;
- UV Clip allows you setting a limit for the uv area the parallax effect takes place
- Normals output. Instead of using a bumpmap node, you can let FDisplace calculate the normals, depending of the displacement value.
- Selfshadows are computed from o a single lightsource.

Limitations

FDisplace accepts only file texture nodes as color and displacement inputs.
FDisplace creates only positive or negative displacement at a time, it doesn't work a a regular displacement node. You can either set a positive or a negative displacement. You also have to create specific displacement maps for positive displacement. In the positive displacement mode, the higher the intensity of the displace value is, the higher positive displacement takes place, and in negative mode, the higher the intensity of the displace value is, the lower that surface will be.
If you enable self shadows and you have no light connected to your shader or if use all light it's not checked, FDisplace will probably crash...Maya.
FDisplace does not take into account the place2dtexture nodes connected to you file textues, you
should repeat your mapping in your uv layout.

Usage

Create an FDisplace node and set the number of textures you want to displace. For example, you have a color map and a spec map, they both have to be displaced, so you set in that case a value of 2 for the number of textures attribute.
Plug the file texture nodes in t1....t8 inputs of fdisplace.
Plug the displacement file texture node in the displacement input. Remember, you should not plug the out_color value, just middle click drack the node in the appropiate attribute.
Plug out_t1...out_t8 in appropiate color inputs of your material. In this example, plug out_t1 in the color input of a blinn shader and out_t2 in the specular color input.


Set the displace depth. Remember that the displacement is done in the uv space and very often 3d coordinates and distanced have nothing to do with uv coords and distances.
Choose a direction of displacement. 1 if for positive and -1 is for negative displacement. You can increase the binary and linear steps values for a finer displacement. You should always choose those values that fit your needs and render faster.


You can enable the UV clip feature and set uv limits within the displacement takes place. The shader will then output in the "out matte" channel the contour matte. You can further plug that in the transparency channel for example.


Enable normals output if you want to let the shader calculate the normals. In this case, you should plug out_normals in the normal camera input of your shader.

In all the renderings presented here, all you see is a plane with the created blinn shader applied.


If you want selfshadows, you should enable them :) and plug a light node into the shadow casting light slot in your fdisplace shader. If you enable clip selfshadows, the shader will know not to put selfshadows into already shadowd/occluded portions of the image. This way you won't have double shadows. To apply the self shadow to you material, you should use the applyshadow shader found on my website. FDisplace outputs the shadow matte as out_sshadow. You should plug for example the out_sshadow in you shadow matte input of applyshadow, out_t1 in the color input of applyshadow, set a shadow color and intensity, and plug the applyshadow's output into your blinn color.

And here is the rendered image with shadow applied.