Friday, April 24, 2015

WIP: Rock Pedestal


I am working on a rock pedestal for a game character model. The image above is the final version of the sculpt.

You may ask why I am modelling when I am a VFX artist. I like modelling. I studied at CG Protege as a modelling student. Later I was offered a position in the VFX department of Tiny Island Productions, and I regarded modelling as a hobby. Now, I feel it is time for me to revisit modelling.

Two incidents made me want to revisit modelling. The first incident was during Dominic Qwek's Creature Design and Development Masterclass. Watching Dominic sculpting a creature made me want to work with ZBrush again.

The other incident was during David Kwok's IP Development course. I signed in for the class because I want to know how I can develop my own IP. Back then I thought my IP will be an animation short that I will do sometime in the far future, perhaps. The class made me rethink the concept of IP. It made me realize that whatever I am working on can be an IP (depending on what I do with it). The most important thing is to start (and finish) a project. So I decided it was time for me to start modelling projects.

Back to the rock pedestal, here are images to show my sculpting progress. I started with a box, shaping it using Move brush. This resulted in stretched polygons, as the right image below shows.

I used Remesher to get a uniform topology; then continued shaping the rocks using Clay Buildup, Move, Flatten, and Polish brushes.

At this point, I used Remesher one more time because some polygons are visibly stretched as I somewhat forcefully added details to the model.
When finalizing the details, I started using the Pinch brush to get sharp edges. I kept reminding myself to maintain the balance between sharp edges and smooth surface; but I may have gone overboard with it.

Version 3 is almost identical to the final version. I simply spent two more days adding details before decided that the sculpt is final.

What is next? The next step, which is what I am working on right now, is retopology, creating a lower resolution model. Here is a screenshot of what I have currently.


While retopology is progressing, I can work on projecting the base texture onto the high resolution sculpt. Texture projection comes after that. Finally, combining the rock pedestal with the character model is the finishing step.

Feel free to hit the comment button and tell me what you think.

Thursday, April 9, 2015

Fixing Normal Map Seams

Baking normal maps for low-poly models may result in annoying seam lines, as shown in the image below.
Notice the seam lines: along the right arm, across the left shoulder, along the middle of the head.

These lines happen along the edges where I broke the UV. I thought this meant that the cause was related to the UV. The cause turns out to be gamma correction problem: the normal map should be read with gamma 1 instead of the default 2.2.
Reading the normal map with gamma 1.0.
And here is the fixed render.
Seam lines fixed.
Credit: I got this tip from this thread at CG Society forum: http://forums.cgsociety.org/showthread.php?t=1187474

There are many possible causes for a normal map problem. This is just one of them. If you have problems with your normal map, feel free to ask me either by commenting to this post or by sending me an email :)

Thursday, March 26, 2015

Different Ways to Light a Bedroom

Ending this series on lighting is interior lighting. Compared to a character and an exterior set, I found interior set the most difficult to light. Here is why.

Interiors are enclosed space usually lit naturally by sunlight. This means the only light sources are openings such as the windows on the images above. The big question is how do we bounce light from the windows to all other parts of the room? (This bounce light question can be answered easily in the two other cases. For characters, we simply add more fill lights. For exterior set, the need for bounce light is minimized by lighting from the sky.) There are two answers that I know of.

The first is using Final Gather to bounce the light. This is, after all, what Final Gather was designed to achieve. The first image was rendered using this method.
The main disadvantage of this method is render time. The Final Gathering step took 2+ hours (I needed 3 diffuse bounces to reach the floor area under the bed); the rendering time took 5 hours. The reason for 5-hour render time is noise elimination. This method uses no fill light at all, requiring high sampling quality to eliminate shadow noise.
Another disadvantage is artistic control. Controlling image contrast with lighting alone is impossible; post-render color correction is needed.

The other alternative is using an ambient light. You can read about this method as explained by Zap Anderson on his blog. The ambient light is an omni light with Ambient Occlusion projection map.
This method renders much faster. The ambient light helps to (1) eliminate the need for Final Gather diffuse bounce (I used Final Gather with 0 diffuse bounce) as well as (2) minimize the visibility of shadow noise from the key lights (the window lights).
Finally, this method allows more artistic control. By setting different intensity for key light and ambient light, I could control image contrast even at rendering stage.

Friday, March 20, 2015

Different Ways to Light a Town Center

After character lighting, I continued with exterior set lighting. Getting a basic lighting for a set is not difficult. The difficulties mainly come from working with a large file and fixing mistakes in the model; not from lighting itself.

Creating a good-looking mood lighting, though, takes more effort. The first difficulty is designing interesting lighting schemes. I researched for ideas at Pinterest. There are many boards there to get lighting schemes from, such as 2D3D_env board and Digital Environments board.

Next step is implementing the lighting schemes I picked, which are 2D paintings, in a 3D scene. Using 3ds Max Daylight System with mental ray Sun & mental ray Sky helps a lot. I spent most of my time placing the Sun. After that, I only needed to make minor adjustments. One interesting step is perhaps about getting cloud shadow. I experimented placing a floating box near the Sun and was pleasantly surprised that mental ray Sun creates a soft shadow as expected. I used this trick for the "Morning" image. If you know another trick, please share it in the comments.

I did color corrections in Photoshop. Color Balance adjustment layers are effective to get colors close to those in the lighting schemes. I also cheated lighting quite a bit. For example, in the "Morning" image, I used an extra rim lighting on the foreground tree to get more details. In the "Sunrise" image, I brightened the bright line along the road, which made the lit wall on the left extremely bright. I hand-painted a layer mask so that only the road was brightened.

As always, feel free to tell me what you think in the comments.

Thursday, March 12, 2015

Different Ways to Light a Character


Different ways to light Bruce Willis
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 :)

Tuesday, March 3, 2015

3ds Max 2014 Visual Diagnostics Work Around

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"

Here is an article at Autodesk's AREA blog that explains this work-around: http://area.autodesk.com/blogs/maxstation/b001-mental-ray-diagnosis.

Edited on 5 March 2015.

Friday, February 27, 2015

Scripting Particle Flow - Making Particles Cast Light



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.

Further Reading

This post only touches the smallest tip of particle scripting. To learn particle scripting further, have a look at Bobo's tutorials on Particle Flow scripting.