Tuesday, April 16, 2013

Mirror's Edge Shader Overview in UDK

Hey there!

It has been a while since my last blog post and I promised a few people I'd show off the breakdown of the materials being used in the Mirror's Edge stylized test renders in UDK. First off all, I'd like to point out that the shader is NOT final. Second, I'm just going to show it off this time so I probably won't revisit this when I have a scene modeled out whatsoever. Writing these articles takes a lot of time and hopefully it'll be appreciated ;)

AND I got great feedback from one of the Lighting Artists who had worked on Mirror's Edge! I totally didn't expect that and I really appreciate the feedback I've received. When I was going to post the Shader blog post I didn't expect anything to happen. But the opposite happened, my blogpost got shared plenty of times which was great because it was "just" a shader test.

And why it took so long to write my next article? I just finished up a few art tests, so keep your fingers crossed! It seemed like a good time to write it now. Anyways, I was also experimenting a lot with different shaders. I revisited my old sci-fi scene and created a new ocean shader. Exploring these different techniques is really fun in my opinion and it really intrigued me to go more in-depth with HLSL coding for example.

Revisiting old shader

New metal shader in action - This has vertex painted rust and scratches to add more unique looking details on the metal. This in combination with the DX11 settings in UDK can give a really nice effects showing off the reflections of the environment for example.


What I did first was doing research! When exploring a different render/texture style, doing research is crucial. I've always loved the color usage in Mirror's Edge and I knew I wanted to show this off in my shader test. Also, I wanted to have the ability to create a shader that is specifically designed for a specific material definition. So I created a list of the following materials:
  • Concrete
  • Metal
  • Plastic
  • Tiles
  • Marble (optional)
  • Fabric


The shader overview has straightforward commented areas, A = Diffuse, B = Specular, etc. For optimization sake, I made all the textures greyscaled and added a 3-vector param, With this I can add/tweak the colors and color-intensity of the textures. Orange can now be insanely bright, which you couldn't just create with a single texture node, cranking up the colors is essential to achieve these results. 

What I use mostly in my shaders is a Fresnel, it's not that expensive (anymore) to my knowledge. But what I learned from the guys at Chaos Group (V-ray creators), everything has Fresnel, it might be subtle but everything has it. So I did implement it in all of my materials but as a parameter so adjusting it would be easy.

Tip: Use paramaters instead of "hardcoded" values, tweaking Material Instances is very efficient and handy.


This is the most complex shader at the moment for the Mirror's Edge tribute. I'm not that happy with the shader itself, it's pretty messy and could be using better optimized textures. But the end result is rather good looking and convincing painted metal. I can't really go in depth with the shader, I do want to point out that I'm using DX11. This uses "image based reflections" and I added some cubemap reflections to add in the environmental reflections.

Sorry I didn't go in-depth with the shaders but please look at the setup and it should be pretty clear if you follow the structure.

Weapon scope study

I forgot to add in my weapon scope study ;) High Poly was all done in Zbrush, Low Poly in Max, Texturing in PS.

Games Photography Experimentation

Recently I started messin' around with photography within games, luckily Mirror's Edge happend to be one of the games where I could use the "freecamera" mode. Unfortunately in more recent games I didn't quit got this "hack" work just yet. One of the games I'd like to visit is Bioshock and Tomb Raider, those environments are gorgeous.