cginternals / cginternals/webgl-operate

Most Examples not working on Safari (context hash 1M+-1n, webgl 1)

Open
#269 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
170
Forks
25
PR merge metrics
No merged PRs in 30d

Description

I opened webgl-operate.org/examples on Safari and found several issues. Below you find the list of Examples and their state of functionality. Looking at that list, it seems that everything related to textures is broken.
Opening the broken examples shows several errors in the console related to shader compilation, e.g.

- `'textureLod': no matching overloaded function found`
- `'textureCubeLod': no matching overloaded function found`
- `'dFdx': no matching overloaded function found`
- `'normalize': operation result is undefined for the values passed in`
- `'switch': illegal use of reserved word`, `'switch': syntax error`
- `'<<' bit-wise operator supported in GLSL ES 3.00 and above only`
- ...

but also other errors like:

- `INVALID_ENUM: texImage2D: invalid texture format`,
- `drawArrays: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete', or it is a float/half-float type with linear filtering and without te relevant float/half-float linear extension enabled`
- `loading image from 'https://webgl-operate.org/examples/data/triangle-texture.webp' failed`
- `Unhandled Promis Rejection` (probably due to failed image loading)

To me it seems that webgl1 is not handled, or maybe just not recognized as such. I see this as critical, since the code uses facades and masquerades to make webgl-operate handle webgl1 and webgl2 and handle querying/enabling of extensions.

I used Safari Version 13.1.2 (latest), Backend is `webgl1`, Context Hash is `1M+-1n`.

### List of Examples:

**Examples that work well:**
Canvas Size
Color Lerp
Color Scale
Label 3D
Label Anchor
Label Elide
Shadow Mapping
Shadow Mapping (Progressive)

**Examples that work in parts:**
Environment Mapping (from left to right: black, landscape, white, landscape)
Perlin Noise (only shows grey background; but at least it stopped loading)
Tile-based 4k Rendering (it renderes a coloured cube without texture)

**Examples that keep loading forever:**
Context Lost Example
Gouraud/Phong Shading
Image Based Lighting
Scene
Textured Cube
Textured Cube (Progressive)
Textured Triangle
Xtoon Shading

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at webgl-operate.org/examples in Safari 13.1.2 with the reported WebGL1 backend and context hash 1M+-1n, then inspect the listed shader, texture, image-loading, and WebGL console errors. Done means the affected texture-related examples no longer fail or load indefinitely and the partially working examples render correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.