dbuenzli / tgls

Thin bindings to OpenGL {3,4} and OpenGL ES {2,3} for OCaml
http://erratique.ch/software/tgls/
ISC License
54 stars 7 forks source link

specify precision for fragment shader #8

Closed edwintorok closed 10 years ago

edwintorok commented 10 years ago

Fixes "0:3(14): error: no precision specified this scope for type `vec4'"

The default for the vertex shader is 'precision highp float', but there is no such default for the fragment shader, see 4.5.3 "Default Precision Qualifiers" in GLSL_ES_Specification_1.0.17.pdf

trigles2 now works with "OpenGL ES 3.0 Mesa 10.0.2", IF I have libgles2-mesa-dev installed at build time.

dbuenzli commented 10 years ago

Oh and In the commit message specify that it's for ES examples. Thanks.

edwintorok commented 10 years ago

Added the precision specifier for trigles3.ml, but I cannot test it, as trigles3 doesn't work on my box (only trigles2 and trigl3 does), could you please test it? (together with the fix from the exposedfix branch). ./trigles3.native INFO: Could not create GL context

Although it appears it should work, haven't investigated why it doesn't work yet: EGL_CLIENT_APIS: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3 GL_VERSION: OpenGL ES 3.0 Mesa 10.1.0-rc1 (git-1e6bba5)

dbuenzli commented 10 years ago

I can't test either, just assuming it will also be needed. Thanks for the fixes. The patch is in as bd5d46194114051