NEW 230370
Add an experimental SceneKit mode to explore <model> and separated layers
https://bugs.webkit.org/show_bug.cgi?id=230370
Summary Add an experimental SceneKit mode to explore <model> and separated layers
Tim Horton
Reported 2021-09-16 12:52:13 PDT
Add an experimental SceneKit mode to explore <model> and separated layers
Attachments
Patch (203.47 KB, patch)
2021-09-16 12:52 PDT, Tim Horton
ews-feeder: commit-queue-
Patch (203.46 KB, patch)
2021-09-16 13:04 PDT, Tim Horton
ews-feeder: commit-queue-
Patch (203.46 KB, patch)
2021-09-16 14:02 PDT, Tim Horton
thorton: review?
ews-feeder: commit-queue-
Tim Horton
Comment 1 2021-09-16 12:52:36 PDT
Tim Horton
Comment 2 2021-09-16 13:04:30 PDT
Tim Horton
Comment 3 2021-09-16 14:02:38 PDT
Simon Fraser (smfr)
Comment 4 2021-09-16 14:16:41 PDT
Comment on attachment 438390 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438390&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:3640 > + _page->preferences().setCSSTransformStyleOptimized3DEnabled(true); > + _page->preferences().setModelElementEnabled(true); A bit weird that setting a SceneKit node has side effects. > Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:216 > + RetainPtr<SCNNode> _sceneKitNode; _sceneKitRootNode? > Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:416 > +// Assign a node that has this view as a material. > +@property (nonatomic, retain, setter=_setSceneKitNode:) SCNNode *_sceneKitNode; So does the caller have to set this view as a material or does that happen automatically? > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.h:50 > + static constexpr uint64_t portalContentsCategory = 2; > + static constexpr uint64_t portalMaskCategory = 4; Magic > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.mm:80 > +SCNNode *SceneKitHost::ensureNodeForLayer(CALayer *layer) Could this return a RetainPtr<SCNNode> so I don't have to think too hard about ownership? > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.mm:94 > +void SceneKitHost::setCustomChildNodeForLayer(CALayer *layer, SCNNode *node) Take a RetainPtr<SCNNode>&&? > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.mm:99 > +static SCNNode *customNodeForLayer(CALayer *layer) Return a RetainPtr<SCNNode>? > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.mm:104 > +static SCNNode *ensurePortalNodeForLayer(CALayer *layer) Return a RetainPtr<SCNNode>? > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.mm:117 > +void SceneKitHost::updateLayer(CALayer *layer, bool isInPortalSubtree, bool& isPortal) This looks like it's updating the node for the layer, not updating the layer? > Source/WebKit/UIProcess/RemoteLayerTree/cocoa/SceneKitHost.mm:130 > + node.transform = SCNMatrix4Translate(toSCN(layer.transform), position.x - (parentSize.width / 2), -position.y + (parentSize.height / 2), layer.zPosition + zEpsilon); > + node.pivot = SCNMatrix4MakeTranslation(-(0.5 - layer.anchorPoint.x) * size.width, (0.5 - layer.anchorPoint.y) * size.height, -layer.anchorPointZ); I guess at some point we'll have to map animation of transform and transform origin to node animations? How does that work? > Tools/3DMiniBrowser/3DMiniBrowser/sample.html:39 > + document.getElementById("flap").style.transform = `translateZ(10px) rotateX(${ 15 * (Math.sin(ts / 300) + 1) }deg)`; CSS animations??
Radar WebKit Bug Importer
Comment 5 2021-09-23 12:53:23 PDT
Note You need to log in before you can comment on or make changes to this bug.