Skip to content

Tag

OpenGL

13 posts

Building Draco and Compressing 3D Files

3D data files can get very large. Basically, the more polygons (vertices) there are, the larger they get. But especially on the web, large files take a long time to download, which isn't practical. So this time, we'll reduce the file size with Draco, a 3D data compression program developed by Google. Draco can make files very small. We'll actually compress an OBJ file with Draco.

Compressing glTF / GLB Files with Draco for the Web

In recent years, techniques for doing CG on the web with JavaScript have advanced greatly, and it has become possible to develop web apps that use AR, VR, and more in the browser. The problem, however, is the file size of 3D models. 3D models such as glTF are very large for the web and take a long time to download. So we'll reduce the file size by compressing them with Draco, an open-source 3D data compression method developed by Google and adopted by glTF as an extension.

Getting Started with OpenGL 4 in Python 3

You can use modern OpenGL in Python. I picked up my pen to share how moving that is. In this series, I'll explain modern OpenGL features such as VAOs using Python, with code, as clearly as I can. Since this is part 1, it mainly covers an introduction and setting up the environment, and at the end we'll write a program that displays the OpenGL version your PC supports. By the way, I'll use GLFW, which lets you configure things like the context, rather than GLUT.

Vertex Arrays and VBOs

OpenGL and GLSL provide a mechanism called VBO for sending data to the GPU more efficiently. So far, we've been sending data to GLSL with functions such as glBegin() and glVertex3f(). As I mentioned before, glBegin() and the like have already been removed or deprecated, and drawing with them is very slow. Here we send only the vertices to GLSL as an attribute variable, but you can send normals, colors, UVs, and other data the same way. With what we've covered so far, you should be able to write fairly efficient programs. By the way, there's also the term VAO (Vertex Array Object), which is very confusing, but it isn't another kind of VBO or an alternative to VBOs: it's a way to encapsulate VBOs.

Opening a Window with GLFW

For drawing with OpenGL, GLUT (or FreeGLUT) would be fine, but GLUT is a bit unintuitive, makes contexts harder to understand, and is no longer maintained (presumably for good reason), so I'll use GLFW. GLFW is still maintained and has more features.