marcofugaro / three-projected-material

📽 Three.js Material which lets you do Texture Projection on a 3d Model
https://marcofugaro.github.io/three-projected-material/
MIT License
671 stars 57 forks source link

Do not texture parts behind (hidden) #17

Open remmel opened 3 years ago

remmel commented 3 years ago

Hi, thanks for your great lib!

It actually project the image on all part of the mesh, even if that part is behind (from the point of view of the camera used to project). Do you plan to add a "visibility check" to avoid projecting the image on not visible parts ? I only use 1 mesh.

image

Nothing special is done, but here is the code : https://github.com/remmel/image-processing-js/blob/45959089fbd042f5d3e986b73339131e238339be/pose-viewer/PoseCylinder.js#L62

http://remy-mellet.com/image-processing-js/pose-viewer.html?datasetType=LUBOS&datasetFolder=https://raw.githubusercontent.com/remmel/rgbd-dataset/main/20201130_195000.dataset

Thanks!

marcofugaro commented 3 years ago

Hmm I see, I didn't do this check for simplicity, it's quite elaborate and is called Depth testing. But I'll see if I can make it work!

remmel commented 3 years ago

Yes, that's would be great :) on my side, I don't know anything about that shader topic!