Open Thomas-Feldmeier opened 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.
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.