Technical

Maya Ascii

I posted about this topic earlier, but I felt a real world example would be beneficial to everyone. In an earlier post, I had said that if you saved an .ma and your project crashed or you couldn’t open it for some reason, you could go through that file in a text editor and find the problem. I just lived through this hellish problem. I had been working on my shoe and saving and iterating as normal and then I tried to merge vertex and it fatal errored. When I tried opening the last file I had saved, I found out that it had been corrupted and could not open. Since it was an .mb I was out of luck and my last iteration saved was 2 hours prior, which really isn’t too bad. Fortunately Maya successfully saved an .ma in temp when it crashed.

This .ma was almost 400 megs and it was too big to open for notepad, but astonishingly wordpad was able to open it (doh!). This file was over 500,000 lines long, so long that wordpad had to open it in sections and ended up taking about 20 minutes to fully open. Generally an .ma is structured in this way:

Basic File Info (name, date etc…)

Camera nodes and tranformations

Other node information (creation, transformation)

Lights

Layers

Histories of objects

Animation Histories

ConnectAttrb of lights/shaders/materials

Now granted this information could be off and should taken with a grain of salt, but GENERALLY this is the order.

Since I knew what killed it (MergeVertex), and where it was located, I scrolled down near to the bottom and searched for “MergeVertex”. I found it and deleted it then saved but it still didn’t open. So I figured it had to be linked to its history so I deleted the entire history of the object and all of its connections (basically the entire last bit of the .ma). Be very careful when you do this and make sure the structure stays in tact and semi colons and such remain in the right places.

After this I was then able to open it up. Everything was in Chaos-all my display layers were deleted, things were misnamed-utter chaos and of course no materials existed on the objects. But this was fine, since I had prior working scenes and I just needed to export and import the object that I had been in the middle of working on when Maya died.

So in Conclusion, make sure you save an .ma at least once per work session and if you do need to root through one, especially if it was as big and scary as mine, do it smartly. Know what you are looking for and where it is located. If you are not sure what caused it, it usually is one of the last things you tried to do.

Also, a lot of times fatal errors can be caused by conflicting preferences so move your preferences and try and opening the file first and see if it does it, if not move your preferences back and start rooting away!

Sunday, May 16th, 2010 3D, Maya and Mental Ray, Technical 2 Comments

Ambient Occlusion

Throughout the years I have always been told to render an AO pas and multiply it over the beauty and fuss with it to make it “correct.” This method has always looked incorrect to me and always makes things look dirty. But I was always the student (and will always be in a sense) so I never thought to challenge it, and thought I was wrong. Well ladies and gentlemen, I am about to link you to a post on Master Zap’s blog that will rock your world and will change how you do an AO pass (hopefully).

Here is the image:

and here is the article

http://mentalraytips.blogspot.com/2008/11/joy-of-little-ambience.html

Tuesday, April 13th, 2010 3D, Maya and Mental Ray, Technical No Comments

Illuminance Continued

*Generalizing Alert*

my notes continued.

So say you have a point on a surface and you want to find out how much illuminance it is getting. What we do, is look at the light source and see how big of an angle it covers. We take that angle, multiply it by the amount of luminance the light has and you get the illuminance value at that point. If the light source is bigger, it covers a larger angle. If the same light is farther away, it covers a smaller angle which means the illuminance of that point is lower. Distance is irrelevant actually. All that matters is the size of that angle. A large light from a far distance and a small light at a near distance that covers the same angle and same luminance value will give the same illuminance.

You have heard the term “light falls of quadratically” or at least seen the option for the light in Maya (distance^2). This is actually a fairly inaccurate representation of the above subject. It is only accurate for distant lights. Example. You have a plane of light that has a length of X meters at a distance of Y from object P covering an angle of Z.  If you were to half the distance between the light source and the object, the angle of course gets bigger, and at far distances it’s really close to doubling the size of that angle Z. However, since the light source can never reach point P, that means the angle can never grow past 180 degrees. This means that for each time you half the distance, the degree that the angle changes will grow farther away from doubling and closer to staying the same.

Example. Walk up to a large light source such as a window or tv. Look at your hand as well as how bright the tv/window is and notice how bright it is. It has a specific luminance. Take two steps back and look at your hand, your hand will appear darker, but tv/window look to have exactly the same luminance.  This is because when you were closer, the light source covered a larger angle compared to your hand and when you stood back, it covered a smaller angle which means it will illuminate your hand less.

There are many ways to imitate this in CG. For MR, you have your final gather, photometric lights, and of course the beautiful and amazing Portal Light.

