Closed k4r1 closed 5 years ago
The issue becomes more apparent when you outline the planes on which the images are being rendered
Hey @k4r1, thanks for reaching out. I don't think changing the rendering order would help you here, as it looks like it might be a depth issue.
When rendering the second circle, if we see that there was something already drawn on that pixel that is closer to the camera in the depth buffer, the rendering is ignored (to avoid drawing a redundant pixel behind another pixel)
Could you try setting the imageNode material's setReadsFromDepthBuffer and/or setWritesToDepthBuffer to false and see if the issue occurs?
~Yes I just tried that and it did the trick!~ Thanks very much for your help.
(Edit: this wasn’t really fixed, it just seemed that way because the circles are transparent. Continuing discussion on the react-viro issue for now.)
The question remains as to what to do about this behaviour in react-viro, do you think we should change the usage such that setReadsFromDepthBuffer is false? Or give the user a way to toggle that from React?
Closing the issue here since this is an API usage issue and therefore the fix needs to be done in react-viro.
Environment
Please provide the following information about your environment:
Description
Rendering two intersecting nodes with transparent textures results in one of the textures being falsely occluded by transparent regions of the other, dependent on rendering order.
Note: This behaviour is observed in react-viro (https://github.com/viromedia/viro/issues/762) but it can also be recreated in ViroCore. So it seems like either:
Reproducible Demo
This is based on an issue I first experienced with Viro React and have now confirmed it is also present in ViroCore. To recreate, I hacked up the
ARShadowTest.cpp
with an example:Note:
debug-circle3.png
is an image of a circle with transparency.Similarly to https://github.com/viromedia/viro/issues/762, this renders the following (between screenshots I swapped the rendering order):
Expected: Two full circles to render