Closed yaustar closed 4 months ago
This is currently not supported unfortunately. For picker to work, the engine internally generates a variation of the fragment shader for each standard shader, but this is not supported for user specified shaders.
We could update Material class to keep an array of shaders, one per pass, like a standard material, to handle this. Alternatively, the user could use StandardMaterial, and override an emissive chunk to implement custom functionality, which would be picker compatible.
ShaderMaterial supports this now, in the engine V2, and so I'll close this. See here: https://github.com/playcanvas/engine/issues/6835
Forum: https://forum.playcanvas.com/t/pc-picker-and-custom-shader/30758
Use example: https://playcanvas.github.io/#/graphics/area-picker
With the following code:
Creates warnings: