Thursday, 27 March 2014

Final Stretch

The last week (maybe 2?) of classes is fast approaching and it's crunch time to the extreme. Our studio has to pass the second GDW gate next week, keep working on 3 reports, a sound project, and independent architecture, accounting, and graphics homework. That's a lot to keep track of!

Ambient Occlusion attempt
I tried out some AO in Maya the other day and it turned out pretty sweet. The model was not created by me originally and I hadn't realized that the normals weren't softened first, so it turned out a little liney. I would've done it again (and will do so if it's used in our game) but it took about 15 minutes to render the first time and I had things to do :-P The nice thing about AO, at least in it's most basic form, is that coding it is so easy; just multiply the AO texture by the regular diffuse texture and it deepens the shadows quite nicely. Except for those darn lines!

Assembly... gah
On another note I've also been working in MIPS assembly for my Architecture class. It had.... one hell of a learning curve, I'll give it that. I'm still a little shocked I got it all to work. Basically, I did a whole bunch of research to do this first as I was making a class that accepted an array, size n, and int x. The program goes through the whole array and adds to a sum if array[i] is equal to x. EASY stuff in C++, C, heck even in Flash, but in MIPS it was extremely tricky to wrap my head around for a long while. This isn't all the code obviously but it's the bulk of the for loop and if statement. It was kind of relaxing to work in a lower level code though to just look at something different and try and solve a super simple problem with a lot of hard work, just like coding in C++ used to be when I was learning it.

That's all for this week. Back to working on... everything!

Thursday, 20 March 2014

Sudden Progress!

Finished dragon head (tada!~)
My little pride and joy, this dragon head. I finished it in only like 3 days, so while I'm sure it could have some better geometry a better method of having the jaw open then making it a seperate object I'm super happy with what I came up with in such a short time. I hope to bump map it all over the place as this enemy is going to be nearly the size of the scree and such a detail would really make it pop.

Other than this lovely model I've also been working hard to incorporate normal mapping into our game while accounting for multiple normal maps for different objects. The way I worked around this small problem was by changing what texture was at GL_TEXTURE2 (which is being used for normal mapping) before rendering each individual model. This way the right normal map applies to the right model. There may be a better way of doing it, but this certainly seems to work just fine :-)

Our studio also finally reincorporated the menu we had so long ago but haven't seen in months because of this semesters reframeworking. Now it's back! This week I'm focusing on normal mapping all of our models, even if that means loading them in Mudbox and creating a 'blank' one for our game to load, as well as helping out with the creation of the boss level. Busy week!
but always time for music

Thursday, 13 March 2014

Steady Progress

Tangent Normal Shader
It's been yet another hectic week as I finished up my last midterm (finally!) and have started programming and modelling like mad. I've been trying to focus a lot on some Graphics homework questions to try and get them out of the way and potentially into our game before the end of the month. For the past couple of days I've been working on a normal map shader as seen above. Oddly, I found making one in tangent-space easier then one in object-space, but that must be because no one in online forums has any advice for object-space. Kind of shows how tangent-space is better!

Shader Code~
The code above is pretty simple for creating normal maps, or at least a lot more simple then I would have anticipated. Obviously, the normal of the point is what is affected, which in turn affects how the lighting is calculated for that point. Using the position and the texcoord of each point, the tangent is found pretty easily (credit to imbusy from http://www.pouet.net/topic.php?which=6266 for the calculation of the TBN matrix). In order to return the normal to world-space from tangent-space multiply the Tangent-Binormal-Normal matrix by the normal map that was created earlier in the code. This way the normal map applies to each normal, insuring the light is affected in the way the normal map intended.

Final Boss - WIP
Aside from some rather frantic coding I've also been doing a lot of last minute model work. Above is the dragon head I've been working on as a final boss for our game. I still have to add the teeth to the bottom jaw and sculpt the inside of the lower mouth, as well as whip together a simple texture, but I'm super happy with how the upper head turned out so far! If time allows I'm also going to give him some head armor reminiscent of our main character, but there is a fair chance I simply won't have time. I'm in charge of the whole boss level where the player gets eaten up by this dragon head and spends the level inside his body, dodging bones and ooze while trying to slash at his heart. That's a dragon head, heart, level walls, and falling bones I have to model in about 4 days if you weren't keeping count! I'm up for a challenge but this is a bit much on my birthday weekend :-P

This is the first model I've made with a functional mouth, so it's taking significantly longer than if the mouth was closed. By significantly, I mean I was finished modelling the base after 2 hours before I had to cut it in half and keep going. It's lovely practice though and I appreciate any chance I can get to try something new in Maya, so I'll persevere I'm sure!

Tuesday, 4 March 2014

Long Time No See!

It's been too long~

It's been quite a while since I last posted anything, my bad! I took Reading Week off to study, unwind, sleep; the usual. After that was the week of midterms and I just completely forgot about blogging. I'll try to make it up this week and, now that I've remembered about blogs, I certainly won't miss another one! (we hope)
Mole Enemy
This week I've been pretty busy in trying to create some more content for our game. I mentioned on a previous blog that I'd been working on this little mole guy and he's now fully modeled and textured. I think he turned out pretty good and I'm looking forward to seeing him implemented in the game as the little nuisance I imagine him to be >:]

Bird Enemy (WIP)
 The other one I've been modelling for the past couple of days is just a semi-realistic, eagle-type bird I based off of some real photographs. I plan on texturing him in the same manner as the other enemies to help tie them together; vibrant colours, chunky textures, painterly shadows. He'll probably be a reddish-brown with a bright yellow beak and eyes. He drops things on the player, probably rocks, as he flies through the level and pesters the player. I seem to like enemies that really annoy our poor player, whoops.

Other than these two models, both of which I'm pretty proud of for different reasons, I also recreated the font for our UI and menus so they were higher quality and a little less... curly.
Screenshot of our Toon Shader

Toon Shader Code

Above is a screenshot of our protagonist model being lit with the simple Toon-style shader that our Lead Programmer Mark has been working on. It's not 100% definitely the shader we'll be using, but it looks pretty sweet! I think adding outlines would detract from the aesthetic of the game that we have going so far, so the other option would be a more realistic lighting over this Toon shading. We also plan on adding some form of bloom in game and rim lighting behind the main player, but we will definitely (read: hopefully) having the lights move throughout the day/night cycle that our backdrop goes through. The colour of the light will also adjust depending on the time of day, such as a cool, bright blue for night lighting and a vibrant yellow-white for regular sunshine.

The code is actually stupidly straightforward in how it creates the sharp contrasting shadows. Depending upon the degree of diffuse lighting on an area of the model if it's within a certain range, it's set to one value. ie if the diffuse value of a point is between 0.0 & 0.2, it is set to a factor of 0.2. This makes that sharp contrast between a 0.2 and a 0.5 area, for example, as there are no values in-between that remain visible. The colour of the light is also applied at this stage, and the specular calculated for the shiniest of areas.

All in all, our game is coming together nicely if at a slower pace then I'd like. But it's crunch month! If there's such thing as just the right motivation to finish our game, it would be known as Crunch Month~