Showing posts with label effects. Show all posts
Showing posts with label effects. Show all posts

Sunday, March 20, 2016

Your guide to Antialiasing

If you play enough video games, you know that Antialiasing or AA is a software technique for diminishing jaggy-stairstep-like edges that should be smooth.
Even if you don't, here's a quick image comparison.


I recently discovered an old book of mine where I'd written down the different types of antialiasing and how they compare for my own reference. It was a handy little thing to have so I could know which type of antialiasing meant what (there are a lot of them out there, to be honest), and which ones I should use to get the best looks out of my game without taking a huge hit to performance.
I'm going to take this guide out mostly from what I'd written in that book, so depending on when you're reading this post, there is a chance that some new features might not be covered here. You can find the sources of most of the information here by following the links in the titles.

SSAA or FSAA


SS stands for 'supersampling', FS for 'full scene'.
The entire scene is rendered at a larger resolution, and the edge points from that render are used in the actual scene.

Type : Rendering
Performance Hit : Significant, since it involves upscale rendering.
Quality : Genuinely Antialiased

MSAA


MS stands for 'multisample'.
It is a special case of supersampling where only portions of the scene where aliasing might be noticeable are rendered at a higher resolution, like lines or edges.

Type : Rendering
Performance Hit : Tends to be much lower than SSAA, since upscale rendering is only performed to parts of the scene.
Quality : Looks the same as SSAA except in cases where certain edge polygons might go undetected.

CSAA or EQAA


CS stands for 'coverage sample', EQ stands for 'enhanced quality'.
CSAA is by Nvidia, EQAA is by AMD.
Designed to succeed MSAA, it adds more and better coverage sampling in order to produce quality like MSAA would at higher modes, but at only a small performance cost. 

Type : Rendering
Performance Hit : Slightly higher than MSAA at the same sample multiplier.
Quality : Increase in quality as compared to MSAA can range from some to none at all.

FXAA or MLAA


FX stands for 'fast approximation'. ML for 'morphological'.
FXAA is by Nvidia (but also used on other environments due to its popularity), MLAA is by AMD.
There is no rendering involved here. Edges are detected and directly smoothed or blurred.

Type : Post-Processing
Performance Hit : Least. Cheapest form of AA. (Certain benchmarks indicate FXAA to be faster than MLAA)
Quality : Successfully removes jaggies, but normal textures may also have a blurred quality to them.

SMAA


SM stands for 'subpixel morphological'.
It is an upgrade to MLAA where jaggies are removed with better detection without blurring too much.
In my opinion, this is best form of antialiasing due to its perfect balance of good quality for a low performance overhead.

Type : Post-Processing
Performance Hit : Slightly higher than FXAA. Most efficient in terms of performance to quality ratio.
Quality : Better than FXAA or MLAA. Morphs colors and textures appropriately.

TXAA


TX stands for 'temporal'.
It is a mix of filtering and sampling techniques in order to get the best quality at the expense of performance. It's also designed to remove crawling and flickering from moving scenes.

Type : Post-Processing and Rendering
Performance Hit : Most. Much higher than post-processing methods and might even be higher than MSAA.
Quality : Depends on implementation. Might look like a combination of MSAA and FXAA.

I have, to the best of my ability tried to maintain accuracy in this guide, but despite that if you feel something is out of place or needs to be changed, do not hesitate to let me know.
If this guide helped you, you are welcome, though I have a feeling that it is not going to be long before modern games do away with AA tweaking entirely and make it a standard feature of the game engines that they're built on.
Note : Some types of AA were not covered here because they were either too niche, or there was inadequate information available about them, such as TrAA or CFAA. That was intentional to keep things relevant and informative.

Thursday, December 6, 2012

A record every day

This post is part of the "First Few Old Blog Posts" archive.
You could expect a certain lack of coherency/maturity from these posts.

One particularly interesting fact about my weird life is that I have an obsession with getting stuff done. Even if any work at that point happens to be non existent.
If any day passes by without any significant reduction from my workload/to-do list or any addition to my personal records , then that day is to be considered as a complete waste of time and energy.

Now , if you've read my older blogs , then you'll know that I am an OCD patient. What that means is that I need to consistently keep a track of any work done , any work that shouldn't be done , any work that should be done in the future , and so on.
Out of all these , obviously the most important is to keep track of any work that needs to be done in the future. This is why last year , I furnished a complete To-Do list of every work that needs to be done by me at some point later. As of now , the list stands in 57 points of work that needs finishing. All the points mentioned on the list do not consist of everyday work such as shopping or cleaning the lawn as some might expect , but it is rather a collection of long term projects such as learning Android Development or writing a previously thought out novel.

I hold this list to high regard. Every point noted within demands a lot of time , patience and energy which would in some way or the other benefit me later either by self gratification . or by any other method.
When I look back to my past , I see the transition or marking progress. When I was 10 , I used to see how much I had progressed every year. By the time I was 13 , I measured progress monthly. And now at 15 , I do so in a more or so , daily/weekly manner.

The next point and the most important point is the one presented by the title of this blog.
And that is my commitment to setting records.
You see , every now and then , I attempt activities that are not listed in my to-do list either because they are not important enough or they produce inconsiderable results. Among these , I put forward great emphasis on personal achievements.

What sort of personal achievements you ask?
Well let's say that just today , I got chased by a beggar for the first time , I walked over a sewer bridge for the first time , I tripped over a road divider for the first time and I was ambushed by a group of crows for the first time.

It's just that the possibility of doing "firsts" fascinates me. The fact that I'm doing (or being done) something for the first time in my life gives me a great deal of satisfaction and that is why I deliberately put myself in such situations where such "firsts" are possible.
Like for example , all those "firsts" that I accomplished today , they were the result of deliberately choosing to walk all the way to my friend's house , rather than taking a cab (or an auto in linguistic precision).

This is why sometimes , instead of sitting at home and trying to contemplate on sad and stupid stuff , I sometimes set foot outside my house to get some achievement accomplished.
Just this month , during the Diwali dinner held at school , I accomplished a lot of "firsts".
I took pictures with every girl in my class (except 2 because they did not turn up to the party)
I wore a suit for a good whole of an hour
I confessed to a watchman how hideous his uniform was
I walked 10 meters on my toes and most importantly ,
I ran through every corridor that the school had (a pretty great task considering that the party was held at the grounds implying that every corridor was fucking dark and deserted)

And the most daring firsts were also recorded this very month
I stayed 24 hours without food
I stayed 24 hours without water (on separate days) (dehydration is worse than hunger. I had to sleep more than half of the day to keep myself distracted)
I slept for 20 hours straight
I ate a burger for every hour in a day
And most importantly - I got drunk for the first time (this was just last week and it was just a few simple glasses of beer , nothing to worry about)

So , yup. With all these stuff to do , I take pride in saying that almost every day , I am setting and breaking records. It seems eminent that with so much , soon I will be needing a list to maintain all these achievements , and every achievement that was close to completion and every achievement that should be avoided  , and so on.

So , yup. That is it. In summary , I give high regard to working and achieving. Something that I take pride in.
I know that many of the records as such do not present much moral value and you will dissent in opinion about the necessity of performing such acts , but I assure you that they were all executed in safe environments. The last think I want you to assume is me being a reckless teen. Pssh , me? I barely even get out of my house.

I just think that this is my blog , and it needs to contain any personal habit that needs to be mentioned. Also , I haven't posted a self centered blog in a very long time.


Tuesday, April 17, 2012

OCD Boon or Bane?

This post is part of the "First Few Old Blog Posts" archive.
You could expect a certain lack of coherency/maturity from these posts.

I was rifling through a Wikipedia article about RenĂ© Descartes , supposedly a great patron of mathematics and philosophy when all of a sudden I remembered about something called OCD which I always wanted to know more about. I don't know why I thought of it at that time , but the next thing I knew , I was on Wikipedia again. This time staring at a different title:


