KhronosGroup / WebGL

The Official Khronos WebGL Repository
Other
2.65k stars 670 forks source link

WebGL2: Differences from WebGL1 section #542

Open grorg opened 10 years ago

grorg commented 10 years ago

Fill in the section that lists other differences between WebGL2 and WebGL1

Oletus commented 10 years ago

Here's one difference between WebGL 1 and WebGL 2 that still needs to be addressed better: Uploading 3D and floating-point texture data. WebGL 1 restricts the types of ArrayBufferViews that can be passed to tex(Sub)Image2D, these restrictions should be updated to reflect the needs of WebGL 2. A texImage3D entry point accepting an ArrayBufferView could also be added. Is there some reason why the function is not in the spec right now? I'll look into this.

kenrussell commented 10 years ago

Agree that the types of ArrayBufferViews accepted for texture uploads needs to be rethought with the introduction of many new internal formats in ES 3.

The reason texImage3D isn't exposed is that immutable size textures allocated with TexStorage[n]D are much easier to deal with in the implementation, and we didn't want to encourage the old style of usage with the newly-introduced 3D textures. Happy to revisit this topic.

Oletus commented 10 years ago

Ah, that's right. The texStorage[n]D functions are of course better, I don't think there's that much reason to revisit this. Since we still have texImage2D though, maybe we could add a mention to the spec that usage of that is also discouraged.

kenrussell commented 10 years ago

A note about avoiding texImage2D in preference of texStorage2D is a good idea. Thanks for adding that to your recent pull request regarding texStorage3D, etc.

juj commented 10 years ago

I just ran into https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.14 . I don't think WebGL 2 should do this, and I think WebGL2 should add glTexImage3D to the spec. Saying "texStorage3D is a better API, people should use that instead of texImage3D, so let's not add texImage3D" might be agreeable from an ideal API perspective, but I don't think it's proper that WebGL 2 should start deprecating the GL API arbitrarily like that. glTexImage3D is not deprecated by Khronos, so I would recommend that WebGL 2 carries texImage3D over.

kenrussell commented 10 years ago

Thanks for the feedback. Would you please post to public_webgl and let's discuss?

juj commented 10 years ago

Sure. Created a thread "Removal of glTexImage3D entry point?"