v3.8.0
- drop the legacy features of v2 (that was legacy for easier porting code) – that includes the previous
<GL.Uniform>
now replaced by Bus as well as thecreateComponent
now unnecessary. - Introduce
Uniform
object with Backbuffer, Resolution, textureSize(t), textureSizeRatio(t) ( more info https://gl-react-cookbook.surge.sh/api#uniform ) - Deprecate the previous
Backbuffer
that was directly exposed in gl-react: instead ofimport {Backbuffer} from "gl-react"
you should doimport {Uniform} from "gl-react"
and useUniform.Backbuffer
- introduce Uniform.Resolution: when used to do
C = connectSize(({width,height}) => <Node uniforms={{ res: [width,height], ... }} ... />)
, you can now just doC = () => <Node uniforms={{ res: Uniform.Resolution, ... }} ... />
- introduce Uniform.textureSize(input) that you can pass to an
uniform vec2
and that will inject the size of the given texture. whereinput
it whatever you can give to a texture uniform (e.g.uniforms={{ t: input, tSize: Uniform.textureSize(input) }}
) - introduce Uniform.textureSizeRatio(input) that is doing like textureSize, except it only send the
width/height
ratio (for anuniform float
) - console.warn when you pass width/height to gl-react-native Surface : unlike the gl-react-dom implementation, the gl-react-native implementation don't use them, instead you need to use
style
(like in React Native paradigm) - more explicit console.warn when you accidentally have twice the gl-react library (the typical symptom being that a shader can't be found by id, because it does not live in the user's lib but in the gl-react- > gl-react dup*).
internal changes
- the TextureLoader needs to implement a getSize method.
textureSize usage example: https://gl-react-cookbook.surge.sh/golwebcam