Creating Lit sphere material in 3dsmax
In this article I’d like to go back to the trend of previous years – Lit Spheres materials (also called matcap/Spherical Environment Mapping (SEM), etc.). The essence of this material is that all shader parameters: color, reflections, and so on are located on the image, where the sphere is depicted. To use such a image as material you will need a special shader which can draw out from it the necessary parameters.
This kind of materials are very useful in modeling (especially organic objects) and allow to identify errors in the topology. They have proved themselves in programs such as Mudbox and Zbrush. Presence of the library with such materials and possibility of fast switching between them considerably lighten modeling.
Just creation of Lit Sphere materials and library with them in 3dsmax we’ll do now. In this article we won’t consider creation of pictures with spheres, but we’ll take the ready-made. Our task is to create a material whose properties will be equally visible as when working with a model in the viewport, and in the case where we need to render our model.
Lit Sphere 3dsmax material
For visualization of materials in viewport in 3dsmax and for rendering are responsible different shaders, material created just for rendering is likely to be incorrectly displayed in the viewport, and vice versa.
Before you begin, download and unpack archives with images with the sphere:
LitSphere images collections
- We’ll begin with the material for the viewport. In 3dsmax There is no ready-made shader, which would work with such images. That’s why we’ll make use of Matballz shader. written by Charles Hollemeersch.
– For work in Direct3d mode (directx 9) you should use the original Matballz.fx shader.
– For work in Nitrous mode (Directx 11) you should use modified by me Matballz11.fx which support Directx 11.
Material for the viewport is as follows:
Materials-> Standard -> DirectX shader-> Matballz.fx-> Lit Sphere map-> image with the sphere
Assigning it to to your object you can see its work in viewport, but if you render the scene, then the properties of your material will be lost because the DirectX shader does not work with a renderer.
- As renderer we will use Mental Ray. Mental Ray comes with Environment Probe/Gray Ball shader, its properties are similar to Matballz.fx.
So material for Mental Ray looks as follows:
Materials-> Mental Ray->mental ray->Surface->Environment Probe/Gray Ball->Gray Ball->image with sphere
This material will be visible on the render, made by Mental Ray but in the viewport material properties will be lost.
- Accordingly, our task is to combine the two previously created materials in such a way that new material worked for the viewport and for render. And here 3dsmax Shell material will help us.Our new material will look as follows:
Materials-> Standard->Shell material->Original Material->DirectX Shader (created earlier); Baked Material-> mental ray (created earlier).
Be sure to specify the parameters of the Shell Material:
Original Material-> Viewport; Baked Material-> Render
So our final material will look the same in the viewport and in render that you can see in the screenshots.
Lit Sphere materials library
Create hundreds of nearly identical materials manually is tedious task, so I wrote a maxscript (litsphere_lib), which will help us to automate this task. You will need to specify the .FX shader that you want to use, and the folder in which your images with sphere. The script automatically tried all images in a folder and all its sub-folders, and then create the materials on the same principle, which we have reviewed above, then save them in a new library. Using the library you created, you can quickly change the Lit sphere materials on your objects that allow you to identify errors in the object topology.