Lighting your Spaceship
Wednesday 28th Feb 2007
The purpose of this tutorial is to be able to light a spaceship in such a way that allows fine control of lighting and optimal render times.

This tutorial will teach you,
A) Mental Ray area lights, methods of optimisation.
B) Rotationally independent lighting rig.
C) How to bastardise 3D Max's default teapot model.


The basic model

Step 1 – Switch your current renderer to Mental Ray. This can be done with the default render panel key F10, or alternatively can be found inside Menus --> Rendering --> Render..


The render panel

Step 2 – Lower your render quality for faster render previews. Inside the Renderer Tab of the Render window, you'll find a Min/Max settings. Set this to ¼ and 1. Set your filter type to Gaussian, Mitchell or Lanczos. This will give sharper edges than the Box filter.


The sampling panel.

Explanation – Min samples represents the minimum number of rays that will be cast when the anti-aliasing threshold (shown underneath, shown as 'Contrast') finds two pixels outside the luminance threshold. By default, more than 5% difference in luminance between two side-by-side pixels will make mental-ray use the maximum number of samples.

Obviously, this means areas of low-contrast (blurry textures, black background, etc) will render extremely fast.

Setting one quarter means that the minimum ray value is by default 4 pixels wide, and upon an edge or area of high contrast, it will use its maximum quality of one ray per pixel.

Step 3 – Drag out a an mr area spot as shown.




 

Step 4 – Set the width of your light. Inside the modify panel (with your light selected), find the tab labelled Area Light Parameters. Make it a disc, and make it roughly half the size of your spaceship.

Next, in Light Type (at the top), un-tick targeted.

Now, in the Intensity/Color/Attenuation rollout, set the Far attenuation to be further out than your ship. The reason for this is so that rays don't have to travel all the way to 'infinity' before they terminate. The same rule applies for all rays, defining a defined limit increases render efficiency, on some scenes this is more noticeable than others.

Now find a nice view, and hit render to see what you've got.

For illustrative purposes, I've taken the texture off my object and made it white, to better illustrate how the lighting is affecting the object.

So far, not very interesting.

So, now we've got our main sunlight. Now we're going to put in our kicker light, this is an extremely bright light that will make a sharp edge on the object, it should be quite dramatic.

Step 5 – Clone the previous light by holding shift, and dragging it to somewhere “behind” your spaceship, make sure you select 'Copy' (not instance). Drag it around until just the very edge of your ship is lit up, we really want to be able to see the profile of this epic ship (right now, imagine we're using the Enterprise E rather than a teapot with wings).


Okay so we're starting to get a bit more dramatic. We can widen the size of this light to make the edge slightly softer if you like.

Next, some bounce light from our (not-shown) nearby planet. For the sake of ease, I'm going to choose a blue planet like Earth. Because this is a blue planet, we'll be using a blue light. We can do this with either a spotlight or an Omni, but for the sake of education, we'll use an Omni.

Now I've chosen to put my omni in nearly the direct opposite direction of the main light but slightly toward the front (so we see some real blue on the bottom). I've set its multiplier to 0.5, its falloff to just past the object. Now here is where we hit a cross road.

Depending on how complicated and large your spaceship is, you can either use shadows on the light (each Area light is extremely expensive on render time), or you can choose to make your falloff start at the start of the object (relative to the lights view) and end just after your ship.

I have personally chose to have the light falloff, and hence I don't need to have shadows being case by this light.


If you do have an extremely complex ship where the absence of shadows will be noticed, then its important to make sure that you make your omni's 'Area Light' parameters very large, this will ensure you get an extremely soft light, we can visible see that its 'bouncing in' rather than being a direct source of light.

Okay, so we've got our “Universe Lights.”

Now, if you've kept all your lights quite tight on your model, its time we rigged them up so you can fly your spaceship around at will without having to move lights, or move them so far away that render time is really hurt by the amount of rays being cast.


Step 6 – Make a dummy in the same place in space as your spaceship. Select all three lights and link them to your newly made dummy.

To make sure this worked, grab the dummy and move it around, your lights should move with it. If you press H (object select) and tick the ''Display Subtree' in the bottom left.

Now, we want to be able to rotate and move the ship freely without its rotation affecting the lights, only its movement.

Step 7 – Select your dummy. Animation --> Contraints --> Position Constraint. Now you'll see a white line floating around your cursor, its waiting for you to select a target. Select your spaceship.

Now, grab and move your spaceship, you'll notice the lights follow, but they do not follow rotation, so you now have a global direction of light.

Step 8 – Lighting the ship itself.

Now this magical teapot model has quite a few 'viewports', and I feel that these should be emitting some light, even if this would technically be erroneous. I have built 3 lights, red, blur, and purple, these are all Omni's with extremely short falloffs (Far Attenuation).

If while you're doing this with your own ship you find you've run out of hardware-renderable lights (by default, most video cards will only show you 8 lights in real-time at once), or you're annoyed with working in the dark, use Ctrl-L to switch to Max's default lighting mode (this will only affect the viewport, not your render).


So as you can see, I've placed some Omni's around. The lights on the other side of the ship are instanced, rather than copied. Any changes I make to these lights are automatically changed on the other side.

Then I've linked the lights to the spaceship (since I want these lights binded to the ship rather than rotationally independent).


 

 
  ADVERTISE WITH JTBENTLEY.COM