Bot releases are hidden (Show)
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.4.1...v0.4.2
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.4.0...v0.4.1
Published by CodyJasonBennett over 2 years ago
Adds a size
render prop to mirror R3F's API for sizing, this is handled by the <Canvas />
component. This can be subscribed to via useOGL:
const size = useOGL(state => state.size)
console.log(size.width, size.height)
Adds support for WebXR rendering via an XRManager:
XRManager {
session: XRSession | null
setSession(session: XRSession | null): void
connect(session: XRSession): void
disconnect(): void
}
//
const renderer = useOGL(state => state.renderer)
const xr = useOGL(state => state.xr)
useEffect(() => {
let mounted = true
(async () => {
const session = await navigator.xr.requestSession('immersive-vr', {
optionalFeatures: ['local-floor', 'bounded-floor', 'hand-tracking'],
})
session.updateRenderState({ baseLayer: new XRWebGLLayer(session, renderer.gl) })
if (!mounted) return session.end()
else xr.connect(session)
})()
return () => {
mounted = false
xr.disconnect()
}
}, [renderer, xr])
This will augment useFrame subscriptions to access an XRFrame
while in a session:
useFrame((state: RootState, time: number, frame?: XRFrame) => {
// ...
})
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.7...v0.4.0
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.6...v0.3.7
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.5...v0.3.6
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.4...v0.3.5
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.3...v0.3.4
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.2...v0.3.3
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.1...v0.3.2
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.3.0...v0.3.1
Published by CodyJasonBennett over 2 years ago
This is a big update in terms of feature parity with https://github.com/pmndrs/react-three-fiber with some perf improvements. Among them:
We now use Zustand under the hood for granular context subscriptions, including a new hook useStore
:
// Only update when gl updates
import { useOGL } from 'react-ogl'
const gl = useOGL(state => state.gl)
// Or, for custom zustand selectors:
import { useStore } from 'react-ogl'
const store = useStore()
React.useEffect(() => store.subscribe(state => ... ), [])
Expands the attach
prop by accepting an attach function in addition to a string. This is 1-1 with R3F v8's unified attach API.
// will attach to parent.target
<parent>
<child attach="target" />
</parent>
// will attach to parent.target.subtarget
<parent>
<child attach="target-subtarget" />
</parent>
// will attach to parent.target[0] and parent.target[1], creates an array if parent.target is undefined
// useful for attaching multiple elements to an array
<parent>
<child attach="target-0" />
<child attach="target-1" />
</parent>
// will call child.setParent on mount and child.removeChild unmount
<parent>
<child
attach={(parent, self) => {
self.setParent(parent)
// remove on unmount
return () => parent.removeChild(self)
}}
/>
</parent>
extend now accepts a passGL
argument inwhich passes the active gl context automatically to the element in construction. Importantly, this will affect all elements passed in the call to extend
or any elements who extend them. Passing gl as an arg to these elements will still work as before, however, it is unneeded.
// Marks both classes as effectful and will receive an effect
extend({ CustomClass1, CustomClass2 }, true)
- const gl = useOGL()
- <customClass1 args={[gl]} prop={value} />
- <customClass2 args={[gl]} prop={value} />
+ <customClass1 prop={value} />
+ <customClass2 prop={value} />
This is enabled for core classes to let users use props instead of args for common classes like meshes, materials, geometry, and so on.
<program vertex="" fragment="" />
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.2.2...v0.3.0
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.2.1...v0.2.2
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.2.0...v0.2.1
Published by CodyJasonBennett over 2 years ago
This release does away with platform-specific imports (react-ogl/web
or react-ogl/native
) in favor of a unified target (react-ogl
).
// web
- import ... from 'react-ogl/web'
+ import ... from 'react-ogl'
// native
- import ... from 'react-ogl/native'
+ import ... from 'react-ogl'
Additional fixes improve internal stability when using concurrent features, suspense, and devtools.
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.1.6...v0.2.0
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.1.5...v0.1.6
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.1.4...v0.1.5
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.1.3...v0.1.4
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.1.2...v0.1.3
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.1.1...v0.1.2
Published by CodyJasonBennett over 2 years ago
Full Changelog: https://github.com/pmndrs/react-ogl/compare/v0.0.9...v0.1.1