Skip to content

v3.8.0

Compare
Choose a tag to compare
@gre gre released this 08 Jul 09:47
· 342 commits to master since this release
  • 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 the createComponent 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 of import {Backbuffer} from "gl-react" you should do import {Uniform} from "gl-react" and use Uniform.Backbuffer
  • introduce Uniform.Resolution: when used to do C = connectSize(({width,height}) => <Node uniforms={{ res: [width,height], ... }} ... />), you can now just do C = () => <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. where input 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 an uniform 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