There is a big problem with traditional cg lights because they are point lights. Points cannot cover an angle to a point on a surface because it has no area which means it cannot emit any illuminance. This means the objects in a scene does not know what luminance the light has so it is faked. It also has an unclear mythical 0-1 value of color which is of course unrealistic (value of light is from 0-whatever). Lights also have strange falloffs (none, linear, or tries to do a distance^2 blindly). They are also rarely ever visible in a scene like they are in real life. When they are visible, their intensity is computed incorrectly. Even old MR. lights are buggy and hacks.

The reflections of the light source is generated by a fuzzy blob. This is a big problem because our eye uses highlights to judge an object and figure out most of it’s features. If we make it visible so it can be seen in reflections we run into major sampling issues.

Tuesday, April 13th, 2010 3D, Maya and Mental Ray, Technical No Comments

Let’s get technical with light and pixels

This post is going to be quite dry and lacking of pictures, I hope you will forgive me because this stuff is actually quite interesting. I have learned all of this through mindless perusing of sites, and blogs. Below is basically a summation of some of the teachings of Master Zap. And of course everything is generalized

When you talk about lights and units, you can break them (generally) into two categories. Radiometry and Photometry. Radiometry is what you measure. It is actual radiation and its base unit is the Watt. Photometry is what you see, it is the perceived brightness, and its base unit is the lumen. The relationship of these two is based on the relationship on the sensitivity of the human eyes. This is called the “Photopic Response Curve” For any spectra of light, it can be expressed as a number called “luminous efficacy” (lm/W)

As you can see from the graph, we see green the most–>exactly 555 nm of wavelength. So it will have a very high luminous value. Whereas over in the far left area of the violet where there is exactly the same amount of watts we will have a 0 photometric value to us.

Computer graphics is technically radiometric units, photometric units can be more useful.
.                                         photometric                                    radiometric
Luminous power =       lm                                                          (W)
Luminous Intensity = lm/sr = cd                                         (W/sr) cd=candela
Luminance =                  lm/sr/m^2 =cd/m^2                  (W/sr/m^2)
Illuminance =                lm/m^2                                             (W/m^2)

sr = steradian
radian=2d angle where the arc length of a circle is equal to the radius
circle =2pi radians

steradian
3d angle where the area on a sphere is equal to the square of the radius
A sphere covers 4pi steradians

luminous power = the amount of light leaving the entire light in every direction at once.

luminous intensity = the amount of light leaving the entire light in a particular direction.

luminance = the amount of light leaving a particular point on a light and goes in a particular point. Our everyday perception of brightness is luminance.

illuminance = the amount of light arriving at a particular point on a surface, but coming from every direction. A sum of all the luminances in all directions seen from a point.

Now you can begin to see how this is all related to the CG world and rendering. But what about pixels?

PIXELS:

A camera is a luminance measuring device.

Pixels can be many different things. They can be the actual brightness of something. R,G,B are proportional to spectral radiances. Weighted value is proportional to luminance. The range of this is 0 – whatever. You can have as much as you want. We cram these into low dynamic ranges and call it black to white. That is just the limit of the file type, not of reality. It can be how much something reflects (0-1 range) such as texture images.

Most computer graphics displays have a display of 8 bits of red, green, and blue. 0 is black, 255 is white and 127 LOOKS like middle gray, but even though 127 is half of 255, it is not half the brightness. The human eye is a funny thing. We perceive light in a non-linear way.

This is a perceptually linear ramp:

This is a linear ramp:

If you measure the values of luminance, you will see that the perceptually linear ramp is not right. If you really made the same change for each step, you would see a curve like the bottom image. We perceive huge jumps in the dark area and small jumps in the light area.
If we try and encode an image using the linear values it will look horrible, whereas if we encoded it using the perceptually linear values, it will look correct. This is exactly what the computer monitor does. The pixel response of the monitor is not linear. 127 is not half as bright as 254. This, of course, is called gamma. A computer’s gamma is typically 2.2.

All this means that your 8 bit images have gamma encoded into them so they will display correctly on your monitor.

When you work in an 8 bit format your gradients between colors become muddled and ugly.

All this creates disastrous results when rendering. This is why, when working realistically, you need to work in a linear method. There are tons of “how to’s” out there, I have even provided links in a previous post on this blog.

If you work nonlinearly lots of bad things happen. You get unrealistic fall offs, you get blown out effects when using physical lights, you also get artifacts around highlights. There is a weak propagation of Indirect Light, and you get unrealistically strong reflections. There is also a huge problem with motion blur, it looks dark and smudgy and highlights will not streak properly.

Monday, April 12th, 2010 3D, Maya and Mental Ray, Technical No Comments

Demo Reel!

Oh, finally! I have finished my demo reel. Such a relief. You can check it out here:  (http://www.jdbeals.com/home.html) Hope you all like!

Friday, June 12th, 2009 3D, Maya and Mental Ray, Technical No Comments