CSS matrix3d incorrectly culls visible elements
Reported by
doug...@gmail.com,
Jul 19 2016
|
||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36 Example URL: http://jstraight.com/1376/13/show Steps to reproduce the problem: 1. http://jstraight.com/1376/13 2. Click Run 3. Click in the view (black box) in bottom right pane 4. Move the mouse around so the wall is just about to be clipped on the left edge 5. Note that all of the divs disappear the moment that it the first wall div touches the left edge of the view. What is the expected behavior? Correct cull What went wrong? Browser is improperly determining that all of the divs are not visible. It does not seem to take the perspective into account. Does it occur on multiple sites: N/A Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 51.0.2704.79 Channel: stable OS Version: Ubuntu 15.10 Flash Version: Works perfectly in firefox 47
,
Jul 21 2016
@doug16k: Could you please have a look at the attached video and let us know if this is the correct behavior to reproduce this issue. Else, provide us the screen-recording for better understanding. Which would help us in triaging it further. Thank you.
,
Jul 26 2016
When you click the area slowly turn the view to the right and left, until the left edge of the visible face touches the left side. As soon as the div touches the side, the whole row of divs disappears. Turning back to the right makes them all reappear, when the first one is no longer clipped. They would be offscreen/clipped if there were no perspective, but they should remain visible, because perspective is on. You can use W A S D keys to move too, but the starting position is a good reproduction, simply looking slightly left and right. Try it in firefox too, for comparison, it clips/culls correctly. Sorry, the example is rather crude, I wanted the minimum amount of stuff going on. It is simply a row of divs, transformed with matrix3d. It does implement a mouselook with WASD control with css though.
,
Jul 26 2016
Nothing should disappear just because the view angle changed. My code does not cull at all, the matrix is being correctly calculated, shown in another browser correctly. The browser is improperly determining that the divs are not visible anymore. It would be right if there weren't perspective/matrix3d.
,
Jul 27 2016
The video you posted isn't showing the expected view because of a combination of a glitch in the initial view direction, and cancelling the pointer lock (for some reason a big look-right directionX input event happened). When you clicked to start view control it jumped for some reason, then you cancelled the pointer lock, which made you unable to look right sufficiently. Can you try it again without cancelling the pointer lock? Use small mouse movements, sorry I realize now it is too sensitive. Thanks! The repro is when you look right a bit more than you did, and touch the walls against the left side of the viewport.
,
Jul 27 2016
Sorry for pinging several times, I keep thinking of new information to provide. You can use the left and right arrow keys to rotate the view right and left. You don't need to touch any of the mouse interaction or pointer locking. Simply open the page http://jstraight.com/1376/13/show and press left arrow a few times (to look left a bit, which works okay), then stop doing left arrow and do several right arrow keypresses. Notice that once the first div touches the left they all disappear (apparently improperly determined offscreen).
,
Jul 29 2016
Here's an improved test case. Notice that you can walk around the room and when you get near the corners, things randomly flicker. Nothing flickers on firefox though, they are all there. Nothing hides. It just sets all the transforms. http://jstraight.com/1376/16/show See code at http://jstraight.com/1376/16 Just look up a bit to see the floor disappearing. The backface cull is not right. To see more, click inside the viewport and walk around with WASD+mouse first-person-shooter style interface. Get near a wall, look toward it, fine, look away, disappears.
,
Jul 29 2016
Ah I should not have said "randomly". It is deterministic. If you are facing toward a face (the view vector is toward the normal vector of the div) then it is visible. If you are facing away from a face at all, so the view vector is in the same direction as the div normal, then it disappears. It is not taking perspective into account. Instead of taking the normal vector dot the view vector, it should be dotting a vector from the view to the face with the div normal vector.
,
Jul 29 2016
Here's a version that makes a fully enclosed room. http://jstraight.com/1376/18/show If you face toward a face, it appears, if you look away from a face, it disappears. Get close to walls and look slightly away from them to make them disappear. Removing "backface-visibility: hidden" makes the disappearance stop.
,
Aug 5 2016
,
Aug 12 2016
Thank you for providing more feedback. Adding requester "rnimmagadda@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 16 2016
Able to repro this issue on Windows 7, MAC (10.11.6) & Ubuntu Trusty (14.04) for Google Chrome Stable Version - 52.0.2743.116 & Canary Version - 54.0.2829.0 This is a Non-Regression issue existing from M40 - # 40.0.2172.0 Before this build, the "WASD movement, mouse look" looks tiny and is not full screen.
,
Aug 16 2016
,
Aug 18 2016
,
Aug 18 2016
I have to think this is a problem with visible rect calculations. Assigning to our new expert in the area, but maybe it's on the compositor side and not Blink.
,
Aug 20 2016
I think it is more to do with backface cull dot products of vectors/surface normals. It is possible to make it disappear when it is fully onscreen. It seems to be dotting the surface normal against the wrong vector. Facing "toward" a face slightly makes it appear, facing slightly away from a face makes it disappear.
,
Aug 20 2016
For example, in the provided "enclosed room" repro (with brick texture everywhere) http://jstraight.com/1376/18/show , looking down slightly makes the whole ceiling disappear. Looking up slightly makes the whole floor disappear.
,
Mar 24 2017
,
May 11 2017
I don't expect to be able to look at this soon, unassigning self to allow others to look if they are able to do so sooner.
,
May 14 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 14 2018
Working correctly now. |
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 Deleted