Friday, March 22, 2013

Graphics Assignment 9

I was thinking that this assignment is really easy and it is true indeed. But I could not complete the second part of the assignment properly even after trying hard for a long time.

The first part of the assignment was to  create reflecting surfaces.

I used environment maps for doing so. I used the DirectX's texture tool to create Environment Map. 




I used this environment map to be sure that I am doing all the steps correctly. I could have have created different fancy environment maps but for the assignment I stuck to this one.

I used the camera position to find the vector between the fragment and the camera. Then using the reflect function, I found the reflected vector which was used to look up in the Environment Map to find the exact color for the pixel.

I was done with this part pretty quickly.

The next part was to create different render targets and create some fancy effects. For example, making the translucent objects to have the refraction like feel or magnification. 

The steps were:

1) During Initialization, create a copy of the back buffer.
2) Create a different render target (i.e. the back buffer won't be used for storing the information)
3) Draw all the opaque objects (This information will be written to the user created DirectX surface)
4) After drawing the opaque objects, the back buffer should be set as a render target again.
5) Copy all the information from the user created DirectX surface to the back buffer.

After this step, we have all the information about the opaque objects in an image which will be used by the translucent effects to create fancy effects.

6) Draw the translucent objects.

I thought of another way to do it which would be to:

1) Keep the back buffer as the render target
2) Draw all the opaque objects
3) Copy the back buffer data to a texture which will be used by the translucent objects for creating effects
4) Draw the translucent objects

By doing this, we would not have to change the render targets and the work will be done.

Unfortunately, due to a few problems ( which are unknown right now ), I was not able to exactly do what I intended to. But I will look into it and completely it later.

Here is the Pix screenshot and the Screenshot of the renderer.




Friday, March 15, 2013

The Judgement Day

After so much of hard work for more than a month, everyone was waiting for the decision. We wanted to know which were the games that got selected. We came to the lab at 9 in the morning. Our EPs (Professors) wanted to make sure that they were on the same page. So they were LATE :P. We all wanted to relieve our pressure. What could help more than a game of League of Legends? So all of us started a game of league.

After a while, Roger, Bob, Mark and Craig arrived. We all sat in the presentation area and all of them started talking about how they felt about the pitches and all the games. They said that they spent hours talking about the games and finally they revealed that two games out of the four presented, were gonna go ahead. After that they asked each team about the responses of the industry panel about their game and what exactly each team felt about that.

Now was the time for the big announcement. The two games that got selected were VINYL and THE CO-SIGNERS. It was a happy moment for me. I wanted to jump in the air but at the same time, I was feeling bad for the other games that could not make it. Everyone in the cohort did an fantastic job of creating an awesome prototype and putting forward some awesome pitches but unfortunately, only two games were gonna go ahead.

After this announcement, they told us that everyone in the cohort can choose whichever team they want to join and we were given time till Tuesday for making the decision. Most of the team was pretty much decided on the same day itself.

Now our new team for THE CO-SIGNERS includes me, Chris, Max, Nikhil, Kiran, Sagar, Saurabh, Aaradhya and Yang as Engineers, AJ, Andrew, Zac and Jake as Producers and Damean as our Artist :).

I am very excited to see people playing this game when we complete it. Right now, we are finalizing the details and we are gonna complete an Alpha version of the game till the end of this semester. Hard work ahead. Hope it pays off :D.

Let me tell you about The Co-Signers :D

THE CO-SIGNERS


It has been a long time since my last blog post about the games we pitched and the games that got selected for Gate 1. Now I will tell you about my experience as I started working on our prototype for Cellblock.

Our final team who was working on Cellblock for the Gate 1 included me, Max, Nikhil, Chris, Kiran and our great team of producers, Andrew, AJ and Zac. I was very happy with my team. All of us were really excited to make an awesome game. The idea of an Asymmetric couch co-op game was something different and exciting. So our team started working on it with full force.