Also known as Obsessive Compulsive Syndrome , this is an anxiety disorder characterized by intrusive thoughts that produce uneasiness, apprehension, fear, or worry, by repetitive behaviors aimed at reducing the associated anxiety, or by a combination of such obsessions and compulsions. In short this means that people having OCD often have random/unwanted thoughts/habits (this is common even among other people) , but they feel uncomfortable or anxious unless they carry out their compulsion.
I read on and realized that the description of the symptoms was quite precise , if not exact , with what I did
I never really thought before that I actually had a disorder of such sort. One major symptom of to always keep things arranged and organized in a systematic order. That made sense like nothing ever did. I opened my school bag and stared at the books inside. Not only were they arranged according to height , but also subject-wise. To accept what I had seen and to admit that I functioned a bit differently from others took me some time.

At first , when I started writing this , I originally titled it as 'God isn't really funny'. Seriously , if you look at it , I have the weirdest combination of abilities and disorders. Who the hell will like it they've been informed that they have the ability to learn and cope with new concepts/environments really fast , but on the other hand , they will also have OCD. So that means you'll get the hang of Java in only an hour but you'll take days to write a good enough project on it. Oh yeah , I may have forgotten to mention this - OCD doesn't seem to have any effect while you're learning or understanding new principles. But it haunts you in full measure when you apply them. In this case I consider myself quite lucky that this is one of the only drawbacks to what I have to endure. The main disadvantage is supposed to be that it will be hard to ignore irrational thoughts and anxiety and uncomfort will be felt unless the compulsion is carried out. I don't know if I'm just "used" to this uncomfort but I don't seem to have any problem at all at discarding irrational thought. If the thought , however is completely sane or will deal no harm , then I don't see any reason not to carry it out.

As I read on , I was greeted by more revelations:
The article said that people diagnosed with OCD commonly share personality traits such as high attention to detail, avoidance of risk, careful planning, exaggerated sense of responsibility and a tendency to take time in making decisions.
And all this while I just thought that I was good at covering up my tracks. Ironic as it seems , I have almost never been caught for any offense I made till now. Makes sense now I guess. You will be quite surprised at how I would think about the hundred possible ways I could get caught and then take steps to eliminate them all. Always thinking a couple of steps ahead was my forte.
Within moments , I realized that I had more advantages than disadvantages at my disposal. Take the ability to learn fast and add careful planning and avoidance of flaws , and you will then have attempts at perfection. Only , it just takes twice the time.
At this stage , I would like to assert that the personality disorder characterized by a pervasive pattern of preoccupation with orderliness, perfectionism, and mental and interpersonal control at the expense of flexibility, openness, and efficiency is also known as Obsessive Compulsive Personality Disorder. Although I feel that I have OCPD and not OCD , it is said that symptoms are very similar and since OCD is more widely known , I will stick to OCD for now.

Secondly , this 'careful planning and thinking' allows me to pull out my strengths even in the most hopeless of situations .OCD is probably the reason that I can outline these advantages in the first place. It allows me to first think what is helpful and what is not in particular circumstances and then do whatever necessary to gain the lead. All I have to do now is make sure that I play on my strengths and avoid falling into occasions which are to my disadvantage. If I can somehow make sure that over-thinking , mental pressure and time consumption are not limiting factors , then I will gain the upper hand.

Thirdly , I realized that OCD can come at one certain point of time from several factors. For example , if I start to feel mentally tired when I'm doing some hard thinking , then due to fear of getting too tired I can abandon thinking about it and divert thought to somewhere else. Just now , before I started typing out this paragraph, I started to feel a bit weary so I just took a round in my house thinking about this anime I was watching yesterday before I continued typing the rest out. So this means that if the task at hand proves to be uncomfortable or tiring , then I can choose to divert my concentration on something less trivial.

