gLTF and displacement map

from the blender gLTF document,


it seems the gLTF did not support displacement map, but for some texture, a displacement map would make it more realistic. is there any workaround for this?
besides, i did not find any doc about how much will displacement map affect the performance.
any resource i can read about it?

You can load and apply displacement maps manually.

It’s an additional texture upload in the vertex shader. The sampling and the respective computations should not produce a significant overhead.

1 Like

I don’t think displacement maps have any effect on realism. Anything that a displacement map could do, could simply be baked into the vertices for exactly the same result, and usually less performance cost. There could be some workflows where (a) the same mesh is used multiple times with different displacement maps, or (b) the displacement map is procedural. But I don’t see these often.

Most likely if you’re trying to make a model look more realistic (e.g. adding more detail than the mesh geometry can support) it’s a normal map that you want, not a displacement map. Normal maps are much more detailed because they affect individual pixels, not just vertices.

1 Like

thanks for replying. straight to the point!

Thanks, do you mean bake high-poly to low-poly model.
btw, by adding more details to geometry, how’s the performance cost comparing to using displacement map? or where can i find some doc about it. i am not sure is it the same like in blender.

A displacement map (at least in three.js) cannot add detail to geometry – it just shifts vertices that are already there. What you want is to bake “high-poly geometry” to “low-poly geometry + a normal map”. Normal maps exist entirely because they improve performance, but the specifics depend on the model. Any tutorial about “baking normals in Blender” should be applicable.

1 Like

Thanks for the explain.
But do you consider real vertex displacement is better(or more realistic) than faking light with normal map? which may result in more realism.
Besides. any ideas on the performance cost using displacement map in threejs?

Good reasons to use displacement maps are very rare, compared to (a) using real geometry, or (b) using a normal map. It’s also very common to confuse displacement maps, bump maps, and normal maps — can you share the model and the texture you are talking about? If you don’t have a particular model in mind, then you should definitely not be thinking about displacement maps yet. :slight_smile: Use real geometry if it’s performant, and bake the details of that geometry to a normal map when performance isn’t good enough without it.

As a rule of thumb, if you have more than 100,000 vertices in the scene, you should think about using a normal map to reduce that.

2 Likes

Thanks, It make more sense to me now.