Saturday, February 26, 2011

Morphological Anti-Aliasing

This post is going to be a bit technical, but perhaps this angle will also be interesting to some of you.

We are in the process of implementing Morphological Anti-Aliasing in the graphics engine. You may have noticed the jaggy lines - aliasing artifacts - in previously posted screenshots, and MLAA is a method to lessen the problem. With the new deferred shading technique in our renderer, we can no longer use standard MSAA techniques. The two technologies are incompatible.

There is a brute force anti-aliasing solution - supersampling, also known as Full Scene Anti Aliasing (FSAA), but the performance hit is considerable. We will offer supersampling as an option in the game - the scene looks just great with it if you have a powerful graphics card with fill-rate to spare and lots of memory to allocate the larger buffers needed. But we also wanted to make the picture better on middle class or low-end hardware.

This is where MLAA comes handy. It is a very smart post-processing pass on the rendered image, basically selectively smoothing out parts of the image where a smart filter detects a jaggy line. It is not perfect, sometimes it blurs things that would be better left untouched, and it also cannot really reconstruct single-pixel width objects (for example electrical wires in the distance) to make a smooth line out of them like MSAA or FSAA could. But it helps considerably in many situations, and the performance cost is acceptable. You can read more on the method here http://www.geeks3d.com/20101023/tips-what-is-the-morphological-anti-aliasing-mlaa/. It is not our invention, the algorithm was invented by a very smart engineer at Intel.

As the picture below illustrates, the benefits of MLAA can be clearly seen on the big concrete blocks near the camera. However, the technique cannot really fix the problem with the road on the other side of the river just below the castle. The amount of information preserved in pixels of this part of the image is not high enough.

40 comments:

  1. soon there will be any more videos of trucks

    ReplyDelete
  2. It's amazing SCS!
    Beautifull grapichs

    ReplyDelete
  3. Wow, i really like this graphic
    its look so perfect atm.
    good job ceep on trucking.!

    ReplyDelete
  4. Yeah very nice work ! :P

    ReplyDelete
  5. Very nice adition to the game! :)

    ReplyDelete
  6. very good job, this is the best truck game

    ReplyDelete
  7. Can we see some new prefabs?

    ReplyDelete
  8. Did anyone notice the difference?

    ReplyDelete
  9. Nice addition, it really helps as on the pictures and it's a cool alternative for FSAA.

    ReplyDelete
  10. I noticed the difference, if you look ate the first picture you can see the concrete blocks have kind of rough edges and whith the mlaa on they look much much smoother.
    and scs keep up the good work :D

    ReplyDelete
  11. Thanks SCS
    Very interesting post. It is good to understand about the tools used by you and the techniques to improve the game.

    Thanks for keeping the blog updated.

    Greetings
    Rafael Brusque Toporowicz
    São Mateus do Sul - Paraná - Brasil

    www.amocaminhoes.wordpress.com

    ReplyDelete
  12. Hmmmmm - i dont like those bluring AA methodes and hope it's possible to use driver AA too.
    Maybe NVidia can make a driver profile for your engine, but you must they also draw attention make.

    Kamaz

    ReplyDelete
  13. very good, more graphics options in menu mean a better game ;)

    ReplyDelete
  14. I think Kamaz raised an interesting question. Is it hard for a small software company to get in touch with NVIDIA? Or is money involved?

    I trace them drivers release notes regularly, but still miss an entry for your games. Only those of a whole lot of other products. Would love to spot them, one day.

    ReplyDelete
  15. I think if SCS uses the NVidia logo at the game start, NV make it for free :p

    And SCS, please, make those HDR,AO, etc options switchable, so real AA are available with playable FPS.

    Kamaz

    ReplyDelete
  16. I full quote "Kamaz" , its a good idea ;)

    Freddy

    ReplyDelete
  17. normally you say that a picture says it all.
    but excuse me I can not tell the difference .. and I dare to bet that if you make 4 images with different off / on and asked us to tell what was what, no one would guess right

    but sure it is a nice shot were ...
    dannemann

    ReplyDelete
  18. PS: I really love the coast-road in the screenshot!

    Freddy

    ReplyDelete
  19. @dannemann: if you zoom the image you can see the difference..look at the castle and at the concrete blocks ;)

    Freddy

    ReplyDelete
  20. Damn the compromises!

    If I could I rely entirely on visual quality.
    You may remember those people who have invested many euro in a powerful computer! ;-)

    ReplyDelete
  21. Nice job, interesting! When I play your games, I use 16x anti-aliasing, and I am pretty sure that is the quivalent of FSAA. The performance hit is considerable for this as well. If it is, that will be great, becasue my computer deals with 16x quite well. But, what you created is a nice substitute.

    ReplyDelete
  22. HUGE difference between the two. Nice work guys. Nice new vegetation too. If you zoom in on the picture, you can see the difference.

    ReplyDelete
  23. Here's the multiplayer for GTS.

    http://www.youtube.com/watch?v=jUrbUBAOQxY

    ReplyDelete
  24. @dannemann: if you zoom the image you can see the difference..look at the castle and at the concrete blocks ;)okey now i se it but you really have to now what you shut look at too se it . i have to say it , when I have too sit and look at a picture in 5 min. to see the difference. it does not seem important to me. but go for it. my gamepc. will eat it
    but now i have look at the pic. for 5 min i miss some shadow in the (old) trees
    keep it up SCS ..

    ReplyDelete
  25. Very interesting read. Thank you very much and keep up the splendid work SCS Software team.

    ReplyDelete
  26. This is Slovakia? Oravsky Podzamok?

    ReplyDelete
  27. Don't bother with MLAA. ATI cards already have that, and it's not such a big deal. Infact, I can barely tell any smoothing at all in the screenshots here, so obviously it's not as effective as forcing it through CCC.Waste of time IMO. Maybe you can fix the grid like glitches on textures with alpha channels in direct3d game mode.

    ReplyDelete
  28. MLAA a big deal, i lol'd ...
    MLAA are only a "better blur filter", nothing more - you can't compare it with real FSAA!
    Look at other games, they don't have native FSAA support too, like Mafia2 or some UE3 games, there never be any edge smoothed and you got shader flickering ... yeah, what a great deal *roll*


    @ IronArmz

    What profit good hardware, when the engine is limited?
    With mod content this would not better, imo :O)

    ReplyDelete
  29. will the game support the G27????

    ReplyDelete
  30. Great work SCS!!!
    Will there be a post today(Sunday), too?
    Keep up the great work!!
    SCS Software ROCKS!!! Good luck in the future!
    Please add speedbumps at the tolls. Also, will we have to pay to get through the tollbooths?

    ReplyDelete
  31. Anonymous how do you know what's next ?

    ReplyDelete
  32. I want to see the truck and opens the door to get off six dirty truck driver and six year as a reality and if you make it visible accidents

    ReplyDelete
  33. getting into the game and glider iveco otherwise note 9 for the work

    ReplyDelete
  34. Slovakiaaaa :D ♥
    Good Work ScsSoftware !!
    Please make Hungary too !!

    ReplyDelete
  35. You could put in double trailer Euro Truck Simulator 2, so with the following images and http://stcv.com.br/store/37a.jpg as exists in the 18 Wheels of Steel American Long Haul and Haulin.
    Assure that every fan of the Brazilian population trucks will like the idea

    ReplyDelete
  36. Thanks for considering people who don't have the latest hardware in their PCs.

    ReplyDelete

Note: Only a member of this blog may post a comment.