Friday, December 31, 2010

Blurred environment reflection

Here is a shader that is intended for real time usage. It takes advantage of passing custom derivatives to the texture lookup function. This is quite useful to produce blurred environment lookups. This enables you to produce more realistic looking surfaces because it allows you to mimic real-world surfaces in a much better way.

Since it is the 31st of December and I am about to dive into the next new year's party I will keep this post short... ;)

Idea:
Create an shader for real time usage that blurs the reflection based on the incident viewing direction.

Different Blurs of the reflection:
  • From inner to outer 
  • from outer to inner 
  • controlled by another texture

Observation:

  • If you take a look at a blurry surface, the reflection gets crisper when you look at it from a grazing angle. I observated this in detail a couple of years ago when I was working at a post production company and we were doing a promotion video for a big steel industry company.
    My colleagues back then told me that I was too meticulous. Maybe I was, but when your passion is building shader graphs its the observation and implementation of these small details that give the extra punch to your shader.
  • Also, reflections appear to have less saturation which, depending on the surface is not true. However, I added a control to the shader that allows you to drive the saturation of the lookup.


Other features:

  • The environment blur can be inverted
  • A constant blur can be applied too
  • Amount of the incident blur can be controlled

Tip:

  • Use the constant blur to shift the incident blur
Find the shader code on the mental images forum

Increasing the intensity of the constant blur (controlled by a texture) can yield
stunning looking corrosion effects. Also the reflection saturation has been
reduced for these screenshots.

Happy New Year Everyone!

Thursday, December 30, 2010

Uncharted 2 Art Direction

As shader artist, you have to work closely with other designers, modelers, art directors all of which have a different view of their profession. When it comes to creating big game titles, I am in awe how good these groups can work together to produce these marvelous wonderlands that take us to new places that don't even exist in the real world.
A friend of mine forwarded me this link that gives insight in the art direction of the game "Uncharted 2". Though I haven't played the game, the document is very interesting and can give you some insight and good inspiration. Take a look.

Art Direction in Uncharted 2

Tuesday, December 14, 2010

The beauty of aliasing

It does not happen too often, but occasionally there is beauty in things that you don't want. What I am talking about is aliasing. I guess that lies in the nature of those who like playing around with visuals. I have to admit that I am one of those persons who get inspiration from things that go 'wrong', but especially in visual arts there is sometimes no real wrong or right. Some people might say 'oh, that looks great' while others will comment that this is the most useless thing that they have seen.
Visuals are a bit like music, taste is also so different. So while I have been testing the shader pack that will be released today or tomorrow on the mental mill forum, I started cranking up some parameters. All of a sudden,  aliasing patterns appeared and that looked quite beautiful actually.
The beauty of aliasing

And talking about visual arts. My very first blog entry featured a fractal shader. I discovered this amazing 10 minute fractal zoom that features some tech-house sound. It might not be everybody's taste. Beauty is in the eye of the beholder.

Fractal Zoom (HD) to 6.066 e228 (2^760) Mandelbrot - (Last Lights On)
http://www.youtube.com/watch?v=foxD6ZQlnlU

Quote from the video description:

For the record, 1 to 6e228 is like expanding a proton to 7000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­000000000000000000000000000 times the size of the visible universe. [...]
(Proton has 1 femtometer diameter, universe has 93 billion light year diameter)
If you were actually traveling into the fractal, you would be moving faster than the speed of light.

Friday, December 10, 2010

Web 2.0 shader

The idea
Seeing all those fashionable buttons and icons on every web page, smart phone etc. I though it was about time to create a shader that can just do this for us: Generate shiny icons. So here is the result:

This is probably one of the most pointless shaders that I have made so far ;) Nevertheless it was great fun to work on. If you have read my previous blog entries you will see that this shader reuses the ideas presented in these blog entries. It is a mixture between rendering a square and circles.

Features:
The shader outputs the color map of the icon, a bump map and a black/white mask for the icon.
A large number of input parameters give you control over the shader: Roundness of the icon, position, size, highlight intensity and highlight color, bump map intensity, just to mention a few. Just play around with it and see for yourself.



The MetaSL code
If you can call yourself a mental mill owner, I recommend to step with the visual debugger though the source code and see what it happening in each step. I tried to make the code as clear as possible and it is full of comments. Nevertheless sometimes looking at the debugger and 'seeing' is far much easier than reading comments and source code.

Here are some variations of the shader. I plugged the bump map into an Illumination_phong node to obtain some crisp highlights that I added on top.

You can download the shader along with the test-icon and a mental mill project from the mental images forum:
Web 2.0 Shader Source
Feel free to modify the shader for your own needs and let me know your feedback or any questions.

Further improvements
As almost everything in life, this shader can be improved by adding a few more features to it. I will leave it as it is right now. Experienced users might want to implement the ideas mentioned below:

  • Make a softer transition for the bump map. The edges are quite hard which leads to aliasing artifacts. It would be better to ramp the normal gently.  
  • The highlight overlay could be tweaked to look nicer. Right now a simple blend between the icon color and the highlight color is performed. Trying some other blend modes might yield a more realistic looking reflection overlay.