The PC tutorials include a method for entity clicking using the frame buffer.
I used this in one of my applications and it seems as it is no longer working.
I assume this could be due to some pc update, as the tutorial doesn’t seem to work either:
(testing on my PC only the middle cube registers clicks)
(old build, here all objects register the click and call the pulse)
As always, thanks for any info on this.
Tested the example on Chrome/Win10, it’s seems to work on my side but with reduced accuracy. For example I have to click close to the sphere/cone center to get them picked, in the old build of the example that isn’t the case.
The box is being picked as expected, clicking on any pixel does that job.
@mvaligursky @yaustar any idea?
Looks like it was introduced in 1.41.0. Investigating
I refactored that code considerably recently … but this and also editor works, which I used for testing
I might need to investigate.
It’s probably related to aspect ratio of the texture in some way … when I make the viewport square, it seems to work.
Fixed. picker.resize needs to be called before prepare.
That’s amazing. Great work as always. Thank you very much!
@Rechi I’ve just updated the project to use a ‘scale’ for the picker so you balance accuracy and performance
Edit: tutorial in PR: https://github.com/playcanvas/developer.playcanvas.com/pull/269
On a roll now, Martin added support to pick from specific layers in 1.41.0 so added that to the tutorial now!