Recommended Posts

I'm a bit confused about displacement mapping. I thought you needed vertex textures with SM3.0, but I've read that Half Life 2 uses it, so can it be done on SM2.0 hardware?
Also, are there any benefits in using displacement mapping over normal mapping on brick walls and cobbled floors..does it look better, less flat? And can it be used to draw terrain from a heightmap? Is this worthwhile?
Cheers

Share this post

Link to post

Share on other sites

Half-Life 2 doesn't use displacement mapping. Actually I think there is no commercial game out there yet that uses it.

Parallax mapping is a different thing. It's more of an "extension" of regular normal mapping, and it's done by changing texture coordinates per-pixel according to heightmap and eye vector.

Quote:

Original post by jameswrenAlso, are there any benefits in using displacement mapping over normal mapping on brick walls and cobbled floors..does it look better, less flat? And can it be used to draw terrain from a heightmap? Is this worthwhile?

Displacement mapping changes actual vertex positions, so yes, it does look less flat. Actually, it is less flat. [smile]But anyway, I wouldn't recommend using it yet, because majority of hardware out there won't support vertex textures.

Share this post

Link to post

Share on other sites

I quickly skimmed through that page, and there's nothing about displacement , mapping. Displacement maps are mentioned, but here they mean stuff like terrain, caves, etc. That stuff is precomputed and rendered normally. "Real" displacement mapping is done in realtime, sampling textures in vertex shaders and using that data to modify vertices. Here (6.8 Mb PDF) is a presentation about Half-Life 2 shading, if you're interested.

Bah, skittleo beat me to it. [smile]

0

Share this post

Link to post

Share on other sites

it's not "proper" displacement mapping,they are talking about bump mapping.

Displacement mapping creates new vertices depending on the height map;the bump mapping merely simulates this by mapping the light and shadowsinside each triangle of the fixed vertex skeleton to add "depth".

Share this post

Link to post

Share on other sites

Like Centipede stated, the 'displacement maps' in HL² have nothing to do with the technique known as displacement mapping. These 'displacement maps' are just regularly divided planes in the editor you can use to build anything terrainlike and they feature blending of 2 textures based on vertex alpha (at least that is what the handling in the editor implies) and I personally think this 'displacement map' thing is a bit of a misnomer. So no displacement mapping in HL².

Back to 'real' displacement mapping: as Skittleo posted, currently displacement mapping doesn´t create new vertices (at least it didn´t in any tool I used) but changes the position of existing vertices to reflect the structure (texture) of an object better by not only simulating depth, but actually generating it as good as possible with the existing vertices. So, it doesn´t save memory or anything, because you would need the vertices beforehand anyway. Because you need those vertices anyway you could apply a displacement map in a modelling tool and "bake" the vertices positions... not sure if there is any tool that allows storing the displaced vertices positions. On the other hand the displacement mapping done real-time would allow you to animate the displacement map, which would be nice... Since displacement mapping doesn´t _create_ new vertices and therefore add geometry that wasn´t there, therefore again saving memory, I don´t see a point in displacement mapping done real-time in a game for some unanimated thing... would be just a waste of horsepowers in my oppinion. At least at the moment... geometry shading could change that quite a bit ;)

Share this post

Link to post

Share on other sites

I was under the impression that the new Shader 3.0 technique people are talking about in context to displacing was actually adding vertices (geometry instancing) following a height map,somewhat like the old Parhelia would do with its hardwired extension.