Saturday 27 July 2013

Week Four

A full week, this week, which covered a broad range of topics.  This post will focus on lighting.

A lot of the lighting within 3D software is calculated using the same physics which governs the movement of light in the real world; however, I am not a physicist, nor is my teacher.  This post may be fatally flawed with regards to real physics.  I will be talking solely about the use and behaviour of light in the 3D world, not the real one.  That out of the way, lighting is a fascinating part of 3D.  It's complex and can be highly technical; the physical laws can be followed strictly, or disabled and ignored.

The first tool I'm going to write about is Final Gather, which is a render technique by which ambient light is added to a scene.  Ambient light is light which is not being emitted from a direct light source such as a light bulb: it is light which has bounced off walls, the floor, surfaces, or has been diffused by cloudy sky.


dif·fuse  [v. dih-fyooz; adj. dih-fyoos] 
1. to spread or scatter widely or thinly; disseminate. 

Both scenes below contain just one light, casting a shadow.  In the first render light is emitted, lands, and does nothing more.  In the second render Final Gather is enabled; the emitted light lands, bounces and does nothing more.  Maya uses the bouncing light rays to calculate how much ambient light is in a particular area, and subsequently how much ambient light (or how little shadow) there should be.  That's roughly how it works.


Direct light.

Direct light and ambient light.

Similar but very different is ambient occlusion which, to quote Wikipedia, "attempts to approximate the way light radiates in real life, especially off what are normally considered non-reflective surfaces".  In our context, ambient occlusion is a tool used to pick out fine detail on an object when rendering the final image.  The term ambient occlusion means - not too helpfully - the occlusion of ambient light.


An ambient occlusion render pass.

In the image above, there is no direct light.  Final Gather is not enabled.  Only Ambient Occlusion is being used to 'light' this scene.  The back of the typewriter contains a lot of fine detail - switches, dials, layers of casing - which are picked out cleanly and clearly by the ambient occlusion render.  That image can be composited over another render of the typewriter, lit with a direct light.  The Ambient Occlusion pass will help to pick out the fine detail.  It may be that an Ambient Occlusion pass is required on top of a Final Gather pass, but that will depend on the situation. 

As opposed to Final Gather which calculates how much light there should be in a scene, Ambient Occlusion emits 'shadow rays' from surfaces and based upon how far they travel calculates how much shadow there should be.  In the fine cracks of the typewriter the shadow rays travelled an extremely short distance and so there is a lot of shadow.  On the top of the typewriter the shadow rays travelled much further, so there is no shadow.  

In 3D ambient light is different from direct light.  The two are classed as two distinct parts of lighting and may be setup and controlled independently of each other.  In the real world ambient light is just there; in 3D it's an option.  Direct light, Final Gather and Ambient Occlusion can be used in conjunction to achieve the best results: direct light to light the scene, Final Gather to simulate ambient, bounced light and Ambient Occlusion to ensure the fine detail is not lost.  

On Monday we will be looking at non-linear workflows in lighting.  That is, setting up light in a real-world manner such that it decays in the same way light does.  That will probably get quite complicated but I'll write again if I understand it.  For homework, you can all look up the inverse square law.

Wednesday 24 July 2013

Typewriter update ii

A quick update on the typewriter.

I've built the keyboard keys and the struts that support them.  Oddly - to my eyes - there's no '1' key!  This seems to have been a flagrant oversight.  These have all been extremely simple, the keys almost all being exactly the same, while their supporting struts are broadly similar throughout.

The black colour is just to make the keys easier to distinguish.
The hammers which stamp the ribbon to produce a letter on the page have, on the other hand, been a battle:


It's not immediately obvious, but this structure is extremely complex.  The 'base' the hammers sit in describes a curve.  The hammers themselves each rotate slightly as they get to to the periphery; lastly, the keyheads themselves rotate.

All of this together is incredibly complicated to construct.  It's only thanks to my wife that I was able to crack the nut - I had been trying to work out a way to build this as you see it now - from above, taking into account all of the angles.  Wife - brilliant, as always - pointed out that the hammers are not as complex as I'd first though they were and, instead of building them on a slant, I should build them as if they were.  That led to my finally working out how to make this structure.  Nearly finished:



In the image above I have accidentally orientated the hammers the wrong way round; however, I hope it's relatively clear.  I need to figure out how to rotate the hammer-heads correctly and I will be able to slot this into place.  Each hammer is an individual piece meaning that, in theory, I could animate the typewriter such that a keypress triggered a hammer-press.  Fun stuff!

Tomorrow we are taking the photographs into which we will be compositing our objects.  This means I am bringing the typewriter in, to get a good reference photo of it in situ.  A fellow student is modelling old camera of mine, so I will be heavily laden down!  

I'll post another update soon detailing this week's lessons - on Light.

Friday 19 July 2013

Typewriter update i

"How's the typewriter going", you ask?  Well, I'll tell you!

The short answer is, "very well".  Starting yesterday afternoon, with some work this morning and more today, I've worked on it for around 8 hours.  The boxy blob has transformed into something resembling my typewriter and I'm very pleased.

Low-poly mesh

High-poly mesh
The basic structure is in place and I have moved toward a final shape (adding detail) on the front section of the case; this is a double-edged sword, making it easier to get a feel for the finished product but changes will take longer. Right now the shape is slightly more clear on the low-poly mesh thanks to the wireframe, but with the high-poly mesh you can make out the curves.  This weekend I will be working on the back of the machine where the paper feed mechanism - and letters - are housed.  I have worked largely from reference pictures to date but for those complex parts I really need the machine in front of me.

Of particular note is the sloping, curving section at the front of the machine, which surrounds the keyboard.  The inner and outer edges go through some extremely abrupt changes from sharp to smooth to sharp.  Realising them on the model has been a chore so far but I've nearly got it.

