Post Categories

UDK Static Shadows on terrain

One of my pet peeves with UDK is the surprising quality of shadows as a default on terrain. Seen here is a sequence of images that simply goes over the process of shadows in UDK. I’m sure this is not a mystery to the folk at Epic games, after all the demo games that come with UDK are typically built with BSP brushes and meshes rather than relying on the overhead that comes with complex terrains, and it’s something to take note of.

Some starter info : I’m using a moonlit night, but I have turned down some defaults in UDK.

Under World Settings : I like to turn my Environment color way down, there is simply too much light bouncing around for me. So I set the color dark, and then I set the Environment Intensity down as well. This makes it much more shadowy in my worlds.


For this test environment I’ve also turned off the default exponentialHeightFog, to keep the scene clear. The only thing I am altering in these renders are the lighting attributes on the Terrain.

NOTE : Although I will crank up the resolution of the shadow it is not recommended to do this for your game. This is A SIMPLE scene and merely to DEMONSTRATE the change in shadow quality, but real world tests of your game will show that this will not only be costly in time to bake your shadows, but also will create overhead in your maps that are loaded into memory.

FIRST RENDER : I set up a quick environment to show what shadows of my trees will look like on the default UDK ground. It’s passable, we have shadows out of the gate.


SECOND RENDER : I added a 16×16 terrain to my environment, and added a quick grass texture. There is no height change in this render, so it should be pretty clean. Now, to the new user of UDK this will look pretty promising. This is a render from the Editor window, but it’s deceptive and disappointing. When in editor mode our shadows are dynamic shadows, because they haven’t yet been rendered. To use dynamic shadows throughout our game would be very heavy in UE3 (we’re promised real time shadows in UE4).


Confusing to many who setup a scene in UDK and are seeing great shadows, is the surprise of going into game mode, and seeing your shadows evaporate. The reason can be found in the terrain’s settings. You can see the Static Lighting Resolution is super low, this line and the entry below it are what we want to focus on.


THIRD RENDER : Static Lighting 2 :
This is what the shadows look like after we bake out our lighting. There is simply not enough resolution someplace, so we lose any fidelity in our shadow renders. If we double click on the Terrain, our terrain Attributes will come up, and we can see the default static lighting Resolution is set to 2, and that Override is turned off. (Actually this is a mistake, the default is actually a more discouraging 1 – and that number can not exceed 4 without hitting Overriding Light Resolution. If overriding that number doesn’t make you nervous it should. You have reached a dilemma, and will face quality vs speed issues after that number goes up.)


Now we can start doubling that number to 4 and 8, but our progress making better shadows will be slow. So we jump to Default Static Lighting : 16 However, before you type that in, make sure Overriding Light Resolution : is ON ! Otherwise it will bounce back to 4.


FOURTH RENDER : Static Lighting : 16
In this render we can see a great improvement in our shadows. Remember at this point to Play your game and make sure the shadows are the same as in the editor window.


FIFTH RENDER : Static Lighting : 32
For this demonstration I’m doubling my numbers and keeping them power of two, but this will not be our end game, this is more about demonstration. We are seeing a much higher quality and I could live with this render and get back to other tasks. Still, I want to push it one more notch and see what I get.


LAST RENDER : Static Lighting : 64
A thing to note is that I also turned on specular highlights on my terrain in the attributes, but here we can see a higher quality. It looks good. The trade off will be how much time I am willing to wait for shadows to bake to get better results.


This tutorial was not meant to be an end all on the subject of shadows but I hope it gives guidance to the issue of what happens to terrain shadows, so that someone making a UDK game can consider some of the hidden things about UDK before proceeding too far in design. Shadows themselves are a complicated area, the information will vary for different types of objects. Terrain, static mesh, dynamic mesh all have different requirements. There is also a zone around the player which has dynamic shadows, and may be seen at times as it follows the player through the game, this is because you will have a near area in game you interact with in terms of lighting, casting your own shadow, or using a light that is carried in game).

One thing that is clear, for now in UE3 if you set your shadows to dynamic your game will not likely be able to handle shadows for long, although it will be tempting to use, you need to think smart about how to bake shadows, set up lighting UVs on objects and break your game up to make sure the lighting can still bake. Be careful how much you crank up that number for static shadows while you’re testing.

For the record : I am currently using a Static Lighting value of 10 in my game, but the results in overhead will vary depending on the size of your terrain, and the number of materials you use to paint your terrain. These numbers make my lighting too heavy to bake out daily while developing. I test small areas of my game by keeping my game areas as streaming levels, so that I can test parts of the whole and consider how to make my work, and game more efficient, while still trying to make the game look good.

UDK can be a very intuitive software to use, but shadows are a sticky point in UE3, that will challenge your patience as you wait for scene lighting to bake out. To me the end result is one of the most rewarding but lack of computer power for an Indie developer makes it one of the most challenging to deal with.


Can I coin the word, Un-Corporate, instead of Incorporate?

Incorporate carries so much pressure in this world, you must incorporate to create a business, and businesses are typically about getting bigger, making more profit each year, and getting the goose to lay as many golden eggs as possible. Corporations are usually interested in the bottom line, not the individuals in a company and many companies are guilty of not treating artists well (I’m referring here to the visual effects and gaming industry but the same can be said about many corporations I’m sure. The bottom line is workers at most companies are not part owner of the company, they fill a role and as one manager told me, everyone is replaceable).

I’m not a big supporter of the must grow model. As an artist, the idea that corporations can drive art never seems like a good plan to begin with. The idea that companies think that they can just grow infinitely seems beyond flawed, after all we live in a world with limited resources, yet we have this paradigm that everything must get more profitable (i.e. sell more stuff) every year. Can we really?

Let’s look at the latest criticism of a company like EA games, who won the award two years in a row for worst company. Their focus was on releasing games on time, and making sure no one could hack their games, is how the story goes online and it’s likely true. I’m not saying that they aren’t doing amazing things, but there is a clear focus on deadlines and profitability over all else.

Then there are companies like Mojang, who created the ever-popular Minecraft and have until now resisted the pressure to go public with their company, and I applaud them for not falling into this trap. Go bigger, let someone else own you, and then watch yourself implode when your investors are disappointed with their returns. The day Mojang opens up to the stock market, I’m thinking their days are numbered, or at the very least their creativity will suffer for profitability as the company becomes a true Corporation.

As an independent artist, that likes to make games, write books, and paint I’ve been more about keeping things small and getting more and more personal at this point in my life. For big companies efficiency also means the opposite of what I find I need in my life. Artists perform smaller and smaller pieces of production.

When working at Rhythm & Hues I once proposed we go the opposite way, and put scanners at artists stations, give technical directors zbrush, photoshop and anything else to make us creative. This was not one of my most well received ideas.

I realized over the years, that I’m an artist who likes to work in his studio and have all those things at my finger tips so I can do just that; explore, create, make mistakes and try again. I like being an artist who learns different thing, so yes, I enjoy using game engines, and sculpting in Zbrush and painting in various painting packages. To me the more experience I have, the more effectively I should be able to wield my preferred mediums, but in the corporate art world, this is not a paradigm that typically exists. Artists see one small part of the beast, and as you gain experience you are encouraged to stop practicing the trade to manage teams of artists, until eventually you are cut off completely from the thing that you once did as a creative endeavor, in favor of a pay raise and a title.

I guess the bottom line for me is that I hate to be pigeon holed. I love to paint, and I love to create on the computer, and write, etc, and yet there are some things I miss about working for a big company which is what brings me to the wish to Uncorporate.


What’s missing, in working independently in my studio is my daily interaction with friends and colleagues, creative people.

It’s true, I have sort of a paleo-lifestyle. Not only do I work from home, but we try to foster a lifestyle where we are with our kids, so we home-school, my wife works from her office and this all makes things more complicated I admit. It means working for myself I don’t just have unlimited time in my studio, for now it means my time is somewhat limited, but then again the time I spend in my studio is of my own choosing right now, and that’s a pretty big gift which is in no small way due to the my wife now supporting us as I dabble in various arts, since I quit teaching a year ago.

Once I’m working in my studio though I feel that loss of community that I had at corporations and even teaching. I want to be able to share my ideas, or get feedback on why a particular piece of programming isn’t working. Instead I find myself going to facebook to see what people are up to, and I end up reading five little articles and get completely sidetracked for an evening from my goals.

Now it’s true there are forums I can go to and sign up for. There are Indie gaming communities, there are places like Unity forum and the Unreal Game Forum. These places though are not exactly communities in the manner that I’m hoping for. For starters, I don’t really know who people like “Snake-Man” are. People hide behind Avatars. Hiding behind Avatars means you don’t have to actually connect with people as humans, and it makes it easy to troll sites and knock people down. There’s a lot of trolling on sites, essentially you’ll ask for help on a tricky bit of code, and get a vague and condescending answer which is the equivalent of “fuck off” but not in so few words.

I have just found a writing community here in Boulder. They are real people and not avatars. They get together every two weeks, and this has lead me to my idea of Uncorporating as an Indie game developer.

The idea in essence is to get some like-minded indie game developers together and start my own private forum. It would be a forum by invite only to allow some isolated indie game developers to have a place to find critique and support, and where their work would stay private, not get exposed to the entire web but to a select few that choose to Uncorporate.

The idea of Uncorporating is to share in a way that is not competitive but supportive. I feel that there is some loss working in a vacuum and that independent teams who band together can be more than the sum of their parts, and have a better chance at making creative pieces.

That’s the theory anyway. Look at film-makers such as Guillermo Del Toro. He credits part of his success to bouncing ideas off of people like Alfonso Cuaron. His small group of independent film directors would critique each other, and support each other and I believe it made for a strong group of like-minded directors doing unique works as seen in works like Children of Men, Pan’s Labyrinth, The Devil’s Backbone, Gravity.

So that’s where I am. I’m on the fence, trying to decide if I’ll launch my small forum, to Uncorporate as it were and find some like minded indie developers to form a small community. I’m not sure what’s stopping me at this point, self doubt, fear or rejection surely (why won’t Guillermo Del Toro return my emails?).

My web developer tells me, “If I build it they will come” but I feel skeptical and yet longing for some of that community that I once had around my work.