SMAA T2x source code released

SMAA T2x source code released

We’re thrilled to announce the release of the SMAA T2x source code!

We joined forces with Tiago Sousa from Crytek, to deliver a very mature temporal antialiasing solution. It has been integrated into CryEngine 3, checkout the SMAA demo movie.

The goal of SMAA is to more accurately match the results of supersampling, by faithfully representing subpixel features, and by solving other common problems of filter-based antialiasing. This reduces the flickering seen in complex scenes.

On the other hand, we made really big efforts towards simplifying the usage of our shader; the source code is now reduced to a single SMAA.h header and two textures, with very detailed comments and instructions. We hope this will ease integration into game engines. The feedback so far has been very positive, with a Java/Ruby programmer with no experience in graphics integrating SMAA into Oblivion (using OBGE) in just a few hours.

Leave a comment
Top of page

SMAA: Enhanced Subpixel Morphological Antialiasing

We are proud to announce the evolution of Jimenez’s MLAA!

SMAA, Subpixel Morphological Antialiasing

It solves the key weaknesses of MLAA by introducing the following features:

  • Improved pattern searchs
  • Improved pattern detection
  • Diagonal handling
  • Avoiding the general roundness introduced by MLAA
  • And probably the most important: subpixel features.

We’ve decided to release it as a technical report, available here:
SMAA: Enhanced Subpixel Morphological Antialiasing

Please note that some information is outdated (for example the timings of FXAA and SRAA, as they are now faster); we will be updating it in the next weeks. The souce code builds on top of Jimenez’s MLAA v1.5, so we will be posting patches with each improvement we added, with all the nut and bolts details, so stay tuned!

We’ll also be talking a little about it in the SIGGRAPH course Filtering Approaches for Real-Time Anti-Aliasing, we invite you to come by!

Project Page
5 Comments
Tweet
Top of page

Teasing our Real-Time Skin Rendering Advances

These last weeks we’ve been researching a little bit more on skin rendering, and found a really interesting discovery that allows our shader to run in only two passes (as any separable convolution). The results are not the same, but quite close visually! We hope it will be much more Xbox 360 EDRAM-friendly than our previous 6 pass approach, and the implementation is now easier than ever.

The SSS effect is now fully customizable, including the generated gradients colors, the per-channel filter strength and more. We also setup various defines that allows to customize the quality, allowing to adapt the shader to diverse hardware targets. The shader takes 0.27ms@720 and 1.69ms@1080 in the lowest and medium settings respectively, in a GeForce GTX 295 (we used the medium setting for these shots). We are releasing the source code privately to interested game developers, with a public release being scheduled for 2011 Q4.

I recommend looking at the images at their native resolution to better appreciate the details.

Skin 1
On
Off
Middle click to bypass lightbox
Skin 2
On
Off
Middle click to bypass lightbox

I’ll be talking about this in SIGGRAPH 2011, in the session CG in Europe (Wednesday 10th from 11.30 to 12.30, in the International Center, Harbour Concourse). If you are attending SIGGRAPH 2011, I invite you to come by!

The 3D head scan used for the images was obtained from Infinite Realities.

7 Comments
Top of page

Jimenez’s MLAA featured on Digital Foundry and GamesIndustry.biz

Jimenez’s MLAA featured on Digital Foundry and GamesIndustry.biz

Links to the articles:
The Future of Anti-Aliasing (Digital Foundry)
MLAA heads for 360 and PC (GamesIndustry.biz)

Leave a comment
Top of page

Torque 3D 1.1 features Jimenez’s MLAA

Torque 3
No AA
MLAA
Middle click to bypass lightbox

We are proud to announce that our GPU MLAA implementation (Jimenez’s MLAA) will be featured in the upcoming version 1.1 of Torque 3D!

Here you have some sample screenshots that Eric Preisz kindly sent us (to easily compare no antialiasing with MLAA, we recommend opening the images in browser tabs, and keep them at their original resolution):

Torque 1
No AA
MLAA
Middle click to bypass lightbox
Torque 2
No AA
MLAA
Middle click to bypass lightbox
Torque 0
No AA
MLAA
Middle click to bypass lightbox
Torque 4
No AA
MLAA
Middle click to bypass lightbox

