tentone / potree-core

Potree point cloud viewer library core components for easier integration in a three.js project.
https://tentone.github.io/potree-core/
Other
171 stars 53 forks source link

Possible to use interpolated shader / paraboloid point shape? #11

Open shiukaheng opened 4 years ago

shiukaheng commented 4 years ago

Hi, and thanks for the hard work! I tried switching to Potree.PointShape.PARABOLOID for material.shape, but ended up with WebGL throwing errors on undefined terms. After some digging in Potree I found that I needed to get extensions from WebGL by the getExtension method as follows: let gl = renderer.getContext(); gl.getExtension('EXT_frag_depth'); gl.getExtension('WEBGL_depth_texture'); let extVAO = gl.getExtension('OES_vertex_array_object'); if(!extVAO){ throw new Error("OES_vertex_array_object extension not supported"); } However, it still calculates scene depth incorrectly. I'm not familiar with WebGL at all, but removing the line pos.z += wi * vRadius; in the fragment shader makes it render correctly again, albiet without the paraboloid depth applied to the square shapes. Perhaps vRadius is somehow passed down incorrectly?

Thanks, Heng.