Sunday, February 24, 2013

Game Graphic 6

    Here comes assignment 6.
    This week is unlucky for me. I try this assignment very early because I know that both Maya and Binary files are new to me. However,  I got an eye problem and it make me hard to use computer....

    I want build a nice world at first But my eyes do not support me. Anyway. I had to finish the assignment first. So here just a simple sphere I got it work.
   code
 
 



    When I finish an torus and export it into VS.  I found such a simple polygon  had already contains 400 vertices and 200 faces...... 1809 line code. (Luckily we have Maya, how about the  people finish this when Maya does not exist...)
                                                                       
      I can't imagine how next generation game creating an HDR emulation human face with million polygon. No matter to say the whole game scenes. So may be I should just get a basic understanding of how computer do this for us. And focus on learn game engine  Based on lots of great computer scientist who made powerful engine like Unreal and Cry.

    How to balance my energy to learn Commercial Game Engine and fundamental part of computer science has become a problem now...




   

Friday, February 15, 2013

Game Graphic 5

    Based on Assignment 4

     o_color = diffuse_color*(diffuse_light+float4(g_ambient_color,1.0))+specular_light;

     This is how we do light in computer graphic. Computer science always inspired me in amazing way. Take light here for example. Computer scientist didn't build a source of light(This is what we understood of light and where is light from) in computer, they animate the effect that a point of light, diffuse light, and environment light may caused to a object together to show the graphic.
     They solve the problem on different way, the way usually opposite to us   (at least me). However, it is the unique thinking point that change the world dramatically. Maybe we should keep in mind to try solve difficult problem on different way in daily life. That is the biggest harvest for me.  DX11 may change, shader language  may change or maybe I will change my Job in future. But the knowledge of how to abstract problem to finish it last forever


CODE
Light manual:
 I K J L O P(Z axis)


                                 


Game Graphic 4

 Honestly  speaking , I  believe 10 hours is just enough for me to understood what I should do and how could I do to finish the task.
I spent lots of  time this week to see how my classmates built their I /O  and program structure. From this process  I found how inefficiency my programming is and it is hard to do expansion and code management.
(it is a valuable experience to make such mistake and see how other people do it better)
So I do rebuilt everything and make my I/O systems work in a expandable way.
Similar to I/O system. I realize I should make my parser expandable. So I made Effect parser, Entity parser, Material parser inherited from a parser class in order to do future expansion.


Even though, it is a painful experience to finish such a big structure. But I am glad I had learn lots of knowledge beyond game graphic.

By the way,  I have solved my CADE problems by going to CADE office.  I realize that a directly download link is not only a convenient advance but also take advantage of commercial elements behind a tiny change.


Here are cubes  made by two different fragment shaders


At first I cannot got depth buffer in PIX

With TA's help
m_direct3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
                                           
Code