Friday, April 3, 2009

Switch cycle using Material modefier

There is a scene projects in which we want to work with multiple lights but this requires a lot of system resources. In these cases is better to replace the lights with textured objects to simulate them (fake lights), at least where it is possible (lights with short range).

In this tutorial I will show you how to make switch cycle (on/off) using Material modefier. Of course, you can use any object for the purpose, from geometrical or extruded shape spline to mesh or poly. I will use a Plane, also I will use materials without texture maps, to can catch the idea only.

This is all:
  1. Create Multi/Sub-Object material
  2. Create a Plane and adding Material modefier
  3. Animate Material ID

1. Create Multi/Sub-Object material

In empty slot in Material Editor press on Standard end select Multi/Sub-Object material. Set Number to 2 and change Diffuse and Ambient color for both sub-materials. For first to pure white (RGB: 255 255 255), and pure black (0 0 0) to second one. Also change Self-Illumination to 100 for 1st and check Color box for 2nd. The material is ready.

2. Create a Plane and adding Material modefier

  • Create a Plane
  • Assign material to the plane
  • Add Material modefier to it

3. Animate Material ID

As you can see, the Material modefier has only one parameters - Material ID, but animateable and it's enough for our task. Now we can setup your keys using ID 1 for on and ID 2 for off event. We can do it manually or to expedite the task using a script. But if you plan to use some script, first you must rename Material modefier, because it default name "Material" will create conflict in MAXScript.
So I renamed it to "MaterialMod" and here's some example:

Well, that's all.
Demo video (example):

PDF version here (54 kb)

No comments:

Post a Comment

Thanks for your comment