List of changes:
- Made some progress on material that can be used to reduce the seams between static meshes and the ground.
Description of the progress:
I have to say that I'm quite happy with the results so far, even though this solution is a simple and dirty trick. I won't be posting a full breakdown of it, as I still need to figure out if there is a more elegant way of doing this, but here is the basic overview.
The material uses vertex colour to blend between grass and a rock material (I've used one of the default UDK meshes) and between the phong lighting model and flat shading. I've used a MLM_Custom lighting model and rebuilt the phong setup as seen here: http://udn.epicgames.com/Three/CustomLighting.html
Next I created another network below it and replaced the setup responsible for calculating the shading (Dot product of the Light Vector and Normal) with a Constant parameter. Tweaking that value changes the brightness of the mesh within the painted area of the mesh and allows to match the shading of the mesh to the shading of the ground.
Now the problem with this setup is that while it works greats for the lit areas, the shaded areas look the same as they normally would. So to brighten them up, I've multiplied my Diffuse by a constant parameter and plugged it into a Lerp node. Then, I plugged the Lerp into Emissive slot, made a constant node with a value of 0 (solid black; meaning it won't affect the emissive) and used Vertex Color again as the alpha.
At this point, I only needed to tweak the constant parameters until the seam between the ground and the rock was almost unnoticeable. It's not a perfect solution and the seam is still there if you look really closely, but this approach seams to be very flexible and is a bit similar to the method that Blizzard uses. One of the main issues with this material is that changing the brightness of the lighting or the ambient lighting requires the parameters to be tweaked.
On the other hand, I've tried using floating geometry with alphas before and while that produced slightly better results modelling transition geometry around each object would be much more difficult to setup and would make it very difficult to modify anything once these floaters are in place. Moreoever, using alphas with soft transparency would be more costly, while using 1-bit alphas didn't produce very good results.
Anyways, this approach seems like the way to go. I should be able to achieve even better results if I model my meshes accordingly and create slopes in the area where they intersect with the ground. If I could somehow figure out how to project the UV coordinates of one mesh onto another, then I would be able to get completely seamless results.
- Finish the textures for the building
- Finish the ground-blending material