Saturday, February 11, 2012

QUADS?!

SPOILERS ALERT. DON'T READ IF YOU DON'T WANT SPOILERS ABOUT EVERYTHING IN THE WORLD MAGIC UNICORN WIZARDS.

Intermediate Computer Graphics - INFR 2350

So last week I wrote about lighting with shaders. I really wanted to work on the shadow mapping question, but it seemed really hard, so I'm putting that one on the back burner for now. I'm going to get it done eventually, but maybe just for fun/GDW, not for experience. So this week I just did a bunch of miscellaneous questions, not really much of a theme.

However  that's not what I want to talk about. I want to talk about quads this week. On Monday I talked with my GDW member Gordon about some of his shadering adventures. He said he got a full screen blur shader done. I thought about the full screen shaders a bit before too, and I couldn't figure out a way to do it since I thought that shaders could only be used on elements, so I wasn't sure how you would make it so that elements around our models would be able to glow or blur. With my limited knowledge of frame buffer objects, I figured it was possible to just texture our scene onto a quad and display that instead. I thought that was dumb, and that can't be how it was done. But Gordon said that that was how he did it.

lolno.

Skip to Tuesday night. We were learning about frame buffer objects in class and the things that could be done with them. Dr. Hogue mentioned that we could apply full screen shaders to the texture generated from the frame buffer objects, and that we could essentially "Photoshop" our scene by using multi-pass rendering and full screen shaders. Seeing an opportunity, I raised my hand and asked: "So do you just draw a quad and texture your scene onto it?".

And he replied: "Yes" and just did that Dr. Hogue smile. You know the one. It's the one he uses when he knows hes crushing the magic our childhoods were built on. All those 3D games we played? Totally just a flat quad.

Nooooooooooooooooooooooo.

Man, it really sucked. From a technical perspective it made sense, and it was totally reasonable and in fact, kind of creative to do so. However from just a games-as-entertainment point of view, I could feel the magic of video games I had dropping another level. Or two.

I mean it's cool. It allows you to texture your entire scene and then re-render every part of it which allows you to do really neat things. Blurring, glowing, etc, all that stuff is essentially just having a full screen texture being run through a shader. It makes the game look cool and modern, and I'm all for cool and modern. But man, quads. Quads.


Damn you purple quad.


Unfortunately my frame buffer objects don't work as intended so I couldn't try any full screen shaders. I figured out a way to replicate a similar result, but it's really hacky and nasty. Regardless, the next day the first thing I did was did was draw a quad on the screen that the was the same size as my viewport, and then textured my scene onto it.

It totally looked fine too. I couldn't even tell that it was a flat plane. Which I guess also makes sense seeing how technically everything on your screen is a 2D image anyways. Once a 3D model goes through the graphics pipeline it gets rasterized as a 2D image on your screen, it's just that it's updated so fast and smoothly that it gives an illusion that it's still 3D. So really, texturing a quad shouldn't be that big of a deal.

But it totally is. My mind exploded and I'm still recovering from like the post-traumatic shock.

I managed to make sure enough of my brain stay unexploded to shader.

I mean, I always kind of thought that if I were to punch through my monitor, I would be able to interact with real 3D objects on the screen. Obviously that's not how things work, but I always just hoped that everything on screen was legit 3D. Now I know I can't actually do that. If I were to punch through my monitor, I would have to deal with the fact that there is a solid brick quad in the way.

:(

---

So a few posts ago I talked about the homework questions in this class. Apparently today Dr. Hogue decided to change the decay system a bit so that it was less soul crushing and just normal crushing. But normal crushing is fine, normal crushing is a walk in the park in game dev.

So now the homework questions have a minimum value of 3/5/8 for easy/medium/hard questions respectively, meaning that questions never run out of value. A few weeks ago I would've loved this change. It would've made it so that I wouldn't have to stress over the fact that I really wanted to get to 65 and that if I wanted to get to 65 I would have to power through them asap.

But now that this changed happened, I have no idea how to feel. A part of me is more relaxed since now I don't have to worry as much for my last batch of points, but at the same time I'm somewhat annoyed that all that work I put into it to get it done so soon ended up not meaning too much. I know, I'm a terrible person, but a part of me wishes that it didn't change >_>

Hm, adjust the numbers a bit and it'll be like the format I blogged about!

Regardless, doesn't really change too much for me. I got a fantastic one extra point, meaning that I just need 12 points for my 65. I already know which ones I want to get done, and my goal is to have 65 by Tuesday.

After that, it's GDW full-time.

No comments:

Post a Comment