We started our first day with physical prototype of the Game focusing on the stealth mechanism and communication between the two players. Initial premise of the game was a Hacker helps a Prisoner to escape out of a high security prison. The hacker can hack the security cameras, get to know the position of the prisoner using the security camera footage and eventually, guide the prisoner to take proper decisions while the prisoner tries to dodge the security guards and other security threats on the ground.

Here's the video of our physical prototype

This physical prototype was followed by a week of brainstorming sessions. We came up with a few mechanics for both sides of the game. The mechanics that we came up with for the first-person view player did not suit the theme of the prisoner. We wanted the first-person guy to have some high tech gadgets like tracking bugs, mobile cameras and other similar stuff. A prisoner would not have all this if he was trapped in a jail. So we thought of moving away from the Prisoner-Hacker team to something else.



The Prisoner-Hacker theme was followed by a Thief-Hacker theme but even that too did not stay on the table for long. Then during our next stand-up meeting, Andrew told us about the theme that he thought of during the weekend. So the theme was that two graduate students infiltrate the department of education for resetting all the student loans. So we thought of the name THE CO-SIGNERS!!!

After the theme and the mechanics we decided, we started working of the prototype in Unity4 with full force. Me and Kiran were working on the Point Man's mechanics whereas Nikhil, Chris and Max were working on the Hacker's mechanics. Max also managed the networking between the two parts of the Game.

Me and Kiran working on the Point-Man's mechanics

Chris, Max and Nikhil discussing the Hacker's perspective

Specifically, I started my work on the Mechanics with implementing the doors properly, viz. Opening and the Closing of doors. The doors that I implemented for the prototype were the old-school Doom or Wolfenstein style doors which open and close side-ways. 

My next task was working on the AI, i.e. movement of the guards in the world. I used Unity4's NavMesh for implementing it. Andrew gave me the guard paths and I assigned those patrol paths to the Guards. We thought that if the Point-Man is seen by the guard then that is the end-state for the prototype. So me and Max added a vision box for the guard and that was all about AI for the prototype.



Both sides of our prototype were coming through nicely. Max had figured out the networking stuff in Unity4 in the first week itself. He continued managing the networking till the end of the prototype. We had a few playtesting sessions and added a few mechanics that we necessary for the prototype.

This prototype had to pass through Gate 1 for making it into a complete game. Industry panel was going to judge our games and give some suggestions about the game. The games shortlisted after this gate were gonna be made into complete games. Before the final industry panel meeting, we had our demo presentations. For this presentation, everyone worked really hard. 

Before the Gate 1, we had a major question in front of us. Whether to show a video of the game being played or to show a live gameplay demo? Our prototype had a few game crashing bugs which would show up once in thousand times. We tried our best to find all the bugs and resolve them before the Gate 1 presentations. While this was being done, deciding which way to go was still a question. After our first demo presentation all of us decided that we will have a live gameplay demo. A gameplay demo was really necessary for understanding the core of our game which was the co-operative tension between the two players. If this was not showcased properly, our prototype and the presentation would have lacked the most important idea that we wanted to convey.

It was Saturday and our industry panel presentations were gonna be on the following Monday. All of us met in the lab on Saturday and we were working on polishing the presentation. Few of us worked on the Game Demo while others worked on the presentation. Collective effort of Chris and AJ created an awesome video which was gonna place the plot of our game during the presentation.

On Monday, all of our cohort helped is setting up and cleaning the lab for the BIG EVENING.

Studio Setup

Members of Team Hack 'n' Hide Setting up the presentation (From left - Zac, Me, Andrew, AJ and Chris)
Everything was set to go. Our team, all pumped up. Andrew, very nervous :P. We wanted to be the first ones to present because we were the one group which had 10 different technical things that could fail. Two projectors, HDMI switchers, Live Gameplay Demo are the few things that I can mention. 

Finally the presentations started. Here's the video of our presentation.


