1

Real Time Rendering Assignment

Real Time Rendering Techniques

Modeling the castle

First and
foremost to begin the project a suitable scene was designed using Auto Cad and modeled
using the 3DS Max software package. When modeling any scene it is essential
that everything is to scale and each element is proportional to another. This
was the reasoning behind using Auto Cad to model the scene as it an
architectural program by which designs can be made to scale.  This model provided the plans which were then
used to model the scene in 3DS Max. In order to do this two sets of drawings
were made, the first was a top down Birdseye view of the model, secondly an
elevation plan which described the structures height.

Matsumoto Castle

Many
of the castles that were researched whilst planning the project were considered
however most castles all look rather bleak, old and diminished. Therefore it
was decided that rather than your traditional European castle, a castle from
Japan named Matsumoto was planned.
A vast period of
time was then spend modeling the castle in 3ds max, as a highly detailed and
accurate model of the castle was developed. Once the model was completed,
another extended period of time was spend creating the texture maps for the
model.  One cravat to creating the model
was discovered  when a first attempt to
load the model into direct X is that as the model had multiple hi-resolution
textures the 3DS loading module unfortunately did not support the material
mapping functionality that was implemented in 3DS MAX. There were two ways
around this problem.
 Firstly, each individual component of the
castle could be separated, a new texture map could be generated and loaded in
as separate objects into DirectX. The other method would be to write a new 3DS
object loader that fully supported material mapping functionality. Due to time constraints,
rather than re-inventing the wheel, the objects of the castle were separated
into individual components and loaded into DirectX. One problem that occurred
at the beginning was due to the highly detailed models, the application took
around 30 – 60 seconds to load in all of the meshes.  Therefore in order to address this issue, many
of the complex and highly detailed mesh data was excluded and the model was
compressed into around 222,000 vertices.
In order to
texture the model each mesh was un-wrapped and a texture was individually hand
made for each one which was a time consuming process. Bump and normal maps were
applied to the Rocky and wooden features of the model to provide additional
detail.  All of the textures were then
pre-baked to include bump mapping and lighting calculations. This again took a
very long time to process.

Matsumoto Castle

For my final year real time rendering project, I decided to undertake the modeling of the Japanese Matsumoto castle. Most of the modeling was undertaken using 3DS Max of which took around two weeks to model, it was no easy task, given that I am by no means an artist ! This project took a considerable amount of time due to the complexity of the mostly hidden detail that this castle features. Here is a quick example video that took 3 days to render ! After my exams I’ll do a better video of the model & have a play around with the lighting, additionally  I will explain some of the difficulties regarding exporting and loading this model into a DirectX program.

Summer’s Here!

Just handed in my last piece of coursework for my third year in University, what a momentous occasion!
Update to follow detailing what I’ve been up to in my last term here in The University of South Wales.
Now all I have left to do is complete exams in Concurrent & Parallel Programming and Artificial Intelligence, then the fun beings!

The plan for the summer is to develop my skills in these areas :

 

  • C# programming
  • Direct X 11
  • Open GL  revising terrain project
  • Complete a few unfinished android applications
  • Build a render farm
  • Make some 3DS Max models  & possibly my own file format for use in my graphical applications
It’s certainly going to be a busy couple of months !
nasmount

Mounting File Share from Terminal

After three days of hacking together mount commands finally my NAS is connected so that it can be accessed from terminal.

The script’s purpose is to mount a networked attached file store using terminal with the correct read and write attributes.

1:  ################################################################  
2:  #     Author       :   Robert Lutken                       
3:  #     E-mail  :      rolandroid117@gmail.com                 
4:  #     Date   :      Sat, 15-02-2014                      
5:  #     File Name :     nasmount.sh                      
6:  #     Purpose  :      To connect to NAS                 
7:  #     Version      :      1.0                           
8:  #     Notes   :     Unsecure version should not be used in       
9:  #               volitile domains                 
10:  #                                          
11:  #################################################################  
12:    
13:  #!/bin/bash  
14:    
15:  ## The user name of the account on remote device i.e. admin   
16:  username=yourusername  
17:    
18:  ## The Password of the user's account on remote device  
19:  password=yourpasword  
20:    
21:    
22:  ## The source location of the server and the share directory.  
23:  ## In order to mount you should ensure that /etc/nsswitch.conf apears as so:  
24:  ## hosts:     files mdns4_minimal wins [NOTFOUND=return] dns mdns4   
25:  ## The order is important !   
26:  ## and that winsbind is installed -> sudo apt-get install winbind  
27:  ##  
28:  ## If it isn't then you may use the IP address of the local server  
29:    
30:  mountSRC=//nameofserver/sharedirectory  
31:    
32:  ## The local directory of where the shared folder should be mounted i.e. /mnt/myshare.   
33:  ## This will need to be created i.e. sudo mkdir /mnt/myshare  
34:  mountDST=/wheretomount/share  
35:    
36:  ## Finally the command that put's it all together with relvent read and write permissions.  
37:  sudo mount -t cifs $mountSRC $mountDST -o username=$username,password=$password,iocharset=utf8,file_mode=0777,dir_mode=0777  
38:    
39:    

There is however an inherent security issue with this script as it stores passwords in plain text.

I would recommend that the use of a credentials file is used :

sudo nano $HOME/Desktop/CIFSCRED  

All this file should contain is :

 username=yourusername  
 password=yourpassword  
 domain=servername  
   

Press CTRL+X and enter Y and Return to save

The file should then be restricted by using :

sudo chmod 0440 $HOME/Desktop/CIFSPWD  

Finally the original script can be updated to

1:  ################################################################  
2:  #     Author       :   Robert Lutken                       
3:  #     E-mail  :      rolandroid117@gmail.com                 
4:  #     Date   :      Sat, 15-02-2014                      
5:  #     File Name :     nasmount.sh                      
6:  #     Purpose  :      To connect to NAS                 
7:  #     Version      :      1.                           
8:  #     Notes   :     This version uses a credentials file  
9:  #               which should be secured using :  
10:  #  
11:  #               sudo chmod 0440 myPasswordFile                           
12:  #                                          
13:  #################################################################  
14:    
15:  #!/bin/bash   
16:    
17:  myCredentials=$HOME/Desktop/CIFSPWD  
18:    
19:  ## The source location of the server and the share directory.  
20:  ## In order to mount you should ensure that /etc/nsswitch.conf apears as so:  
21:  ## hosts:     files mdns4_minimal wins [NOTFOUND=return] dns mdns4   
22:  ## The order is important !   
23:  ## and that winsbind is installed -> sudo apt-get install winbind  
24:  ##  
25:  ## If it isn't then you may use the IP address of the local server  
26:    
27:  mountSRC=//nameofserver/sharedirectory  
28:    
29:  ## The local directory of where the shared folder should be mounted i.e. /mnt/myshare.   
30:  ## This will need to be created i.e. sudo mkdir /mnt/myshare  
31:  mountDST=/wheretomount/share  
32:    
33:  ## Finally the command that put's it all together with relvent read and write permissions.  
34:  sudo mount -t cifs $mountSRC $mountDST -o credentials=$myCredentials,iocharset=utf8,file_mode=0777,dir_mode=0777  
:
nasmount
nasmount.sh