Bump mapping(parallax mapping) is a common technic to give materials a more realistic look. Even though it is cheap performance wise it just creates a pseudo 3D look. Looking from a small angle reveals that the surface is still flat.
Besides it is possible to create parallax occlusion materials with UDK. A sample material can be downloaded here: http://udn.epicgames.com/Three/DevelopmentKitGemsParallaxOccludedMapping.html
The basic idea of POM is to split a texture vertically into several layers and calculating height (and shadow) data for each layer, which results in a real 3D look. In contrast to bump mapping lower parts of a texture(f.e. ground) are occluded by higher parts(f.e. a stone). In addition high parts are casting real shadows.
The downside is that artefacts appear at an small viewing angle because the layers become visible. Another disadvantage is the performance. That's why one should use POM quite attentive.
I used the UDK sample material to show you some differences between different levels of Bump and Parallax Occlusion Mapping.
Diffuse + Normal
Bump map - slight bump
Bump map - usual bump
Bump map - heavy bump (artefacts appering / stretching)
Parallax Occlusion mapping - slight bump
Parallax Occlusion mapping - usual bump
Parallax Occlusion mapping - heavy bump (layering artifacts already appearing close to the viewing point)
Because of the artifacts I made some changes to the sample material by raising the number of layers from 10 to 16 and also changing the shadowing parameters. Again take a look at the distance at which artifacts start to become visable
Last but not least the extended material:
As you might guess due to the instruction count POM can be really a performance issue if used to much.
It should be also possible to rebuild this material for UT3 - I've also began doing so and will share the material if it's done.
-- Edited by mAlkAv on Wednesday 24th of August 2011 11:15:16 PM
Sweeeeeeeeeeeeeet! I jump in when I can! I ever wanted to make a nice bump effect, but I always got that "fisheye" effect. Thanks a lot for this great demonstration. I have a new hope for the bump mapping in UT3 now.
-- Edited by Foufoune_Rose on Wednesday 24th of August 2011 10:12:08 PM
__________________
[Knowlage is power]Sinéad, for the first time, life is gonna turn around...
Just to tease a bit. I recently made some changes to Epics example POM material for reducing it's complexity but obtaining the visual quality at the same time. It's far from a professional solution but I was able to lower the instruction count from 213 to 149 (including normal mapping and specular).
Right now I am rebuilding the material for UT3 since it is not possible to use .upks of newer engine versions.
mAlkAv!An wrote:Last but not least the extended material:
As you might guess due to the instruction count POM can be really a performance issue if used to much.
It should be also possible to rebuild this material for UT3 - I've also began doing so and will share the material if it's done.
My head hurts from just looking at that, much less trying to understand it.
I looked at the examples and that does look very nice. Hard to beleive that's from a flat mesh/BSP?
On the subject of ambient oclusion and Blender (slightly off topic), I know you can bake an Ambient Occlusion map, but how do you go about adding it and do you have to sort of "guess" at the lighting angle and such to get it to look right?
Yes it's looking weird indeed. I started with Epics example material (which is not well made performance wise, btw) and just increased the number of samples from 10 to 16. The reason for the material complexity is the iterative functionality of parallax occlusion mapping. You might take a look at the UDN page for better understanding: http://udn.epicgames.com/Three/DevelopmentKitGemsParallaxOccludedMapping.html
Since I made these shots straigt from the material editor there is no way of hiding addtitional geometry ^^ If done right POM can be an adequate substitution to DX11 tesselation. If you have a copy of Crysis / Warhead you can see some spots where it's beeing used at very high details :)
The easy way of adding ao maps is a static approach by multiplying it with the diffuse . This solution is actually not correct, since it does not take into account the light vector like you mentioned. But it's mostly looking good enough and helps to identify the structure.
-- Edited by mAlkAv!An on Saturday 29th of October 2011 11:15:48 AM
Blitz already gave it a try and I'm interested in how long it takes to load the package on different rigs. Perhaps some of you guys can check it out :)
Here's a screeny of my UDK POM material. It has 26 samples/layer and is very complex (built with nodes only, no hlsl), but the pan cake artifacts disappeared nearly completely.
And for comparison, the same scene with a usual material that uses normal and parallax/bumoffset mapping:
I also made a gif animation with a rotating directional light (full 360°) to show the self shadowing implementation:
-- Edited by mAlkAv!An on Thursday 15th of March 2012 06:00:43 PM
lol i m sure thoses who tryed to load yer package thought they ve frozen their PC haha^^ (mine took more than 12 full minutes)
Yeah, probably
The interesting part is that it took me just three minutes with the UDK to load a package that has 4 POM materials, each 3 times more complex than the UT3 material, and that was with my office rig (celeron G530 dual core). That's the best evidence of how much the engine has been improved since UT3 came out 4.5 years ago
I can make another gif with slower animation if you want, but it would be more of a slide show then.
The most strain will be for the editor when loading and editing the package. In game it will run fine but usually you should use it only on certain spots.
Here's a quick fps comparison with my office rig / low end gfx GT520. I replaced the whole floor material, so that's quite a worst case scenario.