Sunday, 17 March 2013

3D modelling constraints

There are three main constraints that a 3D artist will have to take into account when creating 3D models. These are; polygon count, file size and rendering time.


Polygon count


The first constrain is polygon count, This is more of a constraint for 3D real time programs as oppose to say a 3D animated movie. This is because the movie can be rendered out and will then have all the polygons pre rendered where as in 3D real time programs such as video games the user is free to look where ever they wish meaning that the hardware has to render the polygons dependent on where the character is looking.
Therefore this is a huge constraint as the actual performance of your video game may suffer.
I managed to find information on the poly count that was used for crysis. This game was released in 2007 and was a ground breaking game for its time with some of the highest quality textures, lighting and character models this game was often used just to see how powerful your PC really was.


Characters
Heads 3,000 triangles

Body 5,000 triangles
Weapons
 

First person: about 6,000 triangles Third person: about 1,500 triangles







However if you have ever played video games you will have noticed that the cut scenes are always so much better looking, well this is due to the fact poly count is less of an issue (still a constraint) as the polygons have already been pre rendered however a larger constraint for cut scenes as well as the actual game play is file size.



File size


File size is very important especially for video games as they are often put on to disks with limited storage capacity on them meaning that they have to get everything that the game will include and compress it onto a single disk however as games are becoming more advanced in technology they have started having to put it on two disks due to the amount of information in the game. This is also why PC games look better graphically than console games as PC you can just download all the information as well as not being restricted to hardware restraints unlike console. however there are still restraints even on PC as to how large things can be due to the hardware having to read all the info and so larger file sizes often leads to more work on your CPU.



Things to reduce file size

Change render resolution
Reduce the size/reselection of textures
Use a modifier called "ProOptimizer" (this reduces the vertices) 
Do not keep modifiers on objects once finished modifying


Rendering time 