Alright , for those who are interested , lets step into my shoes and feel how it is to face OCD.
First , OCD can become seriously inconvenient while doing something will full concentration/dedication. In my case , that will be Programming. Writing a one file program is pretty easy (and fun) and will probably make no difference if any other person programmed it. The problem kicks in when the content increases (or the complexity of the logic). Usually  , you keep track of the features to implement in a program. Lets say I've got Login , Chat and a 'Users available list' left to implement while I am programming a Register feature. My mind constantly keeps telling me that you've got 3 more features to finish coding. My subconscious however , delves further into each feature. This tells my mind that I've got to make a prompt system for Login , A userbase to keep track of the users' records , a password checking protocol , keeping track of who logged in from where , etc . Then it goes into the next thing I was yet to do. My mind realizes that to implement Chat , I have to configure socket connection , make a working protocol to send , receive live messages , make sure every username is unique, etc.
This entire deduction builds up and finally gives the illusion that I've got millions of stuff left to do which finally results in headaches or feeling mentally fatigued. This illusion can be intimidating and while you're trying to remember every one of those features that you were going to implement , you miss out on concentration on the actual task at hand and this results in your work slowing down considerably. Unless I don't actually look back and realize that I've actually got just 3 simple features to complete , this mental stress continues.
This can also happen when you're try to read/understanding certain logical components which was programmed by  a person other than you. You're trying to figure out what programming in that particular fashion will result in . You're just trying to figure out what the output of his logic will be. Simultaneously though , your subconscious will question WHY he coded in that peculiar fashion. Although most of the components make sense only at the end of the program , till then you're constantly bombarded with questions like - "why hasnt he used that variable yet?" , "why did he use that specific datatype?" , "why didnt he do something simpler?". This again leads to mental fatigue and slow progress.

Lets take an example more common and more applicable to people on a day to day basis.
Now , if you step into the room of a person suffering from OCD , you will see that every thing is arranged in one order or another. It may not make sense to you but it certainly makes sense to the person who arranged it in that fashion. Most likely , it will also be clean to the last speck. Now , you might think its not a big deal if you just pick up one of those books from that neat pile to read , you'll just put it back later. Now , if you happen to be close to the person , he will not mind. Else , he might tell you to keep that back down. In either case , he will certainly feel a tinge of annoyance. This is not because he thinks you will be careless with his belongings. He is mostly afraid that you will disturb the order in which it was originally arranged and he doesn't want to put everything back again.

To make things clear , let me state this. A person suffering from OCD is NOT aggressive or violent , or acts strange in public. He's just ignoring stupid thoughts in his mind and forming plans , slowly , but a completely perfect one , when done.

Also , everyone , yes EVERYONE has OCD in very negligible forms if they dont have it on a larger scale. Example of this : Whenever you set the TV volume or the computer's volume , most of us , always set it in multiples of 5 if say the volume ranges from 0 to 50. Although you may have set it to 33 once , you will , or at least tend to set it to 30 or 35.

SO , through this , we come to an end of another one of my blogs. God , I can't believe I ruined another one of my blogs with stupid random stuff about me. My promise to you - next time , I will post about a more general topic which will be way more interesting.

I probably bragged out a lot about myself in this blog. I did so with the sole motive that I want to know myself to the maximum. What I'm good at and what I'm not. So forgive me if I bored you too much with how great I am and stuff. I wrote this in a stretch so I'm scanning for typos and grammatical errors. Forgive me if you fall across one.

Alright , so did you like this blog? Do you think it was too long? Any inaccurate information? Do you think that I'm wrong and that I'm mistaking something else for OCD, and that I'm not really suffering from it? Want to share your experiences too? Any specific parts about this blog that you liked? Any other thing you might want to tell me?
Just leave a comment below or email me at arvind@enkrypt.in

Ciao

Quote: "Action is the real measure of intelligence." ~ Napoleon Hill
Another Quote: "I think , therefore I am" ~ Rene Descartes