Parallax occlusion mapping (version 0.2) I played a bit with material system in Source SDK lately and I managed to change VertexLitGeneric to use parallax occlusion mapping. Most of the code was already there, written by Valve. It isn't ready for general use. It has no real shader fallback, it doesn't support anything lower than SM 3.0 and practically every material parameter that exists in VertexLitGeneric is disabled. These screenshots were made using a simple cube with texture on it with heightmap attached. Textures are from DirectX samples. Screenshots 3 and 4 look weird because I set heightmap scale too high. Next thing that I plan to implement is normal mapping. Currently bumps look like holes at some angles because lighting treats it as flat surface. If you want to play with the shader, download this file and extract it in SourceMods/Empires. v_0_1.zip
It's not a big problem. When running DirectX sample bump mapping I get 1100 FPS and with parallax mapping I get 400 FPS. There will be shader fallback and also option that switches back to bump mapping.
I fixed some bugs and enabled normal mapping. If you want shader to work you need to have base color texture, normal map and a height map. I'll upload shader files later.
You put shader DLL in bin/ and that's all. When making a material you use "Emp_Parallax" instead of "VertexLitGeneric".
Here are some screenshots showing how models can look with parallax occlusion mapping. Most of them have height map that is of far too low resolution. That's why you see all this stretching. NF light tank looks worst because continuous surface on the model isn't continuous in texture.
I realise you probably don't want to hear this but parallax mapping would be far more useful on LightMappedGeneric than VertexLitGeneric. Models can be made with proper 3d geometry which fades out at distances using LODs, and you would need to make the high resolution geometry anyway in order to make the normal map. Lightmappedgeneric materials on the other hand can only use very very simple geometry, therefore they would benefit immensely from parallax mapping to increase their apparent complexity. It would also probably be a good idea to see if you can make it work with SSBump because SSbump is apparently less expensive to render than normal mapping for some reason.
It is in my plans but it'll take time. Parallax occlusion mapping is more effective than additional triangles for everything (including models).
True, but parallax mapping doesn't work at parallel viewing angles, in fact it tends to bug out a bit in my experience, it also doesn't look as good, in most cases you would want to use actual tris for a close in view model (which is what tanks are to the people driving them) and there is no reason why you shouldn't, because you won't see more than one on the screen at once at that detail level. It is also harder to texture for as you demonstrated, the seams are a lot more obvious than they are with normal mapping. Tris look better, can do more things, and have no real downsides to their use on models at the sort of range at which parallax mapping would be visible.
Almost nothing of what you've written is true. http://www.ati.com/developer/gdc/2006/GDC06-Tatarchuk-Parallax_Occlusion_Mapping.pdf 1. Good resolution height map is more memory efficient than triangles. It looks just as good. 2. Percent of angles where you will not see the detail done with parallax occlusion mapping is extremely low. 3. Some (quite many) of current models were done with virtual-displacement mapping in mind (parallax occlusion mapping is one of algorithms that implements it). 4. Sometimes you have to blur the heightmap to make height changes smaller to avoid too quick changes in height. 5. Making LODs is time consuming and currently we have no LODs for our vehicle models. 6. It isn't much harder to texture it. You just have to texture models with big contiuous patches. 7. NF heavy with 2600 polygons + POM will look as good as 10k polygon model. LOD is done in the shader and also by MIP-mapping. The fact that I posted almost only screenshots of POM with crappy heightmaps doesn't prove a lot.
I packaged new version of the shader. Most vertexlitgeneric options are disabled. That includes flashlight. http://gerwazy.lo3.wroc.pl/~moo/empires/v_0_2.zip