Jump to content
  • Advertisement
Sign in to follow this  
jameswren

Displacement Mapping

This topic is 4844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
it looks as if the surface is modelled in 3d as long as you don t look at it from the side

also known as parallax mapping i think

have a look at this link

http://graphics.cs.brown.edu/games/SteepParallax/

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 jameswren
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?

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
you say half-life 2 doesn't use it, but here's where i got it from...

http://www.firingsquad.com/hardware/half-life_2_performance/

and a google of "half life 2 displacement mapping"

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]

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 shadows
inside each triangle of the fixed vertex skeleton to add "depth".

Tudor

Share this post


Link to post
Share on other sites
skittleo:

Sorry, but I am not a native English speaker.
I meant that they were not talking about the real displacement mapping.

Is there any way to stick the "proper" word to this kind of idea?
e.g. not displacement proper = not really displacement, but something else

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
matches81:

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.

Moving existing vertices seems kind of pointless to me unless animations
are intended.

Perhaps I'm wrong, though. I haven't actually studied/implemented code for that, so anything is posible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!