Closed Reda-S closed 7 years ago
Is this using three.js? Could be getting culled if it's closer than the near plane. You could try overriding this behavior and see if it shows again:
cursor.frustumCulled = false;
Yes using three,.js, and setting frustumCulled to false was the first thing that I have tried, but it didn't work. The second thing that I have tried was moving the cursor over the z axes, assuming it was a problem of being outside the near and the far plane, no luck either, any other ideas?
I see what you mean. I think this is an issue with ANGLE, although they work with auto-stereo rendering the view/projection matrices it spits out aren't quite correct for calculations script-side (e.g. frustum culling, scene graph).
In the meantime a script-side workaround would be to create a duplicate THREE.Camera (or any other Object3D) and set it's position per frame as follows:
let matrix = new THREE.Matrix4().getInverse(new THREE.Matrix4().fromArray(window.getViewMatrix()).multiply(new THREE.Matrix4().makeScale(-1, 1, 1))); matrix.decompose(duplicate.position, duplicate.quaternion, duplicate.scale);
Use the main camera to render but add cursor and other children to this duplicate (and add the duplicate to the scene). Ideally you'd set the projection matrix on the duplicate and use it for frustum culling as well (but still not rendering). three.js isn't really set up to allow this though, so probably leave frustum culling off for now. Also use the duplicate for any raycasting calculations.
Thank you @sjando for the fix. I merged the ANGLE fix and updated the submodule/binaries in HoloJS.
Is the proposed workaround still needed?
@Almost-Done nope, everything working as expected now based on my testing.
@sjando the culling is working fine and the camera children are showing as expected. Thanks.
We had a "cursor" attached to the camera that was showing just fine until yesterday's master's merge. I think it's related to the frustum culling issue.