pex-context
pex-context copied to clipboard
Modern WebGL state wrapper for PEX: allocate GPU resources (textures, buffers), setup state pipelines and passes, and combine them into commands.
```js // Instead of for (let i = 0; i < directionalLights.length; i++) { sharedUniforms[`uDirectionalLights[${i}].intensity`] = directionalLights[i].intensity; sharedUniforms[`uDirectionalLights[${i}].color`] = lightColorToSrgb(directionalLights[i]); } const uniforms = { uDirectionalLights: directionalLights.map((light) => { intensity:...
[MDN clearBuffer](https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/clearBuffer)
[Best practice for WebGL2 is texStorage + texSubImage](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#use_texstorage_to_create_textures). texStorage has some limitations: - size and format cannot be changed after first call - but it is more performant to store/update...
Why: negative normals in a glTF model can change winding order. See test model: https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/NegativeScaleTest Docs: [MDN frontFace](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/frontFace) **Implementation:** pex-context: - Add state.frontFace (default CCW) - In applyPipeline (?), add...
In nodes when clicking toggle `flipY` I get the following errors 