Sunday, September 7, 2008

3D crystal ball

First resest max. The choose the sphere Object Then take your cursor and make a nice sized sphere.



Now press "m" to bring up the material editor, and select a normal gray unmodified material and check the three boxed circled below



Now we have to make a nice reflection. To do this go to "maps" in your material editor, and open it up. Then check reflection, and click were it says "none" to chose he image that you want it to reflect. To get the right effect you are going to need something that is a shiny crome color. If your verrsion of max came with the materials that mine did than chose the crome material below





Now we need to give the ball a "see through" affect. To do this go to maps, and checkk "opasity" and were it says "none" clcik and chose "falloff"



Now scroll back up to were the material colors are now you are all done, when it is rendered you should get an image very close to the one below

Saturday, September 6, 2008

Texturing / Materials in 3DsMax

I ran into a scene where I wanted to render an ambient occlusion (AO) pass, but certain objects were using transparency maps as cutouts. So when I rendered the AO pass, those objects with transparency maps turned out solid...not the desired result.

Disclaimer: This is some-what of a half solution for AO with transparencies. AO works based on geometry proximity and does not take into account mapping. So this solution is an approximation. With that said, lets take a look at AO with transparencies.

I'm going to explain how you can render an AO pass while keeping the transparency of certain objects, just using the mental ray and A&D shaders. The example I'm using here is a tree textured with A&D materials.

The leaves on the tree are simply planes, but when rendered you see the leaves, because the planes have a alpha-map of the leaves in the cutout slot of the A&D material.

When you render an AO pass (click here to go to my AO in mental ray posting), the transparency on the leaves go away and the occlusion shows the planes. Of course this is not what we're wanting.

So to render an AO pass with transparency, there are regular objects and there are the objects that we want with transparency. So we will need 2 AO shaders. The first is my regular AO shader, and the second is one with transparency. There is a trick to creating the AO shader with transparency. I create a mental ray material, and in the first slot I insert a mix map. In color #1 I insert a "material to shader". That shader is an A&D material, where I turned up the refraction to 1.0, the IOR to 1.0. For color #2, I use my regular AO shader, and for the mix amount, I use the leaves transparency map to mix the AO with the 100% transparent A&D shader.

When I render my AO pass the easiest way to do this is plugging in the AO material into the material override in the Processes tab of the Rendering Settings. But it's not enough to insert the AO material with the transparency into the material override, because we also have regular objects that shouldn't render with the leaves transparency. To overcome this problem I create "Sub-Object" material shader, with ID 1 being the regular AO shader and ID 2 being the AO shader with transparency. I plug the Sub-Object material into the material override.