This close-up shows the quality of the gradients produced by MLAA, which is one of its strongest points when compared with MSAA:

No AA
No AA
MLAA
MLAA

We encourage taking a look at the Torque 3D demo to see the whole thing in movement. We believe you will be convinced that MLAA has excellent temporal stability!

Images courtesy of GarageGames from the Torque 3D game engine.

Leave a comment
Top of page

Screen-Space Subsurface Scattering

Screen-Space Subsurface Scattering

(Image rendered in real-time)

The new generation of game engines is out there! They are full of new rendering techniques, including classic topics like shadows, water rendering and post-processing, and also more recent techniques such as deferred shading and post-processing anti-aliasing. But there is a rendering topic that has been dormant for a few years, and at last, is being awaken:

Subsurface Scattering

Unreal Engine 3 features Subsurface Scattering (SSS), and so does CryEngine 3 and Confetti RawK. Specifically, these last two engines are using what is called Screen-Space Subsurface Scattering (update: it seems Unreal Engine 3 also uses SSSSS), an idea we devised for the first book in the GPU Pro series two years ago. Given the importance of human beings in storytelling, the inclusion of some sort of subsurface scattering simulation will be, in my opinion, the next revolution in games. Bear with me and discover why.

Let’s start the story from the beginning. What is SSS? Simply put, SSS is a mechanism of the light transport that makes light travel inside of objects. Usually, light rays are reflected from the same point where the light hits the surface. But in translucent objects, which are greatly affected by SSS, light enters the surface, scatters inside of the object, and finally exits all around of the incident point. So making a long story short, light is blurred, giving a soft look to translucent objects: wrinkles and pores are filled with light, creating a less harsh aspect; reddish gradients can be seen on the boundaries between light and shadows; and last, but not at least, light travels through thin slabs like ears or nostrils, coloring them with the bright and warm tones that we quickly associate with translucency.

Now you may be thinking, why should I care about this SSS thing? Every year, advances in computer graphics allow offline rendering to get closer to photorealism. In a similar fashion, real-time rendering is evolving, trying to squeeze every resource available to catch up with offline rendering. We all have seen how highly detailed normal maps have improved the realism of character faces. Unfortunately, the usage of such detailed maps, without further attention to light and skin interactions, inevitably leads the characters to fall into the much-dreaded uncanny valley. The next time you see a detailed face in a game, take your time to observe the pores, the wrinkles, the scars, the transition from light to shadows, the overall lighting… Then, ask yourself the following question: is what you see skin… or… maybe a piece of stone? If you manage to abstract the colors and shapes you observe, you will probably agree with me that it resembles a cold statue instead of a soft, warm and translucent face. So, it’s time to take offline SSS techniques and bring them to the real-time realm.

Some years ago, Henrik Wann Jensen and colleagues came up with a solution to the challenging diffusion theory equations, which allowed practical subsurface scattering offline renderings. His technology was used for rendering the Gollum skin in The Lord of the Rings, for which Henrik received a technical Oscar (awarded for the first time in history). This model evolved to accurately render complex multilayered materials with the work of Craig Donner and Henrik Wann Jensen, and was even translated to a GPU by Eugene d’Eon and David Luebke, who managed to obtain photorealistic skin images in real-time for the first time. Unfortunately, it took all the processing power of a GeForce 8800 GTX to render a unique head.

It was then when Screen-Space Subsurface Scattering was born, aiming to make skin rendering practical in game environments. From its multiple advantages, I would like to mention its ability to run the shader only on the visible parts of the skin, and the capability to perform calculations in screen resolution (instead of texture resolution). Subsurface scattering calculations are done at the required resolution, which can be seen as a SSS level of detail. The cost depends on the screen-space coverage: if the head is small, the cost is small; if the head is big, the cost will be bigger.

The idea is similar to deferred shading. The scene is rendered as usual, marking skin pixels in the stencil buffer. After that, skin calculations are executed in screen space for each marked skin pixel, trying to follow the shape of the surface, which is inferred from the depth buffer. This allows to render photorealistic crowds of people with minimal cost. One thing I love about our approach is that even given the amazing math complexity behind the skin rendering theory, in the end, it’s reduced to executing this simple post-processing shader only six times (three horizontally and three vertically):

