forked from ebruneton/precomputed_atmospheric_scattering
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compatibility with Mesa-driven GPUs (ebruneton#14)
* Don't require GL_EXT_geometry_shader4 OpenGL 3.3 alone is perfectly capable of what we need. * Unuse glBegin/glEnd and family in class Demo to make it possible to enable Core Profile * Unuse glBegin/glEnd and family in class Model to make it possible to enable Core Profile * Unuse glBegin/glEnd and family in model_test to make it possible to enable Core Profile * Implement text rendering compatible with OpenGL 3.3 Core Profile * Use GL_RGBA32F/GL_RGBA16F for color buffers unconditionally GL_RGB32F/GL_RGB16F are not required color buffer formats, and some OpenGL implementations like Mesa don't support them, leading to Framebuffer Incomplete Attachment errors. * Request OpenGL 3.3 Core Profile from GLUT * Switch to GLAD GLEW can't handle OpenGL Core profile without hacks: you need glewExperimental option, and then you have to loop until glGetError returns GL_NO_ERROR to make the demo work. This sounds unclean. As a bonus, we get the ability to restrict the headers to only the relevant API functions and constants, i.e. OpenGL 3.3 Core Profile, without any others, which lets us check at compile time that we aren't using anything higher than requested (except possibly in the shaders, which the C++ compiler can't know about). * Fix output path for glad.o * Move glad-related files to external/ * Rename attribIndex and coordsPerVertex to match Google coding style * Rename TextRenderer.{cc,h} to text_renderer.{cc,h} * Move private members of class TextRenderer after public members * Add trailing underscore to data members of class TextRenderer * Rename {vertex,fragment}ShaderSrc to k{Vertex,Fragment}ShaderSrc variables * Reduce indentation in implementation of TextRenderer from 4 spaces per tab to 2 * Rename {vao_,vbo_} to full_screen_quad_{vao_,vbo_} in demo.{cc,h} * Rename {vao_,vbo_} to full_screen_quad_{vao_,vbo_} in model.{cc,h} * Rename {vao_,vbo_} to full_screen_quad_{vao_,vbo_} in model_test.cc * Add white space around operators in text_renderer.cc * Captialize first letters of methods of TextRenderer * Add missing space * Revert "Use GL_RGBA32F/GL_RGBA16F for color buffers unconditionally" * Use RGBA32F format for 2D textures unconditionally RGB32F is not guaranteed to be supported as a framebuffer color attachment, while RGBA32F is. This matters on such OpenGL implementations as Mesa, which drives opensource-powered Linux GPU drivers. * Fallback to RGBA32F for 3D textures if RGB32F is not supported as FBO color attachment
- Loading branch information
Showing
13 changed files
with
3,823 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.