Heightmap on pcd files in ThreeJS

Hello everyone, I wanted to implement Heightmaps on my PCD file. Do I have to write some shaders for that, or is it possible to do it some other way? I was searching through ThreeJS examples and found Lookup table which has pretty much the same idea of a heightmap. If I have to write some shaders for that, please suggest me some resources from where I can learn writing custom shaders in WebGL.

There is no height map support for point clouds. You need to enhance the built-in PointsMaterial with custom code in order to displace points based on height data. You can use Material.onBeforeCompile() to enhance built-in materials or you write a custom shader material from scratch.

1 Like

Thanks for the reply @Mugen87, can you please recommend some good source from where I can learn to write custom shader materials?

I suggest you have a look at the Resources section at https://threejs.org/. There is a lot of learning material.

1 Like

@Ashutosh_Sharma just passing to let you know that @marquizzo posted a neat workaround that may suggest an interesting approach for your use case: by using a depthMap render to search for geometry faces. Here is the post and the demo. Give it a look!

2 Likes