float4 BlurPS(PassV2P input, uniform float2 step) : SV_TARGET {
    // Gaussian weights for the six samples around the current pixel:
    //   -3 -2 -1 +1 +2 +3
    float w[6] = { 0.006,   0.061,   0.242,  0.242,  0.061, 0.006 };
    float o[6] = {  -1.0, -0.6667, -0.3333, 0.3333, 0.6667,   1.0 };

    // Fetch color and linear depth for current pixel:
    float4 colorM = colorTex.Sample(PointSampler, input.texcoord);
    float depthM = depthTex.Sample(PointSampler, input.texcoord);

    // Accumulate center sample, multiplying it with its gaussian weight:
    float4 colorBlurred = colorM;
    colorBlurred.rgb *= 0.382;

    // Calculate the step that we will use to fetch the surrounding pixels,
    // where "step" is:
    //     step = sssStrength * gaussianWidth * pixelSize * dir
    // The closer the pixel, the stronger the effect needs to be, hence
    // the factor 1.0 / depthM.
    float2 finalStep = colorM.a * step / depthM;

    // Accumulate the other samples:
    [unroll]
    for (int i = 0; i < 6; i++) {
        // Fetch color and depth for current sample:
        float2 offset = input.texcoord + o[i] * finalStep;
        float3 color = colorTex.SampleLevel(LinearSampler, offset, 0).rgb;
        float depth = depthTex.SampleLevel(PointSampler, offset, 0);

        // If the difference in depth is huge, we lerp color back to "colorM":
        float s = min(0.0125 * correction * abs(depthM - depth), 1.0);
        color = lerp(color, colorM.rgb, s);

        // Accumulate:
        colorBlurred.rgb += w[i] * color;
    }

    // The result will be alpha blended with current buffer by using specific 
    // RGB weights. For more details, I refer you to the GPU Pro chapter :)
    return colorBlurred;
}

The crusade of rendering photorealistic skin does not end here for me. We have been researching the ability of rendering very fine skin properties, including translucency, wrinkles, or even color changes due to emotions and other conditions, which was presented in ACM SIGGRAPH Asia 2010. I will be commenting on every one of these projects, so stay tuned!

I truly believe we are getting closer and closer to overcoming the uncanny valley. In the very next future, I think we will see astonishing skin renderings in games, which will make characters more human. This will lead to stronger connections between their emotions, and those of the players, allowing storytellers to reach the gamers’ feelings and ultimately, their hearts.

Project Page
11 Comments
Top of page

Practical Morphological Anti-Aliasing

It was a year ago when I was talking about games with my big brother. He was telling me how much MSAA was degrading performance in his rig and that he thought that maybe a better solution could be to do some kind of post processing, some sort of blur. By then I believed that it wasn’t possible to obtain anything near to MSAA without resorting to sampling multiple times, that it was impossible. That blurring does just that, blurring, and looks… let’s say… not so good. But now I can see how wrong I was!

It was not much later that we knew of Alexander Reshetov’s MLAA for the first time: this finally opened our eyes (and our mind, btw). Then, we known it was possible to obtain results on par with MSAA with a postprocess. So, what was the problem? It was CPU-based, and a little bit slow to be practical for games. After months of work, we came up with our own GPU-based MLAA, which we called Jimenez’s MLAA.

For those that doesn’t know, MLAA allows to apply high-quality anti-aliasing without needing to resort to multisampled buffers, which is a big advantage in some scenarios, specially for deferred engines. And now MLAA is lighting fast on a GPU! (1180% faster than MSAA in our test rig)

You will find our technique in the GPU Pro 2 book, which can be ordered from Amazon. As the previous series, it comes full of state-of-the-art techniques, so it’s worth every penny spent on it! Also, you can checkout our MLAA project page for more info, including the latest version of the source code.

Project Page
Leave a comment
Top of page

Starting Up at Full Throttle

Starting Up at Full Throttle

Hi all, and welcome to www.iryoku.com!

I’ll be posting around about the development and deployment progress of the game technology being produced here in the Universidad de Zaragoza, which is gaining a lot of momentum lately. Right now, I can’t say much more, but we are researching in very interesting directions, which we hope will materialize into a new line-up of real-time techniques by this summer. Let’s see what happens in the next months, stay tuned!

Hope you enjoy the visit!

Leave a comment
Top of page