Monday, September 19, 2016

Blog 2: Algorithms

Ambient occlusion

Ambient occlusion is a way to render shading in a 3D area. This algorithm calculates how exposed areas in a scene should be and create ambient lighting. The Algorithm's goal is to figure out the darker areas of an object. Once it has calculated this then the computer can darken that part of the image to make a simulation of natural light. This is done by finding an "accessibility value" that is calculated for each surface point. This effect does not necessarily create shadows, but instead just darken areas on the surface to help improve a rendered image's tone. This process is normally done as an extra effect done in post processing to help improve the image instead of creating it.

One real time application for this algorithm is computer games, this uses a different variation of ambient occlusion called screen space ambient occlusion (SSAO). This is a much more efficient version of the ambient occlusion algorithm that is able to develop the effect in real time. SSAO was originally invented by Vladimir Kajalin while working on the video game Crysis. It was released as a feature in the game when it came out in 2007. The algorithm is implemented as a shader that gathers the same information as the ambient occlusion algorithm, but saves a value for every pixel. The it calculates the occlusion for each pixel and assigns it a value. This is a very costly method that is extremely inefficient, and would make it impossible to run anything at real time speeds. So to get real time speeds SSAO uses a randomly rotated kernal. A kernal is a method used for sharpening or blurring an image using a small matrix. It does this by using a convolution operation to determine weather to sharpen or blur each pixel in relation to the other to get the desired effect. The random kernal orientation is repeated every N pixels which allows the user to set how extreme of the desired effect the want, and allow different amounts of post processing effect to take place. High quality results tend to be in the area of 16 or less to receive an acceptable effect. Because the algorithm is only processing a portion of the pixels you still receive the desired effect without using as much processor space because not every pixel has to be calculated.

This algorithm is very complicated and could in theory be calculated by hand but realistically you have to have a computer do all the calculations for you. This is because you wold have to do the same calculation for every point in your image which would become very tedious, and be very prone to mistakes.

Ambient occlusion is a Algorithm that will give you a precise output every time. Like what was said in the book " it is a fail safe way to achieve a specific goal". The problem that is frequently faced with this algorithm is that it's a very inefficient way of calculating the desired output. The SSAO is a heuristic that was created from the algorithm that is able to be much more efficient and still recreate mostly the same outcome. it takes only a portion of the pixels and uses that to represent all the ones surrounding it instead of calculating every single pixel like the algorithm does.

I decided to to choose this algorithm for my blog because I have always seen it as an option to turn on when playing video games, and I know that it helped make my game look better. I never knew how it worked and was interested in what it did. I can say that after our lecture in class and reading about it for the last hour I understand it, and I think that is really cool how it is able to calculate the different levels of shading, and help make the image look better.

Tuesday, September 6, 2016

   Hi I am Robert Duff and I am from Leawood Kansas. I have always loved computers, from a very early age I would spend my time playing simple games on my parents computer. My first video game was for the pc, Monster Truck Madness, I played that game constantly. I think that is where my interest for computers and computer science was sparked. Starting freshman year in high school I built my first computer. Since then I have slowly upgraded it to what can truly be called a battle station. Since then I knew I wanted to study computer science. 

   The reason I chose Kansas State to study computer science is because I love the atmosphere, people, and the facilities are all amazing. I feel very welcome here which was an impression I didn't initially get at other schools. I am very excited to expand on my knowledge of computer science here at Kansas State. I still do not know exactly what I want to do with what I learn, but I know it will be in this field. I really like the logic side of programming and enjoy finding a shorter way to doing different things. 

     My family consists of my parents, my younger sister, and myself. My Parents and I enjoy sailing as our main hobby. From a very early age I have been sailing. My Dad bought me my first boat for my 6th birthday. Within 2 months I was able to sail it by myself. When I was 8 I started going to a sailing school near our cottage in northern Michigan that my mom also learned how to sail at. I graduated form that program when I was 16 and have taught as an instructor there for the past 2 summers. I do a  lot of racing with sailing and that is where my passion for the sport is fueled from. I have placed very well at many regattas in the past including 2 state championships. I just recently won my first college regatta last weekend with the Kansas state sailing team that I have helped start this year. That was a very big achievement for me, and I'm really excited to travel to more regattas.

   Another hobby of mine is eSports. I play Counter:Strike Global:Offensive more than I would like to admit. I have been on multiple teams, and competed at Lan tournaments in the area. I really enjoy playing the game competitively and hope to make it onto the team here at K-State in the spring when I bring my desktop to school. I think it has taught me a lot about communication and teamwork especially when working with random people who I do not know. I think that i a really good skill that I have gained from playing so much.

The chapter I look forward most to learning about is chapter 5 Algorithms and Heuristics. Like I said before I really like the logic part of programming and am really excited to learn about that. An online source I check frequently is reddit, specifically r/technology. I really enjoy seeing all the new things invented each day and how they can change the world.