Tuesday, 29 March 2011

Transcription - Ghosts

For my project I needed a ghost. So I created one.

It consists of a piece of cloth with some eye holes cut out, over the top of a pillow!
Pretty scary huh?

Well maybe not, but it was a good excuse to do a cloth sim!

So in two ghost Train scenes I needed the pillow to be covered with a sheet that would be pulled away by the bear. (Still haven't thought of a name yet)

This is what I have come up with.
I created a flat plane, and nClothed it. After letting it drape over the pillow, I then set the deformed mesh to be the default position. I then created a constraint that is animated to pull the cloth off the pillow. From here I did a few tests.

The first test I did (after some tweaking of settings) I got pretty good results, but wanted the sheet to be pulled off quicker.


I moved the ground plane further back so it didn't fall out of the scene and made the constraint pull quicker. Sadly though, a little to quick and due to the plane being CG smooth the cloth slid right off anyway!



One final test and I got something that I was totally happy with!



If anyone is wondering how animation is going, it's going fine. Some scenes are better than others. So far I have three favourites. The rest have far more room for improvement, and depending on what time I have left, depends on how well they look in the end.

Here are a few screen shots, from some of the scenes. (not necessarily final render)


Notice the fur looks a bit different after the splash. I animated some of the fur attributes.



A Flock of Pixels

Friday, 25 March 2011

Maya Tasks Week 23 - Dynamics and Mental Ray

Here are the latest Maya tutorials. They will be the last for a little while. You will be seeing some Transcription project stuff soon.


Dynamics

This weeks dynamic tutorials further expanded upon particle instances.

The first example are instanced Gold Fish. The new thing we've learnt is how to apply animation to instances, that can be offset amongst the individual particles. This way, they don't move at exactly the same time. This technique involved duplicating a copy of the goldfish for every frame of the animation. All the geometry is played back in sequence in the particle instancer.


The second example shows robots all walking on the ground. The same technique was used to offset all the walk animations. The addition of a script was used to make the feet stick to the floor better.


The last example shows spider crawling along a surface. The fact that the surface is not flat was the challenge in this exercise.


Here is a video of the above effects.





Displacement Maps

You can use displacement maps as a way to add more sculpted detail to geometry. With bump and normal maps which can add surface detail, displacement maps actually deform the geometry.

The software renderer can use displacement maps but its functionality is limited.

(Click to enlarge) Figures 1-4


Here a flat plane is used, to demonstrate what can be done in the software renderer. Fig 1

After applying the displacement map image, this is what the default settings give. Fig 2

After upping the samples of displacement you can see what its supposed to look like, but there are a few little mistakes left to fix. Fig 3

After a bit of tweaking I got this result. Fig 4

_____________________________________


Continuing from the last example, we then learnt about how displacement maps should always both extrude inwards and outwards, so that the object being displaced doesn't appear to explode only outwards. To do this, means telling Maya where mid grey is. This can be done by adjusting the Alpha Gain and Alpha Offset attributes in the image file node. The rule is that Alpha Offset is always minus a half of the Alpha gain.

Here are a selection of images demonstrating the effect the attributes have on the displacement.

Alpha gain 1
Alpha Offset -0.5


Alpha gain 2
Alpha Offset -1


Alpha gain 3
Alpha Offset -1.5


Alpha gain 4
Alpha Offset -2


If you open all the images and flick though them you can see exactly what's happening.

It is interesting to note that when comparing these images that the words and board punch out the most, while the the noisy area stays more less in the same place. This is because the words and boarder are white in the displacement image, and the middle bit is grey with noise, ie the mid point.


In the next example we look at refining the displacement results using the Mental Ray renderer, which has some extra options for creating good displacement.
The way to achieve those kind of results is with what's known as the Approximation editor.

___________________

Mental Ray Approximation editor

In this example the letter M is used. The white area is what's being displaced.

No Displacement map.


Default Settings. (as usual is a mess)



Changed to Alpha Gain 0.1
Alpha Offset -0.05


Tweaked with approximation editor.


_____________________

Dice Example

(Click to enlarge)


Figure 1 shows a die with no displacement.

Fig 2 shows what default displacement gives us. Its exploded!


In Fig 3 the approximation editor is set to the polygons or Sub Divisions setting.
this is the result. But it seems we've lost most of the displacement now.

After adjusting a few settings we get the spots indenting. Fig 4


Upping the Max subdivisions fixes the stepping effect as shown in the image below.


_______________________

Nurbs Tube example

The last example is with a nurbs tube.


The approximation editor has a specific section just for Nurbs objects.
This is what we get.


After some tweaking we get clean results.



____________________________________


Indirect Lighting


Now onto Final Gather

With final gather you can light a scene without using any actual lights. In the example we used the environment colour to light the scene.
What it does is it shoots final gather rays from the camera and bounces them around the scene, and where ever they bounce they add light. So naturally, places that would be in shadow will end up being darker than areas fully exposed.
Because the rays bounce around the scene, it is being lit indirectly.




Final Gather has render diagnostics.
The green areas represent the tighter areas of calculations, where the light bounces the most.




The dots can even be viewed in 3D.


After tweaking some settings a result like this was achieved.




Now on to Global Illumination in Mental Ray.

Where Final gather deals with bouncing light, Global Illumination will colour the scene based on the other colours around it. Photons are emitted and bounce around to colour the scene.

After a little bit of setup and switching on global Illumination a test render will result in something way over exposed! The white spots are photons.



Using Final Gather in conjunction with Global Illumination will help to smooth out the render as you can see.


After adjusting some other attributes in Global Illumination you can achieve a result like this.


You can view photon dots in the same way as Final Gather.


So this is the beginning of how to render scenes with realistic lighting effects.
I'm sure there's still plenty more to learn.


A Flock of Pixels

Maya Tasks Week 22 - Dynamics and Mental Ray

First is the dynamics.

The first tutorial was on creating lots arrows and then fire them across the screen. To do this, one arrow was instanced on particles that were emitted. The aim rotation was set to velocity, so that the arrows aimed in the direction they are going.


The same thing was done to these rockets, except a secondary particle system was used to emit smoke from the particle rockets.


This scene demonstrates how one particle system can have its particle rotations based on several different calculations. ie some arrows point at a fixed location, some are born with a random rotation in X axis, and some aim in the direction they are going. At birth, one of these options is chosen.


The last example shows a way of creating masses of randomly placed trees using particle instancing. In the tutorial, we were shown a way of placing trees in specific areas based on a texture map on the surface, then using the particle emission texture rate to emit from only the white areas from the black and white image map. Rather annoyingly, that bit didn't work for me. The same thing happened in lesson too, and the suggested fix, (restarting Maya) didn't work for me either. Although I have seen other people have managed to get it to work, so I'm can only assume that it is a Maya on Mac problem. I'm sure that if it came to it, there is probably a way to get it to work, but at least I know that this is a feature that exists to use.


Here is a video of the above effects.






_______________________

This week for rendering we looked a motion blur and depth of field.


Motion Blur

With the software renderer you can use two kinds of motion blur, 2D and 3D.

In this scene we have an example of 2D movement, meaning that 2D motion blur can be used.
There are multiple ways of changing the amount of blurriness in a render.
You can either use the blur by frame or blur length to control the strength of the directional blur. Alternatively you can also use the shutter open and close controls, which are similar to actual cameras.
They all do much the same thing.


Then there is the smoothing value, which basically blurs all the pixels a bit.
And there is also blur sharpness, which also does exactly what it says.

After tweaking all the attributes I got a result like this.


One other thing to note. I'm missing the '2D blur memory limit' options. Don't know what's happened to them.


_________________________


In this next example we looked at 3D motion blur in software, with this wheel.

To illustrate, here is the problem of using 2D motion blur for a 3D movement.

All the bars are blurring in one direction, and not in a curved direction.

Here's what the wheel looks like without blur, and with default motion blur.


And again. we can control the amount of directional blurring by adjusting most of the same attributes. Although there is also a way of adjusting the blur, directly on the cameras themselves in Maya.


___________________________

Lastly there's mental ray's motion blur. (which is 3D)

Default settings will give this result. It looks familiar. (like 2D motion blur)


By increasing the motion steps, it is looking at the movement in minor increments, to smooth out the curve of the blur.
Unfortunately, mental rays motion blur, is very slow by default.

A speedier way is to use mental rays 'rasterizer' renderer. This happens to be better a dealing with motion blur. and offers quicker results.


The only way to remove grain in the image is to up the samples, which will always slow the render down, but then, who's going to notice any grain if its moving fast!
It is still considerably faster than the scanline renderer (mental rays default).

__________________________


Depth of Field

Both Software and Mental Ray can do depth of field.

First lets see what Software can do.
By adjusting the focal distance, the focus can be tweaked to the distance of the subject.
The F stop controls the amount of blurring, while keeping the subject in focus.
Maya Software isn't very accurate though, and doesn't handle edges very well.
This is what comes of adding blurring as a post effect.



The way fix this is to use mental ray.

This renders it correctly, although by default, it will appear very grainy. By lowering the anti aliasing contrast, the render will come out smoother.
Any more smoothing required turning the sampling up (as usual).




Mental Ray also comes with some specific lens nodes.

One of them is the Bokeh lens node.
With it, you can achieve far more realistic depth of field.
It has much the same controls as the other depth of field.


After some tweaking I got this result.



A Flock of Pixels

Monday, 21 March 2011

Maya Tasks Week 21 - Dynamics and Mental Ray

In this weeks dynamic tutorials we looked at particle instancing.

The first example is of a crowd of robots moving forward in one direction.


The robot cycle animation is controlled by scripts and the robot itself is instanced on particles that move forward.


The next example uses particles instancing to create bubbles. The sale of the bubble geometry is controlled by the particles.



Then we come to meteors. In this, the instanced meteors rotation are also being controlled.


In this example, an attribute called object index is used, so that the particles emitted, choose between a selection of instanced shapes.


In this final example all above attributes have been applied. The rotation, scale and object index has been applied to a selection of people, generating a crowd.


Here's the video of the above effects.




___________________________________


Now on to some mental ray stuff.

In this task we were shown how to take depth map shadows rendered in software, to Mental Ray by converting the shadows to their depth map equivalent.

Software Shadows



Although the switch is not perfect as shadows won't appear to render in mental ray, until you tweak the softness attribute. So I take the softness right down.

As you can see, when the softness is decreased you can begin to see the shadows again.

After tweaking the softness you can get a result similar to software, in the mental ray renderer.




In the second exercise, we were using mental ray to render this scene and using its diagnostics tools to understand and tweak settings for optimum performance and speed.

Although to be quite honest, I didn't have much luck as far as tweaking went.

The main focus of the tutorial was on something called BSP, which stands for Binary Space Partition. Although I'm not about to have a long discussion about what that is right now, but for what we were doing, we had to tweak the BSP size and BSP depth under the 'Regular BSP' setting in the render settings. It was just the depth actually, but the idea is to try and find a balance between the two and in theory, quicker render times.

Lets just say that my results after about 4 renders were kind of exactly the same.

In terms of speed, Regular BSP was slightly faster than BSP2, although changing the BSP Depth, or size seemed to have no effect. Although to be honest, I can't really complain about in rendering in 43 seconds, because that's actually pretty fast anyway.

Render 1
45 seconds
BSP2

Render 2
43 seconds
Regular BSP
BSP Size 10
BSP Depth 40

Render 3
43 seconds
Regular BSP
BSP Size 10
BSP Depth 50

Render 4
Regular BSP
43 seconds
BSP Size 10
BSP Depth 60

Render 5
43 seconds
Regular BSP
BSP Size 5
BSP Depth 60

I finally got a result that increased render time by 1 second

Render 6
44 seconds
BSP Size 1
BSP Depth 50
These were its detailed results
RCI 0.3 info : max depth : 50
RCI 0.3 info : max leaf size : 66
RCI 0.3 info : average depth : 38
RCI 0.3 info : average leaf size : 4
RCI 0.3 info : leafnodes : 2089268
RCI 0.3 info : bsp size (Kb) : 114652

…and if you compare that with the second render…

RCI 0.3 info : max depth : 40
RCI 0.3 info : max leaf size : 191
RCI 0.3 info : average depth : 34
RCI 0.3 info : average leaf size : 7
RCI 0.3 info : leafnodes : 531119
RCI 0.3 info : bsp size (Kb) : 31804

Here is a comparison of the BSP depth size
40


50



This is the actual result of the render.



More Maya tasks soon!

A Flock of Pixels