Then I select all of the objects in my scene (in this case it's the tree trunk), and apply a material modifier to assign the material ID to 1. Then I select my leaves in the scene and also apply a material modifier, and set the ID to 2.

Presto, the scene is ready for an AO pass with transparencies!

If you have several different transparency maps in one scene, you will have several AO shaders for each transparency, and put them all into the Sub-Object material, then you will need to apply the material modifier with the correct ID to each object for it's respective transparency maps.

Max 2009 Lighting Analysis

If you haven't played with Max 2009 and it's new lighting analysis tool, it's definitely worth checking out. For this blog I will briefly explain how to use it.

Max 2009 Lighting Analysis
Before I jump into lighting analysis, I have a disclaimer for lighting studies/software. When it comes to lighting analysis, the results are just estimates on how much lighting a space is receiving. There are too many physical factors to be accurate. Materials have to act exactly as they do in reality to bounce light properly. This includes physical characteristics as index of refraction/reflection, caustics etc. Max does a pretty darn good job at simulating these though, so good infact that it is recognized by LEED as program for obtaining lighting analysis credits.

With that said, here is a quick look at how we set a scene up. Firstly, be sure the space you are modeling, is as accurate as possible. The windows need to be the right size, and there cannot be any openings in the space other than the windows. Secondly be sure that the materials you are using are either all ProMaterials or A&D materials, and they act as the material would in real life (tile being reflective, gyp being non-reflective, etc). One of the most important materials is the glass, because it will determine how and how much light will enter the space. The way the glass is modeled is important as well. If the glass is a single plane, in your glass A&D material be sure to specify under the "Advanced Rendering Options" that it "Thin-walled". If your glass has a thickness or it is a box, just leave the setting on "Solid". Thirdly, the lighting must be accurate and represent true-life physical amounts. Creating a Daylight system is the best way to achieve physical properties for your sun, just don't mess with the multiplier amounts. If you also want to include light fixtures the best type of light for this are photometric lights.
Once you have your scene set up, in the menu under"Lighting Analysis" use the "Lighting Analysis Assistant." Basically this box checks your scene to make sure that you don't have any un-natural materials or lights. If you do, it will tell you how many materials and lights need to be tweaked. The "Analysis Output" tab is where you can create a light meter. The Light Meter is just a plane that record light data in the scene and spits out numbers of light intensities (measured in foot candles fc or lux). In the US everyting is measured in foot candles, so I use fc. The modifier settings for the light meter controls the amount of segments, orientation arrows, type of illuminance, and it can export the numbers to an excel csv file.

For the lighting analysis, you will only get figures for where the planes are. So if you need all four walls of room, you will need 4 light meters, one for each wall. Note: the lighting analysis is no gauge on how the scene will render. Much like a camera, you can make a very dark room appear light with the right exposure settings. The exposure settings also don't have any effect on the lighting analysis since these numbers are fixed amounts of energy.

Sketch-Up to 3DS Max does work!

I constantly hear people say, “Sketch-Up to 3DS Max doesn’t work.” This statement just isn’t true. In fact, this is the process our company uses for 3D modeling and rendering, and it’s a very efficient, clean process on a number of levels. If you want to see some rendering that were modeled in Sketch-Up, check out my renderings on cgsociety. They were all modeled in Sketch-Up. I will go through the nuances of how to do this, and hopefully I can convert some of you to sketch-up modeling. Before I begin, here are some reasons the sketch-up to max process is effective:

• Modeling in Sketch-Up is darn fast. I don’t care how fast of a 3D Max modeler you are, anyone who knows sketch-up well will beat you every time!

• Sketch-Up keeps the mesh very clean. You can push and pull walls all day long, and your mesh is exactly what you see. The geometry is super light.

• Materials transfer from Sketch-Up to Max. There’s no need to reapply materials after importing your geometry. There are great tools (paint bucket + shift / ctrl / alt) for coloring geometry that saves plenty of time and is much faster than changing ID’s or shaders.

I could go on, but look into Sketch-Up. Before you purchase the Pro version, you can download the free version and try it out. The free version has everything the Pro version has, except for the export options (which you will need if you decide you like this method).

Alright enough of the sales pitch, let’s jump into the process. It really all starts with sketch-up and understanding how the materials work. When you create geometry in Sketch-Up, it has a default material. You will notice that the default material is white on one side and purple on the other side. This material is showing the direction of the normals, so white should be the front and purple should be the back. This is very important. When you import your model into max, only the white sides will render. So as you model be sure the faces are white.

To get your faces in the right direction, select the face, then right click and select reverse face. If you have the default material on the geometry, you will notice the purple will change to white and vise versa.

Now that your model is done, let’s take a look at materials. Because our faces are all in the right direction we won’t worry about coloring purple faces (face in the wrong direction). Coloring is as simple as clicking on your faces. When you name a material, be sure it describes the type of material and not what color it is…we can see that it’s red! Also keep the names short. Max will truncate the names, so be sure you can tell what it is with just a few letters. Here are some useful Sketch-Up coloring tips/shortcuts:

Paint bucket + CTRL (colors all of the faces with the same current material touching each other)
Paint bucket + SHFT (colors all of the faces with the current material in that current group with the new material)

After coloring your model, you can always go back to view the normals by changing the face style of the model. This is helpful when a Sketch-Up model is already textured, but you want to flip the faces. Note, you will have to re-apply the material to the newly flipped face.


Now that our scene is modeled and colored let’s talk about exporting. With Sketch-Up Pro, you can export as various formats (3ds, dwg, vrml, obj, etc). I typically export as .3ds format. Before you hit export, let’s look at the options button. Every export format will have different options, but I will only discuss the options for the .3ds format. You can change Export to 4 different types: Full hierarchy, By layer, By material, Single object. The only two that I recommend using are “By material”, and “Single object.” And of those two, I prefer “Single object”.

If you export with “By material” sketch-up will break your model into different meshes according to their material. So you may have one object in Sketch-Up, but when you import the .3ds into Max, there will be a mesh for every material. This doesn’t just make a mesh for each material, but it creates a mesh for each material being surrounded by another material, so even though you only have one brick material, for example, you may have several meshes with that same material. The advantage of this method is that you have one shader for each material. So it keeps your materials simple. The disadvantage is that it may take longer to export to .3ds, and in Max your viewport may be a little sluggish if your scene is large and complex.


If you export with “Single object” Sketch-Up will export your entire scene as one mesh, and with that one mesh it will create a multi / sub-object material with a shader for each material from Sketch-Up. Because there is a limitation in the .3ds format that meshes can only have 65,536 vertices and faces, if this limit is exceeded, more than one mesh will be created with the emphasis on keeping the number of meshes to the minimum amount necessary. Here’s where this one gets a little complex though. Because every mesh has its own sub/object material, you may have some sub shaders that have the same material. A good trick is to clean these up by making them instances of each other, before you start tweeking them. The advantage of this method is that the scene no matter how much geometry there is, is incredibly fast and efficient. This, as I already said, is the method that I prefer. The disadvantage is that it does take some time to go through the mulit / sub-object materials to make sure that there is only one copy of each material, and the rest are all instances. These are the only export functions I will cover now, but the image on the left are the settings that I usually use.

Now let’s talk briefly on importing the .3ds file into Max. Use File-> Import. It will first ask you if you want to Merge with the current scene, or replace the current scene. I always merge with the current scene. I also always uncheck Convert units (I do all of my Sketch-Up modeling in feet and inches). This will keep the real-world scale. It will also ask you if you want to change the animation length. I always say no. Now your Sketch-Up model should be nice and tidy in Max. I think it’s important to state this even though to many max users this may be obvious: Just because your material editor is empty does not mean there aren’t any materials in your scene. There is no correlation. The material editor is just a holding place to tweek your materials. If you open the material map browser, this window will show you what you have in your scene, and you can add that to the material editor. You will notice on the image on the left that there is one multi / sub-object shader, that contains the 4 materials that we created in Sketch-Up. So there is no need to apply the materials…they’re already applied! I usually use Arch&Design materials, and I always add a UVW map modifier to my meshes. I use Real-World Map Size, and adjust the scale of my maps in the shaders accordingly.


That’s it! I know this was very exhaustive, and sounds complex, but the process is truly quick and simple once the understanding sinks in. I hope that now you all know that you can model in Sketch-Up and imported beautifully into Max. Stick