14islands/r3f-scroll-rig

V7

Closed this issue · 0 comments

v7

Refactor

  • Make r3f and three dev-deps
  • remove pixelratio - use dpr
  • make PerformanceMonitor optional(pass in as child) - now called DprScaler in stdlib
  • use standard flat / linear settings
  • remove old noEvents flag - events on by default
  • Remove VirtualScrollbar (decided to keep until proven not useful)
  • fix zustand subscribe warnings
  • render always by default - no need to call invalidate or requestRender for basic use case
  • Consider skipping requestRender requirement for basic "demand" frameloop

BUGS

  • HijackedScrollbar: lerp=1 on space, arrow, tab scrolling + dragging scrollbar
  • HijackedScrollbar: fix history scroll position
  • BUG: config override scrollLerp on GlobalCanvas not working when using scrollbar

LOW prio improvements

  • configure camera orth - overide x,y,z
  • configure camera persp - override fov
  • ViewportScrollScene - make camera fov configurable
  • Remove {bind} requirement from HijackedScrollbar?
  • Perf: should global render be clever and skip render if children are empty?

High level Goals:

  • quick to get started
    • render always
    • no need to call requestRender or invalidate
  • minimize "clever" code - use basic R3F for most
  • Scroll rig is mainly synching WebGL and Scrollbar - that's it! Other things should be optional

By default frameloop="always"

  • Always render global loop
  • Add a viewport -> will cause double render
  • Adding a global child -> always renders even if hidden
    = OK for most scenarios. Most projects will not need otpimizing

By settings frameloop="demand"

  • Only render global loop if requested
  • Adding a viewport -> won't cause a global render unless needed
  • Adding a global child > will need to call both invalidate() and requestRender() to be visible
    = VERY advanced - only useful if sometimes only viewports/scissors are visible

Advanced:

  • possible to render several passes
  • possible to disable global render loop if you want your own
  • possible to tweak global autoClear for VR