• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

3D lighting tutorial

Scarecrow

SOC-14 1K
Lighting is a sorely overlooked issue in too many 3D renders. You can have the most highly detailed models and textures you like but without convincing lighting it'll still just look like lego bricks. Following is an example of how I light my models. I've tried to keep it simple so that it can be used with any 3D renderer (provided that renderer can use shadow maps) and so that you don't have to be a rocket scientist or have fancy radiosity plugins to render a realistic looking rocket.
As this is a generic tutorial, I cannot give specific instructions so it may require you to read up on lights and shadow maps in your respective modelling/rendering packages before you can put it into practice.

First of all, forget ray-tracing. It's waaaaay too accurate. I use raytracing for mirror reflections and nothing else. It casts nice, razor sharp shadows, which I find unconvincing. Due to the diameter of the sun, shadows should have a very slightly blurred edge, becoming more diffused as the shadows moves further away from the subject.

To be fair, the following effect can be achieved with raytraced shadows but you'll need a heck of a lot of lights which slows down render times considerably. I prefer to use Shadow maps. You might need to use very high res maps for sun shadows which eats up memory and slows down render time but not much more - if any - slower than raytraced shadows and they give you more control over the sharpness of the shadow.

Okay, first up is an example of an object with just a main light and no shadows atall.



This is obviously completely unconvincing. There's no indication of where the sphere connects with the cube or where the cube connects with the floor. It could be floating in space.
So, we need to turn the shadow on. In this next image we can see the same light casting a ray-traced shadow. Note that it is a low pass so it is aliased, giving edges that stepped look. That can be fixed, but also notice how sharp the shadow edge is. That cannot be altered with Ray-Traced shadows.



In the next picture we can see the same light casting a fairly high res shadow map (1024). Notice how it's edges are blurred. Maybe a might too blurred. That also can be altered by raising the resolution of the shadow map to make it sharper or lowering the resolution to make it more blurred (for overcast shadows for example).



The main thing I want to draw your attention to in this image however is the fact that the shadows are completely, solid black. That's fairly realistic if you're rendering a space scene, but no use to man nor beast if you're doing a land-based scene or indeed if you want to show off your hard work in all it's finery.
Okay, you can turn up the ambient light, if it's not on allready. Well, I wouldn't because you get this:



The problem with ambient light is that it doesn't cast shadows. What that means is that all it does is lighten the existing shadows. In effect it makes objects glow. You need to shut off that ambient light. Shut it off and never cast eyes upon it again.

What I do is set up an array, a sphere in effect of dim lights all around the object like this:





Left is the front view and right is the top.
There is a ring above the object pointing towards it. There is a ring just above the horizon and pointing down and finally a ring under the object pointing up.
These lights are known as 'fill-lights' and would be set to around .3 of full intensity and they would cast very low res shadow maps (128). These maps would also be quite blurred. Most shadow maps have the ability to increase their filtering, which makes them more blurred. This has the effect of highlighting exposed surfaces and creating very soft shadows that gradually intensify as the geometry dissapears into a recess. This creates a much more realistic ambient light that gives intersections on objects a more visual connection. Note how it gets darker as the sphere meets the cube. Also the cube is darker around it's base where it meets the floor:

 
Okay, that's nice. How about we combine the array of lights with the main light:



The more lights you have, the subtler the effect. I used to make an array with just three or four lights. Now I usually use 24 as in the example. The same effect can be achieved using raytraced shadows but you need many many lights. In Maya I use an array of about 70 ray-traced lights - sadly Maya is a bit rubbish when it comes to shadows (oh Studio MAX how I miss thee).

You will need to mess with their brightness too. For space scenes I'd make it pretty dim. Just enough to pick out the shape of the craft. It's supposed to be starlight. Okay, in real life, it'd just be black. Starlight isn't strong enough, however this is hollywood-land and we're more interested in it looking cool.

Finally, we colour the lights. I often make the fill lights a dim blue/grey colour and the main light a bright white with a hint of yellow. The results are thus:




I lit this model using exactly this method:

port_ground.jpg
 
Perfect
Could you put that in a PDF or a single page somwhere so it can be saved?
It's this kind of info that helps us newbies graduate from making 3D fruit... ;)
 
Very nice. Reminds me of the Hunter, which was published in White Dwarf many years ago. Also a two-deck wedgie, but never got the proper external treatment.
 
I know the one. I adored that ship for years. Even though it was a wedgie, the deckplans were so beutifully done, I couldn't help but like it. Sadly, I once drew an elevation and the top deck (there were actually three) didn't fit in. There was something like 2 feet to stand in!!!!
=(

I loved that it had a huge air-raft bay with a turntable to turn the thing around so it could drive in and out forwards.
I loved that it had all the fixtures and fittings drawn in instead of symbols. I loved that he'd drawn fuel tanks instead of having cloured squares. I loved that it had the observation/navigation dome from Alien (unused in the movie). It was all round a thoroughly well concieved ship. Shame it was a wedgie =)

Crow
 
Back
Top