Posts

Showing posts from May 8, 2019

Using 3D texture in OpenGL/openFrameworks with programmable pipeline

Here we explain how to work with 3D textures using modern OpenGL, verson >= 3.2, using C++ code with openFrameworks. For preparing this text we used several sources: https://stackoverflow.com/questions/13459770/glsl-sampler3d-in-vertex-shader-texture-appears-blank https://en.sfml-dev.org/forums/index.php?topic=23871.0 https://community.khronos.org/t/opengl-3-x-glenable-gl-texture-2d-gl-invalid-enum/61405 https://github.com/tiagosr/ofxShadertoy We will performs the folliwing steps to create and 3D texture for openFrameworks 0.10.1: 1. Enable programmable pipeline 2. Define the function for printing GL errors 3. Create some volume data 4. Create and upload 3D texture 5. Setting 3D texture to shader 6. Create shader files 1. Enable programmable pipeline Be sure you are using programmable pipeline, so in main.cpp, main() use the following code: int main() {     ofGLWindowSettings settings;     settings.setGLVersion(3, 2);