Thursday, February 28, 2013

Graphics Write-Up #7

Not a whole lot to say this time around.  Getting transparency to work was pretty easy, just a matter of setting the render state and then actually using an alpha value.  Most of my time this week was spent with getting the sorting code working correctly and coming up with a best as possible way to sort the transparent objects back to front every update.  Oh, and changing files around, but that's getting faster.

Getting the transparency working was awesome, the binary alpha in particular is really sweet.  It was also cool to see how big of a difference sorting the transparent objects back to front made.  You'd inherently think it shouldn't matter at all (since you can see through them!), but when I was drawing them front to back since that's the way I ordered them in my scene file, you could only see the one in front.  It really drove home the lesson.

Now that I'm looking at the 2nd screenshot below I should probably put the Render state code inside it's own PIX event just so it looks a little nicer, but I'll do that for next week since I don't want to go re-upload the code.

I also made sure to go back and fix all the little errors I'd made after getting feedback on Assignment 5.  6 will still have the same issues since it was submitted before then unfortunately.  Summing them up: I normalized the incoming normals to my fragment shaders so specular lighting is working at last.  I also took out my hard coded debugging specular exponent value and now pull it directly from the material as opposed to the scene file.  And....  I think that's everything that was wrong....


PIX events with only one Opaque and Transparent:

PIX events showing Opaque and Transparent expanded:

What it looks like now:



Link to Code: http://eng.utah.edu/~jthummel/graphics/ThummelGraphicsAssignment7.zip

Friday, February 22, 2013

Graphics Write-Up #6

Once again, this graphics assignment wasn't particularly challenging, but it did take a bit longer than I'd expected.  As of class yesterday I'd pretty much finished and had Maya models loading into my renderer.  However, for some reason only certain meshes were working, my original cubes worked fine and the new cone and soccer ball worked fine, but my torus didn't load at all.  This proved to be the most difficult part of the assignment as I'd never worked with binary files before.

I knew that I was writing the file out correctly, or at least I was pretty confidant I was since at first I didn't know how to convert a binary file into hex to verify it.  Once I got that working it became clear that I was indeed writing the file out correctly.  That left reading the file back in as the only issue.  This seemed rather confusing, though, as it was clearly working with some of the meshes already.  I tried using a cylinder instead of a torus, but it failed to work as well.  After talking to Cody during the break in class he helped me spot the error I'd made in my file reader.

The other section of the assignment, sorting all the PIX calls, was very easy, although it's been quite a while since the last time I wrote a sorting algorithm.  I didn't know at the time how to nest the calls, and now that I think about it I should have done that for this submission, but since we're going to be modifying it slightly during the next assignment I'll just make sure to do it then.

Oh.  I also think there's something wrong with my specular lightning, but I haven't gotten feedback on the last assignment so I'm not sure.  All attempts I've made at "fixing" it have done nothing at all though.

Here's the sorted PIX events broken down so that Effect is at the top of the tree, followed by Material and then finally the Entity.


Thursday, February 21, 2013

Vinyl, Prototype Complete!

By the end of Tuesday we managed to complete all our goals for the prototype.  Since last week we modified it so that instead of the static just randomly appearing, they now actually spawn based off the music itself.  One slight problem with this was that before we spawned them far enough away that it was difficult to notice this as well as we'd have liked.  We talked about running two music tracks, one silently that everything spawns off of, and the other delayed slightly so that everything shows up at the right time, but in the end we just spawn everything closer.  It looks great (other then seeing them appear, which really isn't that bad) and it's still possible to dodge everything.  Additionally, Sherly also got the equalizer fully working and it looks great.

We also found a fantastic Unity plug-in for sound manipulation that should allow us to do very awesome things with the game if we get past the first gate.

Today the producers are giving a dry run pitch to Cohort 2 and then Monday night is the big night.  The first gate.  All the prototypes will be pitched and shown to a panel of industry professionals and we'll see which games pass the gate and actually get a shot at being made into a full fledged game.  I think Vinyl stands a very good chance, but I'm still a little nervous.

Friday, February 15, 2013

Graphics Write-Up #5

This assignment ended up taking longer than I expected it would, but overall it wasn't terribly complex.  Most of the work this time around was just making all the new files, but it was really awesome to see the scene load perfectly after setting all of that up.

Getting the ambient lighting in was simple, but the specular lighting proved to be more challenging.  I got the correct equation in, but the light still wasn't showing up for some reason.  After going into PIX it was revealed that this line in the fragment shader:

float3 specularLight = pow( saturate( dot(R, V) ), specularExponent );

was resulting in 0, which would obviously mean that there's not going to be any specular light.  I talked with Sherly about this issue and she said that the same thing was happening with her 8 vertex cube, but that her 24 vertex cube worked fine.  So I made a new mesh for a 24 vertex cube so that each face could have its own normal and poof, it worked just fine.  I wasn't able to figure out why it doesn't work with the 8 vertex cube, but since it is working on the 24 vertex, at least I know my specular lighting calculations work.

Even though we didn't need a screen shot for this weeks submission, it feels weird to post a blog about a graphics assignment without a picture.  So here's my cubes with specular lighting in.  Unfortunately it's really hard to get a good shot with the rotating cubes.  The front and right side cubes are all using specular lighting, although only the 2nd and 4th are using the 24 vertex mesh.

Link to code: http://www.eng.utah.edu/~jthummel/graphics/ThummelGraphicsAssignment5.zip

Tuesday, February 12, 2013

Vinyl Lights and Sound!

Huge progress on the game this week.  We've got songs playing in game and we have the ability to change the speed of it based on the players speed.  So at the optimal speed the song would play correctly as opposed to too fast or slow.  A slight problem with this seems to be that the song is getting warped somehow, so if you speed up/slow down and then return to the normal speed it won't sound right.  We're trying to figure out why this is.

Volume also is full while in the center of the pipe and decreases as you get near the edges.

On top of this we added lasers as another object to obstruct the player.  These act as walls that prevent you from moving side to side in the pipe narrowing the playing field and making it noticeably harder.  As a side effect of adding these we ran into a small bug where the lasers were appearing pointing up into the sky instead of along the length of the pipe.  We currently added this as an additional feature so that there's a mini light show going on in the distance now, it looks pretty cool, especially since it's all based on how the player is moving.

To go along with all of this we added a Score and Speed display to help inform the player.  Speed currently shows an internal value we understand, but we need to convert it to a number that makes sense and we can teach the player about (RPMs).  Score constantly increases, but does so faster if you're in the center of the pipe and going at the optimal speed.

Now we want to make things change based on the music as opposed to just randomly spawning them in the world.  We're not sure if we'll actually have this done in time for the pitch in two weeks, but maybe it will happen.

Here's what it currently looks like:

Sunday, February 10, 2013

Graphics Write-Up #4

This assignment was brutal.  In the end I logged a total of 15 hours on it.  10 of those hours were trivial file parsing code, which was incredibly dull and boring.  The other 5 hours were at least more interesting.

Setting up the light color and intensity was very easy.  I implemented this first before doing anything else so I could see if it was working.  I also did the depth buffer at this point, although I obviously was unable to test it with a single cube.  Once I had the file parsing working, I then had to figure out how to change the code so that multiple objects could be drawn instead of just one.

This was probably the most interesting part of the assignment since I had to really go through all of the code and understand exactly what it was doing.  The code changes really weren't that bad though.  Instead of using a single m_scene object I just made an array of them and looped as necessary.  Initially all I did was wrap the Update, Load, and Release in for loops based on the number of entities in the scene, but this just resulted in a black screen.  

After a bunch of struggling and use of PIX, Sherly helped a bunch by telling me that parts of Update could only be called once, which obviously makes sense.  So I took out the clearing, BeginScene, and EndScene and I finally had three cubes working.

The end result is awesome.  Now all we have to do to add more objects to the scene is change/add files and the program *should* do the rest of it.




Tuesday, February 5, 2013

Vinyl Progress

Today during class we made a big step forward in getting the game to a playable state.  After struggling with it for a while we finally got the player movement down so that the half-pipe movement feels natural and behaves as it does in other games of the same genre.

With that stumbling block down we're now moving forward at full steam.  We've already added in basic enemy spawns for the player to avoid.  Right now they just spawn down the pipe directly in front of you, but eventually they'll ideally be spawning off of the music.  For the extent of the prototype I imagine we'll just randomize where in front of you they spawn instead of directly ahead.

Today we also met with a music PHD student who seems very interested in our game.  Our goal is that he might be able to help create some music for the game and how to tie it in well.

We've still got a week until the dry run presentation, by then we need to have some form of color in the game, but I think we've got most of the core elements in.  It's already enjoyable to play around with, even if only for a short time.  Once it becomes a little more interactive with collisions it should get a lot better.