Wednesday 11 December 2013

Codemasters Professional Brief - Vehicle/ Material Project

The second professional practice brief of the year was a vehicle/ material focused brief set by Codemasters. I had been anticipating this project from the beginning of the year, as you're probably aware, vehicles are kind of my thing!

As mentioned the task was focused on two elements, the first was to create a vehicle within a scene, the second was to use the real time shaders provided especially by Codemasters. Emphasis was on the second aim in order to demonstrate the material properties displayed on the vehicle using the shaders provided as well as this we also had to focus on the final presentation of our vehicle scene considering the lighting set-up as the final renders had to be in real time. An example scene was provided by Codemasters which was to aid us during the process, having never used specific shaders before the example scene meant I had the opportunity to pull it apart and explore it in order to see how best to use the shadrers so that we could spend more time focusing on the art.

In consideration to my last project, the Rooftop Project, where I had lost quite a bit of time for various reasons including spending too much time at the beginning of the project concepting ideas, for this project I wanted to get straight into it. I had two options, to design a new vehicle or to choose an existing vehicle. Obviously I chose the latter, one, for the reasons mentioned above and secondly I felt that my familiarity with vehicles in general, especially my chosen vehicle a motorcycle, would give me an advantage in delivering certain key features including the variety of material properties within the vehicle. The vehicle I chose was a Ducati Desmosedici RR, a rare and exotic motorbike in its own right, see photo below;


Before modelling I went straight to the-blueprints.com to purchase and download blueprints for the bike but these were lacking a lot of the smaller details which are more visible on a motorbike in comparison to a car such as cables, levers and more engine components so I also downloaded examples of orthographic images of the bike, I used both of these reference images within the viewport when modelling and found it helped to move between one or the other depending on the amount of detail I wanted to capture in that particular area of the model. For the front reference of the bike I even merged the orthographic image and blueprint in Photoshop.


I began by setting up my reference images inside the 3D Studio Max scene, which was more difficult than I had first hoped. It was important that all of the projected drawings matched each other in the various viewports of 3DS Max so that I didn't run into any difficulties during the modelling stage, particularly with this being a motorbike, the details are more confined and even the flow lines of the body work are much tighter than you would usually find with a car so it was important that this wasn't affected by poor planning and set-up.

Once set-up I quickly began modelling and experimenting with various methods, such as starting the model in different viewports. I also began to box model the vehicle but it became quickly apparent that this was not going to be the best way of modelling the vehicle. Again, because of the tight and varying flow-lines within the body work, it was vital that the topology of my vehicle was as good as possible to mimic this within my model.



I quickly abandoned this method and began to planar model the vehicle, it gives you much more flexibility when it comes to smaller more organic shape modelling like this and probably why its more commonly used with character modelling too.I was also going to have to worry more about my tri-limit budget later on, right now is was about getting the core elements and shapes of the vehicle in place as well as clean topology. I could then look into refining the geometry towards completion.



As you can see from the screen shot above, the planar modelling method was extremely effective in achieving the smooth transitions within the geometry. As explained, I was also having to be quite generous with my tri's to begin with to ensure that all of the elements to the vehicle, the mentioned smooth changing directional bodywork, swooping front and side vents for example were as accurate as possible.


The next stage for me was to begin modelling some of the larger elements of the bike to begin getting an idea of the overall look of the model as well as the scale and position of these different elements such as the wheels, the brakes and forks etc.


All of these elements were done in the first few days and I was extremely happy with how quickly the project was moving along. I was really enjoying modelling the bike, as I had the chance to work on something I have a passion for away from uni anyway and as initially thought, this seemed to be paying off.
The next stage for me was to begin modelling the petrol tank and seat unit as well as begin modelling other smaller parts such as the handle bars, frame work, swing arm and chain etc. For some unknown reason I began to attempt to box model the petrol tank again. I clearly hadn't learnt from my mistakes! Again, it became quickly apparent that the tank would be best planar modelled. I actually found the tank very hard to model as it has various small changes of shape and direction in a very confined space with made it hard to model with limited tri's. I also began to apply simple colours to my standard materials just to give me an idea of how the vehicle would look as a final composition, which helped a great deal.




 Another smaller part of the vehicle still having to be modelled was the mirrors. I decided to do this in a separate Max file which I then imported into the vehicle file. I found modelling the mirror extremely difficult, for some reason I just could not get the shape right at first despite numerous attempts, and found it almost impossible to model the mirror to match both the front and side reference images. Again this was something I had to compensate for in using my judgement in order to make it look right. Again, I also had difficulty maintaining a low tri count for the mirror given its small size and it complex shape.


Time in week two was running out as I began to model the final smaller details of the bike. Despite starting so quickly, getting all of the detail I intended into the vehicle was taking longer than I first thought. Every time I looked at my reference photographs and then back to my model there seemed to be a different part I had missed each time which was becoming quite frustrating. Considering I had already well hit my tri-limit there just seemed to be more and more parts needing to be modelled.


At this point, because I was well over my tri-limit by a few thousand tri's I felt it was necessary to split my vehicle so that I had two. With one I could continue to model all of the smaller details without having to worry about the tri-limit which would be my high-poly model and the other I could begin to re-fine and re-topologize the geometry and begin to bring the tri count back down towards the budget.


Week two had almost come to an end and although I hadn't finished my vehicle as planned I had began to explore the example scene provided and explore how it had been set up. It seemed as though I could follow a very similar set-up for my own vehicle despite it being nothing alike. I planned on placing my vehicle within a pit-lane garage with an obstructed view of the pit-lane and pit-lane wall outside. I began by modelling a very simple layout, similar to the example scene and placing my vehicle inside to get a feel for how it would sit within the environment. I also used the same method for creating my sky as in the example scene by squashing half of a sphere and creating a high resolution panoramic image from photographs of a day-time landscape that could be applied to the sphere/ dome.