When I started work on this, delayed by shoddy pictures (my fault), I was worried that I had over-reached and this might be too much to achieve in the relatively short time available.  I feel much calmer about things now, having made good progress already.

Otherwise, we have begun to look at lights and their uses.  The whole of next will will be devoted to lighting.  I'm looking forward to this a lot as it's one of the parts of 3D I know the least about.  The next week will hopefully leave us prepared to render our objects in a few weeks.

Thursday 18 July 2013

Projects

I am late in posting this and can only apologise to the millions of readers left hanging.

The course has hit its next milestone: The (First) Project.  I have previously mentioned that the projects require us to model, texture, light and position an object of our choosing in a photograph; this will be achieved such that its true nature as CGI is hidden.  Some of us knew that projects were part of the structure of the course, while it has come as something of a surprise to others.

The purpose of the project is to act as an equivalent for coursework in school.  As we go through the next three and a half weeks learning more about the tools of Maya for modelling, texturing, lighting and compositing we will work on our projects at the same time, using the same skills.  Once we finish the first six week section of the course we will be more familiar with the workflow from start to finish.

The object I have chosen is a typewriter! A nod back to my years of working as a typist.

A Smith-Corona De Luxe typewriter.  
I bought this typewriter in Spitalfields Market for thirty-odd quid and do really rather like it.  It is in perfect working order, the only thing it needs is a ribbon; ribbons are, to my surprise, still very much available and I will be buying one as soon as possible.

We started the projects at the start of this week (on the 15th of July), but haven't got much further than taking reference photos and setting up our scenes.


Above is the scene as I work on it - the images are photographs I took, all of them with the camera as far away as possible from the typewriter, using a zoom lens to remove perspective.  The boxy blob in the middle is a rough 'sketch' of the model which will be kept as simple as possible until I'm ready to start adding more detail to it.  The goal is that I will have most of the important shapes and curves fleshed out in something as simple as this before I begin to detail the model: as soon as detail is added, working on the mesh and making small changes can become a nightmare so it's best to realise mistakes and problems early on.

I'm pleased that the project has started because it will give me something to structure this blog around.  Instead of simply running through the last week's learning, I will post regular updates in the form of 'how the typewriter's going' and fill in with other, extraneous, details.

The completion of this project will mark the end of the first half of the course, and so will be at the six week mark: three weeks, two days.

Friday 12 July 2013

Week Two

Another week finished - only ten to go!  The course is moving fast and some people are struggling: the first few weeks of learning 3D software, and learning to work in a 3D environment, are extremely difficult.  Most of the ground has been covered now so the next four weeks are to reinforce the concepts and ideas, continue to learn new tools, and work on our projects (more on those, soon).

This week was devoted entirely to polygonal modelling and was a real blast for me.  I love poly modelling and already know a lot of the tools intimately.  As from the start, it continues to be eye-opening how much of my time has been mis-spent on previous projects, and I am cursing my lack of knowledge!

The week started with a detailed look at the basics of modelling a human face.  This is an important skill and also showcases the tools better than many other things.  The head we made was very basic and extremely ill-proportioned but could be used as a foundation for any future projects: it's a good rough outline from which to start.  This exercise allowed us to go through most of the poly modelling tools in one way or another.

Looking quite alien this may look like a experiment in bad modelling
but the basic structure is the same as any head.  

The rest of the week was spent modelling a P-51 Mustang.  This exercise brought the 'theory' from the human head exercise into practice, using many of the same tools in a more refined, planned manner.  Working from basic schematics - front, side and top - over the course of a day and a half we modelled a simple but true-to-form P51.  This was great fun and really rewarding.  The model took shape quickly and the form of the plane is a pleasant one.  

Low-poly.

High-poly - subdivided low-poly model.
The two images above are formed from the same mesh - the top image is the low-poly mesh.  That mesh began as a cylinder, just behind the nose cone: that cylinder was reshaped and extruded back, with further reshaping, to form the fuselage; the wings were extruded out from the fuselage along with the rudder and tail fins.  Looking at the low-poly version the loops of lines that flow down the length, and across the width of the plane are obvious.  Those are edge loops and their (relatively even) distribution is key to the plane having a smooth surface.  That they line up on the wings, fuselage and cockpit highlight that the plane was built as one piece. 

Next week: UV mapping and texturing.  UV Mapping is one of the truly hated parts of 3D modelling - reviled by all.  The premise is the same as drawing a map of the globe: flattening a 3D structure into two dimensions.  It's difficult, impossible to get perfect, and slow.  We will also be making a start on our projects - which I outlined briefly in my post last week and which I'll write more about on Monday.  

Coalescing

Nine days in and the group of people flung together to make up our class is beginning to coalesce into a friendly state of being.  It's nice that everyone's relaxing into the social side of the group because over the next ten intense weeks I think we'll really need the support from each other.  Simply learning the software and the concepts of 3D modelling is stretching some people and having the support from other, more experienced, members of the class will continue to be a real boon.

One of the most popular topics for discussion has been the reason for attending, and general hopes and fears about the course and the time after it.  That's been particularly good because it seems to have made everyone - certainly me - realise that their motive for attending is the same as everyone else's; hence, I think, the ice being broken.  There is still a sense of everyone sounding each other out but the safe conversations about film, TV, music etc. are bouncing about.  I hope that in the next week or so things will relax even further and solid banter will develop.  When we get to the stage that we can casually insult each other I'm sure an unbreakable bond will have been made; or broken...

I'm also becoming more comfortable in talking with other students in the school who have been there for many weeks more than we have and from who I've kept a nervous distance since now - God knows why.  Naturally, they are entirely friendly and full of advice.

This is all a Good Thing.