February 28, 2009

Creating a Foggy Scene in 3D Studio MAX using "Fog" and "Volume Fog"

By Stealth Snake | 3D Studio Max | Intermediate


This tutorial will teach you how to create a foggy scene in 3D Studio Max. I applied this effect to the ending result of my previous tutorial about Texturing (Using UVW and Unwrap UVW). We will create our scene using two atmospheric filters: "Fog" and "Volume Fog". It is possible to create a foggy scene using one of these alone, you shall be able to experiment with these on your own once you are done with this tutorial. We are using this model (MAX File) in our tutorial, please download it to follow this tutorial.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/small_00.jpghttp://www.republicofcode.com/tutorials/3ds/fog_stealth/small_finalrender.jpg
Before and After - Click to enlarge.

It is necessary to explain the difference between our two effects. Fog is the more generic effect which applies to the whole scene in a constant level, you have a relatively less amount of control over this effect. On the other hand, "Volume Fog" generates an inconsistent flow of clouds through out the given 3D space. "Volume Fog" requires a container to which we apply it to, this sort of container is called Gizmo.

Adding the "Fog" atmospheric effect

Applying the standard "Fog" effect is straightforward using the Environment and Effects window. Open up this window by hitting 8 on your keyboard. Scroll down to the Atmosphere rollout from where you can click on Add to find the required effect.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/01.jpg

You can simply apply the effect using the preset configurations, however, I did make some changes to the parameters as could be seen in the image below, you can use these instead of the presets and then experiment with these on your own to get your personally desired result.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/fog.jpg

You may render your scene at this point to acquire a scene similar to the one below.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/small_03.jpg
Scene rendered with "fog" effects only. Click to enlarge.

Adding the "Volume Fog" effect

Unlike the Fog effect, Volume Fog generates a less synthetic looking environment by having an inconstant density volume of fog. Adding "Volume Fog" requires having a container, or as 3DS calls it, "Gizmo". To create a Gizmo go to Create>Helps>Atmospherics>Box Gizmo. You will then have to draw your Gizmo in the place where you want to have your Volume Fog, we want to have it all around the house in our tutorial. Enlarge the image below to see how I did it.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/small_04.jpg
"Gizmo Box" placed it around the house. Click to enlarge.

We will now fill our container with our Volume Fog, access the Environment and Effects window, you can press 8 on your keyboard to open it if you closed it. Scroll down to the Atmosphere rollout and click on Add, select Volume Fog from there. Now, this will have to be assigned to our Gizmo. Look for the Volume Fog parameters rollout, click on the Pick Gizmo button that you'll find there and simply select the Gizmo from the scene.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/small_05.jpg
Assign "Volume Fog" to "Gizmo Box". Click to enlarge.

The Volume Fog default parameters are not too bad, you may want to play around with them though to have it look in your own way, you can use the same values that I used as seen in the image below.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/volue_fog.jpg

This should do the trick, but before you render your scene I suggest that you deactivate the previous effect so that you can clearly see how different it is from the normal Fog effect. You can deactivate the first effect by accessing the Environment and Effects window once again, and this time simply unchecking the Active checkbox to hide your effect. Hide the first effect that we created, Fog. Render your scene afterwards.

http://www.republicofcode.com/tutorials/3ds/fog_stealth/06.jpg

Once you are happy with setting of the both fogs setting, hit render and see you awesome fog effect on your scene. But make sure you activate them first.

This concludes our tutorial, you can activate both effects and render the scene once more. You should play around with the parameters to see what values work best for your work. I hope that you learnt something new by reading this tutorial. If you need any more help feel free to drop at Oman3D Forum.
http://www.republicofcode.com/tutorials/3ds/fog_stealth/small_finalrender.jpg
End result. Click to enlarge.

-End of Tutorial

February 26, 2009

How to Create Grass in 3ds Max

After having posted the tutorial on how to create a night rendering I’ve been asked a several times through both comments and emails, how I did the grass in that rendering. Therefore, I’ve decided to do a little tutorial about creating grass as well.

1) Create a plane, or a surface that will lately become the grass.
2) Apply whatever tilebale texture on the diffuse chanel.
3) Apply a planar UVW modifier to the plane or surface you have just created.
4) Apply a vray displacement modifier above the uvw in the modifier stack.
-under “paramenters” check “2d mapping”
-under “common params” select a displacement map for your grass.
This is actually the most important factor; if your displacement map is not good, you will never get the grass to look right, regardless of the texture that you have used for the diffuse slot.
I have actually obtain good results only by using a procedural “smoke” map with various shades of green, without actually using a texture. If you don’t have a good displacement map, you can use mine.

Download grass displacement texture.

-next to “amount”, type in how much you want the grass to be displaced. For this scene (since I’ve chose meters as units),I have typed 0.18
-under “2d mapping”, “resolution” type 1024 (if you leave it at 512 it will look more like boulders than grass).