Render time is especially important to company for example Pixar can spend years rendering their latest movies and this is even done through render farms (basically a load of computers solely for rendering. There are a few ways in which you can decrease this time however the options you change to speed up render time will ultimately affect the look of the render. 


If your render doesn't require reflections then you are probably going to want to turn ray tracing off. This basically creates mathematical formulas to replicate realistic lighting which is very powerful and power consuming on your CPU.


Another way to cut down your render time is to turn down or off anti-aliasing this basically smoothens the model so you don't get jagged edges in the rendered image.


Sunday, 10 February 2013

Displaying 3D polygon animations

To display 3D polygon animation you need a application (application programming interface) that actually display the 3D animation some of these are Direct3D and OpenGL. These programs create the shape that will then be displayed on the screen.
The graphics pipeline is a stage that requires a three dimensional object to be shown on a two dimensional screen, to do this it gathered information on the vertices or the main control points of the 3D object and basically crops the 3D model so that it only displays what can actually be seen, for example, if we have a model of a shoe and we are looking at the shoe from a side on angle, the application programming interface will give only the information concerning the side visible of the shoe and will cut out the parts that should not be visible.there are a few different bits of information provided by the vertex which include its position on the x-y-z coordinates, the texture, reflectivity (or specular values) and the RGB (red, green, blue) values. The general primitives within a 3D model or 3D graphic are lines and triangles that create the shape and illusion of depth. however there are a few steps that the program does before simply creating and displaying the 3D model or graphic. These are; modelling, lighting, viewing, projection, clipping, viewport transformation, scan conversion, texturing & shading and then finally the display.




Each of these stages has very important jobs to create the image displayed.
First of all modelling. In the modelling stage the whole scene is generated using the vertices, edges and faces.
secondly the lighting stage. this is where the surfaces in the scene are lit accordingly to the position and location of the light sources in the scene.
Then there is the viewing stage. this is where the virtual camera is placed and based on the position of the camera the 3D environment is then transformed into a 3D co-ordinate system.
After the viewing stage there is the projection stage. this is where the 3D illusion is created using perspective projection meaning that the more distant objects appear smaller.
the fifth stage is clipping. this is the stage where objects that are outside of view will not be generated, this isn't needed but helps improve overall performance of rendering.
Once the clipping process is done the next stage is viewport transformation. In this stage co-ordinates are given to the post-clip vertices, these co-ordinates will relate to the next stage which is called scan conversion. in the scan conversion stage rasterisation is used to determine the end pixel values.
once the scan conversion stage is done the individual pixels are given colours depending on their values givien from the rasterised vertices or from images created to be applied to the specific areas. this stage is the texturing and shading stage. then the final stage is the display where the final image of the scene with all the coloured pixels is shown on a 2D screen.

Now once a model is finished a final render will be made which will place all the information together and give the best quality image deponent on the selected settings. the four main ways in which these completed models and enviroments can be rendered are; Rasterisation, Ray-casting, Ray-tracing and Radiosity.

Rasterisation - this is basically where it takes the shapes and information from the scene and creates a raster image (image using pixels) which will then be displayed on a TV etc or can be saved as an image file.

Ray-Casting - this basically sends rays to each pixel and collects information from it such as RGB value and opacity value. From this information it projects an image of the scene which is based upon the perspective of the scene using little effects. This is basically a lower quality of Ray-tracing but however due to this lower quality it is more efficient and less intensive on hardware meaning it is much better for interactive purposes such as video games or 3D animated tours.

Ray-tracing - This method of rendering is a much more intensive version of the Ray-casting method. This is because not only does it collect information for pixels but it also replicates lighting, shadows and refractions. Due to this being so intensive it will be a slower process to render meaning it isn't as efficient as Ray-casting when needed for interactive applications.

Radiosity - This is used with other rendering techniques and this simulates more realistic lighting as it calculates the passing of the light through a scene and reacts how lighting would for example, it will illuminate an environment with more realistic shadows and lighting levels.
















Now talking about lighting there are 4 different types of light that affects the models and environments. These are; ambient light, diffuse light and specular light.
first of all is like the base colour of the model this is often a dull colour meaning that it is quite a plane colour on its own and so we can add the other types of lighing to an object. The next lighting is the Diffuse lighing and this again is a darker colour usually and adds the general texture to the object. then finally we have the specular light which gives its reflectiveness whether it be high or lower.



Textures can also be applied to models and these are basically a image that gets wrapped around the model. Textures can be extremely realistic when you take into account how the texture should behave e.g. any transparency or reflectivity, how rough or smooth the object should be. these can all be modified by creating different layers of the texture. For example, first we could put a basic diffuse bitmap on the model (this is basically the texture) but then we can make this look 3D by adding a bump map layer (for example makes a image of a brick wall look more 3D in the sense of the rough textures look clearer and more realistic. we could then also put a specular map on the image its opacity and so on.




















Another technique used to make interactive applications that are using all these methods more efficient is fogging. This method basically has a distance fog on it so that from the camera the polygons in the distance were not as high quality and hazed out unlike the textures closer to the camera, this would then display the polys as the camera got closer. This method is defiantly more efficient on hardware and processing speed of the environment and the polygons in the scene.

Shading is another technique that is used to help processing speed etc... and there are three main methods of shading first of all flat shading this basically generates one colour for each of the polygons in view for example if you have a sphere made up of squared polygons it will look more like a disco ball than a sphere meaning that it looks very unrealistic, however it is incredibly quicker at processing. The second method of shading is gouraud shading. this is similar to flat shading but rather than it calculating a colour for each poly it creates one for each of the veracities meaning there are a lot cleaner shading however this can actually miss some effects such as specific lighting. This method is particularly fast but as i just said it can still miss effects leading to slight unrealism or not the highest quality. The final method is phong shading, this is a might more precise approach to that works out vector normals at every vertex which if we use the sphere example again it is more accurate at creating the realistic curve of the sphere. However this means that it has more calculations meaning slower processing speeds when rendering.

The final method of increasing efficiency is the level of detail in the models, for example close to the camera a model of a human can be extremely detailed with facial features etc... however move the human model a specific distance and we can change its model to be less detailed but keep some of the main features then if we move the model even further away from the camera we could change the model again so it is a basic outline of a human with slight depth cues.









Monday, 29 October 2012

3D Development Software


There are lots of different 3D modelling programs out there, from the popular ones such as 3Ds Max and Maya to the less known such as DAZ Studio 4 and Bryce. 



First of all lets start with 3Ds Max. 3Ds Max offers a wide range of import and export file types. any 3D model created can be exported to programs such as Adobe Illustrator (*_AI), 3D Studio (.3DS), Shockwave 3D (*.W3D), ASCII Scene Export (*.ASE) etc.... This allows the modeller to have greater variety of programs to use one the model is finished. 3Ds Max also has a very large range of file types that can be imported into the program such as 3D Studio (*.3DS, *.PRJ), Adobe Illustrator (*.AI), Autodesk Inventor (*.IPT, *.IAM), 3D Studio Shape (*.SHP), Wavefront Object (*.OBJ) and Material (*.MTL) and many more, 




3Ds max also allows you to animate your models as well as creating them, this can be useful if the model needs to be animated but don't want the hassle of exporting the model and re importing it into another program just to animate it. you can also render in real-time so that you can view the final product without having to first export it. this helps with efficiency and small tweaks to the project. 

however 3ds max can cost around £3,335.00 which is a very heavy investment for any software especially as there are free 3D modelling programs available 






Another 3D modelling software is called cinema 4D is believed to be better for movies and CGI/Animation within films where as 3Ds Max is believed to be a better program for games and architecture. however the way in which to chose which to use ultimately comes down to what type of work you will be creating, if you are creating large and possibly endless ideas then it is said that 3Ds Max is better with its more versatile range of tools. however Cinema 4D costs about £1,368.00 which is significantly less than 3Ds Max but still a large investment. 





















As well as these well know modelling there are also some other programs which are maybe not as popular as the previous ones. 

First of all FormZ this is a modelling program for AutoDesSys, This program allows you to present your designs interactively on line with the new VR creation features. These allow you to create web ready interactive panoramic and 360 object movies of your design. however this program also can cost up to £995.00 where as on the other hand you can get DAZ Studio which was originally £155.00 is now free for anyone to download. DAZ studio a lot like 3Ds Max also has its own animation tools. also within this you get Bryce which is a 3D modelling software more specifically aimed at landscape modelling which i have found to be very useful in game development or architecture. 








Sunday, 28 October 2012

Mesh construction

Firstly to explain mesh construction i am going to give a walk through of a object i created explaining the aspects of mesh construction along the way.

Firstly in the command panel click the create tab and then the shapes sub tab, here you can get open and closed splines. a spline is any 2D object that has veracities and segments. There are also doughnuts and eggs which involve two splines.
 Now if i remove these splines by using Ctrl + Z i find that i cant remove all of the splines due to the amount of them, therefore to allow me to undo more moves i can go to customize in the tool bar and then preferences.














 Then under the scene undo title we can select the amount of stages we wish to be able to undo in the future.






















Now i am going to create an open spline using the front view port by simply selecting the line shape then clicking and dragging then repeating again until i have three points (start, middle and end) then right click to end the shape.


Now we can go to the modify tab and click the + key next to the line and you can see we have vertex, segments and spline.






























Now i am going to life the middle vortex to create a triangular shape.



Then i cloned the spline by holding the Shift key and then left clicking and dragging on the spline creating an exact replica. I have also re coloured the splines so they are easier to see, the original spline is red and the clone is green.


as i clone the spline a box appearers with the options copy, instance and reference. to clone and create a separate spline i selected instance because no matter what i change about one of the splines it will change the other one exactly causing a mirrored effect. this would then mean that i have less control and flexibly within my creation.
Now i am using the bend modifier in the drop down, make sure that the vertex sub-object is unselected, This is a demo to show the difference between a instance clone and a copy clone.

no i am going to remove my instance clone and make two copy clones this has no referencing system, so now i have three splines.


Now i am going to attach these splines together. this is done by selecting one of the splines and then selecting attach in the geometry roll down in the control panel.



















I then hover over the other splines and will see a + symbol with four circles, once this appears simply click on the spline you wish to attach. in this case i am attaching all three of my splines. dont forget to deselect the attach tool once done. So now they are all selected.












Now i am going to turn this into a surface using the cross section tool in the geomatry roll down (same area as attach) and now i simply click from one spline to the other.


Again make sure to turn the cross section tool off after use, just like the attach tool.











now as you can see there isn't a surface but it has created a structure between each of the splines which i can now place a surface one using the surface modification (in the modification drop down) and now i have a surface.



















Now if i go back into the spline level of this object and use the vertex sub-object and select the veracities i can then modify them even after i have placed the surface.








As you can see i dropped the center of my surface downward and as you can see it gets rid of the surface and just shows the wire frame structure. if i wish to see the surface at the same time to know what it would look like after these modifications i can select the end result button (looks like a Solid bar) in the command panel just below the modification selection box.




Now i can also add effects such as bezier (selected by right clicking and in the top left quadrant selecting bezier) to alter my surface shape.and as you can see now i have a curve travelling through my surface.

Now This doesn't look very detailed. This is due to the low amount of sub-divisions in the surface, in order to view the sub-divisions properly i have to select the surface layer in the modification box and then in the modification drop down select edit poly modifier.










and now i get a much greater surface division.












Now i have more sub-objects that can be selected and now i have edges, (when this is a spline between veracities it is called a segment but when it is a poly it is called an edge). I also have the sub-object border which if i was to create a hole in the poly it would detect the edges and fill the hole back in, and finally we have element which is the whole object. this is used to select a complete object or set of attached splines if there are multiple objects within the space. now again on top of the edit poly modifier i am going to select the mesh-smooth modifier from the drop down.


Now im going to use NURMS (sub-division method  and so now when i choose the sub-division amount you will see the surface curves get smoother.























However be careful using this as you are creating more polygons when you increase the division amount causing more stress on your CPU. Now i have all these modification tools on these simple splines, i can also travel back to the base splines, however when i do i get a warning message basically telling me that altering the splines it may cause unwanted effects due to the modifications in place for example, if i accept the message and then move my poly it in fact break my surface, as you can see half of my surface is missing.

This is due to the veracities that were connected being broken apart. So if editing/re-editing your object be careful as it is very easy to break your object, however you can select all the veracities together in that area and it will give you more control as you are altering the original shape without breaking it.



Now i am quickly going to show the curve feature on a spline, so i will create a new spline and make a triangular shape again.



So now if i right click on the centre veracities and look in the top left quadrant i am able to select the smooth tool, this then makes the spline automatically curve.


























However there isn't much control over the curve other than moving the curves focus point back and forth, however i can look at the tangent in and out of the vertex by right clicking again and selecting bezier again. This now creates a line that when pivoted changes the curvature of the spline.





































COMPUTER MONITOR


firstly I created a box with the dimensions 80cm - 80cm - 5cm.















Now I am going to turn this box into an editable poly and then select the sub object "edge" and i am going to select two parallel edges. I am then going to right click and select connect, this will simply connect the two parallel edges. I am also able to move this connection to my desired location along the object.



Im actually going to create two connections by selecting the small box next to the right click and the connect to be able to type in my wanted parameters.  
Now as you can see I can change the segments, pinch and slide. Pinch moves the segments closer or further apart and slide moves the segments along the face of the object. Now if I go to the polygon sub object and select the poly I just created (section between the segments) and then select extrude in the roll down bar (or the settings box next to extrude for more specific measurements) I can now extrude the poly by simply clicking and dragging the poly in the direction I wish, as you can see I'm going to drag it upwards to create the stand for my monitor. I can then use the move tool to slant the extension.

Now I'm going to extrude again on the top of the first extrusion and then using the + button in the extrusion settings I'm going to repeat the same changes three times giving me a total of four extrusions. 
Now using the polygon sub object again I'm going to bevel and extrude to create a place for the monitor screen to connect to the stand. I'm also going to use the bevel tool to create the screen. 

Now that I have the outline of the screen I'm going to give it some depth with another extrude and then use the insert tool to make the screen more realistic by adding depth into the screen and then a final bevel to finish the screens depth. 
Now I'm going to add a slight slight rotation to the screen to show that the screen will pivot.
Then I just added a few features like curving the stand and support on the back.