• Welcome to SC4 Devotion Forum Archives.

Night Lighting using 3DS Max Nightlibraries

Started by callagrafx, June 04, 2008, 04:36:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

callagrafx

THIS IS APPLICABLE TO 3DS MAX AND BAT4MAX ONLY.  DOES NOT WORK IN GMAX.

Stage 1 - Creating your window texture.
For the purposes of this tutorial I'll be making a stained glass window illuminate.  Create your window texture, in this case an image from google:



At the moment it is too light for a daytime view, so you can either reduce the bitmap's level in Max or darken it in Photoshop.  To darken the level in Max, change the number by the side of the diffuse map channel, then change the diffuse colour to black.  This is preferred as it reduces the number of bitmaps the scene uses.



IMPORTANT:  Name your texture something appropriate, but you MUST start the name with either "win" or "doo"... i.e. window_stained.  Apply this texture to your window object (name this window too, so you can keep track of them).

Do a test render.



Stage 2 - Making the night texture
Next, duplicate the texture in the material editor but do not apply it to the scene.  Change the diffuse level back to 100 and make the material 100% self illuminating.  Do not change the material name.



Add this copied material (not the first one) to the Material Library



To view this library, click on the Get Material button to bring up the Material/Map Browser:



Click on Material Library and you will see a list of textures in this library (in this instance, just the one).



Stage 3 - Testing
To do a test render, apply the night material to your object.  Then, in the Render > Environment palette, change the Global Lighting tint colour from white to the following RGB:

Game default values R: 128 G: 128 B: 191
Values for Gizmo's night mod R: 41 G: 41 B: 59

Render the scene and you should get something similar to this:



So far, so good.  However, the effect is not really true to life, as any light source creates a hotspot, so we need to simulate this.  To do this, open up the texture in Photoshop or equivalent and darken the edges of the bitmap, like this:



Save as a different name (i.e. stainedglass_night.jpg) and change the map in the night material.  Remember that any changes you do to this material, you need to re-add to the material library (it will overwrite).  Re-render to see the effect



Stage 4 - Saving the Material Library
Go back to the Material/Map browser to check that the texture has been updated.  Save this library using the file controls located bottom left.  This is important...the filename MUST include either -night or _night

Now that you have something approximating a lit window, time to reset ready for export.  Select the day texture and re-apply to the scene.  Change the tint colour back to white.

Stage 5 - Loading Library ready for export
Go back to the Material/Map Browser once again and open the material library you just saved.



On the BAT rollout, under the export box, it should now indicate that your nightlibrary has been loaded and will be used



Export your BAT as normal.  During the render process you will see the illuminated windows in both night render and mask render phases.

Here endeth the lesson.
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it