The one in maya
2013年5月2日星期四
Gamegraphicassignment12
This assignment is focusing on the shadows.
Most of this assignment is the same as the depth part.
I did not solve the problem in my assignment11 so I start assignment 12 using the assignment 11 of Max,as I read the code, I find out the problem in myassignment11 in a minute.
in the render.updata
First I am trying to write all the prosses inside but I soon found out even for myself I couldn't find out which part is the shadow, which part is the depth and which part is the opaque.I get the some idea from Max's code and change it into 4 function.
I think the shadow works good
Code
Most of this assignment is the same as the depth part.
I did not solve the problem in my assignment11 so I start assignment 12 using the assignment 11 of Max,as I read the code, I find out the problem in myassignment11 in a minute.
in the render.updata
First I am trying to write all the prosses inside but I soon found out even for myself I couldn't find out which part is the shadow, which part is the depth and which part is the opaque.I get the some idea from Max's code and change it into 4 function.
I think the shadow works good
Code
2013年4月13日星期六
Assignment11
Assignment11
I think this assignment is very like the assignment 10,almost used the same thing to do it, but I have some problem to show it on the screen, my screen is like all grey.
I am trying to figure out what happened in Fix.
code
I think this assignment is very like the assignment 10,almost used the same thing to do it, but I have some problem to show it on the screen, my screen is like all grey.
I am trying to figure out what happened in Fix.
code
2013年4月12日星期五
Assignment10
I really don't know my assignment 9 is right or not, so this time I used Max's assignment 9 to start my work
Add a new Effect include new VertexShader and FragmentShader
In this time we need another pair of VS and FS, because we need it for the depth texture.
This is screenshot
Here is the code
Code
Add a new Effect include new VertexShader and FragmentShader
In this time we need another pair of VS and FS, because we need it for the depth texture.
This is screenshot
Here is the code
Code
2013年3月22日星期五
assignment08
Assignment08
At first.
Because I do not sure I have done the assignment 7 correctly so I use Max's assignment 7 to finish my assignment 8 and 9
And this is it looks like in assignment 8
By reading the code of Max, I think I learn more than to finish the code, especial the part reading files and the whole structure. I can say it is clear and beautiful.
Run out of time for write_up
I will have dinner first,I am sorry to say this,but I did not eat breakfast and lunch. It will update soon,
Code
At first.
Because I do not sure I have done the assignment 7 correctly so I use Max's assignment 7 to finish my assignment 8 and 9
And this is it looks like in assignment 8
By reading the code of Max, I think I learn more than to finish the code, especial the part reading files and the whole structure. I can say it is clear and beautiful.
Run out of time for write_up
I will have dinner first,I am sorry to say this,but I did not eat breakfast and lunch. It will update soon,
Code
2013年3月8日星期五
GameGraphics7
This assignment we need to create three new effect,
Effect
1.partially transparent Effect
This effect is to present the materials like glasses, so we need to send transparency to the fragment shade to let it know.
2. alphabinary Effect
I had used the clip() to ignore the part which is under 0.5
The former must be done before in the latter or you will not get the effect you want.
I had used the clip() to ignore the part which is under 0.5
_________________________________________________________________________________
3.the additive effect
I get very confused in this part, and then, I found out it just need to set the render state to the right one.
Sorting
sort the list to draw,We need to separate the our entities into two part, one part do not need the Alpha blending like the normal object and the one using Binary Alpha
the other part need Alpha blending,like Additive material and the Partially transparent material,
2013年3月1日星期五
GameGraphics6
In this assignment, I think most challenging thing to me is to read the binary data.I did not work with binary data before.
And the link in the email helped a little bit.It talks about the way to output.
http://www.cplusplus.com/doc/tutorial/files/
And I add the maya_export as a tool into my solution.finished it first.
Then got three shapes in maya, just cone, cylinder and ring.
I went to the TA hours to get some help from Jin Cui
First I finished the shapes in maya,just cone, cylinder and ring and output into meshes.
This works good
And I changed the MeshBuilder to let it changed the file to binary data and it can be faster to read.
And then I changed the MeshReader to read the binary data.But I can not get index
correctlly
Here I fixed it just now, Right now it can work well to show four meshes on it.
This is the screenshot
And the link in the email helped a little bit.It talks about the way to output.
http://www.cplusplus.com/doc/tutorial/files/
And I add the maya_export as a tool into my solution.finished it first.
Then got three shapes in maya, just cone, cylinder and ring.
I went to the TA hours to get some help from Jin Cui
First I finished the shapes in maya,just cone, cylinder and ring and output into meshes.
This works good
And I changed the MeshBuilder to let it changed the file to binary data and it can be faster to read.
And then I changed the MeshReader to read the binary data.But I can not get index
correctlly
Here I fixed it just now, Right now it can work well to show four meshes on it.
This is the screenshot
2013年2月22日星期五
Assignment5
This assignment we are focusing on light.
Ambient Lighting
Specular Lighting
This is also we talk on the class
diffuseColor * (diffuse lighting + ambient light) + specular lighting
I saw the my classmates work and learn from there to make the our mesh in with 24 vertexes so ,each face will have their own normal.
the code
Ambient Lighting
Specular Lighting
This is also we talk on the class
diffuseColor * (diffuse lighting + ambient light) + specular lighting
I saw the my classmates work and learn from there to make the our mesh in with 24 vertexes so ,each face will have their own normal.
the code
Assignment4
At first I must say something as sincerely advise to myself and to the people will read this.
Do not use a MacBook with a broken DVD driver and Never let the power down when the windows 7 is updating.
The code
Do not use a MacBook with a broken DVD driver and Never let the power down when the windows 7 is updating.
Or you will get the result like this.
This week we talked about the depth and the other part of lighting.
I think I have a better understand of this assignment, because I did it twice,Haha.
To be honest, this assignment took me a lot of time,I think it costed about 20 hours for me,( I mean just once) it almost rebuild the whole thing before, and it is not so difficult but it takes time.
I know why we did this, it can help us a lot when we want to use another texture but the same rendering way, or in other case.
I used some Gundam texture which is my favorite animation, this made me feel very happy.
Here is the screenshot
And this is the screenshot in the PIX of the depth buffer
2013年2月1日星期五
GameGraphics 3
This time we talk about how to rendering texture on our cube,
The most important part need to be change is about our struct of vertex
D3DDECLUSAGE_TEXCOORD part need to be add into our vertexElements.
We also talk about lighting.For now we just ignore the reflecting light.
We use the cosine value between the norbal and the light to control the light
The screen cut
in Pix
The code
The process of our graphics work
I want to do this because every time we talk about this will make us embarrassed. I just want to answer the question easier.
The process of our graphics work
First we send the vertex data and the how they connect together to be several triangles (the index data) to the vertex shade
There are two main purposes of vertex shader, and the vertex shader will do what we want(as we program),it will output in two part: 1.the position data to the graphics board. 2 the second part is the data we want (anything).This part we will deal it with the fragment shader. For assignment 2 we output the data of color want the fragment shader do the interpolation for us
The fragment is some potential pixels. The graphics board will deal with the position data to decide which fragment to be shaded.
The data output from the vertex shader(the part what we want)will be send into the fragment shader. The graphics hardware does interpolates the output of the vertex shader, and the values we get as input to the fragment shader are already interpolated.
Image is 2D array pixels.
varying data is different in one draw call
Uniform data is the same in one draw call
Now we have two kind of data send to the fragment shader the varying and the uniforms.
Varying and uniform data is available to both the vertex and fragment shaders. Uniform data is set the same way (we actually do this in our code: seconds elapsed is set in both the vertex and the fragment shader). Varying data in the vertex shader is sent by us in our vertex and index buffers, and varying data in the fragment shader comes from the interpolated output of the vertex shader.
The texture is one kind of special uniforms. Texture is 2D dimension array data.We send it into device.
The reason why we use the texture.
When we only have a single triangle, we only now it is a individual fragment.If we want some visual thing on it, we have to do texture coordinate to know where to sample the texture. We do this in vertex shader using the varying data which gives us the specifics coordinates to put our texture.
P.S Light is another kind of uniforms
The transformation
To know the position to output to the graphics board we need to do the transformation in the vertex shader.
We have different kinds of spaces
The first space is the model space where we pass our varying data in.
Model space is origin position of the model and facing forward.
Then we do the transformation
model space to the world space
World space: the models can be anywhere of the world and can face anywhere.
world space to view space
View space: the camera is at the origin position and facing forward.
At this step we move the whole world let the camera is at the origin position.
view space to Projection space
Projection space: It is a 2D space which we take a 3D view of camera and project it to 2D. It is like we holding a paper and say this is what we want to captrue.
2D coordinates is the projection position.
The most important part need to be change is about our struct of vertex
D3DDECLUSAGE_TEXCOORD part need to be add into our vertexElements.
We also talk about lighting.For now we just ignore the reflecting light.
We use the cosine value between the norbal and the light to control the light
The screen cut
in Pix
The code
The process of our graphics work
I want to do this because every time we talk about this will make us embarrassed. I just want to answer the question easier.
The process of our graphics work
First we send the vertex data and the how they connect together to be several triangles (the index data) to the vertex shade
There are two main purposes of vertex shader, and the vertex shader will do what we want(as we program),it will output in two part: 1.the position data to the graphics board. 2 the second part is the data we want (anything).This part we will deal it with the fragment shader. For assignment 2 we output the data of color want the fragment shader do the interpolation for us
The fragment is some potential pixels. The graphics board will deal with the position data to decide which fragment to be shaded.
The data output from the vertex shader(the part what we want)will be send into the fragment shader. The graphics hardware does interpolates the output of the vertex shader, and the values we get as input to the fragment shader are already interpolated.
Image is 2D array pixels.
varying data is different in one draw call
Uniform data is the same in one draw call
Now we have two kind of data send to the fragment shader the varying and the uniforms.
Varying and uniform data is available to both the vertex and fragment shaders. Uniform data is set the same way (we actually do this in our code: seconds elapsed is set in both the vertex and the fragment shader). Varying data in the vertex shader is sent by us in our vertex and index buffers, and varying data in the fragment shader comes from the interpolated output of the vertex shader.
The texture is one kind of special uniforms. Texture is 2D dimension array data.We send it into device.
The reason why we use the texture.
When we only have a single triangle, we only now it is a individual fragment.If we want some visual thing on it, we have to do texture coordinate to know where to sample the texture. We do this in vertex shader using the varying data which gives us the specifics coordinates to put our texture.
P.S Light is another kind of uniforms
The transformation
To know the position to output to the graphics board we need to do the transformation in the vertex shader.
We have different kinds of spaces
The first space is the model space where we pass our varying data in.
Model space is origin position of the model and facing forward.
Then we do the transformation
model space to the world space
World space: the models can be anywhere of the world and can face anywhere.
world space to view space
View space: the camera is at the origin position and facing forward.
At this step we move the whole world let the camera is at the origin position.
view space to Projection space
Projection space: It is a 2D space which we take a 3D view of camera and project it to 2D. It is like we holding a paper and say this is what we want to captrue.
2D coordinates is the projection position.
2013年1月25日星期五
GameGraphics 2
This time we talked how we can render out a 2D image from the 3D shade.
we start form Model space change it to the World space where the object really are.
Then get it to the view space which means the camera view. It always facing forward, if we want to move it,We just change all the objects to the negative direction.
At last we change the view space to the project space. The project is a piece of paper which we put in front of our camera (wherever we want).
When we want to move our object we usually change the rotation first and then do the translation
To finish the assignment
First Add the Index Buffer into code just like the vertex Buffer, I just change the vertex Buffer code to Index Buffer's
Add Mesh and Camera files
Add transform_modelToWorld, transform_worldToView,transform_viewToProjected
This is screen-cut
updata
2013年1月18日星期五
GameGraphicsYang Assignment1
This is Blogger just for showing what I have done on the GameGraphics Class,Maybe very boring.Just for recording
The mesh data from the text-file
this part confused me a lot
I think the way to load the data from a file is using this part of code, but every time I build I can not find out my Meshes folder from my Data folder.
I think I need to change this part of the AssetList.lua file, but it did not work well
Here are screenshots of debugging the vertex shader and pixel shader in Pix.
The mesh data from the text-file
this part confused me a lot
I think the way to load the data from a file is using this part of code, but every time I build I can not find out my Meshes folder from my Data folder.
I think I need to change this part of the AssetList.lua file, but it did not work well
I still work on this.I want to say it is my fault I thought this will be easy to do.
Update of The Assignment-1
I know this took a lot of time but worked it out by myself and learned somethings is good.
This is a sample which help me to read the txt file give the idea how to do our assignment
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
const int Money = 10000;
struct Patrons
{
string name;
double money;
};
int main()
{ ifstream inFile;
inFile.open("demo6_9.txt");
if(!inFile.is_open())
{
cout<<"could not open the file \"demo6_9\"\n";
cout<<"program terminating!\n";
exit(EXIT_FAILURE);
}
int num;
inFile>>num;
cout<<"the number of Patrons is :"<<num<<"."<<endl;
inFile.get(); .
// string name;
// int money;
Patrons *pt = new Patrons[num];
if(inFile.is_open())
{
int i;
for(i=0;i<num;i++)
{
// inFile>>name;
// inFile>>money;
// pt[i].name = name;
// pt[i].money = money;
getline(inFile,pt[i].name); //读取一行输入
(inFile>>pt[i].money).get();
}
int k=0;
cout<<"Grand Patrons:"<<endl;
for(i=0;i<num;i++)
if(pt[i].money >= Money)
{
cout<<pt[i].name<<" "<<pt[i].money<<endl;
k++;
}
if(k==0)
cout<<"none.\n";
cout<<"Patrons:"<<endl;
if(k==num)
cout<<"none.\n";
else
{
for(i=0;i<num;i++)
if(pt[i].money < Money)
cout<<pt[i].name<<" "<<pt[i].money<<endl;
}
}
inFile.close();
delete [] pt;
system("pause");
return 0;
}
This is what it looks like
Here are screenshots of debugging the vertex shader and pixel shader in Pix.
订阅:
博文 (Atom)

