http://www.cgdigest.com/material-settings/grass-tutorial/displacementsettings.jpg
5)If necessary you can adjust the tiling of the vray displacement map. You can do that by dragging the texture to an emty slot in the material editor and select “instance” when the question will pop.

That’s it! As simple as that.

I always look forward to hearing your suggestions reagarding what tutorials should I write, so if you have any ideas feel free to contact me either by commenting here, or by email (cgdigest(at)gmail.com).

Night Interior Rendering Tutorial (using V-Ray and 3D Max)

Night Interior Rendering Tutorial (using vray and 3d max)

This is a follow-up of the Night Exterior Rendering Tutorial that I have written a while ago, so if you haven’t checked that one already, I advice you to read it before this one.

Background image
1) For the first step of this tutorial you need to choose a photo for the background. Try to find a picture that is rich in colors, with shades of blue for the sky instead of black.
2) Create a plane and place it at the exterior, perpendicular to the camera, like in the picture bellow.

http://www.cgdigest.com/illumination-tutorials/interiornightrendering/1plan.jpg
3) Apply a vray light material, and map the photo to it.
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/2plan.jpg
You may ask why you need to map the image on a plane and not simply drop it in the environment slot.; the answer is simple… if you do that, all the reflective materials in the scene will look transparent, unless you use a spherical environment, and not a planar one.

General Vray Settings
Before starting to place lights in the scene, I usually make general rendering settings.
1) Check “on” in the vray global illumination rollout
2) Chose irradiance map with low preset for the primary bounce (you will keep this only for test rendering; this should be changed to “high” before hitting the high resolution rendering) and lightcache for the secondary bounce.
3) Chose “Reinhard” in the v-ray color mapping rollout, with the multiplier to 1.5 and burn value to 0.8

Natural light
The key to obtaining a realistic architectural rendering of an interior at night is the color variation in the light. Many would be tempted to say that an interior scene at night time doesn’t receive any natural illumination; that couldn’t be more false. Natural light that comes through the window, although it has a lot less intensity than at day time, it is considerably more saturated (in shades of blue).

In order to mimic that effect, the first thing to do is to check the “GI environment (skylight) override”, leave the multiplier to “1” and chose a dark blue for color.
If you do a test rendering at this point, you should obtain a result similar to the one bellow.
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/stage1.jpg

As you can see, that is by far not enough. If we increase the GI multiplier we will end up with areas that receive too much illumination for a night rendering. What we need to do in this case is to place a light that will affect ONLY the ambient, without affecting the diffuse or the specular.
We can achieve this by placing an omni light just outside the windows, with inverse square as decay type, and “ambient only” ticked in the “Advanced Effects” rollout.
Use the scale (and non-uniform scale) tool until the gizmo spreads to about ½ of the room, like in the screen capture bellow
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/omnigizmo.jpg

For the intensity multiplier, you can choose a value around 0.35, depending on the scene. Regarding the color of the light, choose a hue that is predominant in the color of the sky of your background image, so that it will blend well with the rendering.
After doing these steps, I ended up with the following image:
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/stage2.jpg

Artificial Lights
At this point we have enough natural light in the scene, so it’s time to go to the next step. In this interior I will use 3 types of artificial lights: spotlights – that will give a sharp shadow, indirect light (where the wall meets the ceiling) and a smooth light coming from the large pendant in the ceiling.

1) For the spotlights I almost always use photometric lights, so this will be no exception. I started with a “recessed 75 W wall wash” template that comes with 3ds max kit, but you can use any IES file you like and tweak the parameters until you like what you see. In this particular case I have changed the color temperature to 4950 K in the “Intensity/Color Attenuation” rollout and obtained the following result:
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/stage3.jpg

2) In the next step, we will add light to the pendant in the ceiling. Since in real life this type of lighting fixture casts a subtle area shadow, the most suitable for the job is a planar vray light. For this interior, a multiplier of 4 and a pale orange hue for color where all what I needed.
I got a bit lazy and did not model this lighting fixture entirely, and I just assigned a vray light material to the part that is emitting light; if I wanted to do everything from a to z I should have modeled the inside of a lamp and use a translucent plastic material for that part in order to obtain a more realistic result (like in the
vray lampshade tutorial I have written sometime ago)
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/stage4.jpg

3) For the indirect lighting above the wall just model a thin box, assign a vray light material to it and place it above the geometry at the top of the wall. While you are doing this, you may want to “turn on” the monitors by assigning a vray light materials to the screens with a “desktop” map, like in the image bellow:
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/stage5.jpg

4) We are almost done and ready for the final touches! If you analyze the rendering carefully, you will notice that it still looks a bit cold, and lacks the “yellow/orange” that is specific to artificial lighting. We can correct that by creating another omni light, similar to the one placed just outside the windows that you have created at the beginning of the tutorial, only this time you need to use an orange tint instead of the blue one.

Here is the final result:
http://www.cgdigest.com/illumination-tutorials/interiornightrendering/final1.jpg