Add support for double and dvec uniform#210
Add support for double and dvec uniform#210TristanCacqueray wants to merge 1 commit intoglumpy:masterfrom
Conversation
|
Thanks and sorry ofr being so late in answering you. Are the GL_DOUBLE type part of GL ES 2.0 ? Else, you light need to surround the declaration with some conditionals. |
|
GL_DOUBLE doesn't seem to be part of GL ES 2.0. It seems to be only available when using this extension: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gpu_shader_fp64.txt . Thus I'm not sure how the type could be correctly added conditionally. Perhaps the Uniform constructor could have the Program version and the type would only be available if the version is > 400 ? |
|
I'm afraid it might be more complicated than that since we can add them only when we know what version of GL we're using. This means you probably have to hacky gloo on the fly. Do you have a simple case usage ? Maybe we can start with a simple example file to check this can work and then consider a more durable implementation. |
83c741a to
9820f43
Compare
This change adds GL_DOUBLE (np.float64) support to uniform types.
|
I added an example that uses a dvec2 uniform... Couldn't find an easier way to demonstrate double usage :-) I don't understand why gloo has to be patched on the fly. If Variable and Uniform constructor could know the program version, then why not load gl_double type informations when version > 400? |
|
And actually, GL_DOUBLE is also defined on my system independently of the GL version so maybe we can just merge. What is your example doing exactly (didn't ran it yet)? |
|
The example animates Julia sets of the burning ship fractal. The animation increments the Julia coordinate with a value below the float precision limit, hence the need for double. It may not be the best example to show double uniform, but that's the use-case i needed this change. |
|
Ok, I'll test it and merge. |
|
OSX doesn't allow me to have GL 4.0 :( Do you know when this extension first appeared ? |
|
According to https://www.khronos.org/opengl/wiki/History_of_OpenGL , Version 4.0 appeared in 2010. |
|
I can't make it run with 3.2. |
This change adds GL_DOUBLE (np.float64) support to uniform types.