I was also able to pull apart the textures from the example scene as well as experimenting with the shaders in a new Max file to give myself an idea of how they would function seen as I would be texturing my vehicle in week three now. I explored how the diffuse textures had been done with the specular in the alpha channel which would tell the shader how to use the reflection map on the model. Once I had explored how this effected the reflection map within Max it actually became quite straightforward.

I was now halfway through the project and I had gradually fallen behind again, but hopefully this time I hadn't bitten off more than could chew and I was still confident that, especially now I was familiar with the shaders and the processes involved with using them I would still be able to finish the project to a high standard.

Now that both of my high and low-poly vehicles were modelled I could unwrap my low poly. Unwrapping was the usual story, the same old stuff that takes 10 times longer than you had originally hoped! The main thing again with the unwrap was to make sure I utilised all of the texture space and considered which parts of the vehicle would demand the most detail in the texture. Below is the final UV's;

After unwrapping the vehicle I was able to then bake the high-poly model onto the low poly, because I had only included more defined high detail elements such as the petrol cap, seat unit vents and nuts and bolts I also planned on putting some smaller details into the normal map using Photoshop and nDo2 such as the tyre tread and speckled paint effect on the frame work and brake calipers. Below is an example of the models before and after baking. From left to right is the high-poly model (31,754 tris), centre is the low-poly model (10,812 tris) and then the low poly model with the normals. 


The final task for the week was to complete the diffuse texture and specularity map in the alpha channel of the diffuse, they are shown below;


Throughout the texturing process I continually exchanged between Photoshop and 3D Studio Max, now running in Direct3D to inspect how the textures rendered on the model with the shaders. As mentioned in the brief, due to the particular format of the shaders so I had to duplicate the texture in a multi-sub material in order to achieve the desired material effects for my vehicle. Although the reflectiveness should be dictated in the alpha channel of the diffuse I also wanted more control using the parameters within the shaders themselves, so for example I could have the body work of the bike really shiny and reflective but the rubber of the tyres quite dull, as in the example scene I also wanted a diffuse texture with an alpha for the screen of the motorbike so this also had to be done in a separate material.

I able to achieve the range of material properties I wanted by using 6 multi-sub materials as shown to the right.




Below is an example of my vehicle in the viewport with the materials applied;


Now that my vehicle was completely finished I had to complete my environment and place the vehicle within it. Again, after exploring how the example scene was set up I followed the same method by texturing my environment using a variety of simple textures on a multi-sub material using the DirectX Xoliulshader_1.6 shader.

For some reason I encountered lots of problems with the viewport now that I was in the new environment file. Problems such as;
  • The viewport being too dark
  • Materials no showing correctly
  • Textures showing at a very poor resolution
This took some time to correct, simply by changing various setting within the viewport configuration as well as comparing how I had set my own scene up with the example scene. I think most of the problem was that the scene had to be displayed only using the default lights, but because there had to be textures applied with light maps the scene was showing too dark. I also managed to combat the problem further before applying the textures by setting the viewport configuration, and under the 'lighting and shadows' tab change the illuminate scene to use 2 default lights which helped massively.

One other thing that helped improve the look of the environment within the viewport itself was to change to field of view of the viewport to around 90.0, again taken from the example scene, which improved the aesthetics of the scene when exploring the viewport.


Once the environment was unwrapped an textured I needed to work out how to bake a light map, this again involved a lot of trial and error baking a variety of different textures to see which yielded the best results. In order to save the baked texture and apply it I had to unwrap the whole environment again within a separate channel. This was easy to do quickly and a good enough result could be achieved by simply using the flatten mapping tool. Once this was done it was simply a case of using the render to texture tool to render the shadow map using id channel 2. The shadow map render is shown right;

After completing the environment with lightmap applied, the next step was to complete the cube map. Again this was a new problem presented by the project, but again, using the example scene and brief provided everything seemed quite straightforward. I completed my cubemap by importing the camera rig from the example scene into my own, I then increased the field of view until I was happy I'd gotten enough of my environment in the screen grab. Using these screen grabs I then composed my cubemap in Photoshop. My final cubemap is shown below; 


Once I had completed my final renders and post processed them in Photoshop the next step was to create a video. Fortunately I have some experience using Windows Movies Maxker to complete a decent professional looking video. I did encounter numerous problems which had to be resolved.

To render a video from the viewport, once I had set a camera up with key-frames, Max has an extremely useful feature under tools – Views – grap viewport and create animated sequence file. Unfortunately this only rendered out at 4:3, to change my renders to 16:9 I used Adobe after affects. With all of my video together in Windows Movie maker I also composed some music with sound effects using the program Audacity to compliment the final video. 


I am extremely happy with the outcome of this project and especially the final product inc the renders and video. I feel that I was able to understand the example scene very well and solve lots of new problems presented by this unique project. As per usual there are some aspects of the project that could be improved with time, I feel that the diffuse texture could benefit well from more surface properties to really sell the look of the individual materials of the vehicle. The environment also could of benefited from a more varied lighting set-up between the outside and the garage.

My main issue with the outcome of this project that has had some effect on my work flow at the end has been the fact that I shared my work with others a few days before the deadline. This resulted in endless requests for help and information on a variety of issues including the lightmap baking, creating the cubemap and creating the video from the viewport. I really don’t mind helping others, but when I've spent a lot of my time learning these things for myself and solving these problems, it seems a bit unfair for other people to just request this knowledge without having looked into anything themselves. I honestly believe that some of my peers would not have completed certain aspects of the project if I hadn't of shared my knowledge of these things with them.



Ducati Desmosedici RR (click to view in 3D)

;
Ducati Desmosedici RR