Skip to content

goldragoon/opengl-geometry-dump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opengl-geometry-dump

This repository contains the example implementation for extracting the primitives of graphics pipeline using transform feedback. I implemented two example scenarios. One is extracting vertex from triangle mesh, and another is extracting original geometry.

The diagram below represents the idea of the function 'extract_triangle_mesh()' which implements original geometry extraction. First, pass a unique vertex ID to the geometry shader. Then geometry shader writes position and ID of primitives to transform feedback buffer. Finally, after the rendering process is finished, primitive information is copied to main memory. And mesh reconstruction is handled by unordered_map. For details, please see main.cpp. Idea of extract_triangle_mesh function

Motivation

As far as I know, most transform feedback examples[1, 2] only explain or implement only point primitive extraction. So they cannot recover connectivity of the geometry. Of course that softwares such as RenderDoc, glintercept can do similar thing. But we cannot extract geometry programatically with RenderDoc, and glintercept cannot be running other than Windows environment.

Getting Started

You can build this project with CMake. Please see CMakeLists.txt (very short)

Dependencies

Easiest way to install the dependencies is vcpkg.

  • GLUT, GLEW, GLM, OpenMesh

To Do

  • Support extracting additionally generated geometry.
  • Connectivity extraction and original geometry recovering.
  • Librarify

References

[1] Particle System using Transform Feedback
[2] Transform feedback - Feedbacktransform and geometry shaders

About

Simple example for extracting geometry that processed by rendering pipeline with OpenGL implementation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors