An acquaintance of mine, Sahak, found me with an interesting challenge: he wanted me to get his “Virtual city of Oslo” map to a presentable form.
He imported simple buildings from City Engine to UDK and made a map of the city.
Problems with the City Engine -> Unreal Engine asset pipeline and the sheer scope of the project led to an interesting task specification:
- The city barely fits Unreal’s “world", which is a roughly 10x10 km area.
- 4188 unique buildings made up the city. No instancing at all. Each building had its pivot at the world origin.
- No textures or proper UVs.
- I had 48 hours to finish.
After the two days, I came up with this:
Virtual Oslo flythrough.
(HD version on Vimeo.)
The more technical, “behind the scenes” stuff is after the break.
A programmer bailed out on me, so now I have to do his job as well. ![]()
Not that I mind scripting, but it doesn’t make the development of GViz any faster…
Also, writing the PSA/PSK exporter for modo is a task way out of my league. So, kind reader, if you are interested in this paid job (even after reading the specification), then please drop me a mail.
Better news is that I’ve just received the final concept art of Nat, the base character for GViz:
He will play all roles in the system: by simple attachments and changing masks we can express it’s function in the pitched game: A blue bulletproof vest with a white POLICE sign on the back makes a cop, camo texture and a helmet with a dry bush on it turns Nat into a sniper, glasses and a lab coat is for playing a scientist, you get the idea.
The next task is designing the skeleton and the animation system.
Here is a scene file which makes cubemap generation (for Unreal) simpler:
CubemapRenderRig.lxo
Just import it to any scene and render the first 6 frames from the CubemapRenderCam camera. The frames should be added in the same order to the Cubemap in UnrealEd.
There is a sphere object as well, around the camera, which blurs the surroundings. The RefractionRoughness parameter in the BlurMaterial group adjusts blurriness.
(At first I tried camera DOF, but that way there were seams between the cubemap’s faces.)
Intel’s research on morphological antialiasing (PDF paper) is rather interesting: its a post process effect, working on a rendered image. It looks for high contrast areas, recognizes basic pixel patterns and does pixel blending on them.
Very clever stuff, inspiring, so I wanted to see if I can make a fake AA post process in Unreal.
A less groundbreaking but more obvious approach was an edge detection based blending between the original frame buffer and a slightly blurred version. I did the blending based on local contrast so the blurred image appeared where pixel lightness suddenly changed.
This method created ghosting on near vertical and near horizontal edges, so I had to weigh edge types.
Then I tried to do the edge search on the depth buffer which produced slightly different results. Eventually I ended up combining the two methods so contrast in lightness and depth both matters.
Here are the results (big files):
The effect works best on ~22.5 degree slopes (45 degree ones look smooth even without AA). The shader has difficulties with high contrast, high frequency details: the grate at the top of the building, with its 1-2 pixel wide bars looks really weird after filtering.
This filter does a certain degree of de-noising as well, which helps with the bright edges on the window bars.
Alpha tested foliage looks better with the post process, in spite of the lost sharpness. The loss of high frequency details is quite apparent on the cliff and the dome, but that’s not that obvious while moving.
Interestingly the ideal settings of the effect (7 parameters) depend heavily of the content of the scene: lighting, textures, geometry detail. My test map, DM-Deck and DM-Sanctuary needed a quite different setups, so for best results, the parameters would need tweaking on a room-by-room basis, which would be a hassle. (A script could handle the blending values when moving between rooms.)
The other problem is that the shader is quite expensive, clocks at 86 instructions at the moment, although I haven’t tried to optimize it.
And lastly, I’m not convinced that I need AA this way at all. The effect is very subtle and it would be worth the effort only in really low resolutions. Even in 720p, it’s not very obvious, save for a few extreme cases. Beyond 1080p, the pixel size gets so small that AA is practically unnecessary. More resources spent for less impact.
So until a GPU implementation of the cheap MLAA gets implemented in Unreal, I won’t worry about aliasing too much.
Here are two weapon concepts I’ve made for one of my running projects:
For the second gun I used Inkscape extensively. It’s far from being perfect, but at least it’s advancing steadily and now reached a point where I dare to use it for work.