Recently I have been practicing lighting, specifically character lighting. First big question: How many ways should I light the character?
After a little research, I
decided to cover 7 ways that I thought were large enough a variety. In addition, 7 cases should be enough opportunity to develop
an understanding of what is important in lighting.
The more I
researched for reference, though, the more interesting lighting
schemes I came across. This gave me the one extra case to make a total of 8 schemes above.
Next big questions:
Should I vary the camera angle to maximize impact?
Should I employ compositing, again, to maximize impact?
Well, I am hoping to use these as material for a short course on lighting. The course goal is to give
students chance to experience lighting as much as possible. This means
the class is simply lighting, lighting, and lighting.
With this in mind, I decided to keep one camera angle so that comparisons between lighting schemes will be more objective. I also decided to forego compositing to keep the focus on lighting.
This does not mean that I am not planning to polish these :)
Currently I am trying out 3ds Max 2014. I have been using 3ds Max 2011 since 2010, so I thought it was time for me to make the switch. As expected, there are changes to get used to.
One such change is the Mental Ray visual diagnostics. (You can find this in Render Setup dialog > Processing tab.) I use it often to make sure that I have enough Final Gather points. To my surprise, the "Enable" check box is greyed out, unclickable.
Figure 1. "Enable" checkbox is unclickable
A quick search revealed that this is because the new default Sampling Mode "Unified/Raytraced" does not work with the diagnostics feature. (You can find this in Render Setup dialog > Renderer tab.) The work-around is by setting the Sampling Mode to "Classic/Raytraced". The visual diagnostics will work as previously.
Figure 2. Changing the Sampling Mode from "Unified/Raytraced" to "Classic/Raytraced"
Creating glowing particles is easy. However, the particles should cast light to the scene, as the video above shows. Creating the light pass is not so easy. This post will suggest two methods to create such light pass using 3ds Max.
Method 1: Using Final Gather
You may already be jumping on your seat, screaming "Use FG!" to your screen. Final Gather (FG) is a method to compute indirect, or bounced, lighting. In the case of our glowing particles, the glowing material will cast indirect light to the scene (only lights cast direct lighting in CG renders). This method resulted in the video below.
This method kind of works. However, it has these weaknesses:
The resulting light pass flickers. On the video above, this is especially clear on the ceiling.
The color of light cast is difficult to control. FG tends to produce pale (desaturated) colors.
Render time is rather long. The light pass for the video above took around 3 hours to render.
With all these weaknesses, we should be thinking of a better way to render the light pass.
Method 2: Scripting Particle Flow
This method uses direct lighting and therefore avoid all weaknesses associated with Final Gather. The question is how do we move lights according to particle movement?
We can do so using an operator for Particle Flow called Script Operator. Here is my Particle View setup:
To add our custom script, select the Script Operator and click the "Edit Script" button. A new dialog will appear. Replace the script with the following:
on ChannelsUsed pCont do ( pCont.usePosition = true )
on Init pCont do ( -- Keep the lights in an array. global LightArray = $ParticleLight* as array
-- Default position for the lights. global defaultPos = getNodeByName("Help_LightDefaultPos") )
on Proceed pCont do ( t = pCont.getTimeStart() as float if t >= 0 then ( -- Move particle lights. pcount = pCont.NumParticles() for i in 1 to pcount do ( pCont.particleIndex = i if i <= LightArray.count then ( LightArray[i].position = pCont.particlePosition ) )
-- Move extra lights to default position. if LightArray.count > pcount then ( for i in pcount+1 to LightArray.count do ( LightArray[i].position = defaultPos.position ) ) ) )
on Release pCont do (
)
This script assumes the following:
There are lights in the scene.
That is, the script does not create the lights.
You can create a lot of light using 3ds Max Array tool ("Tools" menu > "Array...").
The lights are named "ParticleLight*". For example, there should be "ParticleLight001", "ParticleLight002", and so on.
There is an object named "Help_LightDefaultPos" somewhere in the scene. A light will be aligned to this object if the light is not yet needed.
Here is what the script does. It starts by collecting all the lights into an array called "LightArray". Then, on each frame, it will move a light to each particle. If there are more lights than particles, the unused lights are aligned to the object called "Help_LightDefaultPos".
This method resulted in the video at the top of this post. You can download my Max file and study it.
It is common to get blurry bitmap texture in renders, especially if the geometry is almost perpendicular to the camera line of sight (i.e. at glancing angle). Here is a render for illustration. Observe how the lines between tiles are blurred.
While reading the book "Architectural Rendering with 3ds Max and V-Ray", I learned about the filtering option "Summed Area" for Bitmap map under "Bitmap Parameters" rollout. Here is where the option is in Material Editor:
By default, the filtering method is "Pyramidal." If you are wondering what image filtering is about, you can read the Wikipedia article on Mipmap. Basically a texture image needs to be filtered so that the rendered texture is anti-aliased.
Here is a comparison between the 2 methods.
Observe that the white lines between tiles are now crisp and nice.
... Too nice, in my opinion, that I wondered if there was a further story to this option.
According to Autodesk, both methods take approximately the same render time, but "Summed Area" method needs much more memory:
"Pyramidal" needs around 133% of the size of the bitmap;
"Summed Area" needs around 400% of the size of the bitmap.
This means that "Summed Area" method should be used sparingly. My own take at the moment is to use this for Diffuse maps of geometries, especially those at glancing angles to the camera such as ground, floor, et cetera. Perhaps Bump maps need "Summed Area" filtering depending on geometry and lighting. Specular maps should not need it.
Mental Ray used to not support "Summed Area" method, as was discussed in this CGTalk forum thread. However, I tested this and found that Mental Ray in 3ds Max 2011 supports "Summed Area" method.
The VFX class I am teaching is currently in the topic of Lighting, Rendering, & Compositing. One student, Suresh Kalai, suggested using a new car model for the class exercise. It is a Mazda RX-8 2004. Here is the starting render.
Initial render using materials that come with the model
I spent half a day fiddling with the new model (a messy business because all geometries are separate), working on the shaders, lighting, and rendering. Here is a work-in-progress render.
WIP render after half a day
As always, the 80/20 Rule happens. I spent the next 2 class days fiddling with the materials (while the students are working on their files) until I am happy with the final product above.
I needed "only" 2 years to finish rendering this roundtable. However, while working on this roundtable, I found that I did learn a few things since then:
I put the camera too close to the subject, causing big perspective distortion on the face.
The (relatively) bright background interfered with the lighting.
The Sub-Surface Scattering shader setting that I used was rather harsh.
I thought I made the roundtable better with respect to these factors. What do you think?
This is the final part of a material walkthrough for Batman Tumbler model. I explained the problem in Part 1 as well as offered a partial solution. Part 2 followed up with map manipulations to improve the render.
At the end of Part 2, I got this render.
Figure 1. Render at the end of Part 2.
It looks pretty good: the metal parts have reflection and dirt details at the front part can be seen. Now it is time to check renders of other frames.
The roundtable animation has 120 frames. At this stage, I do not want to render every frame yet. Instead, I rendered every 30 frame to get four different angles of the Tumbler.
Figure 2. The rendered four angles
Looking at the 2 back angles, I found the back wheels looked too "painted" due to the Diffuse map. To reduce the painted feel, I composited Noise maps on top of the Diffuse bitmap. As figure 3 shows, I used 2 Noise maps to break the regular look of the Noise maps.
Figure 3. Composite map to reduce the painted feel of wheel diffuse
For consistency, I made the same modification to the front wheel Diffuse map. Here are the final renders. (On hindsight, the front wheels look too new in these renders.)
Figure 4. Four angles of the final render
I turned on Final Gather to make the shadow areas brighter when rendering the final video. I made further minor parameter tweaks that made the final video look slightly different from the renders above.
Here are two points about Arch & Design that I learned from this test:
Setting Reflection Glossiness very low will result in dark or even black reflections.
Reflection Color should be close to white.
I hope you find this walkthrough useful.
Credit: The Tumbler model and textures were created by Henry Chan.