I’m currently trying to implement an outline shader as the one we currently use is too performance intensive on Retina screens!
I found a shader on the web that does not need to read a fullscreen texture multiple times per frame but simply displace the model by its normals along with front face culling and some other stuff. I assume this would yield better performance.
Alas, this shader requires two passes, one rendering the model and one displacing it to draw the outline, and I don’t see how I could do this in Playcanvas so any help would be appreciated!
I think your best bet here would be to create an additional camera with higher priority, so that it renders on top. Disable any clears on it. Meshes that you need outlines on would be in the main camera, but additional add them to this camera. I think you’d need to clone the entities and change their materials to the outline pass material.
Actually, if you clone the entities as I suggested, you don’t need additional camera. Just have additional layer on the same camera that renders perhaps after all opaque layers. And add those cloned entities with outline hull shader to it.
Hey, I’m facing a similar issue: I’m doing a post-processing effect in PlayCanvas that requires multiple shader passes, and I’m not entirely sure how to go about this. However, I am pretty sure a workaround like mentioned above would not work in my case.