-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addition of web GL2 [FEATURE REQUEST] #1226
Labels
Comments
I'm not very familiar with the Webgl api and the difference between GL1 and Gl2. Would you be able to provide more information and maybe concrete examples covering your two points above. |
On 22-01-18 06:07:03, hhugo wrote:
I'm not very familiar with the Webgl api and the difference between GL1 and
Gl2. Would you be able to provide more information and maybe concrete examples
covering your two points above.
The main differences are:
- creation by passing "webgl2" to getContext
- a few more functions
- many many more options for existing functions.
Look for instance at
https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D
The number of possible values for internalformat and format exploses.
Some of these values are very usefull for shadow mapping, fine tunning
of performance and other modern techniques in GL.
Moreover, webGL1, is more or less deprecated in practice.
I have a version of js_of_ocaml working with webGL2 and only the extension I need
currently. To finish the port I need to take a decision regarding the webGL type
dataType / pixelType / pixelFormat.
with webGL2, type and pixelType have many more common values
in webGL there was only
method _UNSIGNED_BYTE_DT : dataType readonly_prop
method _UNSIGNED_BYTE_ : pixelType readonly_prop
in webGL there was no distinction between format and internalFormat (both
represented as pixelFormat).
I think these should be moved to parametric types
'a dataType and 'a pixelFormat
using a phantom type to distinguish the various usages.
for instance this would give:
method texImage2D_new :
texTarget
-> int
-> [`TexImageInternal] pixelFormat
-> sizei
-> sizei
-> int
-> [`TexImage] pixelFormat
-> [`TexImage] dataType
-> void opt
-> unit meth
An option to go further would be to add more parameter to the
types to handle the coherence between the 3 arguments with something like:
method texImage2D_new :
texTarget
-> int
-> ([`TexImageInternal],'a,'b) pixelFormat
-> sizei
-> sizei
-> int
-> ([`TexImage],'a) pixelFormat
-> ([`TexImage],'b) dataType
-> void opt
-> unit meth
But this requires a lot of investigations ... and probably auto generation.
Cheers,
Christophe
… —
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.*Message ID: <ocsigen/
***@***.***>
--
Christophe Raffalli
tél: +689 87 23 11 48
web: http://raffalli.eu
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
webGL2 is now pretty standard and js_of_ocaml only supports webGL1 and a few extension.
I actually started working on that... But there are a lot of valid combinations of internal format / format / type in function
like texImage2D.
This raises two questions:
is more of less broken by webGL2 with the current type of function.
The text was updated successfully, but these errors were encountered: