cyberbotics / webots

Webots Robot Simulator
https://cyberbotics.com
Apache License 2.0
3.3k stars 1.71k forks source link

RangeFinder does see fully transparent texture #3443

Open Thomas-Feldmeier opened 3 years ago

Thomas-Feldmeier commented 3 years ago

Sample world "range_finder". change DEF GREEN_BOX solid > shape > appearance PBRAppearance > baseColorMap ImageTexture > url > https://raw.githubusercontent.com/cyberbotics/webots/R2021b/projects/default/worlds/textures/ladybug.png

now some regions of the texture have alpha channel 0 (fully transparent), but still visible by RangeFinder.

see similar issue #3405. Pull request #3436 code seems to fix only transparency=1 in material, but not alpha channel in textures.

ad-daniel commented 3 years ago

You're right, ideally it should take into consideration the alpha level of each individual pixel but that might not be nearly as easy to fix (or at least, to do so in a computationally efficient way). Whatever the case, it still makes sense to make fully transparent objects invisible to the camera so the existing PR makes sense in of itself, but as you mentioned it only addresses part of the issue.

If you're willing to tackle the larger issue, feel free to open a PR about it.