Lot of the industry professionals mentioned their concerns about the scope of our game being too big. We knew this could come up and this was one of the other reasons that we wanted a Live Gameplay Demo. We wanted them to know that we have done so much in the span of 5 weeks and we could do a lot more if we get an year. Some of them encouraged us by saying that if this is done in a right way, we could pull this off.

After all the presentations were over, we had to wait till Thursday to know which games were going to go ahead. All of us wanted The Co-Signers to go ahead. All of us were really passionate about this idea and could work really really hard for making this game. But we had to wait till Thursday to know what was gonna happen with the Co-Signers.

Wait for the next post to know what happened with THE CO-SIGNERS :).

Sunday, March 3, 2013

Graphics Assignment 8

I have started loving this class. The things that we are doing are getting interesting every week. Yesterday I was going through my blog and saw all my post from assignment 1 till 7. We started with drawing a rectangle on the screen in 2D space, then we created a cube in 3D space, added a texture to it, added diffused light, added specular light, created transparencies and now, we added normal maps. Things looked better than what they were in the previous assignment.

In this assignment, I was very clear about the concepts for adding the normal maps. So it did not take long for me to complete the assignment. This time we had to add to textures to a single Mesh, one for the diffused map and one for the normal map. The normal map basically gives the information about the normals to the shaders, hence giving a mesh a visual feel as if it was not a flat surface.

With the normals that we already got from Maya, we also needed to take the tangent and the bitangent information. We used this information to create a Matrix which will convert the normals from Texture Space to World Space. After we get the normal information by multiplying the normal in the texture by the matrix, we can use it in a same manner as we did before.


Here is the Grafitti Image for which I gave a wall texture as normalMap and the Soccer Ball image for which I gave the RaisedSucken Image as normalMap.


Here are the diffused maps and normal maps that I used.


Controls for moving the Camera:

W - Up
S - Down
A - Left
D - Right
E - Forward
C - Backward

Controls for moving the light:

T - Up
G - Down
F - Left
H - Right
Y - Forward
N - Backward


Friday, March 1, 2013

Graphics Assignment 7

I loved every bit of this assignment. It was really amazing to see how different blending modes worked for transparency.

I approached this assignment by setting the ALPHABLENDENABLE to True. Then I just changed few alpha values for the Meshes and I ran the program to see how it looks. So it did show some transparent surfaces. For doing so, I had to research a little bit the Render States. Sagar was little ahead of me in this part. So I took his help also in understanding the render states.

After doing this, I targeted each effect on its own. I created each of those effects one by one and tested them. I started with Additive because it was the easiest of the other transparency effects.

According to my understanding, ADDITIVE effect just adds up all the colors that have already been drawn on the screen at that particular pixel position.

SRCBLEND and DESTBLEND is ONE for ADDITIVE effect.

Then I moved to Partial Transparent Effect. For partial transparent effect, I took the alpha value from the material file. I set this Alpha value as a uniform so that the shaders can use it. Using this alpha value, I set the alpha value for the fragment and then GPU did the rest of the work using Render States.

SRCBLEND is SRCALPHA and DESTBLEND is DESTALPHA for PARTIAL TRANSPARENT effect.

Lastly, I worked on the Binary alpha. I created an Alpha map using an image of my favorite football (soccer ;P ) club. I got this image from google and then I deleted the background. I used this image for taking the alpha values for the shader. Then I used the clip function to clip of the unnecessary fragments.

 We set the ALPHABLENDENABLE to false in the case of BINARY EFFECT since we take care of it manually in the shader.

It was very important to sort the Entities from back to front because for creating transparent meshes, the Meshes in the back have to be drawn first.

But I divided the Entities into two different list. One for Opaque Entities (the color of the pixel depends only upon the current value of the fragment) and Translucent Entities (the color depends upon the pixels already drawn).

For optimization purposes, the Opaque Entities are sorted in the way mentioned in the last assignment.
For accuracy purposes, the Translucent Entities are sorted based upon the distance of the Entity from the Camera (descending order).

Here is the screenshot of my scene.





Below are the screenshots from Pix with Events.



Here is the link to my code: Download Code